/* ==========================================================================
   PETAL Attendance Portal - Royal Premium Design System
   ========================================================================== */

:root {
  --font-sans: "Plus Jakarta Sans", "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Outfit", "Plus Jakarta Sans", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "Consolas", monospace;
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-full: 999px;
  --transition: 200ms cubic-bezier(0.22, 1, 0.36, 1);
  --transition-smooth: 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   Theme: Royal Dark (Default)
   -------------------------------------------------------------------------- */
[data-theme="dark"] {
  color-scheme: dark;
  --bg-canvas: #060911;
  --bg-elevated: rgba(13, 18, 32, 0.82);
  --bg-card: rgba(17, 24, 42, 0.72);
  --bg-card-solid: #0f1526;
  --bg-card-hover: rgba(24, 34, 58, 0.85);
  --bg-input: rgba(10, 14, 26, 0.82);
  --bg-hover: rgba(255, 255, 255, 0.05);

  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-gold: rgba(212, 175, 55, 0.35);
  --border-accent: rgba(99, 102, 241, 0.38);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Royal Jewel Colors */
  --gold: #d4af37;
  --gold-light: #fef08a;
  --gold-soft: rgba(212, 175, 55, 0.14);
  --gold-glow: rgba(212, 175, 55, 0.28);

  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-soft: rgba(99, 102, 241, 0.18);
  --accent-glow: rgba(99, 102, 241, 0.35);

  --royal-purple: #8b5cf6;
  --royal-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #9333ea 100%);
  --gold-gradient: linear-gradient(135deg, #fef08a 0%, #d4af37 50%, #b45309 100%);

  --emerald: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.16);
  --sky: #38bdf8;
  --sky-soft: rgba(56, 189, 248, 0.16);
  --rose: #fb7185;
  --rose-soft: rgba(244, 63, 94, 0.16);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.16);

  --shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.65), 0 0 1px 1px rgba(255, 255, 255, 0.05);
  --shadow-lg: 0 30px 70px -15px rgba(0, 0, 0, 0.75), 0 0 1px 1px rgba(255, 255, 255, 0.08);
}

/* --------------------------------------------------------------------------
   Theme: Glassmorphism (Minimum Light Yellow Top-Right to Crisp White Bottom-Left)
   -------------------------------------------------------------------------- */
[data-theme="light"] {
  color-scheme: light;
  --bg-canvas: #ffffff;
  --bg-elevated: rgba(255, 255, 255, 0.78);
  --bg-card: rgba(255, 255, 255, 0.72);
  --bg-card-solid: #ffffff;
  --bg-card-hover: rgba(255, 255, 255, 0.88);
  --bg-input: rgba(255, 255, 255, 0.82);
  --bg-hover: rgba(254, 240, 138, 0.22);

  --border: rgba(203, 213, 225, 0.75);
  --border-strong: #cbd5e1;
  --border-gold: rgba(234, 179, 8, 0.45);
  --border-accent: rgba(250, 204, 21, 0.50);

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  /* Minimum Light Yellow Pastel Palette */
  --gold: #eab308;
  --gold-light: #fef9c3;
  --gold-soft: rgba(254, 240, 138, 0.25);
  --gold-glow: rgba(254, 240, 138, 0.45);

  --accent: #facc15;
  --accent-hover: #fde047;
  --accent-soft: rgba(254, 240, 138, 0.25);
  --accent-glow: rgba(254, 240, 138, 0.50);

  --royal-purple: #8b5cf6;
  --royal-gradient: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(254, 249, 195, 0.85) 100%);
  --gold-gradient: linear-gradient(135deg, #ffffff 0%, #fefce8 50%, #fef9c3 100%);

  --emerald: #059669;
  --emerald-soft: rgba(16, 185, 129, 0.14);
  --sky: #0284c7;
  --sky-soft: rgba(2, 132, 199, 0.12);
  --rose: #e11d48;
  --rose-soft: rgba(225, 29, 72, 0.12);
  --amber: #f59e0b;
  --amber-soft: rgba(254, 240, 138, 0.25);

  --shadow: 0 12px 36px rgba(0, 0, 0, 0.04), 0 0 1px 1px rgba(255, 255, 255, 0.9), inset 0 1px 1px rgba(255, 255, 255, 0.95);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.06), 0 0 1px 1px rgba(255, 255, 255, 0.95), inset 0 1px 2px rgba(255, 255, 255, 0.98);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ambient Radial Mesh Background */
[data-theme="dark"] body {
  background-image:
    radial-gradient(circle at 14% 10%, rgba(99, 102, 241, 0.16), transparent 42%),
    radial-gradient(circle at 86% 12%, rgba(212, 175, 55, 0.10), transparent 38%),
    radial-gradient(circle at 50% 48%, rgba(124, 58, 237, 0.06), transparent 52%),
    radial-gradient(circle at 50% 96%, rgba(16, 185, 129, 0.06), transparent 45%);
  background-attachment: fixed;
}

/* Glassmorphism: Minimum Light Yellow at Top-Right, seamlessly flowing down to Pure White at Bottom-Left */
[data-theme="light"] body {
  background-color: #ffffff;
  background-image:
    /* Top-right subtle light yellow glow */
    radial-gradient(circle at 95% 5%, rgba(254, 240, 138, 0.40) 0%, rgba(254, 249, 195, 0.25) 35%, transparent 65%),
    radial-gradient(circle at 82% 20%, rgba(254, 249, 195, 0.28) 0%, transparent 48%),
    radial-gradient(circle at 65% 38%, rgba(255, 253, 235, 0.35) 0%, transparent 45%),
    /* Diagonal gradient from Top-Right down to Bottom-Left */
    linear-gradient(225deg, rgba(254, 249, 195, 0.32) 0%, rgba(255, 254, 240, 0.20) 30%, rgba(255, 255, 255, 0.85) 60%, #ffffff 100%);
  background-attachment: fixed;
}

[hidden] {
  display: none !important;
}

.mono {
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

.muted {
  color: var(--text-secondary);
  margin: 4px 0 0;
  font-size: 0.875rem;
}

/* --------------------------------------------------------------------------
   App Shell & Royal Sidebar
   -------------------------------------------------------------------------- */
.app-shell {
  display: grid;
  grid-template-columns: 275px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  background: var(--bg-elevated);
  backdrop-filter: blur(24px) saturate(190%);
  border-right: 1px solid var(--border);
  z-index: 30;
  box-shadow: 4px 0 30px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .sidebar {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-right: 1px solid rgba(255, 255, 255, 0.90);
  box-shadow: 4px 0 25px rgba(0, 0, 0, 0.03);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 8px 24px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.brand::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-gold), transparent);
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  padding: 4px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 30%, #ffffff 0%, #f1f5f9 100%);
  border: 1.5px solid rgba(212, 175, 55, 0.45);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.28), 0 8px 22px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  transition: transform var(--transition);
}

