/* ============================================================
   EARLYBIRD DUAL-MOOD DESIGN SYSTEM (DAY ☀️ / NIGHT 🌙)
   Potasfield Schools
   ============================================================ */

/* ☀️ DAY MODE TOKENS (Default) */
:root {
  --bg-main: #F4FAFA;
  --surface: #FFFFFF;
  --surface-elevated: #FFFFFF;
  --surface-subtle: #EDF7F7;
  
  --text-main: #263238;
  --text-muted: #607477;
  --text-light: #899D9F;
  
  --primary-cyan: #00DDE0;
  --dark-cyan: #00AEB5;
  --accent-orange: #F5A623;
  --accent-orange-hover: #D98C15;
  --border: #DCE7E8;
  --border-focus: #00DDE0;
  
  --cyan-glow: rgba(0, 221, 224, 0.18);
  --cyan-subtle: rgba(0, 221, 224, 0.08);
  --orange-glow: rgba(245, 166, 35, 0.18);
  --orange-subtle: rgba(245, 166, 35, 0.08);

  --success: #059669;
  --success-bg: #ECFDF5;
  --warning: #D97706;
  --warning-bg: #FFFBEB;
  --danger: #DC2626;
  --danger-bg: #FEF2F2;
  
  --shadow-sm: 0 1px 3px rgba(38, 50, 56, 0.05);
  --shadow-md: 0 4px 10px rgba(38, 50, 56, 0.06), 0 2px 4px rgba(38, 50, 56, 0.04);
  --shadow-lg: 0 10px 20px rgba(38, 50, 56, 0.08), 0 4px 6px rgba(38, 50, 56, 0.04);
  --shadow-xl: 0 20px 30px rgba(38, 50, 56, 0.1);
  
  --logo-filter: drop-shadow(0 2px 8px rgba(0, 174, 181, 0.25));
  --header-bg: rgba(255, 255, 255, 0.92);

  --btn-clock-in-bg: linear-gradient(135deg, #00DDE0 0%, #00AEB5 100%);
  --btn-clock-in-text: #172326;
  --btn-clock-in-shadow: 0 6px 18px rgba(0, 221, 224, 0.35);

  --btn-clock-out-bg: #263238;
  --btn-clock-out-text: #FFFFFF;
  --btn-clock-out-shadow: 0 4px 14px rgba(38, 50, 56, 0.2);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --font-heading: 'Outfit', -apple-system, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;
}

/* 🌙 NIGHT MODE TOKENS */
[data-theme="dark"] {
  --bg-main: #0D171A;
  --surface: #172326;
  --surface-elevated: #203034;
  --surface-subtle: #131E21;
  
  --text-main: #F2FAFA;
  --text-muted: #A8BCBE;
  --text-light: #6A8386;
  
  --primary-cyan: #19E6E8;
  --dark-cyan: #00AEB5;
  --accent-orange: #F5A623;
  --accent-orange-hover: #FFAF38;
  --border: #2B4145;
  --border-focus: #19E6E8;
  
  --cyan-glow: rgba(25, 230, 232, 0.28);
  --cyan-subtle: rgba(25, 230, 232, 0.1);
  --orange-glow: rgba(245, 166, 35, 0.25);
  --orange-subtle: rgba(245, 166, 35, 0.1);

  --success: #10B981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #F59E0B;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #EF4444;
  --danger-bg: rgba(239, 68, 68, 0.14);
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 24px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 35px rgba(0, 0, 0, 0.65);
  
  --logo-filter: drop-shadow(0 0 12px rgba(25, 230, 232, 0.55));
  --header-bg: rgba(23, 35, 38, 0.92);

  --btn-clock-in-bg: linear-gradient(135deg, #19E6E8 0%, #00AEB5 100%);
  --btn-clock-in-text: #0D171A;
  --btn-clock-in-shadow: 0 6px 20px rgba(25, 230, 232, 0.4);

  --btn-clock-out-bg: #203034;
  --btn-clock-out-text: #F2FAFA;
  --btn-clock-out-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Header & Navigation */
.app-header {
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-logo-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: var(--logo-filter);
  border-radius: var(--radius-sm);
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  display: block;
  line-height: 1.1;
}

.brand-title span {
  color: var(--primary-cyan);
}

.brand-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* 📲 Android Mobile Browser Smart Alert Prompt */
.android-mobile-alert {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.95), rgba(15, 23, 42, 0.98));
  color: #ffffff;
  z-index: 10000;
  padding: 8px 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.android-alert-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.android-alert-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.android-alert-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #ffffff;
  padding: 2px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.android-alert-info {
  min-width: 0;
}

.android-alert-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.android-alert-desc {
  margin: 2px 0 0 0;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.android-alert-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-android-download {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ffffff;
  color: #0f172a;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 20px;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-android-download:hover,
.btn-android-download:active {
  background: #e2e8f0;
  transform: translateY(-1px);
}

.btn-android-alert-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.btn-android-alert-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.btn-android-alert-close svg {
  width: 16px;
  height: 16px;
}

.header-right-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.btn-header-quick-logout {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-header-quick-logout:hover,
.btn-header-quick-logout:active {
  background: #ef4444;
  color: #ffffff;
}

.btn-header-quick-logout svg {
  width: 16px;
  height: 16px;
}

.mobile-only-tab {
  display: none !important;
}

@media (max-width: 1024px) {
  .btn-header-quick-logout {
    display: inline-flex;
  }
  .mobile-only-tab {
    display: flex !important;
  }
}

.nav-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.nav-tabs {
  display: flex;
  align-items: center;
  background: var(--surface-subtle);
  padding: 2px 3px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  gap: 2px;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-tab svg {
  width: 16px;
  height: 16px;
}

.nav-tab.active {
  background: var(--surface);
  color: var(--dark-cyan);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .nav-tab.active {
  color: var(--primary-cyan);
}

.badge-count {
  background: var(--danger);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

/* Theme Switcher Toggle & Header Guide Button */
.theme-toggle-btn,
.header-guide-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 7px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  min-height: 36px;
  position: relative;
  z-index: 10;
  transition: all var(--transition-fast, 0.2s ease);
}

.theme-toggle-btn:hover,
.header-guide-btn:hover {
  border-color: var(--primary-cyan);
  box-shadow: 0 0 10px var(--cyan-glow);
}

.theme-toggle-btn svg {
  width: 15px;
  height: 15px;
  color: var(--accent-orange);
}

.header-guide-btn svg {
  width: 15px;
  height: 15px;
  color: var(--primary-cyan);
}

[data-theme="dark"] .sun-mode-icon {
  display: none !important;
}
[data-theme="dark"] .moon-mode-icon {
  display: inline-block !important;
  color: var(--primary-cyan) !important;
}
:root:not([data-theme="dark"]) .sun-mode-icon {
  display: inline-block !important;
  color: var(--accent-orange) !important;
}
:root:not([data-theme="dark"]) .moon-mode-icon {
  display: none !important;
}

/* Main Container & Layout */
.main-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px;
}

.view {
  display: none;
  animation: fadeIn 0.3s ease forwards;
}

.view.active {
  display: block;
}

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

/* Glass Card Component */
.glass-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.greeting {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
}

.shift-info {
  font-size: 13px;
  color: var(--text-muted);
}

.live-clock-badge {
  text-align: right;
}

#live-time {
  display: block;
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  color: var(--dark-cyan);
}

[data-theme="dark"] #live-time {
  color: var(--primary-cyan);
  text-shadow: 0 0 12px var(--cyan-glow);
}

#live-date {
  font-size: 12px;
  color: var(--text-muted);
}

/* Dashboard Grid & Column Rhythm */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 24px;
}

.dashboard-col.main-col {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.dashboard-col.side-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dashboard-col.side-col > .glass-card {
  margin-bottom: 0;
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.dashboard-col.side-col > .glass-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}

.dashboard-col.side-col > .monetary-card {
  border-left: 4px solid var(--primary-cyan) !important;
}

.dashboard-col.side-col > .streak-card {
  border-left: 4px solid var(--accent-orange) !important;
}

.dashboard-col.side-col > .badges-card {
  border-left: 4px solid #6366F1 !important;
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Verification Camera & Signals (Passport Size Layout) */
.verification-box {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  margin-bottom: 24px;
  background: var(--surface-subtle);
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
  .verification-box {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.camera-wrapper {
  position: relative;
  width: 100%;
  height: 290px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #080E10;
  border: 2px solid rgba(0, 221, 224, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .camera-wrapper {
    max-width: 270px;
    height: 320px;
    margin: 0 auto;
  }
}

#webcam-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(1);
  display: block;
}

.camera-wrapper.facing-user #webcam-preview {
  transform: scaleX(-1); /* Mirror selfie preview naturally */
}

/* Passport Frame & Center Facial Guide */
.passport-guide-frame {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 18px 12px 36px 12px;
  z-index: 2;
}

.passport-oval-guide {
  width: 130px;
  height: 165px;
  border-radius: 50% 50% 45% 45% / 60% 60% 40% 40%;
  border: 2px dashed rgba(0, 221, 224, 0.45);
  box-shadow: 0 0 0 9999px rgba(8, 14, 16, 0.28);
  transition: border-color 0.3s ease;
}

.passport-guide-label {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.65);
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  text-transform: uppercase;
}

/* Camera Switch Button */
.btn-switch-camera {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(13, 23, 26, 0.85);
  backdrop-filter: blur(8px);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  z-index: 5;
  transition: all 0.2s ease;
}

.btn-switch-camera:hover {
  background: rgba(0, 221, 224, 0.2);
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
  transform: scale(1.05);
}

.btn-switch-camera:active i {
  transform: rotate(180deg);
  transition: transform 0.3s ease;
}

.camera-overlay {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(13, 23, 26, 0.85);
  backdrop-filter: blur(6px);
  color: var(--primary-cyan);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  border: 1px solid rgba(0, 221, 224, 0.25);
  z-index: 4;
}

.signals-grid {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.signal-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all 0.25s ease;
}

.signal-item.clickable {
  cursor: pointer;
}

.signal-item.clickable:hover {
  border-color: var(--primary-cyan);
  background: var(--surface-subtle);
  transform: translateY(-1px);
}

.signal-item.verified {
  border-color: rgba(16, 185, 129, 0.4);
  background: var(--success-bg);
}

.signal-item.verified svg {
  color: var(--success) !important;
}

.signal-item.verified strong {
  color: var(--success) !important;
}

.signal-item.warning {
  border-color: rgba(245, 158, 11, 0.4);
  background: var(--warning-bg);
}

.signal-item.warning svg {
  color: var(--warning) !important;
}

.signal-item.warning strong {
  color: var(--warning) !important;
}

.signal-item.danger {
  border-color: rgba(239, 68, 68, 0.4);
  background: var(--danger-bg);
}

.signal-item.danger svg {
  color: var(--danger) !important;
}

.signal-item.danger strong {
  color: var(--danger) !important;
}

.signal-item svg {
  color: var(--primary-cyan);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.signal-item strong {
  display: block;
  font-size: 12.5px;
  color: var(--text-main);
}

.signal-item span {
  font-size: 11px;
  color: var(--text-muted);
}

/* Clock Action Buttons */
.clock-action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.btn-clock {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 24px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
}

.btn-clock.in {
  background: var(--btn-clock-in-bg);
  color: var(--btn-clock-in-text);
  box-shadow: var(--btn-clock-in-shadow);
}

.btn-clock.in:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.btn-clock.out {
  background: var(--btn-clock-out-bg);
  color: var(--btn-clock-out-text);
  border: 1px solid var(--border);
  box-shadow: var(--btn-clock-out-shadow);
}

.btn-clock.out:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn-clock:disabled,
.btn-clock.disabled {
  opacity: 0.42 !important;
  cursor: not-allowed !important;
  transform: none !important;
  filter: grayscale(0.7) !important;
  box-shadow: none !important;
  pointer-events: none;
}

.btn-clock-icon {
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] .btn-clock.out .btn-clock-icon {
  background: rgba(255, 255, 255, 0.1);
}

.btn-clock-text strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 800;
}

.btn-clock-text span {
  font-size: 12px;
  opacity: 0.9;
}

.qr-scan-bar {
  text-align: center;
}

/* Notification Banner */
.notification-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  background: var(--success-bg);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--success);
}

.notification-banner.warning {
  background: var(--warning-bg);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--warning);
}

.banner-icon {
  font-size: 28px;
}

.banner-text h4 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 2px;
}

