/**
 * shared/shared.css — Global CSS
 *
 * Contains:
 *  - CSS custom properties (4 themes)
 *  - Reset & base
 *  - Screen transitions
 *  - Boot splash, Login, Change Password
 *  - Header bar
 *  - Sidebar navigation
 *  - Toast notifications
 *  - Modal / Split / Inline / Drawer detail views
 *  - CRUD modal overlay
 *  - Background layer
 *  - Lottie overlay
 *  - Module placeholder
 *  - Utility classes
 *
 * RULE: All colours use CSS custom properties — never hardcoded hex.
 */

/* ══════════════════════════════════════════════════════════════
   RESET & BASE
   ══════════════════════════════════════════════════════════════ */
:root {
  --cols: 3;
  --status-in: #3b82f6;
  --status-break: #fbbf24;
  --status-out: #6b7280;
  --status-absent: #ef4444;
  --bg-opacity: 0;
  --bg-blur: 0px;
  --bg-dim: 0.7;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body,
body * {
  transition-property: background-color, color, border-color, box-shadow, fill, stroke;
  transition-duration: 0.4s;
  transition-timing-function: ease;
}

body {
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ══════════════════════════════════════════════════════════════
   THEME: CHROMIUM
   ══════════════════════════════════════════════════════════════ */
.theme-chromium {
  --bg0: #0c0d0f;
  --bg1: #121416;
  --bg2: #1a1c20;
  --bg3: #222529;
  --bg4: #2c3035;
  --accent: #00e59a;
  --accent-dim: rgba(0, 229, 154, 0.06);
  --accent-glow: rgba(0, 229, 154, 0.25);
  --tx: #edf0f5;
  --tx2: #a8b0be;
  --tx3: #738090;
  --tx4: #556270;
  --bd: rgba(255, 255, 255, 0.09);
  --bd2: rgba(255, 255, 255, 0.14);
  --metal1: #3a3d42;
  --metal2: #52565c;
  --r: 6px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg0);
  color: var(--tx);
}
.theme-chromium .df {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
}
.theme-chromium .mf {
  font-family: 'JetBrains Mono', monospace;
}
.theme-chromium::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 2px,
    rgba(255, 255, 255, 0.007) 2px,
    rgba(255, 255, 255, 0.007) 3px
  );
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.6s;
}

/* ══════════════════════════════════════════════════════════════
   THEME: NEURAL  (Navy Rail — light, multi-color)
   Cool light shell, dark navy sidebar, blue accent.
   ══════════════════════════════════════════════════════════════ */
.theme-neural {
  --bg0: #dbe0ea;
  --bg1: #16224a;
  --bg2: #ffffff;
  --bg3: #d5dbe8;
  --bg4: #ced4e0;
  --accent: #2f6df6;
  --accent-dim: rgba(47, 109, 246, 0.08);
  --accent-glow: rgba(47, 109, 246, 0.18);
  --tx: #14213d;
  --tx2: #7b8398;
  --tx3: #9aa3b6;
  --tx4: #6d7cab;
  --bd: rgba(20, 33, 61, 0.09);
  --bd2: rgba(20, 33, 61, 0.14);
  --metal1: #b5bed6;
  --metal2: #ced4e0;
  --r: 12px;
  --status-in: #2f6df6;
  --status-break: #f5a524;
  --status-out: #9aa3b6;
  --status-absent: #e8467c;
  --sidebar-bg: #16224a;
  --sidebar-tx: #c9d3ee;
  --sidebar-tx-muted: #7f8fbe;
  --sidebar-active-bg: rgba(255, 255, 255, 0.07);
  --header-bg: #ffffff;
  --header-border: #ced4e0;
  --surface: #ffffff;
  --surface-border: #ced4e0;
  --login-page-bg: #dbe0ea;
  --login-card-bg: #ffffff;
  --login-card-border: #ced4e0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg0);
  color: var(--tx);
}
.theme-neural .df {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
}
.theme-neural .mf {
  font-family: 'JetBrains Mono', monospace;
}
.theme-neural::before {
  display: none;
}

/* ══════════════════════════════════════════════════════════════
   THEME: HOLODECK  (Spectrum Top Rail — light, multi-color)
   Lavender shell, purple accent, spectrum status set.
   ══════════════════════════════════════════════════════════════ */
.theme-holodeck {
  --bg0: #dedee8;
  --bg1: #ffffff;
  --bg2: #ffffff;
  --bg3: #d9d9e0;
  --bg4: #d4d4db;
  --accent: #5b4ae0;
  --accent-dim: rgba(91, 74, 224, 0.08);
  --accent-glow: rgba(91, 74, 224, 0.18);
  --tx: #18162b;
  --tx2: #6d6b85;
  --tx3: #7c7a94;
  --tx4: #9d9bb3;
  --bd: rgba(24, 22, 43, 0.09);
  --bd2: rgba(24, 22, 43, 0.14);
  --metal1: #d4d4db;
  --metal2: #d9d9e0;
  --r: 12px;
  --status-in: #5b4ae0;
  --status-break: #f5a524;
  --status-out: #00b3a4;
  --status-absent: #ef4a76;
  --sidebar-bg: #ffffff;
  --sidebar-tx: #18162b;
  --sidebar-tx-muted: #6d6b85;
  --sidebar-active-bg: rgba(91, 74, 224, 0.08);
  --header-bg: #ffffff;
  --header-border: #d4d4db;
  --surface: #ffffff;
  --surface-border: #d4d4db;
  --login-page-bg: #dedee8;
  --login-card-bg: #ffffff;
  --login-card-border: #d4d4db;
  --spectrum-rail-1: #5b4ae0;
  --spectrum-rail-2: #00b3a4;
  --spectrum-rail-3: #f5a524;
  --spectrum-rail-4: #ef4a76;
  --spectrum-rail-5: #2f9bff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg0);
  color: var(--tx);
}
.theme-holodeck .df {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
}
.theme-holodeck .mf {
  font-family: 'JetBrains Mono', monospace;
}
.theme-holodeck::before {
  display: none;
}