.brand-logo:hover {
  transform: scale(1.05);
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.22rem;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #ffffff 40%, #fef08a 80%, #d4af37 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .brand-title {
  background: linear-gradient(135deg, #0f172a 40%, #854d0e 85%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-light);
  opacity: 0.88;
  margin-top: 2px;
}

[data-theme="light"] .brand-subtitle {
  color: #854d0e;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 22px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 550;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  position: relative;
}

.nav-item svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  transition: transform var(--transition), color var(--transition);
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  transform: translateX(3px);
}

.nav-item:hover svg {
  transform: scale(1.1);
  color: var(--accent);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.22) 0%, rgba(124, 58, 237, 0.14) 100%);
  border-color: rgba(139, 92, 246, 0.42);
  color: #ffffff;
  font-weight: 650;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

[data-theme="light"] .nav-item.active {
  background: rgba(254, 249, 195, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: rgba(254, 240, 138, 0.75);
  color: #0f172a;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(254, 240, 138, 0.25), inset 0 1px 1px #ffffff;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #6366f1, #d4af37);
  box-shadow: 0 0 10px #6366f1;
}

[data-theme="light"] .nav-item.active::before {
  background: #facc15;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.5);
}

.nav-item.active svg {
  color: var(--gold-light);
  filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.4));
}

[data-theme="light"] .nav-item.active svg {
  color: #ca8a04;
  filter: none;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.admin-chip {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.admin-chip-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.admin-chip-sub {
  font-size: 0.72rem;
  color: var(--gold-light);
  opacity: 0.85;
}

[data-theme="light"] .admin-chip-sub {
  color: var(--gold);
}

/* --------------------------------------------------------------------------
   Main Area & Topbar
   -------------------------------------------------------------------------- */
.main-area {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 32px;
  background: var(--bg-elevated);
  backdrop-filter: blur(24px) saturate(190%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.90);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(135deg, var(--text-primary) 60%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-subtitle {
  margin: 2px 0 0;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.clock-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(20, 26, 44, 0.7), rgba(15, 20, 34, 0.8));
  border: 1px solid var(--border-gold);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-size: 0.84rem;
}

[data-theme="light"] .clock-chip {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(254, 240, 138, 0.70);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.clock-date {
  color: var(--text-secondary);
}

.clock-time {
  color: var(--gold-light);
  font-weight: 700;
  font-family: var(--font-mono);
}

[data-theme="light"] .clock-time {
  color: #0f172a;
}

.content-area {
  padding: 28px 32px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.view-section {
  display: flex;
  flex-direction: column;
  gap: 22px;
  animation: fadeSlide 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* --------------------------------------------------------------------------
   Royal Glass Cards
   -------------------------------------------------------------------------- */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(24px) saturate(190%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

[data-theme="light"] .glass-card {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04), inset 0 1px 1px rgba(255, 255, 255, 0.95);
}

.glass-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  pointer-events: none;
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

[data-theme="light"] .glass-card:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(254, 240, 138, 0.80);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.06), inset 0 1px 1px rgba(255, 255, 255, 0.98);
}

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

.card-header h2, .card-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Onboarding Banner
   -------------------------------------------------------------------------- */
.onboarding-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18) 0%, rgba(212, 175, 55, 0.10) 100%);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 16px 40px rgba(99, 102, 241, 0.15);
  flex-wrap: wrap;
}

[data-theme="light"] .onboarding-banner {
  background: linear-gradient(135deg, rgba(254, 252, 232, 0.85) 0%, rgba(254, 249, 195, 0.70) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-color: rgba(254, 240, 138, 0.75);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04), inset 0 1px 1px rgba(255, 255, 255, 0.95);
}

.onboarding-text h2 {
  margin: 8px 0 6px;
  font-size: 1.25rem;
  font-family: var(--font-display);
}

.onboarding-text p {
  margin: 0;
  color: var(--text-secondary);
  max-width: 640px;
  font-size: 0.92rem;
}

.onboarding-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Live Scanner Card
   -------------------------------------------------------------------------- */
.scanner-card {
  background: linear-gradient(140deg, var(--bg-card), rgba(99, 102, 241, 0.1));
  border-color: rgba(99, 102, 241, 0.32);
}

[data-theme="light"] .scanner-card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-color: rgba(255, 255, 255, 0.90);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04), inset 0 1px 1px #ffffff;
}

.scanner-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.scanner-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  color: var(--emerald);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.scanner-title-group h2 {
  margin: 0;
  font-size: 1.25rem;
  font-family: var(--font-display);
}

.scanner-title-group p {
  margin: 5px 0 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.kiosk-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  border: 1px solid var(--border);
  font-size: 0.84rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.kiosk-toggle:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.kiosk-toggle input {
  accent-color: var(--accent);
}

.scanner-controls {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 14px;
}

.scanner-controls-single {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.scanner-controls-single.with-device {
  grid-template-columns: 175px 220px minmax(0, 1fr);
}

@media (max-width: 760px) {
  .scanner-controls-single,
  .scanner-controls-single.with-device {
    grid-template-columns: minmax(0, 1fr);
  }
}

.scanner-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.scanner-input-wrap .input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.scanner-input-wrap .input {
  padding-left: 42px;
}

.quick-sim-wrap {
  display: flex;
  gap: 10px;
}

.tap-feedback {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.92rem;
  font-weight: 550;
}

.tap-feedback.success {
  background: var(--emerald-soft);
  border: 1px solid rgba(16, 185, 129, 0.45);
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.15);
}

.tap-feedback.info {
  background: var(--sky-soft);
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 4px 18px rgba(56, 189, 248, 0.15);
}

.tap-feedback.error {
  background: var(--rose-soft);
  border: 1px solid rgba(244, 63, 94, 0.45);
  box-shadow: 0 4px 18px rgba(244, 63, 94, 0.15);
}

/* --------------------------------------------------------------------------
   KPI Stat Cards (Royal Elevated Metrics)
   -------------------------------------------------------------------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.kpi-card {
  border-radius: var(--radius-md);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

/* Dark theme KPI card */
[data-theme="dark"] .kpi-card {
  background: linear-gradient(145deg, rgba(19, 27, 47, 0.7) 0%, rgba(13, 18, 33, 0.8) 100%);
  border: 1px solid var(--border);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Light theme KPI card - Frosted Glass with Crisp White & Minimum Light Yellow hint */
[data-theme="light"] .kpi-card {
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.90);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.035), inset 0 1px 1px rgba(255, 255, 255, 0.95);
}