.banner-text p {
  font-size: 13px;
  opacity: 0.9;
}

/* Streaks & Badges */
.streak-card .card-header, .badges-card .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.streak-card h3, .badges-card h3 {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fire-icon {
  color: var(--accent-orange);
}

.award-icon {
  color: var(--primary-cyan);
}

.privacy-tag {
  font-size: 11px;
  font-weight: 700;
  background: var(--surface-subtle);
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.streak-counters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.streak-box {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  padding: 14px 10px;
  border-radius: var(--radius-md);
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.streak-box:hover {
  transform: translateY(-2px);
}

.streak-box.early {
  border-color: rgba(0, 221, 224, 0.4);
  background: var(--cyan-subtle);
}

.streak-box.ontime {
  border-color: rgba(245, 166, 35, 0.35);
  background: rgba(245, 166, 35, 0.08);
}

.streak-box.duty {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.08);
}

.streak-box.duty .streak-number {
  color: #6366F1;
}

[data-theme="dark"] .streak-box.duty .streak-number {
  color: #818CF8;
  text-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.streak-box.duty .streak-progress .bar {
  background: #6366F1;
}

.streak-number {
  display: block;
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 800;
  color: var(--dark-cyan);
  line-height: 1;
  margin-bottom: 4px;
}

[data-theme="dark"] .streak-number {
  color: var(--primary-cyan);
  text-shadow: 0 0 10px var(--cyan-glow);
}

.streak-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
}

.streak-progress {
  height: 5px;
  background: var(--border);
  border-radius: var(--radius-full);
  margin-top: 8px;
  overflow: hidden;
}

.streak-progress .bar {
  height: 100%;
  background: var(--primary-cyan);
  border-radius: var(--radius-full);
}

/* Badge Category Tabs & Growth Tracker */
.badge-category-tabs {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.badge-tab-pill {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.badge-tab-pill.active {
  background: var(--primary-cyan);
  color: #0D171A;
  border-color: var(--primary-cyan);
  font-weight: 700;
}

/* Badges Grid */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
  gap: 12px;
}

.badge-item {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  padding: 12px 8px;
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.badge-item:hover {
  transform: translateY(-2px);
  border-color: var(--primary-cyan);
  box-shadow: 0 0 10px var(--cyan-glow);
}

.badge-emoji {
  font-size: 28px;
  margin-bottom: 4px;
}

.badge-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

/* Buttons */
.btn-primary {
  background: var(--dark-cyan);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .btn-primary {
  background: var(--primary-cyan);
  color: #0D171A;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-main);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-secondary:hover {
  background: var(--surface-subtle);
  border-color: var(--primary-cyan);
}

.btn-block {
  width: 100%;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.data-table th {
  background: var(--surface-subtle);
  padding: 12px 16px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
}

.data-table tr:hover td {
  background: var(--surface-subtle);
}

/* Metric Cards */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.metric-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  color: var(--dark-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] .metric-icon {
  color: var(--primary-cyan);
}

.metric-icon.gold {
  color: var(--accent-orange);
  background: var(--orange-subtle);
}

.metric-icon.success {
  color: var(--success);
  background: var(--success-bg);
}

.metric-icon.warning {
  color: var(--warning);
  background: var(--warning-bg);
}

.metric-val {
  display: block;
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.metric-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* Login Card */
.login-card {
  max-width: 440px;
  margin: 40px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-xl);
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo-img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  margin-bottom: 12px;
  filter: var(--logo-filter);
  border-radius: var(--radius-md);
}

.login-header h1 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
}

.login-header p {
  font-size: 13.5px;
  color: var(--text-muted);
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper svg {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  color: var(--text-light);
}

.input-wrapper input, .form-group input, .form-group select {
  width: 100%;
  padding: 10px 14px 10px 38px;
  background: var(--surface);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.input-wrapper input:focus, .form-group input:focus, .form-group select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--cyan-glow);
}

.input-wrapper.has-toggle input {
  padding-right: 42px;
}

.btn-toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color 0.2s ease, background-color 0.2s ease;
  z-index: 2;
}

.btn-toggle-password:hover {
  color: var(--dark-cyan);
  background: var(--surface-subtle);
}

.btn-toggle-password svg {
  position: static !important;
  left: auto !important;
  width: 17px !important;
  height: 17px !important;
  pointer-events: none;
}

.login-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-light);
}

/* Gate Screen Kiosk */
.kiosk-container {
  max-width: 600px;
  margin: 20px auto;
}

.kiosk-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  box-shadow: var(--shadow-xl);
}

.kiosk-logo-img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  margin-bottom: 12px;
  filter: var(--logo-filter);
  border-radius: var(--radius-md);
}

