@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&family=Tajawal:wght@400;500;700&display=swap');

:root {
  --primary: #1e3a8a;       /* Coptic Navy */
  --primary-hover: #172554;
  --secondary: #d97706;     /* Liturgical Gold */
  --secondary-hover: #b45309;
  --ss-color: #059669;      /* Sunday School Green */
  --mass-color: #2563eb;    /* Mass Blue */
  --com-color: #7c3aed;     /* Communion Royal Violet */
  --absent-color: #dc2626;  /* Absence Crimson */
  --bg-main: #f8fafc;
  --surface: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
}

[data-theme="dark"] {
  --primary: #60a5fa;       /* Bright Blue */
  --primary-hover: #93c5fd;
  --secondary: #f59e0b;     /* Liturgical Gold */
  --secondary-hover: #fbbf24;
  --ss-color: #10b981;      /* Sunday School Green */
  --mass-color: #3b82f6;    /* Mass Blue */
  --com-color: #a855f7;     /* Communion Royal Violet */
  --absent-color: #ef4444;  /* Absence Crimson */
  --bg-main: #0b1120;       /* Dark Night Background */
  --surface: #1e293b;       /* Dark Slate Surface */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border: #334155;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Cairo', 'Tajawal', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  direction: rtl;
  text-align: right;
  min-height: 100vh;
}

/* Header */
.app-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e1b4b 100%);
  color: #ffffff;
  padding: 1rem 1.5rem;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.15);
  border-bottom: 3px solid var(--secondary);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.church-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.church-cross {
  font-size: 2.2rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.5rem 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(217, 119, 6, 0.4);
}