.kpi-card:hover {
  transform: translateY(-2px);
}

.kpi-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3.5px;
  background: var(--accent);
  opacity: 0.85;
}

.kpi-emerald::after { background: linear-gradient(90deg, #10b981, #34d399); }
.kpi-sky::after     { background: linear-gradient(90deg, #0284c7, #38bdf8); }
.kpi-rose::after    { background: linear-gradient(90deg, #e11d48, #fb7185); }
.kpi-amber::after   { background: linear-gradient(90deg, #d97706, #fbbf24); }

.kpi-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 2.15rem;
  font-weight: 850;
  margin: 6px 0 4px;
  letter-spacing: -0.035em;
  background: linear-gradient(180deg, #ffffff 40%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .kpi-value {
  background: linear-gradient(180deg, #0f172a 35%, #334155 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.kpi-foot {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Dashboard Grid & Live Feed
   -------------------------------------------------------------------------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(310px, 0.95fr);
  gap: 20px;
  align-items: start;
}

.side-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
  max-height: 400px;
  overflow-y: auto;
}

.feed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: all var(--transition);
}

[data-theme="light"] .feed-item {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-color: rgba(255, 255, 255, 0.90);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.feed-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  transform: translateX(2px);
}

.feed-title {
  font-weight: 650;
  font-size: 0.9rem;
}

.feed-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.feed-right {
  text-align: right;
  flex-shrink: 0;
}

.empty-state-sm {
  padding: 24px 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .empty-state-sm {
  background: rgba(254, 252, 232, 0.60);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-color: rgba(254, 240, 138, 0.60);
}

/* --------------------------------------------------------------------------
   Inputs, Controls & Buttons
   -------------------------------------------------------------------------- */
.input {
  width: 100%;
  padding: 11px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.92rem;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: border-color var(--transition), box-shadow var(--transition);
}

[data-theme="light"] .input {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid #cbd5e1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), inset 0 1px 1px rgba(0, 0, 0, 0.02);
  color: #0f172a;
}

[data-theme="light"] .input:hover {
  border-color: #94a3b8;
  background: #ffffff;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 20px rgba(99, 102, 241, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .input:focus {
  border-color: #ca8a04;
  box-shadow: 0 0 0 3px rgba(254, 240, 138, 0.50), 0 0 12px rgba(234, 179, 8, 0.18);
  background: #ffffff;
}

/* Select & Dropdown Styling across whole app (High Visibility in Dark & Light Themes) */
select,
select.input,
.table-select {
  cursor: pointer;
}

[data-theme="dark"] select,
[data-theme="dark"] select.input,
[data-theme="dark"] .table-select {
  color-scheme: dark !important;
  background-color: #0d1322 !important;
  color: #f8fafc !important;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

/* Ensure all dropdown options inside the popover/popup list are crisp, visible, and high-contrast */
select option,
select.input option,
.table-select option,
optgroup {
  background-color: #0d1322;
  color: #f8fafc;
}

[data-theme="dark"] select option,
[data-theme="dark"] select.input option,
[data-theme="dark"] .table-select option,
[data-theme="dark"] optgroup {
  background-color: #0f172a !important;
  color: #f8fafc !important;
}

[data-theme="dark"] select option:checked,
[data-theme="dark"] select.input option:checked,
[data-theme="dark"] .table-select option:checked {
  background-color: #1e293b !important;
  color: #facc15 !important;
  font-weight: 700;
}

[data-theme="dark"] select option:hover,
[data-theme="dark"] select.input option:hover,
[data-theme="dark"] .table-select option:hover {
  background-color: #334155 !important;
  color: #ffffff !important;
}

[data-theme="light"] select,
[data-theme="light"] select.input,
[data-theme="light"] .table-select {
  color-scheme: light !important;
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid rgba(0, 0, 0, 0.22);
}

[data-theme="light"] select option,
[data-theme="light"] select.input option,
[data-theme="light"] .table-select option,
[data-theme="light"] optgroup {
  background-color: #ffffff !important;
  color: #0f172a !important;
}

[data-theme="light"] select option:checked,
[data-theme="light"] select.input option:checked,
[data-theme="light"] .table-select option:checked {
  background-color: #fef08a !important;
  color: #854d0e !important;
  font-weight: 700;
}
  font-weight: 700;
}

/* Date, Month, Time picker indicator styling (High visibility in Dark & Light Themes) */
input[type="date"],
input[type="month"],
input[type="time"] {
  cursor: pointer;
}

[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="month"],
[data-theme="dark"] input[type="time"] {
  color-scheme: dark !important;
}

[data-theme="light"] input[type="date"],
[data-theme="light"] input[type="month"],
[data-theme="light"] input[type="time"] {
  color-scheme: light !important;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  width: 22px;
  height: 22px;
  padding: 2px;
  border-radius: 4px;
  transition: transform var(--transition), opacity var(--transition), filter var(--transition);
}

/* DARK THEME: Crisp Glowing Royal Gold SVG Calendar Icon */
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="month"]::-webkit-calendar-picker-indicator {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23facc15' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3Ccircle cx='8' cy='14' r='1.3' fill='%23facc15'%3E%3C/circle%3E%3Ccircle cx='12' cy='14' r='1.3' fill='%23facc15'%3E%3C/circle%3E%3Ccircle cx='16' cy='14' r='1.3' fill='%23facc15'%3E%3C/circle%3E%3Ccircle cx='8' cy='18' r='1.3' fill='%23facc15'%3E%3C/circle%3E%3Ccircle cx='12' cy='18' r='1.3' fill='%23facc15'%3E%3C/circle%3E%3C/svg%3E") center / 20px no-repeat !important;
  filter: drop-shadow(0 0 4px rgba(250, 204, 21, 0.75)) !important;
  opacity: 1 !important;
}

[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23facc15' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E") center / 20px no-repeat !important;
  filter: drop-shadow(0 0 4px rgba(250, 204, 21, 0.75)) !important;
  opacity: 1 !important;
}

[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator:hover,
[data-theme="dark"] input[type="month"]::-webkit-calendar-picker-indicator:hover,
[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator:hover {
  filter: drop-shadow(0 0 7px rgba(250, 204, 21, 1)) !important;
  opacity: 1 !important;
  transform: scale(1.18);
}

/* LIGHT THEME: Crisp Slate-800 SVG Calendar Icon */
[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="light"] input[type="month"]::-webkit-calendar-picker-indicator {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3Ccircle cx='8' cy='14' r='1.3' fill='%23334155'%3E%3C/circle%3E%3Ccircle cx='12' cy='14' r='1.3' fill='%23334155'%3E%3C/circle%3E%3Ccircle cx='16' cy='14' r='1.3' fill='%23334155'%3E%3C/circle%3E%3Ccircle cx='8' cy='18' r='1.3' fill='%23334155'%3E%3C/circle%3E%3Ccircle cx='12' cy='18' r='1.3' fill='%23334155'%3E%3C/circle%3E%3C/svg%3E") center / 20px no-repeat !important;
  opacity: 0.85 !important;
  filter: none !important;
}

[data-theme="light"] input[type="time"]::-webkit-calendar-picker-indicator {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E") center / 20px no-repeat !important;
  opacity: 0.85 !important;
  filter: none !important;
}

[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator:hover,
[data-theme="light"] input[type="month"]::-webkit-calendar-picker-indicator:hover,
[data-theme="light"] input[type="time"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1 !important;
  transform: scale(1.18);
}

.input-sm {
  padding: 8px 12px;
  font-size: 0.85rem;
  width: auto;
  min-width: 220px;
}

.input-with-btn {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  user-select: none;
}

.btn svg {
  width: 17px;
  height: 17px;
}

.btn-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #7c3aed 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

[data-theme="light"] .btn-primary {
  background: linear-gradient(135deg, rgba(254, 249, 195, 0.95) 0%, rgba(254, 240, 138, 0.90) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #0f172a;
  font-weight: 700;
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 14px rgba(254, 240, 138, 0.35), inset 0 1px 1px #ffffff;
}

.btn-primary:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 8px 26px rgba(99, 102, 241, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

[data-theme="light"] .btn-primary:hover {
  background: linear-gradient(135deg, rgba(254, 240, 138, 0.98) 0%, rgba(253, 224, 71, 0.92) 100%);
  color: #0f172a;
  box-shadow: 0 6px 18px rgba(250, 204, 21, 0.30);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
  border-color: var(--border-strong);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .btn-secondary {
  background: rgba(255, 255, 255, 0.80);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: rgba(255, 255, 255, 0.95);
  color: #334155;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

[data-theme="light"] .btn-secondary:hover {
  background: rgba(254, 252, 232, 0.90);
  border-color: rgba(254, 240, 138, 0.70);
  color: #0f172a;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--rose-soft);
  color: var(--rose);
  border-color: rgba(244, 63, 94, 0.38);
}

.btn-danger:hover {
  background: rgba(244, 63, 94, 0.28);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 7px 12px;
  font-size: 0.82rem;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 0.98rem;
}

.btn-full {
  width: 100%;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all var(--transition);
}

.icon-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.tiny-btn {
  padding: 4px 9px;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

[data-theme="light"] .tiny-btn {
  background: rgba(255, 255, 255, 0.80);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-color: rgba(255, 255, 255, 0.95);
  color: #334155;
}

[data-theme="light"] .tiny-btn:hover {
  background: rgba(254, 252, 232, 0.90);
  border-color: rgba(254, 240, 138, 0.70);
  color: #0f172a;
}

/* --------------------------------------------------------------------------
   Badges (Jewel Tone Pills)
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.badge-emerald {
  background: var(--emerald-soft);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-sky {
  background: var(--sky-soft);
  color: var(--sky);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.badge-rose {
  background: var(--rose-soft);
  color: var(--rose);
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.badge-amber {
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-indigo {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.badge-slate {
  background: var(--bg-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* --------------------------------------------------------------------------
   Tables (Royal Sleek Grid)
   -------------------------------------------------------------------------- */
.table-card {
  padding: 22px 0 10px;
}

.table-card .card-header {
  padding: 0 26px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th {
  text-align: left;
  padding: 13px 18px;
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

[data-theme="dark"] .data-table th {
  background: rgba(11, 16, 29, 0.55);
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .data-table th {
  background: rgba(254, 252, 232, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #334155;
  font-weight: 700;
  border-top: 1px solid rgba(255, 255, 255, 0.90);
  border-bottom: 1.5px solid rgba(254, 240, 138, 0.65);
}

.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

[data-theme="light"] .data-table td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  color: #0f172a;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.data-table tbody tr {
  transition: background var(--transition);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .data-table tbody tr:hover {
  background: rgba(254, 249, 195, 0.35);
}

.empty-cell {
  text-align: center;
  color: var(--text-muted);
  padding: 36px 18px !important;
}

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

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.86rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.28), rgba(139, 92, 246, 0.2));
  border: 1px solid rgba(139, 92, 246, 0.38);
  color: #c7d2fe;
  flex-shrink: 0;
}

[data-theme="light"] .avatar {
  background: linear-gradient(135deg, #ffffff 0%, #fef9c3 100%);
  border: 1px solid rgba(254, 240, 138, 0.85);
  color: #0f172a;
}

.emp-name {
  font-weight: 700;
  font-size: 0.94rem;
}

.emp-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.pass-cell {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

/* --------------------------------------------------------------------------
   Restructured Employee Directory Components
   -------------------------------------------------------------------------- */
.emp-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.emp-summary-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform var(--transition);
}

.emp-summary-card:hover {
  transform: translateY(-2px);
}

[data-theme="light"] .emp-summary-card {
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.90);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.035), inset 0 1px 1px rgba(255, 255, 255, 0.95);
}

.emp-summary-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.emp-summary-icon svg {
  width: 22px;
  height: 22px;
}

.icon-emerald { background: var(--emerald-soft); color: var(--emerald); }
.icon-indigo  { background: var(--accent-soft); color: var(--accent); }
.icon-amber   { background: var(--amber-soft); color: var(--amber); }
.icon-sky     { background: var(--sky-soft); color: var(--sky); }

.emp-summary-label {
  font-size: 0.76rem;
  color: var(--text-secondary);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.emp-summary-val {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 850;
  color: var(--text-primary);
  margin-top: 2px;
}

.emp-toolbar {
  padding: 0 24px;
}

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

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

.search-input {
  padding-left: 36px !important;
  min-width: 260px;
}

.emp-slot-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  flex-wrap: wrap;
}

[data-theme="light"] .emp-slot-bar {
  background: rgba(254, 252, 232, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-color: rgba(254, 240, 138, 0.45);
}

.emp-slot-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--text-secondary);
}

.emp-slot-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Employee Actions Cell & 3-Dots Action Dropdown */
.emp-actions-cell {
  text-align: center !important;
  white-space: nowrap !important;
  width: 65px !important;
  min-width: 65px !important;
  padding: 8px !important;
  vertical-align: middle !important;
}

.btn-action-trigger {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
  border-radius: 8px !important;
  border: 1px solid var(--border) !important;
  background: var(--bg-card) !important;
  color: var(--text-secondary) !important;
  cursor: pointer !important;
  transition: all var(--transition) !important;
}

.btn-action-trigger:hover,
.btn-action-trigger[aria-expanded="true"] {
  color: #facc15 !important;
  background: rgba(234, 179, 8, 0.15) !important;
  border-color: rgba(234, 179, 8, 0.45) !important;
  transform: translateY(-1px) !important;
}

[data-theme="light"] .btn-action-trigger {
  background: #ffffff !important;
  border-color: rgba(234, 179, 8, 0.40) !important;
  color: #334155 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .btn-action-trigger:hover,
[data-theme="light"] .btn-action-trigger[aria-expanded="true"] {
  background: #fef08a !important;
  color: #713f12 !important;
  border-color: #ca8a04 !important;
}

.btn-action-trigger * {
  pointer-events: none !important;
}

/* Global Floating Action Dropdown Menu */
.action-dropdown-menu {
  position: fixed;
  min-width: 205px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.06);
  padding: 6px;
  z-index: 99999;
  animation: dropIn 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

@keyframes dropIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

[data-theme="light"] .action-dropdown-menu {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(234, 179, 8, 0.40);
  box-shadow: 0 14px 36px rgba(161, 98, 7, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08);
}

.action-dropdown-menu .menu-header {
  padding: 8px 10px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 4px;
}

[data-theme="light"] .action-dropdown-menu .menu-header {
  border-bottom: 1px solid rgba(234, 179, 8, 0.20);
}

.action-dropdown-menu .menu-emp-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="light"] .action-dropdown-menu .menu-emp-name {
  color: #0f172a;
}

.action-dropdown-menu .menu-emp-code {
  font-size: 0.74rem;
  margin-top: 1px;
}

.action-dropdown-item {
  display: flex !important;
  align-items: center !important;
  gap: 9px !important;
  width: 100% !important;
  padding: 8px 11px !important;
  font-size: 0.81rem !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  border: none !important;
  background: transparent !important;
  color: #cbd5e1 !important;
  cursor: pointer !important;
  text-align: left !important;
  transition: all 0.14s ease !important;
  white-space: nowrap !important;
}

.action-dropdown-item * {
  pointer-events: none !important;
}

.action-dropdown-item svg {
  width: 15px !important;
  height: 15px !important;
  flex-shrink: 0 !important;
}

.action-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
  transform: translateX(2px) !important;
}

[data-theme="light"] .action-dropdown-item {
  color: #334155 !important;
}

[data-theme="light"] .action-dropdown-item:hover {
  background: rgba(254, 240, 138, 0.45) !important;
  color: #0f172a !important;
}

.action-dropdown-item.item-block:hover {
  background: rgba(245, 158, 11, 0.16) !important;
  color: #fbbf24 !important;
}

.action-dropdown-item.item-unblock:hover {
  background: rgba(16, 185, 129, 0.16) !important;
  color: #34d399 !important;
}

.action-dropdown-item.item-danger,
.action-dropdown-item.item-rose {
  color: #fda4af !important;
}

.action-dropdown-item.item-danger:hover,
.action-dropdown-item.item-rose:hover {
  background: rgba(244, 63, 94, 0.18) !important;
  color: #ff4d6d !important;
}

[data-theme="light"] .action-dropdown-item.item-danger,
[data-theme="light"] .action-dropdown-item.item-rose {
  color: #e11d48 !important;
}

[data-theme="light"] .action-dropdown-item.item-danger:hover,
[data-theme="light"] .action-dropdown-item.item-rose:hover {
  background: #fee2e2 !important;
  color: #be123c !important;
}

.action-dropdown-divider {
  height: 1px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  margin: 4px 0 !important;
}

[data-theme="light"] .action-dropdown-divider {
  background: rgba(234, 179, 8, 0.20) !important;
}

/* Employee Table Wrap with Pinned Static Bottom Scrollbar & Sticky Headers */
.emp-table-wrap {
  width: 100% !important;
  max-height: calc(100vh - 300px) !important;
  min-height: 340px !important;
  overflow-y: auto !important;
  overflow-x: auto !important;
  position: relative !important;
}

.emp-table-wrap .data-table thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 10 !important;
}

[data-theme="light"] .emp-table-wrap .data-table thead th {
  background: rgba(254, 252, 232, 0.98) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border-bottom: 2px solid rgba(234, 179, 8, 0.40) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03) !important;
}

[data-theme="dark"] .emp-table-wrap .data-table thead th {
  background: rgba(11, 16, 29, 0.98) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border-bottom: 2px solid rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
}

.emp-table-wrap::-webkit-scrollbar {
  height: 9px !important;
  width: 9px !important;
}

.emp-table-wrap::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.35) !important;
  border-radius: 6px !important;
}

.emp-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(234, 179, 8, 0.45) !important;
  border-radius: 6px !important;
}

.emp-table-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(234, 179, 8, 0.85) !important;
}

[data-theme="light"] .emp-table-wrap::-webkit-scrollbar-track {
  background: rgba(254, 240, 138, 0.35) !important;
}

[data-theme="light"] .emp-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(202, 138, 4, 0.55) !important;
}

[data-theme="light"] .emp-table-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(161, 98, 7, 0.85) !important;
}

/* System Password Cell & Icon Buttons */
.pass-cell {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  vertical-align: middle !important;
}

.pass-dots {
  font-size: 0.85rem !important;
  letter-spacing: 1px !important;
}

.pass-btn-group {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.pass-icon-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 24px !important;
  height: 24px !important;
  padding: 0 !important;
  border-radius: 6px !important;
  border: 1px solid var(--border) !important;
  background: rgba(15, 23, 42, 0.4) !important;
  color: var(--text-secondary) !important;
  cursor: pointer !important;
  transition: all var(--transition) !important;
}

.pass-icon-btn:hover {
  color: var(--text-primary) !important;
  background: var(--bg-hover) !important;
  border-color: var(--border-strong) !important;
  transform: translateY(-1px) !important;
}

[data-theme="light"] .pass-icon-btn {
  background: #ffffff !important;
  border-color: rgba(234, 179, 8, 0.40) !important;
  color: #475569 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .pass-icon-btn:hover {
  background: #fefce8 !important;
  color: #0f172a !important;
  border-color: #ca8a04 !important;
}

.pass-icon-btn * {
  pointer-events: none !important;
}

/* Fallback legacy compatibility classes */
.emp-actions-row {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  margin: 0 auto !important;
}

.emp-actions-row .btn,
.emp-actions-row .tiny-btn {
  padding: 5px 9px !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  border-radius: 7px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.cred-pill-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cred-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  width: fit-content;
  border: 1px solid var(--border);
  line-height: 1.25;
}

.cred-active {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.32);
  color: var(--text-primary);
}

[data-theme="light"] .cred-active {
  background: rgba(254, 252, 232, 0.85);
  border-color: rgba(254, 240, 138, 0.70);
  color: #713f12;
}

.cred-blocked {
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.35);
  color: var(--rose);
}

.cred-icon {
  width: 14px;
  height: 14px;
  opacity: 0.9;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Filters & Reports Controls
   -------------------------------------------------------------------------- */
.filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.segmented-control {
  display: inline-flex;
  padding: 4px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border);
  gap: 4px;
}

[data-theme="light"] .segmented-control {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-color: rgba(255, 255, 255, 0.90);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.seg-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.seg-btn:hover {
  color: var(--text-primary);
}

.seg-btn.active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

[data-theme="light"] .seg-btn.active {
  background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
  color: #0f172a;
  box-shadow: 0 4px 14px rgba(254, 240, 138, 0.50);
  border: 1px solid rgba(255, 255, 255, 0.80);
}

.export-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
}

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.summary-strip {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.summary-pill {
  padding: 11px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.86rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .summary-pill {
  background: rgba(255, 255, 255, 0.70);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-color: rgba(255, 255, 255, 0.90);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.summary-pill strong {
  font-size: 1.1rem;
  font-family: var(--font-display);
}

/* --------------------------------------------------------------------------
   Registration Form - Full Screen Width
   -------------------------------------------------------------------------- */
.form-page-card {
  width: 100%;
  max-width: 100%;
}

.reg-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-section {
  padding: 22px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .form-section {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(203, 213, 225, 0.75);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.form-section-title {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  color: var(--accent);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--text-secondary);
}

.req {
  color: var(--rose);
}

.form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
}

/* --------------------------------------------------------------------------
   Drawer & Modals (Royal Frosted Overlay)
   -------------------------------------------------------------------------- */
.drawer-overlay, .modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.72);
  backdrop-filter: blur(8px);
  z-index: 60;
}

[data-theme="light"] .drawer-overlay,
[data-theme="light"] .modal-overlay {
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

[data-theme="light"] .modal {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(254, 240, 138, 0.35);
}

[data-theme="light"] .drawer {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-left: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.08);
}

.modal-overlay {
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
}

.modal {
  width: 100%;
  max-width: 720px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
}

.modal-header, .drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}

.modal-header h3, .drawer-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 750;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(520px, 100vw);
  background: var(--bg-card-solid);
  border-left: 1px solid var(--border);
  padding: 24px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.6);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.drawer-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mini-stat {
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border);
}

.mini-stat-label {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.mini-stat-val {
  margin-top: 4px;
  font-weight: 750;
  font-size: 1.05rem;
  font-family: var(--font-display);
}

.work-sessions-header {
  font-weight: 750;
  font-size: 0.84rem;
  margin-bottom: 8px;
  color: #facc15;
  letter-spacing: 0.02em;
}

[data-theme="light"] .work-sessions-header {
  color: #92400e !important;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.timeline-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border);
}

.code-box {
  margin: 8px 0 0;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: #040711;
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  overflow-x: auto;
  border: 1px solid var(--border);
}

.guide-block {
  margin-bottom: 18px;
}

.guide-block h4 {
  margin: 0 0 6px;
}

.guide-block p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

/* --------------------------------------------------------------------------
   Toast Notifications
   -------------------------------------------------------------------------- */
.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
}

.toast {
  padding: 13px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-card-solid);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fadeSlide 180ms ease;
}