.kiosk-header h2 {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
}

.kiosk-header p {
  color: var(--text-muted);
  font-size: 13.5px;
  margin-bottom: 28px;
}

.qr-display-box {
  background: var(--surface-subtle);
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border);
  display: inline-block;
  margin-bottom: 24px;
}

#kiosk-qr-code canvas, #kiosk-qr-code img {
  margin: 0 auto;
  border-radius: 8px;
}

.countdown-ring {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#kiosk-countdown {
  background: var(--dark-cyan);
  color: white;
  font-weight: 800;
  font-size: 13px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

[data-theme="dark"] #kiosk-countdown {
  background: var(--primary-cyan);
  color: #0D171A;
}

.refresh-label {
  font-size: 12px;
  color: var(--text-muted);
}

.kiosk-live-clock {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(13, 23, 26, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.hidden {
  display: none !important;
  pointer-events: none !important;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-xl);
  animation: popIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-card.modal-lg {
  max-width: 680px;
}

@keyframes popIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

.modal-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 17px;
  color: var(--text-main);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}

.modal-close:hover {
  color: var(--danger);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.celebration-modal {
  text-align: center;
}

.celebration-emoji {
  font-size: 64px;
  margin-bottom: 12px;
}

/* 📷 Futuristic Glassmorphic QR Scanner Viewport */
.scanner-modal-card {
  max-width: 440px;
  padding: 24px;
}

.scanner-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.scanner-viewport-wrapper {
  position: relative;
  width: 100%;
  max-width: 320px;
  height: 280px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000000;
  border: 2px solid rgba(0, 221, 224, 0.35);
  box-shadow: 0 0 25px rgba(0, 221, 224, 0.15), inset 0 0 15px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

#qr-reader {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  padding: 0 !important;
  background: #000 !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

#qr-reader video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: var(--radius-md) !important;
}

#qr-reader img {
  display: none !important;
}

#qr-reader __scan_region__ {
  min-height: auto !important;
}

/* Scanner Corner Viewfinder Guides */
.scanner-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: #00DDE0;
  border-style: solid;
  pointer-events: none;
  z-index: 10;
}

.corner-tl {
  top: 14px;
  left: 14px;
  border-width: 3px 0 0 3px;
  border-top-left-radius: 6px;
}

.corner-tr {
  top: 14px;
  right: 14px;
  border-width: 3px 3px 0 0;
  border-top-right-radius: 6px;
}

.corner-bl {
  bottom: 14px;
  left: 14px;
  border-width: 0 0 3px 3px;
  border-bottom-left-radius: 6px;
}

.corner-br {
  bottom: 14px;
  right: 14px;
  border-width: 0 3px 3px 0;
  border-bottom-right-radius: 6px;
}