/* ══════════════════════════════════════════════════════════════
   THEME: CLEAN  (Electric Blue on Black — 3a)
   Black canvas, near-black chrome, electric blue scale.
   ══════════════════════════════════════════════════════════════ */
.theme-clean {
  --bg0: #000000;
  --bg1: #050505;
  --bg2: #0a0c10;
  --bg3: #0b0d11;
  --bg4: #0e1219;
  --accent: #3d8bff;
  --blue-2: #5ea8ff;
  --blue-3: #7fc4ff;
  --blue-4: #2563eb;
  --blue-5: #1e40af;
  --ink-on-accent: #00112b;
  --accent-dim: rgba(61, 139, 255, 0.16);
  --accent-glow: rgba(61, 139, 255, 0.35);
  --tx: #ffffff;
  --tx2: #ffffff;
  --tx3: #ffffff;
  --tx4: #ffffff;
  --bd: #16181c;
  --bd2: #1c2028;
  --metal1: #1c2028;
  --metal2: #0e1219;
  --r: 14px;
  --status-in: #3d8bff;
  --status-break: #5ea8ff;
  --status-out: #7fc4ff;
  --status-absent: #2563eb;
  --sidebar-bg: #0e2347;
  --sidebar-tx: #ffffff;
  --sidebar-tx-muted: #ffffff;
  --sidebar-active-bg: rgba(61, 139, 255, 0.16);
  --header-bg: #050505;
  --header-border: #16181c;
  --surface: #0a0c10;
  --surface-border: #1c2028;
  --login-page-bg: #000000;
  --login-card-bg: #0a0c10;
  --login-card-border: #1c2028;
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg0);
  color: var(--tx);
}
.theme-clean .df {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
}
.theme-clean .mf {
  font-family: 'JetBrains Mono', monospace;
}
.theme-clean::before {
  display: none;
}

/* ══════════════════════════════════════════════════════════════
   NATIVE DATE / TIME PICKER ICONS
   Chromium’s default calendar glyph stays black on dark --bg3;
   invert/filter is unreliable here, so paint an explicit SVG icon.
   ══════════════════════════════════════════════════════════════ */
input[type='date'],
input[type='datetime-local'],
input[type='time'],
input[type='month'],
input[type='week'] {
  color-scheme: light;
}

input[type='date']::-webkit-calendar-picker-indicator,
input[type='datetime-local']::-webkit-calendar-picker-indicator,
input[type='time']::-webkit-calendar-picker-indicator,
input[type='month']::-webkit-calendar-picker-indicator,
input[type='week']::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 1 !important;
  width: 1.2rem;
  height: 1.2rem;
  margin: 0;
  padding: 0;
  border: 0;
  filter: none !important;
  /* Light icon for dark themes */
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 1.15rem 1.15rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Crect x='3' y='5' width='18' height='16' rx='2' stroke='%23e8f2ea' stroke-width='2.2'/%3E%3Cpath d='M8 3v4M16 3v4M3 11h18' stroke='%23e8f2ea' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.theme-neural input[type='date']::-webkit-calendar-picker-indicator,
.theme-neural input[type='datetime-local']::-webkit-calendar-picker-indicator,
.theme-neural input[type='time']::-webkit-calendar-picker-indicator,
.theme-neural input[type='month']::-webkit-calendar-picker-indicator,
.theme-neural input[type='week']::-webkit-calendar-picker-indicator,
.theme-holodeck input[type='date']::-webkit-calendar-picker-indicator,
.theme-holodeck input[type='datetime-local']::-webkit-calendar-picker-indicator,
.theme-holodeck input[type='time']::-webkit-calendar-picker-indicator,
.theme-holodeck input[type='month']::-webkit-calendar-picker-indicator,
.theme-holodeck input[type='week']::-webkit-calendar-picker-indicator {
  /* Dark icon for light themes */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Crect x='3' y='5' width='18' height='16' rx='2' stroke='%23475569' stroke-width='2.2'/%3E%3Cpath d='M8 3v4M16 3v4M3 11h18' stroke='%23475569' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
  opacity: 0.9 !important;
}

/* ══════════════════════════════════════════════════════════════
   SCREENS
   ══════════════════════════════════════════════════════════════ */
.screen {
  display: none;
  min-height: 100vh;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.4s var(--ease),
    transform 0.4s var(--ease) !important;
}
.screen.active {
  display: flex;
  flex-direction: column;
}
.screen.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Main app: lock to viewport so sidebar + content scroll independently */
#screenApp.screen.active {
  height: 100vh;
  max-height: 100vh;
  min-height: 0;
  overflow: hidden;
}
@supports (height: 100dvh) {
  #screenApp.screen.active {
    height: 100dvh;
    max-height: 100dvh;
  }
}