.toast.success { border-left: 4px solid var(--emerald); }
.toast.error   { border-left: 4px solid var(--rose); }
.toast.info    { border-left: 4px solid var(--accent); }

.mobile-only {
  display: none;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.65);
  backdrop-filter: blur(4px);
  z-index: 25;
}

.ws-alert-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 20px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(99, 102, 241, 0.14));
  border-color: rgba(245, 158, 11, 0.45);
}

[data-theme="light"] .ws-alert-banner {
  background: linear-gradient(135deg, rgba(254, 252, 232, 0.85) 0%, rgba(254, 249, 195, 0.75) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(254, 240, 138, 0.60);
  color: #0f172a;
  box-shadow: 0 8px 24px rgba(254, 240, 138, 0.20);
}

.field-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.input-ws-pulse {
  border-color: var(--emerald) !important;
  box-shadow: 0 0 0 3px var(--emerald-soft), 0 0 15px rgba(16, 185, 129, 0.3) !important;
}

/* --------------------------------------------------------------------------
   Royal Admin Login Page
   -------------------------------------------------------------------------- */
.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background-color: var(--bg-canvas);
}

[data-theme="dark"] .login-body {
  background-image:
    radial-gradient(circle at 50% 25%, rgba(99, 102, 241, 0.22), transparent 55%),
    radial-gradient(circle at 82% 82%, rgba(212, 175, 55, 0.12), transparent 45%),
    radial-gradient(circle at 18% 75%, rgba(16, 185, 129, 0.08), transparent 45%);
}