/* Animated Laser Scanner Line */
.scanner-laser {
  position: absolute;
  left: 8%;
  right: 8%;
  height: 2.5px;
  background: linear-gradient(90deg, transparent, #00DDE0 25%, #FFFFFF 50%, #00DDE0 75%, transparent);
  box-shadow: 0 0 12px #00DDE0, 0 0 20px rgba(0, 221, 224, 0.8);
  border-radius: 2px;
  z-index: 9;
  animation: scanLaserAnim 2.4s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes scanLaserAnim {
  0% {
    top: 18px;
    opacity: 0.85;
  }
  50% {
    opacity: 1;
  }
  100% {
    top: calc(100% - 22px);
    opacity: 0.85;
  }
}

.scanner-actions-bar {
  display: flex;
  gap: 10px;
  width: 100%;
  justify-content: center;
}

.scanner-actions-bar .btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

/* 🛡️ Geofence & Multi-Factor Notice Modal */
.notice-modal-card {
  max-width: 460px;
  text-align: center;
  padding: 26px 22px;
}

.notice-badge-icon {
  font-size: 48px;
  margin-bottom: 8px;
  display: inline-block;
  animation: pulseIcon 2s ease-in-out infinite alternate;
}

@keyframes pulseIcon {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}

.notice-headline {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.notice-subtext {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.notice-issues-list {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  text-align: left;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notice-issue-item {
  font-size: 13px;
  color: #F59E0B;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.notice-alert-box {
  background: rgba(13, 23, 26, 0.6);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  text-align: left;
}

.notice-alert-box i {
  color: #F59E0B;
  flex-shrink: 0;
}

.modal-actions-stacked {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.modal-actions-stacked .btn-primary,
.modal-actions-stacked .btn-secondary,
.modal-actions-stacked .btn-warning-outline {
  width: 100%;
  justify-content: center;
  padding: 12px;
}

.btn-warning-outline {
  background: transparent;
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #F59E0B;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.btn-warning-outline:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: #F59E0B;
}

/* Admin Subnavigation Tabs Bar - Modern Segmented Control */
.admin-subtabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.admin-subtabs::-webkit-scrollbar {
  display: none;
}

.admin-subtab {
  background: transparent;
  border: 1px solid transparent;
  padding: 10px 18px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  margin-bottom: 0;
  border-bottom: none;
}

.admin-subtab:hover {
  color: var(--text-main);
  background: var(--surface);
  border-color: var(--border);
}

.admin-subtab.active {
  color: #0D171A;
  background: var(--primary-cyan);
  border-color: var(--primary-cyan);
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(0, 221, 224, 0.35);
}

[data-theme="dark"] .admin-subtab.active {
  color: #041014;
  background: var(--primary-cyan);
  box-shadow: 0 2px 12px rgba(0, 221, 224, 0.45);
}

.admin-subtab i,
.admin-subtab svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.admin-subtab-content.hidden {
  display: none;
}

/* Table Toolbar (Search & Filter) */
.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  margin-bottom: 14px;
}

.toolbar-search {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.toolbar-search i, .toolbar-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px;
  height: 16px;
}

.toolbar-search input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.toolbar-search input:focus {
  border-color: var(--border-focus);
}

.toolbar-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.form-select {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.form-select:focus {
  border-color: var(--border-focus);
}

.form-textarea {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  font-family: inherit;
  resize: vertical;
}

.form-textarea:focus {
  border-color: var(--border-focus);
}

/* Table Pagination */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px 4px 4px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-size-select {
  padding: 4px 8px;
  font-size: 12px;
}

.btn-page {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.btn-page:hover:not(:disabled) {
  background: var(--primary-cyan);
  color: #172326;
  border-color: var(--primary-cyan);
}

.btn-page:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.page-current {
  font-weight: 700;
  color: var(--text-main);
  padding: 0 4px;
}

/* Status Badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: capitalize;
}

.status-pill.active {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(5, 150, 105, 0.2);
}

.status-pill.suspended {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

/* Selfie Thumbnails */
.selfie-thumb {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid var(--primary-cyan);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  vertical-align: middle;
}

.selfie-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 10px var(--cyan-glow);
}

.selfie-placeholder {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--surface-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 16px;
  border: 1px dashed var(--border);
}

/* Selfie Zoom Modal */
.selfie-zoom-card {
  max-width: 440px;
}

.selfie-large-wrapper {
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--primary-cyan);
  box-shadow: 0 8px 24px var(--cyan-glow);
  margin-bottom: 12px;
}

.zoom-selfie-img {
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  display: block;
}

.zoom-signals-meta {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
}

/* Gamification Badges Feed */
.recent-badges-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  max-height: 290px;
  overflow-y: auto;
}

.badge-feed-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-subtle);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.badge-feed-item .icon {
  font-size: 24px;
}

.badge-feed-item .info h5 {
  margin: 0;
  font-size: 13px;
  color: var(--text-main);
}

.badge-feed-item .info p {
  margin: 2px 0 0 0;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Printable Gate QR Poster */
.printable-poster-wrapper {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

.printable-poster {
  background: #FFFFFF;
  color: #172326;
  width: 100%;
  border: 4px double #00888E;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: all 0.25s ease;
  box-sizing: border-box;
}

.printable-poster.poster-size-a4 {
  max-width: 560px;
  padding: 34px 28px;
}

.printable-poster.poster-size-a5 {
  max-width: 410px;
  padding: 22px 18px;
}

.poster-school-header .poster-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin-bottom: 8px;
}

.poster-size-a5 .poster-school-header .poster-logo {
  width: 54px;
  height: 54px;
  margin-bottom: 4px;
}

.poster-school-header h2 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  color: #172326;
  margin: 0;
  letter-spacing: 0.5px;
}

.poster-size-a5 .poster-school-header h2 {
  font-size: 18px;
}

.poster-sub {
  font-size: 13px;
  color: #607477;
  margin: 4px 0 12px 0;
}

.poster-size-a5 .poster-sub {
  font-size: 11.5px;
  margin: 2px 0 8px 0;
}

.poster-location-badge {
  background: #EDF7F7;
  border: 1px solid #00DDE0;
  padding: 6px 14px;
  border-radius: 30px;
  display: inline-block;
  margin-bottom: 16px;
}

.poster-location-badge span {
  display: block;
  font-weight: 800;
  font-size: 13px;
  color: #00AEB5;
}

.poster-location-badge small {
  font-size: 11px;
  color: #607477;
}

.poster-size-a5 .poster-location-badge {
  padding: 4px 10px;
  margin-bottom: 12px;
}

.poster-size-a5 .poster-location-badge span {
  font-size: 11.5px;
}

.poster-qr-area {
  background: #F4FAFA;
  border: 2px dashed #00AEB5;
  border-radius: 12px;
  padding: 16px;
  margin: 0 auto 16px auto;
  display: inline-block;
}

.poster-qr-canvas canvas, .poster-qr-canvas img {
  display: block;
  margin: 0 auto;
  border-radius: 8px;
}

.poster-scan-text {
  font-size: 11.5px;
  font-weight: 800;
  color: #00888E;
  margin-top: 8px;
  letter-spacing: 0.5px;
}

.poster-size-a5 .poster-scan-text {
  font-size: 10px;
}

.poster-instructions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  background: #F4FAFA;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 12px;
  color: #263238;
}

.poster-size-a5 .poster-instructions {
  padding: 8px 12px;
  font-size: 11px;
  gap: 5px;
  margin-bottom: 10px;
}

.poster-instructions .step {
  display: flex;
  align-items: center;
  gap: 8px;
}

.poster-instructions .step-num {
  background: #00888E;
  color: white;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}

.poster-security-warning {
  background: #FFFBEB;
  border: 1px solid #FCD34D;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  text-align: center;
}

.poster-size-a5 .poster-security-warning {
  padding: 6px 10px;
  margin-bottom: 10px;
}

.poster-footer {
  font-size: 10.5px;
  color: #899D9F;
  border-top: 1px solid #DCE7E8;
  padding-top: 10px;
}

/* Print Stylesheet for Physical Gate Signage */
@page {
  margin: 10mm;
  size: auto;
}

@media print {
  body * {
    visibility: hidden;
  }

  .printable-poster, .printable-poster * {
    visibility: visible;
  }

  .printable-poster {
    position: absolute;
    left: 0;
    right: 0;
    margin: 0 auto;
    top: 0;
    box-shadow: none !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    background: #FFFFFF !important;
    color: #172326 !important;
  }

  .printable-poster.poster-size-a4 {
    width: 186mm !important;
    max-width: 186mm !important;
    padding: 16mm 14mm !important;
    border: 4pt double #00888E !important;
  }

  .printable-poster.poster-size-a5 {
    width: 130mm !important;
    max-width: 130mm !important;
    padding: 10mm 8mm !important;
    border: 3pt double #00888E !important;
  }

  .poster-qr-area {
    background: transparent !important;
    border: 2px dashed #00888E !important;
  }

  .poster-security-warning {
    background: #FFFBEB !important;
    border: 1px solid #FCD34D !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

.hidden {
  display: none !important;
}

/* ============================================================
 * User Profile Badge, Avatar & Cascading Account Dropdown
 * ============================================================ */
.user-profile-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 4px;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 10px 4px 6px;
  border-radius: var(--radius-full);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  user-select: none;
  flex-shrink: 0;
}

.user-profile-badge:hover,
.user-profile-badge:focus-visible,
.user-profile-menu.open .user-profile-badge {
  background: var(--surface);
  border-color: var(--primary-cyan);
  box-shadow: 0 2px 10px var(--cyan-glow);
}

.user-avatar-wrap {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
}

.user-avatar-img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: #ffffff;
  border: 2px solid var(--primary-cyan);
  display: block;
}

.avatar-camera-icon {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  background: var(--dark-cyan);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--surface);
}

.avatar-camera-icon svg {
  width: 8px;
  height: 8px;
}

.user-details-text {
  text-align: left;
}

.user-details-text .user-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
  margin: 0;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-details-text .user-role {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.2;
  margin: 1px 0 0 0;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-dropdown-arrow {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.user-profile-menu.open .profile-dropdown-arrow {
  transform: rotate(180deg);
  color: var(--primary-cyan);
}

/* User Info Dropdown & Hover Bridge */
.user-info-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18), 0 0 1px rgba(0, 0, 0, 0.2);
  padding: 10px;
  min-width: 250px;
  z-index: 1000;
  margin-top: 4px;
}

/* Invisible Hover Bridge so cursor moving across gap never triggers mouseleave */
.user-info-dropdown::before {
  content: '';
  position: absolute;
  top: -18px;
  left: -20px;
  right: -20px;
  height: 24px;
  background: transparent;
  pointer-events: auto;
}

[data-theme="dark"] .user-info-dropdown {
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Desktop Hover Rule (Direct pure CSS hover backup) */
@media (min-width: 1025px) {
  .user-profile-menu:hover .user-info-dropdown {
    display: block;
  }
}

/* Cascading Animations */
@keyframes cascadeDown {
  0% {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes cascadeItem {
  0% {
    opacity: 0;
    transform: translateY(-6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.user-profile-menu.open .user-info-dropdown,
.user-info-dropdown.show {
  display: block;
  animation: cascadeDown 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.user-profile-menu.open .dropdown-user-header,
.user-info-dropdown.show .dropdown-user-header {
  animation: cascadeItem 0.22s 0.03s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.user-profile-menu.open .btn-dropdown-item:nth-of-type(1),
.user-info-dropdown.show .btn-dropdown-item:nth-of-type(1) {
  animation: cascadeItem 0.22s 0.06s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.user-profile-menu.open .btn-dropdown-item:nth-of-type(2),
.user-info-dropdown.show .btn-dropdown-item:nth-of-type(2) {
  animation: cascadeItem 0.22s 0.09s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.user-profile-menu.open .btn-dropdown-item:nth-of-type(3),
.user-info-dropdown.show .btn-dropdown-item:nth-of-type(3) {
  animation: cascadeItem 0.22s 0.12s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.dropdown-user-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface-subtle);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 8px;
}

.dropdown-user-avatar img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-cyan);
  background: #ffffff;
  display: block;
}

.dropdown-user-meta {
  flex: 1;
  min-width: 0;
}

.dropdown-user-meta h4 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-user-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--dark-cyan);
  background: var(--cyan-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 2px;
}

[data-theme="dark"] .dropdown-user-badge {
  color: var(--primary-cyan);
}

.dropdown-user-dept {
  margin: 3px 0 0 0;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-user-staff-no {
  margin: 1px 0 0 0;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-light);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

.btn-dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.btn-dropdown-item:hover {
  background: var(--surface-subtle);
  color: var(--primary-cyan);
}

.dropdown-item-pill {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--surface-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

[data-theme="dark"] .dropdown-item-pill {
  background: rgba(255, 255, 255, 0.08);
  color: var(--primary-cyan);
  border-color: rgba(34, 211, 238, 0.25);
}

.btn-dropdown-item.btn-logout {
  color: var(--danger);
}

.btn-dropdown-item.btn-logout:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.btn-dropdown-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* User Dropdown Close Button */
.dropdown-close-btn {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.dropdown-close-btn:hover {
  background: var(--surface);
  color: var(--danger);
}

/* User Dropdown Mobile Backdrop */
.user-dropdown-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 990;
  animation: fadeIn 0.2s ease forwards;
}

.user-dropdown-backdrop.hidden {
  display: none !important;
  pointer-events: none !important;
}

/* ============================================================
 * RESPONSIVE BREAKPOINTS (Tablets, Mobiles, Foldables)
 * ============================================================ */

/* 💻 LAPTOP / COMPACT DESKTOP SCREENS (1025px - 1360px) */
@media (min-width: 1025px) and (max-width: 1360px) {
  .header-container {
    padding: 8px 14px;
    gap: 8px;
  }

  .brand-logo-img {
    width: 32px;
    height: 32px;
  }

  .brand-title {
    font-size: 19px;
  }

  .brand-sub {
    font-size: 10px;
  }

  .nav-controls {
    gap: 6px;
  }

  .nav-tabs {
    padding: 2px 3px;
    gap: 2px;
  }

  .nav-tab {
    padding: 5px 9px;
    font-size: 11.5px;
    gap: 4px;
  }

  .nav-tab svg {
    width: 14px;
    height: 14px;
  }

  .theme-toggle-btn {
    padding: 5px 9px;
    font-size: 11.5px;
    gap: 4px;
  }

  .user-profile-badge {
    padding: 3px 8px 3px 4px;
    gap: 6px;
  }

  .user-avatar-wrap,
  .user-avatar-img {
    width: 30px;
    height: 30px;
  }

  .user-details-text .user-name {
    max-width: 100px;
    font-size: 11.5px;
  }

  .user-details-text .user-role {
    font-size: 9.5px;
  }
}

/* 📱 TABLET & MOBILE SCREENS (<= 1024px) */
@media (max-width: 1024px) {
  .header-container {
    padding: 10px 16px;
  }

  .main-container {
    padding: 18px 14px calc(85px + env(safe-area-inset-bottom, 12px)) 14px;
  }

  /* Fixed Bottom Navigation Bar */
  .nav-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--header-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    border-radius: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 6px)) 8px;
    z-index: 90;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    justify-content: flex-start;
    align-items: stretch;
    gap: 4px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  }

  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .nav-tab {
    flex: 1 0 auto;
    min-width: 64px;
    max-width: 100px;
    flex-direction: column;
    gap: 2px;
    padding: 6px 4px;
    font-size: 10.5px;
    border-radius: var(--radius-sm);
    text-align: center;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
  }

  .nav-tab svg {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
  }

  .nav-tab span {
    font-size: 10px;
    font-weight: 600;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Cascading User Dropdown Card on Mobile/Tablet */
  .user-info-dropdown {
    position: fixed;
    top: 58px;
    right: 14px;
    left: 14px;
    width: auto;
    max-width: 380px;
    margin: 0 auto;
    z-index: 1000;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  }

  .clock-action-buttons {
    grid-template-columns: 1fr;
  }

  .verification-box {
    grid-template-columns: 1fr;
  }

  .user-details-text .user-name {
    max-width: 100px;
  }

  .user-details-text .user-role {
    display: none;
  }

  /* Admin Subtabs Horizontal Touch Scroll */
  .admin-subtabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 8px;
    padding: 6px 8px;
    margin-bottom: 18px;
  }

  .admin-subtabs::-webkit-scrollbar {
    display: none;
  }

  .admin-subtab {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 9px 15px;
    font-size: 12.5px;
  }
}

/* 📱 SMARTPHONE SCREENS (<= 640px) */
@media (max-width: 640px) {
  .header-container {
    padding: 8px 12px;
  }

  .brand {
    gap: 8px;
  }

  .brand-logo-img {
    width: 32px;
    height: 32px;
  }

  .brand-title {
    font-size: 18px;
  }

  .brand-sub {
    font-size: 9.5px;
  }

  .theme-toggle-btn,
  .header-guide-btn {
    padding: 6px 8px;
  }

  .theme-toggle-btn #theme-label,
  .header-guide-btn #guide-header-label {
    display: none;
  }

  .user-profile-badge {
    padding: 3px 6px 3px 3px;
    gap: 4px;
  }

  .user-details-text .user-name {
    display: none;
  }

  .profile-dropdown-arrow {
    display: none;
  }

  .user-avatar-wrap,
  .user-avatar-img {
    width: 32px;
    height: 32px;
  }

  .avatar-camera-icon {
    width: 13px;
    height: 13px;
    bottom: -1px;
    right: -1px;
  }

  .avatar-camera-icon svg {
    width: 7.5px;
    height: 7.5px;
  }

  /* Mobile User Dropdown Position */
  .user-info-dropdown {
    position: fixed;
    top: 56px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: 380px;
    margin: 0 auto;
  }

  /* Dashboard Cards & Buttons */
  .glass-card {
    padding: 16px 12px;
    border-radius: var(--radius-md);
  }

  .card-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .admin-actions-bar {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .admin-actions-bar button {
    flex: 1;
    justify-content: center;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }

  .metric-card {
    padding: 12px;
  }

  .metric-val {
    font-size: 20px;
  }

  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .toolbar-search {
    min-width: 100%;
  }

  .toolbar-filters {
    width: 100%;
    display: flex;
    flex-direction: column;
  }

  .toolbar-filters select,
  .toolbar-filters input {
    width: 100%;
  }

  .table-pagination {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .pagination-controls {
    width: 100%;
    justify-content: space-between;
  }

  /* Forms and Grids inside Modals */
  .modal-backdrop {
    padding: 10px;
  }

  .modal-card {
    padding: 18px 14px;
    border-radius: var(--radius-md);
    max-height: 94vh;
  }

  #edit-staff-form > div[style*="grid"],
  #add-staff-form > div[style*="grid"],
  #dept-form > div[style*="grid"],
  #admin-tab-leaves > div,
  .profile-info-grid {
    grid-template-columns: 1fr !important;
  }

  .printable-poster {
    padding: 20px 12px;
  }

  .poster-school-header h2 {
    font-size: 18px;
  }
}

/* 📱 ULTRA-COMPACT SCREENS (<= 380px) */
@media (max-width: 380px) {
  .brand-title {
    font-size: 16px;
  }

  .brand-sub {
    display: none;
  }

  .nav-tab {
    min-width: 58px;
    padding: 4px 2px;
  }

  .nav-tab span {
    font-size: 9.5px;
  }
}

/* Large Profile Modal Avatar */
.profile-avatar-large-wrap {
  position: relative;
  width: 110px;
  height: 110px;
  margin: 0 auto;
}

.profile-avatar-large {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  background: #ffffff;
  border: 3px solid var(--primary-cyan);
  box-shadow: 0 6px 20px var(--cyan-glow);
  display: block;
}

.avatar-upload-overlay {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 32px;
  height: 32px;
  background: var(--dark-cyan);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid var(--surface);
  transition: transform 0.2s, background 0.2s;
}

.avatar-upload-overlay:hover {
  transform: scale(1.15);
  background: var(--primary-cyan);
  color: #172326;
}

.avatar-upload-overlay svg {
  width: 16px;
  height: 16px;
}

/* Avatar Preview Box in Modals */
.avatar-preview-box {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--primary-cyan);
  background: #ffffff;
  flex-shrink: 0;
}

.modal-avatar-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* List Avatar Thumbnails */
.avatar-thumb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #ffffff;
  border: 2px solid var(--primary-cyan);
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.staff-table-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.staff-name-col {
  display: flex;
  flex-direction: column;
}

.staff-name-col strong {
  color: var(--text-main);
  font-size: 13.5px;
}

.staff-name-col small {
  color: var(--text-muted);
  font-size: 11.5px;
}

.leaderboard-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: #ffffff;
  border: 2px solid var(--primary-cyan);
  flex-shrink: 0;
}

/* =========================================================
   📶 Offline Sync Pill & Banner
========================================================= */
.offline-sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  animation: pulse-border 2s infinite;
}

[data-theme="dark"] .offline-sync-pill {
  background: #78350f;
  color: #fef3c7;
  border-color: #b45309;
}

.offline-sync-pill.hidden {
  display: none !important;
}

/* =========================================================
   📋 Duty Roster Styles
========================================================= */
.duty-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.duty-grid-card {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.duty-grid-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.duty-status-badge {
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: bold;
  text-transform: uppercase;
}

.duty-status-badge.scheduled {
  background: #e0f2fe;
  color: #0369a1;
}

.duty-status-badge.checked_in, .duty-status-badge.completed {
  background: #dcfce7;
  color: #15803d;
}

.duty-status-badge.missed {
  background: #fee2e2;
  color: #b91c1c;
}

.my-duties-scroll-wrapper {
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  transition: all 0.25s ease-in-out;
}

.my-duties-scroll-wrapper.collapsed {
  display: none;
}

.my-duties-scroll-wrapper::-webkit-scrollbar {
  width: 6px;
}

.my-duties-scroll-wrapper::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.my-duties-scroll-wrapper::-webkit-scrollbar-thumb {
  background: var(--primary-cyan, #00dde0);
  border-radius: 4px;
  opacity: 0.6;
}

.my-duties-scroll-wrapper::-webkit-scrollbar-thumb:hover {
  background: #00b4b6;
}

/* =========================================================
   🧠 AI Analytics Cards & Insights
========================================================= */
.ai-insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.ai-card {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s;
}

.ai-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #00DDE0, #3B82F6);
}

.ai-card.critical::before {
  background: #ef4444;
}

.ai-card.warning::before {
  background: #f59e0b;
}

.ai-card.positive::before {
  background: #10b981;
}

.ai-card.info::before {
  background: #00DDE0;
}

.ai-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.ai-card-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.ai-card-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 12px;
}

.ai-metrics-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 221, 224, 0.1);
  color: var(--dark-cyan);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
}

[data-theme="dark"] .ai-metrics-badge {
  color: var(--primary-cyan);
  background: rgba(0, 221, 224, 0.15);
}

.dept-progress-bar-wrap {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}

.dept-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #00DDE0, #10B981);
  border-radius: 4px;
  transition: width 0.6s ease-in-out;
}

/* =========================================================
   🔍 Predictive Staff Combobox & Autocomplete
========================================================= */
.predictive-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.predictive-search-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.predictive-input {
  padding-left: 36px !important;
  padding-right: 32px !important;
  width: 100%;
}

.btn-clear-prediction {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s;
}

.btn-clear-prediction:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.predictive-dropdown-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.15);
  max-height: 220px;
  overflow-y: auto;
  z-index: 1000;
  padding: 4px;
  backdrop-filter: blur(12px);
}