/* ── Boot splash ── */
.boot-splash {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.boot-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--bg3);
  border: 2px solid var(--bd2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 20px;
  color: var(--accent);
  margin-bottom: 16px;
  animation: bootPulse 1.5s ease-in-out infinite;
  box-shadow: 0 0 20px var(--accent-glow);
}
.boot-text {
  font-size: 11px;
  color: var(--tx3);
  letter-spacing: 3px;
  text-transform: uppercase;
}
@keyframes bootPulse {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

/* ── Login ── */
.login-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  padding: 20px;
}
/* Light themes login: solid page bg, white card, no dark overlays/scanlines */
body.theme-neural.on-login-screen,
body.theme-neural:has(#screenLogin.active),
body.theme-neural:has(#screenChangePassword.active),
body.theme-holodeck.on-login-screen,
body.theme-holodeck:has(#screenLogin.active),
body.theme-holodeck:has(#screenChangePassword.active) {
  background: var(--login-page-bg, var(--bg0)) !important;
}
body.theme-neural.on-login-screen::before,
body.theme-neural:has(#screenLogin.active)::before,
body.theme-neural:has(#screenChangePassword.active)::before,
body.theme-holodeck.on-login-screen::before,
body.theme-holodeck:has(#screenLogin.active)::before,
body.theme-holodeck:has(#screenChangePassword.active)::before {
  opacity: 0 !important;
  display: none !important;
}
body.theme-neural.on-login-screen .bg-layer,
body.theme-neural.on-login-screen .bg-dim,
body.theme-neural:has(#screenLogin.active) .bg-layer,
body.theme-neural:has(#screenLogin.active) .bg-dim,
body.theme-neural:has(#screenChangePassword.active) .bg-layer,
body.theme-neural:has(#screenChangePassword.active) .bg-dim,
body.theme-holodeck.on-login-screen .bg-layer,
body.theme-holodeck.on-login-screen .bg-dim,
body.theme-holodeck:has(#screenLogin.active) .bg-layer,
body.theme-holodeck:has(#screenLogin.active) .bg-dim,
body.theme-holodeck:has(#screenChangePassword.active) .bg-layer,
body.theme-holodeck:has(#screenChangePassword.active) .bg-dim {
  display: none !important;
}
body.theme-neural.on-login-screen #screenLogin,
body.theme-neural.on-login-screen #screenChangePassword,
body.theme-neural #screenLogin.active,
body.theme-neural #screenChangePassword.active,
body.theme-holodeck.on-login-screen #screenLogin,
body.theme-holodeck.on-login-screen #screenChangePassword,
body.theme-holodeck #screenLogin.active,
body.theme-holodeck #screenChangePassword.active {
  position: fixed;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  background: var(--login-page-bg, var(--bg0)) !important;
}
body.theme-neural.on-login-screen #screenLogin .login-wrap,
body.theme-neural.on-login-screen #screenChangePassword .login-wrap,
body.theme-neural #screenLogin.active .login-wrap,
body.theme-neural #screenChangePassword.active .login-wrap,
body.theme-holodeck.on-login-screen #screenLogin .login-wrap,
body.theme-holodeck.on-login-screen #screenChangePassword .login-wrap,
body.theme-holodeck #screenLogin.active .login-wrap,
body.theme-holodeck #screenChangePassword.active .login-wrap {
  background: var(--login-page-bg, var(--bg0));
  flex: 1;
  width: 100%;
  min-height: 100%;
}
body.theme-neural.on-login-screen .login-card,
body.theme-neural:has(#screenLogin.active) .login-card,
body.theme-neural:has(#screenChangePassword.active) .login-card,
body.theme-holodeck.on-login-screen .login-card,
body.theme-holodeck:has(#screenLogin.active) .login-card,
body.theme-holodeck:has(#screenChangePassword.active) .login-card {
  background: var(--login-card-bg, var(--bg2));
  border-color: var(--login-card-border, var(--bd2));
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
}
.login-card {
  background: var(--bg2);
  border: 1px solid var(--bd2);
  border-radius: var(--r);
  padding: 40px;
  text-align: center;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
  animation: cardUp 0.6s var(--ease) both;
  transition: all 0.4s ease !important;
}
.theme-neural .login-card,
.theme-holodeck .login-card {
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.06);
}
.theme-clean .login-card {
  background: var(--login-card-bg, var(--bg2));
  border-color: var(--login-card-border, var(--bd2));
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.55);
  border-radius: 16px;
}
@keyframes cardUp {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.login-logo {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 20px;
  color: var(--accent);
  margin: 0 auto 16px;
  box-shadow: 0 0 20px var(--accent-glow);
  overflow: hidden;
  transition: all 0.4s ease !important;
}
.theme-clean .login-logo {
  border: none;
  background: var(--accent);
  color: var(--ink-on-accent, #00112b);
  border-radius: 16px;
}
.login-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}
/* Full product lockup (HR / Campus header logos) — replaces lettermark + title */
.login-logo.login-logo--mark {
  width: auto;
  max-width: min(240px, 70vw);
  height: auto;
  aspect-ratio: auto;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  margin: 0 auto 18px;
}
.login-logo.login-logo--mark img {
  width: 100%;
  height: auto;
  max-height: 72px;
  object-fit: contain;
  display: block;
}
.theme-clean .login-logo.login-logo--mark {
  border: none;
  background: transparent;
  border-radius: 0;
  color: inherit;
}
.login-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
  transition: all 0.4s ease !important;
}
.login-title.visually-hidden,
.login-title[hidden] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.login-tagline {
  font-size: 12px;
  color: var(--tx2);
  margin-bottom: 6px;
  transition: color 0.4s ease !important;
}
.login-sub {
  font-size: 10px;
  color: var(--tx3);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 24px;
  transition: color 0.4s ease !important;
}
.sso-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sso-btn {
  width: 100%;
  padding: 13px 20px;
  border: none;
  border-radius: var(--r);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s ease !important;
}
.theme-clean .sso-btn {
  border-radius: 12px;
}
.sso-btn:hover {
  transform: translateY(-2px);
}
.sso-btn:active {
  transform: translateY(0);
}
.sso-btn.microsoft {
  background: linear-gradient(135deg, #0078d4, #00a4ef);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 120, 212, 0.3);
}
.sso-btn.microsoft:hover {
  box-shadow: 0 6px 24px rgba(0, 120, 212, 0.4);
}
.sso-btn.google {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: #333;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.sso-btn.google:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
.theme-chromium .sso-btn.google,
.theme-neural .sso-btn.google,
.theme-holodeck .sso-btn.google {
  background: var(--bg3);
  border: 1px solid var(--bd2);
  color: var(--tx);
}
.sso-btn.oidc {
  background: var(--accent);
  color: #000;
  box-shadow: 0 4px 16px var(--accent-glow);
}
.theme-clean .sso-btn.oidc {
  color: #fff;
}
.sso-btn.saml,
.sso-btn.ldap {
  background: var(--bg3);
  border: 1px solid var(--bd2);
  color: var(--tx2);
}
.sso-btn.saml:hover,
.sso-btn.ldap:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.sso-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  font-size: 10px;
  color: var(--tx3);
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: color 0.4s ease !important;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--bd);
  transition: background 0.4s ease !important;
}
.login-form {
  text-align: left;
}
.lf-field {
  margin-bottom: 14px;
}
.lf-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--tx2);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 5px;
  display: block;
  transition: color 0.4s ease !important;
}
.lf-input {
  width: 100%;
  background: var(--bg3);
  border: 1.5px solid var(--bd);
  border-radius: var(--r);
  padding: 11px 14px;
  color: var(--tx);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: all 0.25s ease !important;
}
.theme-clean .lf-input {
  border-radius: 10px;
}
.lf-input::placeholder {
  color: var(--tx4);
}
.lf-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  background: var(--bg2);
}
.lf-input.err {
  border-color: var(--status-absent);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
  animation: shake 0.4s ease;
}
@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-4px);
  }
  40%,
  80% {
    transform: translateX(4px);
  }
}
.lf-error {
  font-size: 11px;
  color: var(--status-absent);
  margin-top: 4px;
  display: none;
  animation: errSlide 0.3s var(--ease);
}
.lf-error.show {
  display: block;
}
@keyframes errSlide {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.lf-submit {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: var(--r);
  background: var(--accent);
  color: #000;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease !important;
  margin-top: 6px;
  position: relative;
}
.theme-clean .lf-submit {
  color: var(--ink-on-accent, #00112b);
  border-radius: 12px;
}
.theme-neural .lf-submit,
.theme-holodeck .lf-submit {
  color: #ffffff;
}
.lf-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
}
.lf-submit:active {
  transform: translateY(0);
}
.lf-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}
.lf-submit .spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  position: absolute;
  right: 16px;
  top: 50%;
  margin-top: -8px;
}
.theme-clean .lf-submit .spinner {
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
}
.lf-submit.loading .spinner {
  display: block;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.login-magic-link {
  font-size: 11px;
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
  margin-top: 12px;
  display: none;
  transition: all 0.25s ease !important;
}
.login-magic-link:hover {
  opacity: 0.7;
}
.login-forgot {
  margin-top: 10px;
  text-align: right;
}
.login-forgot-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}
.login-forgot-btn:hover {
  text-decoration: underline;
}
.lf-link-back {
  display: block;
  width: 100%;
  margin-top: 12px;
  background: none;
  border: none;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--tx2);
  cursor: pointer;
  text-align: center;
}
.lf-link-back:hover {
  color: var(--accent);
}
.login-footer {
  margin-top: 20px;
  font-size: 10px;
  color: var(--tx3);
  transition: color 0.4s ease !important;
}
.login-theme-bar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0;
  border: 1px solid var(--bd);
  border-radius: var(--r);
  overflow: hidden;
  z-index: 10;
  background: var(--bg2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: all 0.4s ease !important;
}
.theme-clean .login-theme-bar {
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}
.lt-btn {
  padding: 6px 12px;
  font-size: 9px;
  color: var(--tx3);
  cursor: pointer;
  background: transparent;
  border: none;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
  font-family: inherit;
  transition: all 0.25s ease !important;
}
.lt-btn:hover:not(.active) {
  color: var(--tx2);
}
.lt-btn.active {
  background: var(--accent);
  color: #000;
}
.theme-clean .lt-btn.active {
  color: var(--ink-on-accent, #00112b);
  border-radius: 10px;
}

/* ── Change Password ── */
.cp-card {
  background: var(--bg2);
  border: 1px solid var(--bd2);
  border-radius: var(--r);
  padding: 40px;
  text-align: center;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
  animation: cardUp 0.6s var(--ease) both;
}
.theme-clean .cp-card {
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.55);
  border-radius: 20px;
  background: var(--login-card-bg, var(--bg2));
  border-color: var(--login-card-border, var(--bd2));
}
.cp-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 6px;
}
.cp-desc {
  font-size: 12px;
  color: var(--tx2);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ── App welcome / logout ── */
.app-welcome {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  position: relative;
  z-index: 1;
  gap: 12px;
}
.app-welcome-name {
  font-size: 28px;
  font-weight: 900;
  transition: all 0.4s ease !important;
}
.app-welcome-email {
  font-size: 12px;
  color: var(--tx3);
  transition: color 0.4s ease !important;
}
.app-welcome-badge {
  font-size: 10px;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-glow);
  padding: 4px 12px;
  border-radius: 20px;
  transition: all 0.4s ease !important;
}
.btn-logout {
  margin-top: 16px;
  padding: 8px 20px;
  border: 1px solid var(--bd);
  border-radius: var(--r);
  background: var(--bg3);
  color: var(--tx2);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease !important;
}
.btn-logout:hover {
  border-color: var(--status-absent);
  color: var(--status-absent);
  transform: translateY(-1px);
}

/* ══════════════════════════════════════════════════════════════
   HEADER BAR
   ══════════════════════════════════════════════════════════════ */
.hdr {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 20px;
  height: 54px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.4s ease !important;
  perspective: 800px;
}
.theme-chromium .hdr {
  background: linear-gradient(180deg, var(--bg1) 0%, var(--bg0) 100%);
  border-bottom: 1px solid var(--bd);
}
.theme-neural .hdr,
.theme-holodeck .hdr {
  background: var(--header-bg, var(--bg2));
  border-bottom: 1px solid var(--header-border, var(--bd2));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.theme-clean .hdr {
  background: var(--header-bg, var(--bg1));
  border-bottom: 1px solid var(--header-border, var(--bd));
  box-shadow: none;
}
/* Spectrum color hint on Holodeck header (colors only — no new DOM) */
.theme-holodeck .hdr {
  border-top: 3px solid transparent;
  border-image: linear-gradient(
      90deg,
      var(--spectrum-rail-1),
      var(--spectrum-rail-2),
      var(--spectrum-rail-3),
      var(--spectrum-rail-4),
      var(--spectrum-rail-5)
    )
    1;
}
.hdr-logo {
  width: 180px;
  height: 44px;
  border: 0;
  border-radius: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  overflow: hidden;
  transition: opacity 0.2s ease !important;
}
.hdr-logo:hover {
  opacity: 0.86;
}
.hdr-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
  display: none;
}
.theme-clean .hdr-logo,
.theme-neural .hdr-logo {
  background: transparent;
}
.hdr-titles {
  display: none;
}
.hdr-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.4s ease !important;
}
.hdr-sub {
  font-size: 9px;
  color: var(--tx2);
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: color 0.4s ease !important;
}
.hdr-tz {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.hdr-clock {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  transition: all 0.4s ease !important;
}
.hdr-date {
  font-size: 9px;
  color: var(--tx2);
  transition: color 0.4s ease !important;
}
.hdr-tz-label {
  font-size: 8px;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: all 0.4s ease !important;
}
.tz-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  width: 300px;
  max-height: 400px;
  background: var(--bg2);
  border: 1px solid var(--bd2);
  border-radius: var(--r);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  display: none;
  flex-direction: column;
  z-index: 200;
  overflow: hidden;
}
.theme-clean .tz-dropdown {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
  border-radius: 14px;
}
.hdr-tz.open .tz-dropdown {
  display: flex;
}
.tz-search {
  padding: 10px 12px;
  background: var(--bg3);
  border: none;
  border-bottom: 1px solid var(--bd);
  color: var(--tx);
  font-family: inherit;
  font-size: 12px;
  outline: none;
}
.tz-search::placeholder {
  color: var(--tx4);
}
.tz-list {
  overflow-y: auto;
  flex: 1;
  padding: 4px 0;
}
.tz-group {
  font-size: 9px;
  color: var(--tx3);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 12px 4px;
  font-weight: 700;
}
.tz-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.tz-item:hover {
  background: var(--accent-dim);
}
.tz-item.active {
  background: var(--accent-dim);
  color: var(--accent);
}
.tz-item-name {
  flex: 1;
}
.tz-item-offset {
  font-size: 10px;
  color: var(--tx3);
}
.tz-empty {
  text-align: center;
  padding: 20px;
  font-size: 11px;
  color: var(--tx4);
}
.hdr-sync {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 8px;
  letter-spacing: 1px;
  font-weight: 700;
  text-transform: uppercase;
}
.sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  transition: background 0.3s;
}
.sync-dot.offline {
  background: var(--status-absent);
}
.sync-label {
  color: var(--tx2);
}
.sync-label.live {
  color: var(--accent);
}
.hdr-themes {
  display: flex;
  gap: 2px;
}
.ht-btn {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--bd2);
  cursor: pointer;
  transition: all 0.2s;
  background: transparent;
  padding: 0;
}
.ht-btn:hover {
  transform: scale(1.15);
}
.ht-btn.active {
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}
.ht-btn[data-theme='chromium'] {
  background: #00e59a;
}
.ht-btn[data-theme='neural'] {
  background: #0aff6a;
}
.ht-btn[data-theme='holodeck'] {
  background: #00e59a;
}
.ht-btn[data-theme='clean'] {
  background: #3d8bff;
}
.view-switch {
  display: flex;
  border: 1px solid var(--bd);
  border-radius: var(--r);
  overflow: hidden;
}
.vs-btn {
  padding: 5px 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  background: transparent;
  border: none;
  color: var(--tx3);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s !important;
}
.vs-btn.active {
  background: var(--accent);
  color: #000;
}
.theme-clean .vs-btn.active {
  color: var(--ink-on-accent, #00112b);
}
.hdr-bell {
  position: relative;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.2s;
}
.hdr-bell:hover {
  background: var(--bg3);
}
.bell-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--status-absent);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  border-radius: 8px;
  padding: 0 4px;
}
.bell-badge.hide {
  display: none;
}
.hdr-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.hdr-avatar:hover {
  box-shadow: 0 0 12px var(--accent-glow);
}
.hdr-dropdown {
  position: absolute;
  top: 50px;
  right: 16px;
  width: 200px;
  background: var(--bg2);
  border: 1px solid var(--bd2);
  border-radius: var(--r);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  display: none;
  z-index: 200;
  overflow: hidden;
}
.hdr-dropdown.open {
  display: block;
}
.theme-clean .hdr-dropdown {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  border-radius: 14px;
}
.dd-item {
  padding: 10px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--tx);
}
.dd-item:hover {
  background: var(--accent-dim);
  color: var(--accent);
}
.dd-item.danger:hover {
  background: rgba(239, 68, 68, 0.08);
  color: var(--status-absent);
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR NAVIGATION
   ══════════════════════════════════════════════════════════════ */
.app-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.sidebar {
  width: 220px;
  background: var(--sidebar-bg, var(--bg1));
  border-right: 1px solid var(--bd);
  display: flex;
  flex-direction: column;
  transition:
    width 0.3s var(--ease),
    transform 0.3s var(--ease) !important;
  flex-shrink: 0;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  z-index: 50;
}
.sidebar.collapsed {
  width: 56px;
}
.theme-clean .sidebar,
.theme-holodeck .sidebar {
  border-right: 1px solid var(--header-border, var(--bd2));
}
.theme-neural .sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.sb-nav {
  flex: 1;
  padding: 8px 0;
}
.sb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--tx2);
  cursor: pointer;
  transition: all 0.15s ease !important;
  white-space: nowrap;
  border-left: 3px solid transparent;
}
.sb-item:hover {
  color: var(--tx);
  background: var(--accent-dim);
}
.sb-item.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-dim);
}
.theme-neural .sb-item {
  color: var(--sidebar-tx-muted, var(--tx2));
}
.theme-neural .sb-item:hover {
  color: var(--sidebar-tx, #ffffff);
  background: var(--sidebar-active-bg, rgba(255, 255, 255, 0.07));
}
.theme-neural .sb-item.active {
  color: #ffffff;
  border-left-color: #38bdf8;
  background: var(--sidebar-active-bg, rgba(255, 255, 255, 0.07));
}
.theme-neural .sb-section-label {
  color: var(--sidebar-tx-muted, #7f8fbe);
}
.theme-holodeck .sb-item {
  color: var(--sidebar-tx-muted, var(--tx2));
}
.theme-holodeck .sb-item:hover {
  color: var(--sidebar-tx, var(--tx));
  background: var(--sidebar-active-bg, var(--accent-dim));
}
.theme-holodeck .sb-item.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--sidebar-active-bg, var(--accent-dim));
}
.theme-clean .sb-item {
  color: var(--sidebar-tx-muted, var(--tx2));
}
.theme-clean .sb-item:hover {
  color: var(--sidebar-tx, var(--tx));
  background: var(--sidebar-active-bg, var(--accent-dim));
}
.theme-clean .sb-item.active {
  color: var(--sidebar-tx, var(--tx));
  border-left-color: transparent;
  background: var(--sidebar-active-bg, var(--accent-dim));
}
.theme-clean .sb-item.active .sb-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--ink-on-accent, #00112b);
  font-size: 12px;
}
.sb-item.hidden {
  display: none;
}
.sb-item .sb-icon {
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  font-size: 14px;
}
.sb-item .sb-label {
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar.collapsed .sb-label {
  display: none;
}
.sidebar.collapsed .sb-item {
  padding: 8px 0;
  justify-content: center;
}
.sb-divider {
  height: 1px;
  background: var(--bd);
  margin: 6px 12px;
}
.sb-section-label {
  font-size: 9px;
  color: var(--tx3);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 12px 16px 4px;
  font-weight: 700;
}
.sidebar.collapsed .sb-section-label {
  display: none;
}
.sidebar.collapsed .sb-divider {
  margin: 6px 8px;
}

/* ══════════════════════════════════════════════════════════════
   CONTENT AREA
   ══════════════════════════════════════════════════════════════ */
.app-content {
  flex: 1;
  min-width: 0;
  min-height: 0;
  height: 100%;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.content-page {
  display: none;
  padding: 20px;
}
.content-page.active {
  display: block;
}
.mod-page {
  display: none;
  padding: 20px;
}
.mod-page.active {
  display: block;
}

/* Module coming-soon placeholder */
.mod-coming {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 12px;
}
.mod-coming-icon {
  font-size: 48px;
}
.mod-coming-title {
  font-size: 20px;
  font-weight: 800;
}
.mod-coming-sub {
  font-size: 12px;
  color: var(--tx3);
}

/* ══════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ══════════════════════════════════════════════════════════════ */
.toasts {
  position: fixed;
  bottom: 56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--bg3);
  border: 1px solid var(--bd);
  border-radius: var(--r);
  padding: 8px 16px;
  font-size: 11px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
  animation: toastIn 0.35s var(--ease);
  pointer-events: auto;
  cursor: pointer;
  transition: all 0.3s ease !important;
}
.theme-clean .toast {
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
}
.theme-neural .toast,
.theme-holodeck .toast {
  background: var(--surface, var(--bg2));
  border-color: var(--surface-border, var(--bd));
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
  color: var(--tx);
}
.toast.success {
  border-color: rgba(34, 197, 94, 0.4);
  color: #22c55e;
}
.toast.error {
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--status-absent);
}
.toast.info {
  border-color: rgba(99, 102, 241, 0.4);
  color: #818cf8;
}
.toast.fade-out {
  opacity: 0;
  transform: translateY(8px);
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ══════════════════════════════════════════════════════════════
   DETAIL VIEWS (theme-aware: modal/split/inline/drawer)
   ══════════════════════════════════════════════════════════════ */

/* Chromium: Modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.open {
  display: flex;
}
.modal-box {
  background: var(--bg2);
  border: 1px solid var(--bd2);
  border-radius: var(--r);
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.5);
  animation: cardUp 0.35s var(--ease);
}
.theme-clean .modal-box {
  border-radius: 20px;
  background: var(--surface, var(--bg2));
  border-color: var(--surface-border, var(--bd2));
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.65);
}
.theme-neural .modal-overlay,
.theme-holodeck .modal-overlay {
  background: rgba(20, 33, 61, 0.35);
}
.theme-clean .modal-overlay {
  background: rgba(0, 0, 0, 0.72);
}
.theme-neural .modal-box,
.theme-holodeck .modal-box {
  background: var(--surface, var(--bg2));
  border-color: var(--surface-border, var(--bd2));
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.12);
}

/* Neural: Split panel */
.split-panel {
  position: fixed;
  top: 54px;
  right: 0;
  width: 380px;
  bottom: 0;
  background: var(--bg1);
  border-left: 1px solid var(--bd);
  z-index: 150;
  overflow-y: auto;
  padding: 20px;
  transform: translateX(100%);
  transition: transform 0.35s var(--ease) !important;
}
.split-panel.open {
  transform: translateX(0);
}

/* Holodeck: Inline expand */
.ec.expanded {
  grid-column: 1 / -1;
}
.expand-detail {
  padding: 16px;
  border-top: 1px solid var(--bd);
  margin-top: 12px;
  position: relative;
}
.expand-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--bg3);
  border: 1px solid var(--bd);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--tx2);
  font-size: 12px;
}
.expand-close:hover {
  color: var(--status-absent);
  border-color: var(--status-absent);
}