[data-theme="light"] .login-body {
  background-color: #ffffff;
  background-image:
    radial-gradient(circle at 95% 5%, rgba(254, 240, 138, 0.40) 0%, rgba(254, 249, 195, 0.25) 35%, transparent 65%),
    radial-gradient(circle at 82% 20%, rgba(254, 249, 195, 0.28) 0%, transparent 48%),
    radial-gradient(circle at 65% 38%, rgba(255, 253, 235, 0.35) 0%, transparent 45%),
    linear-gradient(225deg, rgba(254, 249, 195, 0.32) 0%, rgba(255, 254, 240, 0.20) 30%, rgba(255, 255, 255, 0.85) 60%, #ffffff 100%);
  background-attachment: fixed;
}

.login-wrap {
  width: 100%;
  max-width: 440px;
}

.login-card {
  padding: 34px 32px;
  border: 1px solid var(--border-gold);
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.75), 0 0 35px rgba(212, 175, 55, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

[data-theme="light"] .login-card {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.05),
    0 8px 24px rgba(254, 240, 138, 0.20),
    inset 0 1px 2px rgba(255, 255, 255, 0.98);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.login-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(135deg, #ffffff 50%, var(--gold-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .login-head h1 {
  background: linear-gradient(135deg, #0f172a 40%, #854d0e 85%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-head p {
  margin: 6px 0 0;
  color: var(--text-secondary);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 22px;
}

/* --------------------------------------------------------------------------
   Fingerprint Enrollment & Controls
   -------------------------------------------------------------------------- */
.fp-enroll-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 8px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.35;
}

.fp-enroll-status.pending,
.fp-enroll-status.enrolling {
  background: var(--sky-soft);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: var(--sky);
}

.fp-enroll-status.success {
  background: var(--emerald-soft);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: var(--emerald);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.25);
}

.fp-enroll-status.failed {
  background: var(--rose-soft);
  border: 1px solid rgba(244, 63, 94, 0.45);
  color: var(--rose);
}

.fp-tick-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--emerald);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* --------------------------------------------------------------------------
   Door Open Page: Royal Jewel Push Button ("PRESS TO OPEN")
   -------------------------------------------------------------------------- */