.predictive-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.predictive-item:hover, .predictive-item.selected {
  background: var(--surface-subtle);
  border-left: 3px solid var(--primary-cyan);
}

.predictive-item-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.predictive-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.predictive-item-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.predictive-no-match {
  padding: 12px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Selected Staff Pill */
.selected-staff-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 221, 224, 0.08);
  border: 1.5px solid var(--primary-cyan);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  animation: fadeIn 0.2s ease-out;
}

.selected-staff-info {
  flex: 1;
  min-width: 0;
}

.selected-staff-info strong {
  display: block;
  font-size: 13.5px;
  color: var(--text-main);
}

.selected-staff-info small {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
}

.btn-clear-staff-selection {
  background: rgba(0, 0, 0, 0.08);
  border: none;
  font-size: 18px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.btn-clear-staff-selection:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  transform: scale(1.1);
}

/* =========================================================
   📅 Calendar Picker & Quick Day Chips
========================================================= */
.calendar-picker-box {
  position: relative;
  display: flex;
  align-items: center;
}

.calendar-date-input {
  padding-right: 42px !important;
  cursor: pointer;
}

.btn-calendar-trigger {
  position: absolute;
  right: 6px;
  background: transparent;
  border: none;
  color: var(--primary-cyan);
  padding: 6px;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.15s;
}