/* Clean: Drawer */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 400;
  display: none;
}
.drawer-overlay.open {
  display: block;
}
.drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 90vw;
  height: 100vh;
  background: var(--bg1);
  border-left: 1px solid var(--bd2);
  z-index: 450;
  overflow-y: auto;
  padding: 24px;
  transform: translateX(100%);
  transition: transform 0.35s var(--ease) !important;
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.3);
}
.drawer-panel.open {
  transform: translateX(0);
}
.theme-clean .drawer-panel {
  background: var(--surface, var(--bg2));
  border-left-color: var(--surface-border, var(--bd2));
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.55);
}
.theme-neural .drawer-overlay,
.theme-holodeck .drawer-overlay {
  background: rgba(20, 33, 61, 0.25);
}
.theme-clean .drawer-overlay {
  background: rgba(0, 0, 0, 0.65);
}
.theme-neural .drawer-panel,
.theme-holodeck .drawer-panel {
  background: var(--surface, var(--bg2));
  border-left-color: var(--surface-border, var(--bd2));
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.1);
}

/* Shared detail content styles */
.detail-hdr {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.detail-av {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: var(--accent);
  flex-shrink: 0;
}
.detail-name {
  font-size: 15px;
  font-weight: 700;
}
.detail-dept {
  font-size: 11px;
  color: var(--tx3);
}
.detail-close {
  margin-left: auto;
  background: var(--bg3);
  border: 1px solid var(--bd);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--tx2);
  font-size: 14px;
  transition: all 0.2s;
}
.detail-close:hover {
  color: var(--status-absent);
  border-color: var(--status-absent);
}
.detail-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--bd);
  margin-bottom: 16px;
}
.detail-tab {
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 700;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--tx3);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.detail-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.detail-body {
  font-size: 12px;
}
.d-section {
  margin-bottom: 16px;
}
.d-section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--tx3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}
.d-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--bd);
}
.d-row-l {
  color: var(--tx2);
}
.d-row-v {
  font-weight: 600;
}