.door-control-card {
  width: 100%;
  max-width: 680px;
  margin: 10px auto 30px auto;
}

.door-control-body {
  padding: 12px 0 16px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.door-controls-row {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.door-duration-input-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}

.door-duration-input-wrap input {
  flex: 1;
  min-width: 80px;
}

.door-duration-unit-select {
  width: 125px !important;
  flex-shrink: 0;
}

.door-duration-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.door-duration-presets .tiny-btn {
  padding: 4px 10px !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  border-radius: 7px !important;
  cursor: pointer;
  transition: all var(--transition);
}

.door-duration-presets .tiny-btn.active {
  background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%) !important;
  border-color: #ca8a04 !important;
  color: #0f172a !important;
  box-shadow: 0 2px 8px rgba(254, 240, 138, 0.45) !important;
}

[data-theme="dark"] .door-duration-presets .tiny-btn.active {
  background: linear-gradient(135deg, #d4af37 0%, #854d0e 100%) !important;
  border-color: #fef08a !important;
  color: #ffffff !important;
}

.door-push-wrap {
  padding: 24px;
  border-radius: 999px;
  background: radial-gradient(circle at center, rgba(254, 240, 138, 0.40) 0%, rgba(254, 249, 195, 0.12) 50%, transparent 72%);
  box-shadow: 0 0 45px rgba(254, 240, 138, 0.35);
  transition: all var(--transition-smooth);
}

.door-push-wrap:hover {
  background: radial-gradient(circle at center, rgba(254, 240, 138, 0.55) 0%, rgba(254, 249, 195, 0.18) 55%, transparent 75%);
  box-shadow: 0 0 60px rgba(254, 240, 138, 0.50);
}

.door-push-btn {
  width: 204px;
  height: 204px;
  border-radius: 999px;
  border: 5px solid rgba(255, 255, 255, 0.90);
  background: radial-gradient(circle at 35% 28%, #ffffff 0%, #fffef0 20%, #fef9c3 55%, #fef08a 100%);
  color: #0f172a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 16px 40px rgba(254, 240, 138, 0.55),
    0 0 0 8px rgba(254, 249, 195, 0.45),
    inset 0 3px 6px #ffffff,
    inset 0 -4px 10px rgba(250, 204, 21, 0.25);
  transition: all var(--transition);
  user-select: none;
}

.door-push-btn:hover:not(:disabled) {
  transform: scale(1.04);
  box-shadow:
    0 20px 50px rgba(254, 240, 138, 0.70),
    0 0 0 12px rgba(254, 249, 195, 0.55),
    inset 0 4px 8px #ffffff,
    inset 0 -5px 12px rgba(250, 204, 21, 0.30);
}

.door-push-btn:active:not(:disabled),
.door-push-btn.is-pressed {
  transform: scale(0.96);
  box-shadow:
    0 6px 20px rgba(254, 240, 138, 0.45),
    0 0 0 4px rgba(254, 249, 195, 0.35),
    inset 0 4px 10px rgba(250, 204, 21, 0.35);
}

.door-push-btn.is-open {
  background: radial-gradient(circle at 35% 28%, #ffffff 0%, #fefce8 35%, #fef9c3 100%);
  border-color: #ffffff;
  color: #0f172a;
  box-shadow:
    0 0 65px rgba(254, 240, 138, 0.85),
    0 0 0 14px rgba(254, 249, 195, 0.55),
    inset 0 3px 8px #ffffff;
}

.door-push-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.door-push-icon {
  width: 46px;
  height: 46px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.door-push-label {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #0f172a;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.90);
}

[data-theme="dark"] .door-push-wrap {
  background: radial-gradient(circle at center, rgba(212, 175, 55, 0.25) 0%, rgba(99, 102, 241, 0.10) 50%, transparent 72%);
  box-shadow: 0 0 50px rgba(212, 175, 55, 0.22);
}

[data-theme="dark"] .door-push-btn {
  border: 5px solid rgba(255, 255, 255, 0.18);
  background: radial-gradient(circle at 35% 28%, #fef3c7 0%, #d4af37 40%, #854d0e 85%, #451a03 100%);
  color: #ffffff;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.8),
    0 0 0 8px rgba(212, 175, 55, 0.35),
    inset 0 3px 6px rgba(255, 255, 255, 0.6),
    inset 0 -4px 10px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .door-push-label {
  color: #ffffff;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.65);
}

/* --------------------------------------------------------------------------
   Responsive Rules
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .emp-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1160px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .mobile-only {
    display: grid;
  }
  .sidebar {
    position: fixed;
    left: -290px;
    width: 275px;
    transition: left 220ms cubic-bezier(0.16, 1, 0.3, 1);
  }
  .sidebar.open {
    left: 0;
  }
  .scanner-controls, .filter-row, .form-grid {
    grid-template-columns: 1fr;
  }
  .topbar {
    padding: 14px 18px;
  }
  .content-area {
    padding: 18px;
  }
  .clock-chip {
    display: none;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .emp-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sidebar {
    overflow-y: auto;
  }
}

@media (max-width: 600px) {
  .topbar {
    flex-wrap: wrap;
    gap: 12px;
  }
  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }
  .page-title {
    font-size: 1.15rem;
  }
  .glass-card {
    padding: 18px;
    border-radius: var(--radius-md);
  }
  .table-card {
    padding: 18px 0 10px;
  }
  .table-card .card-header {
    padding: 0 18px;
  }
  .card-actions, .card-actions .input-sm, .input-with-btn, .form-footer, .modal-footer {
    width: 100%;
  }
  .card-actions .input-sm {
    min-width: 0;
  }
  .scanner-input-wrap {
    flex-direction: column;
    align-items: stretch;
  }
  .scanner-input-wrap .input-icon {
    top: 14px;
  }
  .input-with-btn {
    flex-wrap: wrap;
  }
  .segmented-control {
    width: 100%;
  }
  .seg-btn {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
    font-size: 0.8rem;
  }
  .form-footer, .modal-footer {
    flex-direction: column-reverse;
  }
  .form-footer .btn, .modal-footer .btn {
    width: 100%;
  }
  .toast-stack {
    left: 14px;
    right: 14px;
    bottom: 14px;
    max-width: none;
  }
  .login-card {
    padding: 24px 20px;
  }
  .emp-summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 440px) {
  .kpi-grid, .drawer-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Late Login & Late Logout Badges, Tags & Time Policy View
   -------------------------------------------------------------------------- */
.late-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  transition: all var(--transition);
}

.late-login-tag {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.35);
}

[data-theme="light"] .late-login-tag {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.late-logout-tag {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.35);
}

[data-theme="light"] .late-logout-tag {
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}

.late-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 4px;
  background: #ef4444;
  color: #ffffff;
}

[data-theme="light"] .late-pill {
  background: #dc2626;
  color: #ffffff;
}

.late-out-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 4px;
  background: #6366f1;
  color: #ffffff;
}

[data-theme="light"] .late-out-pill {
  background: #4f46e5;
  color: #ffffff;
}

/* Time Policy View Container & Cards */
.time-policy-card {
  max-width: 840px;
  margin: 0 auto;
}

.time-policy-body {
  padding: 24px 28px;
}

.time-policy-form {
  margin-bottom: 28px;
}

.policy-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-top: 12px;
}

.policy-stat-chip {
  padding: 20px 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  transition: transform var(--transition), box-shadow var(--transition);
}

.policy-stat-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

.policy-stat-login {
  border-color: rgba(244, 63, 94, 0.35);
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.10) 0%, rgba(17, 24, 42, 0.7) 100%);
}