.brand-text h1 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-text p {
  font-size: 0.9rem;
  color: #cbd5e1;
  font-weight: 500;
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.backup-pill {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.backup-pill:hover {
  background: rgba(16, 185, 129, 0.25);
  transform: translateY(-1px);
}

/* Navigation Tabs */
.nav-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  overflow-x: auto;
  padding: 0 1rem;
}

.nav-btn {
  background: none;
  border: none;
  padding: 0.9rem 1.25rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-btn:hover {
  color: var(--primary);
  background-color: #f1f5f9;
}

.nav-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background-color: #eff6ff;
}

/* Main Container */
.main-content {
  max-width: 1400px;
  margin: 1.5rem auto;
  padding: 0 1rem 3rem 1rem;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards & Containers */
.card {
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Form Controls */
.filter-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-input, .form-select {
  padding: 0.55rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  background-color: #fff;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

/* Buttons */
.btn {
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: all 0.2s;
}

.btn-primary {
  background-color: var(--primary);
  color: #fff;
}
.btn-primary:hover { background-color: var(--primary-hover); }

.btn-secondary {
  background-color: var(--secondary);
  color: #fff;
}
.btn-secondary:hover { background-color: var(--secondary-hover); }

.btn-success {
  background-color: var(--ss-color);
  color: #fff;
}
.btn-success:hover { background-color: #047857; }

.btn-outline {
  background-color: #fff;
  border-color: #cbd5e1;
  color: var(--text-main);
}
.btn-outline:hover {
  background-color: #f8fafc;
  border-color: #94a3b8;
}

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
}

/* Attendance Table */
.table-responsive {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.attendance-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 0.92rem;
}

.attendance-table th {
  background-color: #f1f5f9;
  color: #334155;
  padding: 0.85rem 0.75rem;
  font-weight: 700;
  border-bottom: 2px solid #cbd5e1;
  white-space: nowrap;
}

.attendance-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.attendance-table tbody tr:hover {
  background-color: #f8fafc;
}

/* Independent Toggle Buttons */
.toggle-group {
  display: inline-flex;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  background-color: #f8fafc;
}

.toggle-option {
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: #64748b;
}

.toggle-option:not(:last-child) {
  border-left: 1px solid #cbd5e1;
}

/* Sunday school states */
.toggle-option.ss-present.active {
  background-color: #d1fae5;
  color: #065f46;
  font-weight: 700;
}
.toggle-option.ss-absent.active {
  background-color: #fee2e2;
  color: #991b1b;
  font-weight: 700;
}

/* Mass states */
.toggle-option.mass-present.active {
  background-color: #dbeafe;
  color: #1e40af;
  font-weight: 700;
}
.toggle-option.mass-absent.active {
  background-color: #fee2e2;
  color: #991b1b;
  font-weight: 700;
}

/* Communion states */
.toggle-option.com-present.active {
  background-color: #ede9fe;
  color: #5b21b6;
  font-weight: 700;
}
.toggle-option.com-absent.active {
  background-color: #fee2e2;
  color: #991b1b;
  font-weight: 700;
}

/* Communion Disabled State */
.toggle-group.locked {
  opacity: 0.45;
  background-color: #e2e8f0;
  cursor: not-allowed;
  position: relative;
}

.toggle-group.locked .toggle-option {
  cursor: not-allowed;
  pointer-events: none;
}

.lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: #64748b;
  background: #f1f5f9;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  border: 1px dashed #cbd5e1;
}

/* Statistics Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.stat-box::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
}

.stat-box.ss::before { background-color: var(--ss-color); }
.stat-box.mass::before { background-color: var(--mass-color); }
.stat-box.com::before { background-color: var(--com-color); }
.stat-box.gold::before { background-color: var(--secondary); }

.stat-box-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.stat-box-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
}

.stat-box-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Pastoral Alert Lists */
.alert-card {
  border-right: 5px solid;
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 0.85rem;
  background-color: #fff;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.alert-card.danger {
  border-right-color: var(--absent-color);
  background-color: #fff5f5;
}
.alert-card.warning {
  border-right-color: var(--secondary);
  background-color: #fffbeb;
}
.alert-card.info {
  border-right-color: var(--com-color);
  background-color: #faf5ff;
}

.alert-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--surface);
  border-radius: 16px;
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  animation: modalScale 0.2s ease-out;
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: #1e293b;
  color: #fff;
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  animation: slideIn 0.3s ease-out;
}

.toast.success { background: #065f46; border-right: 4px solid #10b981; }
.toast.error { background: #881337; border-right: 4px solid #f43f5e; }
.toast.warning { background: #78350f; border-right: 4px solid #f59e0b; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-gray { background: #f1f5f9; color: #475569; }

/* Print Media */
@media print {
  body { background: #fff !important; font-size: 11pt; }
  .app-header, .nav-bar, .no-print, .btn, .filter-row, .toast-container { display: none !important; }
  .main-content { max-width: 100% !important; margin: 0 !important; padding: 0 !important; }
  .card { border: none !important; box-shadow: none !important; padding: 0 !important; }
  .attendance-table th, .attendance-table td { border: 1px solid #94a3b8 !important; padding: 6px !important; }
  .print-header { display: block !important; margin-bottom: 20px; text-align: center; }
}

.print-header {
  display: none;
}

/* ========================================================================= */
/* THEME TOGGLE BUTTON & DARK MODE OVERRIDES */
/* ========================================================================= */
.theme-toggle-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
  border-radius: 9999px;
  padding: 0.35rem 0.85rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}
.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}

[data-theme="dark"] body {
  background-color: var(--bg-main);
  color: var(--text-main);
}

[data-theme="dark"] .app-header {
  background: linear-gradient(135deg, #090d16 0%, #171b30 100%);
  border-bottom: 3px solid var(--secondary);
}

[data-theme="dark"] .nav-bar {
  background: #111827;
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .nav-btn {
  color: var(--text-muted);
}
[data-theme="dark"] .nav-btn:hover {
  color: #ffffff;
  background-color: #1f2937;
}
[data-theme="dark"] .nav-btn.active {
  color: var(--primary);
  background-color: rgba(96, 165, 250, 0.12);
  border-bottom-color: var(--primary);
}

[data-theme="dark"] .card {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .card-title {
  color: var(--primary);
}

[data-theme="dark"] .attendance-table th {
  background-color: #0f172a;
  color: #94a3b8;
  border-bottom: 2px solid var(--border);
}

[data-theme="dark"] .attendance-table td {
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
}

[data-theme="dark"] .attendance-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select {
  background-color: #0f172a;
  color: #f8fafc;
  border-color: #334155;
}
[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

[data-theme="dark"] .btn-outline {
  background-color: #1e293b;
  border-color: #475569;
  color: #e2e8f0;
}
[data-theme="dark"] .btn-outline:hover {
  background-color: #334155;
  border-color: #64748b;
}

[data-theme="dark"] .toggle-group {
  background-color: #0f172a;
  border-color: #334155;
}
[data-theme="dark"] .toggle-option {
  color: #94a3b8;
}
[data-theme="dark"] .toggle-option:not(:last-child) {
  border-left-color: #334155;
}
[data-theme="dark"] .toggle-group.locked {
  background-color: #1e293b;
  opacity: 0.55;
}

[data-theme="dark"] .stat-box {
  background: var(--surface);
  border-color: var(--border);
}
[data-theme="dark"] .stat-box-value {
  color: #f8fafc;
}

[data-theme="dark"] .profile-header-card {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
  border-color: #3b82f6 !important;
}

[data-theme="dark"] .alert-card {
  background-color: #1e293b !important;
  border-color: var(--border) !important;
}
[data-theme="dark"] .alert-card.danger {
  border-right-color: var(--absent-color) !important;
}
[data-theme="dark"] .alert-card.warning {
  border-right-color: var(--secondary) !important;
}
[data-theme="dark"] .alert-card.info {
  border-right-color: var(--com-color) !important;
}

[data-theme="dark"] .modal-content {
  background: #1e293b;
  border: 1px solid var(--border);
  color: #f8fafc;
}
[data-theme="dark"] .modal-title {
  color: var(--primary);
}

[data-theme="dark"] .badge-gray {
  background: #334155;
  color: #cbd5e1;
}

/* ========================================================================= */
/* STUDENT AVATAR & PHOTO COMPONENT STYLES */
/* ========================================================================= */
.student-avatar-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}

.student-avatar-wrapper:hover {
  transform: scale(1.1);
}

.student-avatar-wrapper:hover .avatar-hover-icon {
  opacity: 1;
  transform: scale(1);
}

.student-avatar-img {
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(217, 119, 6, 0.45);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
  display: block;
}

.student-avatar-fallback {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
}

.avatar-hover-icon {
  position: absolute;
  bottom: -2px;
  left: -2px;
  background: rgba(15, 23, 42, 0.88);
  color: #ffffff;
  font-size: 0.65rem;
  padding: 2px 4px;
  border-radius: 9999px;
  line-height: 1;
  opacity: 0;
  transform: scale(0.7);
  transition: all 0.18s ease-in-out;
  border: 1px solid rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

/* Profile Header Card Avatar */
.profile-header-card {
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.profile-avatar-container {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 3px solid var(--secondary);
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.3);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s;
  padding: 2px;
  background: var(--surface);
}

.profile-avatar-container:hover {
  transform: scale(1.05);
}

.profile-avatar-container img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.profile-avatar-container .profile-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2.4rem;
  font-weight: 800;
}

.profile-avatar-badge {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

/* Photo Modal Lightbox */
.photo-modal-content {
  max-width: 480px;
  width: 100%;
}

.photo-viewer-frame {
  width: 210px;
  height: 210px;
  margin: 0.5rem auto 1rem auto;
  border-radius: 50%;
  border: 4px solid var(--secondary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  overflow: hidden;
  position: relative;
  background: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-modal-large-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-modal-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4.5rem;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #1e3a8a, #d97706);
}

/* Live Camera Viewfinder */
.camera-viewfinder-container {
  position: relative;
  width: 100%;
  max-width: 380px;
  height: 280px;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  border: 2px solid var(--primary);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.camera-viewfinder-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* User Pill & Header Logout */
.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.18), rgba(30, 58, 138, 0.18));
  border: 1px solid var(--secondary);
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-color);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

#btnHeaderLogout {
  border-color: #ef4444;
  color: #ef4444;
  font-weight: 700;
  transition: all 0.2s ease;
}

#btnHeaderLogout:hover {
  background: #ef4444;
  color: #ffffff;
}

/* Fullscreen Standalone Login Screen (100% Solid Background - Zero underlying data visible) */
.login-backdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #0f172a !important; /* 100% Solid dark slate - no transparency */
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 1.5rem 1rem;
}

.login-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 18px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  padding: 2.25rem 2rem;
  width: 100%;
  max-width: 500px;
  animation: loginCardSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  color: #f8fafc;
}

@keyframes loginCardSlideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-cross {
  font-size: 2.4rem;
  color: var(--secondary);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.quick-login-section {
  margin-bottom: 1.25rem;
}

.quick-login-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 0.75rem;
  text-align: right;
}

.quick-login-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.quick-user-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: right;
  font-family: inherit;
}

.quick-user-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  border-color: #d97706;
  background: #1e293b;
}

.quick-user-btn.active-user {
  border-color: #f59e0b !important;
  background: rgba(245, 158, 11, 0.18) !important;
  box-shadow: 0 0 0 2px #f59e0b;
}

.quick-user-btn:active {
  transform: translateY(0);
}

.quick-user-btn .user-icon {
  font-size: 1.45rem;
  flex-shrink: 0;
}

.quick-user-btn .user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.quick-user-btn .user-info strong {
  font-size: 0.95rem;
  font-weight: 800;
  white-space: nowrap;
}

.quick-user-btn .user-info small {
  font-size: 0.74rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-user-btn.btn-admin {
  grid-column: 1 / -1;
  background: rgba(30, 58, 138, 0.35);
  border-color: #3b82f6;
}

.quick-user-btn.btn-admin:hover {
  background: rgba(37, 99, 235, 0.3);
  border-color: #60a5fa;
}

.quick-user-btn.btn-admin.active-user {
  border-color: #60a5fa !important;
  background: rgba(37, 99, 235, 0.35) !important;
  box-shadow: 0 0 0 2px #60a5fa;
}

.login-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.25rem 0;
  color: #94a3b8;
  font-size: 0.8rem;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px dashed #334155;
}

.login-divider span {
  padding: 0 0.75rem;
}

.login-card .form-control {
  background: #0f172a !important;
  border: 1px solid #334155 !important;
  color: #f8fafc !important;
}

.login-card .form-control:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
}

.badge-purple {
  background-color: #f3e8ff;
  color: #7e22ce;
  border: 1px solid #d8b4fe;
}

.badge-blue {
  background-color: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.badge-green {
  background-color: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

/* Dark mode adjustments for badges & accounts */
body.dark-theme .badge-purple {
  background-color: rgba(126, 34, 206, 0.25);
  color: #d8b4fe;
  border-color: rgba(168, 85, 247, 0.4);
}

body.dark-theme .badge-blue {
  background-color: rgba(3, 105, 161, 0.25);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.4);
}

body.dark-theme .badge-green {
  background-color: rgba(21, 128, 61, 0.25);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.4);
}

body.dark-theme #tab-accounts div[style*="background: #f8fafc"] {
  background: #1e293b !important;
  border-color: #334155 !important;
}

body.dark-theme #tab-accounts div[style*="background: #f8fafc"] h4 {
  color: #f1f5f9 !important;
}

body.dark-theme #tab-accounts div[style*="background: #f8fafc"] p {
  color: #94a3b8 !important;
}