/* ══════════════════════════════════════════════════════════════
   CRUD MODAL (generic, always overlay style)
   ══════════════════════════════════════════════════════════════ */
.crud-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 600;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.crud-modal-overlay.open {
  display: flex;
}
.crud-modal-box {
  background: var(--bg2);
  border: 1px solid var(--bd2);
  border-radius: var(--r);
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.5);
  animation: cardUp 0.35s var(--ease);
}
.theme-clean .crud-modal-box {
  border-radius: 20px;
  background: var(--surface, var(--bg2));
  border-color: var(--surface-border, var(--bd2));
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.65);
}
.theme-neural .crud-modal-overlay,
.theme-holodeck .crud-modal-overlay {
  background: rgba(20, 33, 61, 0.35);
}
.theme-clean .crud-modal-overlay {
  background: rgba(0, 0, 0, 0.72);
}
.theme-neural .crud-modal-box,
.theme-holodeck .crud-modal-box {
  background: var(--surface, var(--bg2));
  border-color: var(--surface-border, var(--bd2));
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.12);
}
.crud-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--bd);
}
.crud-modal-title {
  font-size: 15px;
  font-weight: 700;
}
.crud-modal-close {
  background: var(--bg3);
  border: 1px solid var(--bd);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--tx2);
  font-size: 14px;
}
.crud-modal-close:hover {
  color: var(--status-absent);
  border-color: var(--status-absent);
}
.crud-modal-body {
  padding: 20px;
}