.btn-calendar-trigger:hover {
  background: rgba(0, 221, 224, 0.12);
  transform: scale(1.08);
}

.duty-date-chip-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-cyan);
  background: rgba(0, 221, 224, 0.1);
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: capitalize;
}

.quick-date-chips-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.date-chip {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.date-chip:hover {
  border-color: var(--primary-cyan);
  color: var(--text-main);
  background: rgba(0, 221, 224, 0.08);
  transform: translateY(-1px);
}

.date-chip.active {
  background: var(--primary-cyan);
  color: #172326;
  border-color: var(--primary-cyan);
  font-weight: 700;
  box-shadow: 0 2px 8px var(--cyan-glow);
}

/* =========================================================
   🤖 AI Recommendations & Print Executive Styles
========================================================= */
.ai-recommendations-list {
  margin: 10px 0 0 0;
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 12.5px;
  line-height: 1.6;
}

.ai-recommendations-list li {
  margin-bottom: 4px;
}

.ai-recommendations-list li strong {
  color: var(--text-main);
}

.print-only-header,
.print-only-footer {
  display: none !important;
}

@media print {
  body {
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 12pt;
    margin: 0;
    padding: 0;
  }

  .app-header,
  .nav-tabs,
  .user-profile-menu,
  .admin-actions-bar,
  .modal-backdrop,
  .qr-scan-bar,
  .btn-primary,
  .btn-secondary {
    display: none !important;
  }

  .view {
    display: none !important;
  }

  #analytics-view,
  #admin-tab-insights,
  #admin-view {
    display: block !important;
  }

  .glass-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .print-only-header,
  .print-only-footer {
    display: flex !important;
  }

  .ai-insights-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
  }

  .ai-card {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    break-inside: avoid;
    padding: 12px !important;
    box-shadow: none !important;
  }

  .ai-card-title {
    color: #0f172a !important;
    font-size: 12pt !important;
  }

  .ai-card-body,
  .ai-recommendations-list {
    color: #334155 !important;
    font-size: 9.5pt !important;
  }

  #ai-dept-benchmark-container {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
  }

  .dept-progress-bar-wrap {
    background: #e2e8f0 !important;
  }
}