[data-theme="light"] .policy-stat-login {
  background: linear-gradient(135deg, rgba(254, 226, 226, 0.7) 0%, #ffffff 100%);
  border-color: #fca5a5;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.10);
}

.policy-stat-logout {
  border-color: rgba(99, 102, 241, 0.35);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.10) 0%, rgba(17, 24, 42, 0.7) 100%);
}

[data-theme="light"] .policy-stat-logout {
  background: linear-gradient(135deg, rgba(224, 231, 255, 0.7) 0%, #ffffff 100%);
  border-color: #c7d2fe;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.10);
}

.policy-stat-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.policy-stat-value {
  font-family: var(--font-mono);
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.policy-stat-login .policy-stat-value {
  color: #fb7185;
}

[data-theme="light"] .policy-stat-login .policy-stat-value {
  color: #b91c1c;
}

.policy-stat-logout .policy-stat-value {
  color: #a5b4fc;
}

[data-theme="light"] .policy-stat-logout .policy-stat-value {
  color: #4338ca;
}

.policy-stat-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   Permission, OT Overrides, Badges & Table Controls
   -------------------------------------------------------------------------- */
.permission-tag {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.38);
}

[data-theme="light"] .permission-tag {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.permission-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 4px;
  background: #f59e0b;
  color: #ffffff;
}

[data-theme="light"] .permission-pill {
  background: #d97706;
  color: #ffffff;
}

.ot-tag {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.38);
}