/* Confirm / prompt dialogs (modal.js confirmDialog + promptDialog) */
.crud-confirm-msg {
  margin: 0 0 18px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--tx2);
}
.crud-prompt-field {
  margin-bottom: 18px;
}
.crud-prompt-field label {
  display: block;
  margin-bottom: 5px;
  font-size: 10px;
  font-weight: 600;
  color: var(--tx3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.crud-prompt-field input,
.crud-prompt-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--bd);
  border-radius: var(--r);
  background: var(--bg3);
  color: var(--tx);
  font-family: inherit;
  font-size: 12px;
  outline: none;
  resize: vertical;
  transition: all 0.25s ease;
}
.theme-clean .crud-prompt-field input,
.theme-clean .crud-prompt-field textarea {
  border-radius: 10px;
}
.crud-prompt-field input:focus,
.crud-prompt-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.crud-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.crud-confirm-cancel,
.crud-confirm-ok {
  padding: 8px 16px;
  border-radius: var(--r);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.theme-clean .crud-confirm-cancel,
.theme-clean .crud-confirm-ok {
  border-radius: 10px;
}
.crud-confirm-cancel {
  background: transparent;
  border: 1px solid var(--bd);
  color: var(--tx2);
}
.crud-confirm-ok {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #000;
}
.theme-clean .crud-confirm-ok {
  color: var(--ink-on-accent, #00112b);
}
.crud-confirm-ok.danger {
  background: var(--status-absent);
  border-color: var(--status-absent);
  color: #fff;
}
.crud-confirm-cancel:hover,
.crud-confirm-ok:hover:not(:disabled) {
  opacity: 0.92;
}
.crud-confirm-ok:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ══════════════════════════════════════════════════════════════
   BACKGROUND LAYER
   ══════════════════════════════════════════════════════════════ */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center;
  opacity: var(--bg-opacity, 0);
  filter: blur(var(--bg-blur, 0px));
  transition:
    opacity 0.6s,
    filter 0.6s;
}
.bg-layer.has-image {
  z-index: 0;
  pointer-events: none;
}
.bg-dim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, var(--bg-dim, 0.7));
  z-index: 0;
  pointer-events: none;
  display: none;
}
.bg-dim.active {
  display: block;
}