/* ============================================================
   MODERN FLOATING TOAST NOTIFICATION SYSTEM & NETWORK BAR
   ============================================================ */
#top-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3.5px;
  width: 0%;
  background: linear-gradient(90deg, var(--primary-cyan), var(--accent-orange), var(--primary-cyan));
  background-size: 200% 100%;
  animation: shimmerProgress 1.4s infinite linear;
  z-index: 9999999;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 0 12px var(--primary-cyan);
}

#top-progress-bar.active {
  opacity: 1;
}

@keyframes shimmerProgress {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 440px;
  width: calc(100vw - 48px);
  pointer-events: none;
}

@media (max-width: 600px) {
  .toast-container {
    top: 14px;
    right: 14px;
    left: 14px;
    width: auto;
    max-width: none;
  }
}

.earlybird-toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface-elevated);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18), 0 4px 14px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  pointer-events: auto;
  overflow: hidden;
  opacity: 0;
  transform: translateX(45px) scale(0.95);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), margin 0.3s ease;
}

.earlybird-toast.show {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.earlybird-toast.hide {
  opacity: 0;
  transform: translateX(35px) scale(0.92);
  margin-top: -55px;
  pointer-events: none;
}

.toast-icon-wrap {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.toast-icon-wrap svg {
  width: 20px;
  height: 20px;
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 3px 0;
  line-height: 1.3;
}

.toast-message {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
  word-break: break-word;
}

.toast-close-btn {
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px;
  margin: -4px -6px 0 0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.toast-close-btn:hover {
  color: var(--text-main);
  background: var(--surface-subtle);
}

.toast-progress-track {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3.5px;
  background: rgba(0, 0, 0, 0.06);
}

.toast-progress-bar {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  animation: toastProgress linear forwards;
}

@keyframes toastProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* Toast Variant Themes */
.earlybird-toast.toast-success {
  border-left: 4.5px solid var(--success);
}
.earlybird-toast.toast-success .toast-icon-wrap {
  background: var(--success-bg);
  color: var(--success);
}
.earlybird-toast.toast-success .toast-progress-bar {
  background: var(--success);
}

.earlybird-toast.toast-error {
  border-left: 4.5px solid var(--danger);
}
.earlybird-toast.toast-error .toast-icon-wrap {
  background: var(--danger-bg);
  color: var(--danger);
}
.earlybird-toast.toast-error .toast-progress-bar {
  background: var(--danger);
}

.earlybird-toast.toast-warning {
  border-left: 4.5px solid var(--warning);
}
.earlybird-toast.toast-warning .toast-icon-wrap {
  background: var(--warning-bg);
  color: var(--warning);
}
.earlybird-toast.toast-warning .toast-progress-bar {
  background: var(--warning);
}

.earlybird-toast.toast-info {
  border-left: 4.5px solid var(--primary-cyan);
}
.earlybird-toast.toast-info .toast-icon-wrap {
  background: var(--cyan-subtle);
  color: var(--dark-cyan);
}
.earlybird-toast.toast-info .toast-progress-bar {
  background: var(--primary-cyan);
}

/* Button Loading / Spinner */
.btn-loading {
  position: relative !important;
  pointer-events: none !important;
  cursor: not-allowed !important;
}

.btn-loading > *:not(.btn-spinner) {
  opacity: 0 !important;
  visibility: hidden !important;
}

.btn-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  margin-left: -9px;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btnSpin 0.75s infinite linear;
  display: inline-block;
  pointer-events: none;
}

@keyframes btnSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Mobile In-App Banner for Android Browser Users */
.mobile-inapp-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.14) 0%, rgba(59, 130, 246, 0.12) 100%);
  border: 1px solid var(--primary-cyan);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px var(--cyan-glow);
  animation: slideDown 0.35s ease-out;
}

.mobile-inapp-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.mobile-inapp-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.mobile-inapp-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mobile-inapp-text strong {
  font-size: 12.5px;
  color: var(--text-main);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-inapp-text span {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}

.mobile-inapp-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mobile-inapp-btn {
  font-size: 11px;
  padding: 6px 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.mobile-inapp-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  transition: all 0.2s ease;
}

.mobile-inapp-close:hover {
  color: var(--text-main);
  background: var(--surface-subtle);
}

/* Modern Switch Toggle Control */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-round {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 24px;
}

.slider-round:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.switch-toggle input:checked + .slider-round {
  background-color: var(--primary-cyan);
}

.switch-toggle input:focus + .slider-round {
  box-shadow: 0 0 1px var(--primary-cyan);
}

.switch-toggle input:checked + .slider-round:before {
  transform: translateX(20px);
}

/* ============================================================
 * User Preferences & Settings Modal Styling
 * ============================================================ */
.preferences-modal-card {
  max-width: 680px;
  width: 100%;
}

.preferences-nav {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.preferences-nav::-webkit-scrollbar {
  display: none;
}

.pref-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.pref-nav-btn:hover {
  background: var(--surface);
  color: var(--text-main);
  border-color: var(--primary-cyan);
}

.pref-nav-btn.active {
  background: var(--primary-cyan);
  color: #0d171a;
  border-color: var(--primary-cyan);
  box-shadow: 0 2px 10px var(--cyan-glow);
}

.pref-nav-btn svg {
  width: 15px;
  height: 15px;
}

.pref-tab-content {
  display: none;
  animation: fadeIn 0.2s ease;
}

.pref-tab-content.active {
  display: block;
}

.pref-group-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary-cyan);
  margin: 0 0 10px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pref-card {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  transition: all 0.2s ease;
}

.pref-card:hover {
  border-color: var(--primary-cyan);
  background: var(--surface);
}

.pref-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.pref-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--cyan-subtle);
  color: var(--primary-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.pref-card-text {
  min-width: 0;
}

.pref-card-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

.pref-card-desc {
  margin: 3px 0 0 0;
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.35;
}

.pref-segmented-control {
  display: flex;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 3px;
}

.pref-segment-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pref-segment-btn.active {
  background: var(--surface);
  color: var(--primary-cyan);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* ============================================================
   MID-DAY ERRANDS, BREAKS & MONETARY DEDUCTION STYLES
   ============================================================ */

.status-live-strip {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.status-live-strip.on-duty {
  background: rgba(0, 221, 224, 0.08);
  border-color: rgba(0, 221, 224, 0.3);
}

.status-live-strip.on-break {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.35);
}

.status-live-strip.on-break #live-status-dot {
  background: #F59E0B !important;
  box-shadow: 0 0 10px #F59E0B !important;
}

.status-live-strip.on-errand {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.35);
}

.status-live-strip.on-errand #live-status-dot {
  background: #3B82F6 !important;
  box-shadow: 0 0 10px #3B82F6 !important;
}

.status-live-strip.completed {
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.25);
}

.status-live-strip.completed #live-status-dot {
  background: #94A3B8 !important;
  box-shadow: none !important;
}

.btn-midday {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text-main);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-midday:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn-midday:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-midday.break {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
  color: #F59E0B;
}

.btn-midday.break:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.18);
  border-color: #F59E0B;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
}