[data-theme="light"] .ot-tag {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.ot-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 4px;
  background: #10b981;
  color: #ffffff;
}

[data-theme="light"] .ot-pill {
  background: #059669;
  color: #ffffff;
}

.badge-late {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-late-in {
  background: rgba(244, 63, 94, 0.16);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.32);
}

[data-theme="light"] .badge-late-in {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.badge-late-out {
  background: rgba(99, 102, 241, 0.16);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.32);
}

[data-theme="light"] .badge-late-out {
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}

.badge-permission {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.32);
}

[data-theme="light"] .badge-permission {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-ot {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.32);
}

[data-theme="light"] .badge-ot {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

/* Table Inline Controls for Overrides */
.table-select {
  padding: 6px 10px;
  font-size: 0.82rem;
  border-radius: 6px;
  min-width: 155px;
  font-weight: 500;
  transition: all var(--transition);
}

[data-theme="dark"] .table-select {
  background-color: #0d1322;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color-scheme: dark;
}

[data-theme="light"] .table-select {
  background-color: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(0, 0, 0, 0.22);
  color-scheme: light;
}

.table-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.25);
}

.table-input {
  padding: 6px 10px;
  font-size: 0.82rem;
  border-radius: 6px;
  min-width: 170px;
  transition: all var(--transition);
}

[data-theme="dark"] .table-input {
  background-color: #0d1322;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color-scheme: dark;
}

[data-theme="dark"] .table-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

[data-theme="light"] .table-input {
  background-color: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(0, 0, 0, 0.22);
  color-scheme: light;
}

[data-theme="light"] .table-input::placeholder {
  color: rgba(0, 0, 0, 0.45);
}

.table-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.25);
}

.save-override-btn {
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 6px;
  transition: all var(--transition);
}