/* ══════════════════════════════════════════════════════════════
   LOTTIE OVERLAY
   ══════════════════════════════════════════════════════════════ */
.lottie-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transition: opacity 0.3s;
}
.lottie-overlay.hidden {
  display: none;
}
.lottie-anim-container {
  width: 280px;
  height: 280px;
}
.lottie-anim-label {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 3px;
  text-transform: uppercase;
}
.lottie-dismiss-btn {
  padding: 8px 24px;
  background: var(--bg3);
  border: 1px solid var(--bd2);
  border-radius: var(--r);
  color: var(--tx2);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.lottie-dismiss-btn:hover {
  color: var(--tx);
  border-color: var(--accent);
}

/* ══════════════════════════════════════════════════════════════
   STATUS BADGES (shared by attendance grid + detail views)
   ══════════════════════════════════════════════════════════════ */
.sb {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.st-in {
  background: rgba(59, 130, 246, 0.15);
  color: var(--status-in);
}
.st-break {
  background: rgba(251, 191, 36, 0.15);
  color: var(--status-break);
}
.st-out {
  background: rgba(107, 114, 128, 0.15);
  color: var(--status-out);
}
.st-absent {
  background: rgba(239, 68, 68, 0.15);
  color: var(--status-absent);
}
.st-off {
  background: rgba(107, 114, 128, 0.1);
  color: var(--status-out);
}

/* ══════════════════════════════════════════════════════════════
   SKELETON LOADERS
   ══════════════════════════════════════════════════════════════ */
.skel {
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: var(--r);
  padding: 14px;
  animation: skelPulse 1.5s ease-in-out infinite;
}
@keyframes skelPulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}
.skel-av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg3);
  flex-shrink: 0;
}
.skel-bar {
  height: 10px;
  border-radius: 4px;
  background: var(--bg3);
  margin-bottom: 6px;
}
.skel-bar.w60 {
  width: 60%;
}
.skel-bar.w40 {
  width: 40%;
}