.btn-midday.errand {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.08);
  color: #3B82F6;
}

.btn-midday.errand:hover:not(:disabled) {
  background: rgba(59, 130, 246, 0.18);
  border-color: #3B82F6;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.25);
}

.btn-midday.resume {
  grid-column: 1 / -1;
  border-color: #10B981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.35));
  color: #10B981;
  font-size: 14px;
  padding: 13px;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.25);
  animation: pulse-emerald 2s infinite;
}

@keyframes pulse-emerald {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.errand-type-pill {
  transition: all 0.2s ease;
}

.errand-type-pill:hover {
  border-color: var(--primary-cyan) !important;
}

.errand-type-pill.active {
  border-color: var(--primary-cyan) !important;
  background: rgba(0, 221, 224, 0.12) !important;
}

/* Event badges in tables */
.badge-event-type {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
}

.badge-event-type.clock-in {
  background: rgba(0, 221, 224, 0.12);
  color: var(--primary-cyan);
  border: 1px solid rgba(0, 221, 224, 0.3);
}

.badge-event-type.clock-out {
  background: rgba(236, 72, 153, 0.12);
  color: #EC4899;
  border: 1px solid rgba(236, 72, 153, 0.3);
}

.badge-event-type.break-out,
.badge-event-type.break-in {
  background: rgba(245, 158, 11, 0.12);
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-event-type.errand-out,
.badge-event-type.errand-in {
  background: rgba(59, 130, 246, 0.12);
  color: #3B82F6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.monetary-deduction-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
}

.monetary-deduction-badge.deducted {
  background: rgba(239, 68, 68, 0.12);
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.monetary-deduction-badge.zero {
  background: rgba(16, 185, 129, 0.08);
  color: #10B981;
}





/* ============================================================ */
/* 📚 TEACHER USER GUIDE & WALKTHROUGH MODAL STYLES */
/* ============================================================ */
.teacher-guide-modal-card {
  max-width: 680px;
  width: 95%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.teacher-guide-modal-card .modal-body {
  flex: 1;
  overflow-y: auto !important;
  overflow-x: hidden;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  padding: 16px 20px;
}

.teacher-guide-modal-card .modal-body::-webkit-scrollbar {
  width: 7px;
}

.teacher-guide-modal-card .modal-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.teacher-guide-modal-card .modal-body::-webkit-scrollbar-thumb {
  background: var(--primary-cyan, #00dde0);
  border-radius: 4px;
  opacity: 0.8;
}

.teacher-guide-modal-card .modal-body::-webkit-scrollbar-thumb:hover {
  background: #00b4b6;
}

.guide-stepper-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 2px 12px 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  scrollbar-width: none;
}
.guide-stepper-bar::-webkit-scrollbar {
  display: none;
}

.guide-step-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.guide-step-tab .step-num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-main);
}

.guide-step-tab.active {
  background: rgba(0, 221, 224, 0.12);
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
}
.guide-step-tab.active .step-num {
  background: var(--primary-cyan);
  color: #042B2C;
  border-color: var(--primary-cyan);
}

.guide-slide {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}
.guide-slide.active {
  display: block;
}

.guide-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.guide-pill-badge {
  background: rgba(0, 221, 224, 0.15);
  color: var(--primary-cyan);
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.guide-slide-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.guide-lead-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 16px 0;
}

.guide-info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.guide-feature-box {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 12.5px;
}

.guide-feature-box strong {
  display: block;
  font-size: 13px;
  color: var(--text-main);
  margin-bottom: 3px;
}

.guide-feature-box p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.4;
}

.guide-box-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(0, 221, 224, 0.12);
  color: var(--primary-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.guide-box-icon svg {
  width: 18px;
  height: 18px;
}

.guide-bullet-list {
  margin: 6px 0 0 0;
  padding-left: 18px;
  color: var(--text-secondary);
}
.guide-bullet-list li {
  margin-bottom: 3px;
}
.guide-bullet-list code {
  background: var(--surface);
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--primary-cyan);
  font-size: 11px;
}

.guide-factors-banner {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.factor-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
}
.factor-pill span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-orange);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  font-weight: 800;
}

@media (max-width: 640px) {
  .teacher-guide-modal-card {
    width: 96%;
    max-height: 94vh;
  }
  .guide-slide-title {
    font-size: 14.5px;
  }
  .guide-feature-box {
    padding: 10px;
    gap: 10px;
  }
  .guide-box-icon {
    width: 28px;
    height: 28px;
  }
  .guide-box-icon svg {
    width: 15px;
    height: 15px;
  }
  #guide-header-label {
    display: none;
  }
}

/* ============================================================
 * 📈 PERSONAL TIMESHEET TIMELINE LINE GRAPH
 * ============================================================ */
.timesheet-timeline-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline-toggle-btn {
  background: transparent;
  color: var(--text-muted);
}

.timeline-toggle-btn.active {
  background: var(--surface);
  color: var(--primary-cyan);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.timeline-range-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.timeline-range-btn:hover {
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
}

.timeline-range-btn.active {
  background: var(--primary-cyan);
  border-color: var(--primary-cyan);
  color: #041014;
  font-weight: 700;
}

.timeline-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  transform: translate(-50%, -100%);
  margin-top: -10px;
  transition: opacity 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}

.timeline-tooltip.hidden {
  opacity: 0;
  pointer-events: none;
}

.timeline-svg-point {
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), r 0.2s ease;
}

.timeline-svg-point:hover {
  transform: scale(1.4);
}

/* ============================================================
 * 🎮 ADMIN XP & GAMIFICATION SETUP PANEL
 * ============================================================ */
.xp-rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.xp-rule-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.xp-rule-item label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.xp-rule-item input {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-cyan);
  padding: 8px 10px;
}

.perk-table-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
}

.perk-cost-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(245, 166, 35, 0.12);
  color: var(--accent-orange);
  border: 1px solid rgba(245, 166, 35, 0.3);
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 700;
}

.perk-status-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.perk-status-active {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
}

.perk-status-inactive {
  background: rgba(100, 116, 139, 0.15);
  color: #64748b;
}

.staff-wallet-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

/* ==========================================
   👥 HOD Proxy Attendance Styles (Spec Sec 5, 6, 10)
   ========================================== */
.badge-role-hod {
  background: rgba(245, 166, 35, 0.16) !important;
  color: #F5A623 !important;
  border: 1px solid rgba(245, 166, 35, 0.45) !important;
  font-weight: 700;
}

.hod-banner {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hod-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(245, 166, 35, 0.18);
}

.hod-staff-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}
.hod-staff-card:hover {
  border-color: rgba(245, 166, 35, 0.4);
  background: var(--surface-subtle);
}

.hod-staff-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.hod-staff-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(245, 166, 35, 0.4);
  background: var(--surface-subtle);
  flex-shrink: 0;
}

.hod-staff-monogram {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(245, 166, 35, 0.15);
  color: #F5A623;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  border: 2px solid rgba(245, 166, 35, 0.4);
  flex-shrink: 0;
}

.hod-staff-details {
  min-width: 0;
}
.hod-staff-details h4 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hod-staff-details p {
  margin: 2px 0 0 0;
  font-size: 11.5px;
  color: var(--text-muted);
}

.hod-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  white-space: nowrap;
}
.hod-status-pill.status-not-in {
  background: rgba(148, 163, 184, 0.14);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}
.hod-status-pill.status-in {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.hod-status-pill.status-out {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.hod-actions-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-hod-clock-in {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  font-weight: 700;
  font-size: 12px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}
.btn-hod-clock-in:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-hod-clock-out {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  border: none;
  font-weight: 700;
  font-size: 12px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}
.btn-hod-clock-out:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-hod-completed {
  background: var(--surface-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: not-allowed;
  opacity: 0.75;
}