/* ══════════════════════════════════════════════════════════════
   FORM ELEMENTS (shared)
   ══════════════════════════════════════════════════════════════ */
.form-group {
  margin-bottom: 14px;
}
.form-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--tx3);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 5px;
  display: block;
}
.form-input {
  width: 100%;
  background: var(--bg3);
  border: 1.5px solid var(--bd);
  border-radius: var(--r);
  padding: 10px 12px;
  color: var(--tx);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: all 0.25s ease !important;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.form-input.err {
  border-color: var(--status-absent);
}
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.form-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.form-toggle input[type='checkbox'] {
  appearance: none;
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--bg4);
  border: 1px solid var(--bd2);
  position: relative;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.form-toggle input[type='checkbox']::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--tx3);
  transition: all 0.2s;
}
.form-toggle input[type='checkbox']:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.form-toggle input[type='checkbox']:checked::after {
  left: 18px;
  background: #000;
}
.theme-clean .form-toggle input[type='checkbox']:checked::after {
  background: #fff;
}
.form-btn {
  padding: 10px 20px;
  border: none;
  border-radius: var(--r);
  background: var(--accent);
  color: #000;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.form-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--accent-glow);
}
.form-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.theme-clean .form-btn {
  color: var(--ink-on-accent, #00112b);
  border-radius: 10px;
}
.form-btn.secondary {
  background: var(--bg3);
  color: var(--tx2);
  border: 1px solid var(--bd);
}
.form-btn.secondary:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: none;
}
.form-btn.danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--status-absent);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.form-btn.danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.2);
  box-shadow: none;
}
.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.form-error {
  font-size: 11px;
  color: var(--status-absent);
  margin-top: 4px;
}

/* ══════════════════════════════════════════════════════════════
   STATS BAR (shared by all modules)
   ══════════════════════════════════════════════════════════════ */
.stats-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.stat-pill {
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: var(--r);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}
.stat-pill:hover {
  border-color: var(--accent);
}
.stat-pill.active {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.stat-pill .stat-num {
  font-size: 16px;
  font-weight: 800;
}
.stat-pill .stat-label {
  color: var(--tx3);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .hdr-logo {
    width: 150px;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 54px;
    bottom: 0;
    transform: translateX(-100%);
    z-index: 150;
    width: 220px;
  }
  .sidebar.expanded {
    transform: translateX(0);
  }
  .sidebar.collapsed {
    width: 220px;
    transform: translateX(-100%);
  }
  .sidebar.collapsed.expanded {
    transform: translateX(0);
  }
  .sidebar.collapsed .sb-label {
    display: block;
  }
  .sidebar.collapsed .sb-item {
    padding: 8px 16px;
    justify-content: flex-start;
  }
  .sidebar.collapsed .sb-section-label {
    display: block;
  }
  .hdr-themes {
    display: none;
  }
  .hdr-sync {
    display: none;
  }
}
@media (max-width: 480px) {
  .hdr {
    padding-inline: 12px;
  }
  .hdr-logo {
    width: 128px;
  }
  .login-card,
  .cp-card {
    padding: 28px 24px;
  }
  .login-theme-bar {
    bottom: 10px;
  }
  .sso-btn {
    padding: 11px 16px;
    font-size: 13px;
  }
  .drawer-panel {
    width: 100vw;
  }
}

/* ══════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ══════════════════════════════════════════════════════════════ */
.hidden {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.text-accent {
  color: var(--accent);
}
.text-muted {
  color: var(--tx3);
}
.text-error {
  color: var(--status-absent);
}
.text-success {
  color: #22c55e;
}
.grid-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  grid-column: 1 / -1;
}
.grid-empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.5;
}
.grid-empty-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--tx2);
  margin-bottom: 4px;
}
.grid-empty-sub {
  font-size: 11px;
  color: var(--tx4);
  text-align: center;
  max-width: 320px;
  line-height: 1.4;
}
.grid-empty-cta {
  margin-top: 16px;
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--accent);
  border-radius: var(--r);
  background: var(--accent);
  color: #000;
  cursor: pointer;
  font-family: inherit;
}
.theme-clean .grid-empty-cta {
  color: var(--ink-on-accent, #00112b);
  border-radius: 10px;
}
.grid-empty-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--accent-glow);
}
