/* ===== FingerTrack Enterprise — Design System ===== */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Background & Surface */
  --bg: #f8f9fa;
  --bg-secondary: #f1f3f5;
  --surface: #ffffff;
  --surface-hover: #f8f9fa;
  --surface-raised: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.85);

  /* Border */
  --border: #e9ecef;
  --border-focus: rgba(99, 102, 241, 0.5);

  /* Text */
  --text: #212529;
  --text-secondary: #495057;
  --text-muted: #5a6178;
  --text-inverse: #ffffff;

  /* Primary Palette (Indigo) */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-subtle: rgba(99, 102, 241, 0.12);
  --primary-glow: rgba(99, 102, 241, 0.25);

  /* Accent / Status */
  --success: #10b981;
  --success-subtle: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-subtle: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-subtle: rgba(239, 68, 68, 0.12);
  --info: #3b82f6;
  --info-subtle: rgba(59, 130, 246, 0.12);

  /* Department Colors */
  --dept-webdev: #6366f1;
  --dept-design: #a855f7;
  --dept-hr: #f59e0b;
  --dept-sales: #10b981;
  --dept-finance: #14b8a6;
  --dept-operations: #f97316;
  --dept-marketing: #ec4899;
  --dept-socialmedia: #8b5cf6;

  /* Typography */
  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Sizing */
  --sidebar-w: 240px;
  --topbar-h: 60px;

  /* Radius */
  --r: 8px;
  --rl: 14px;
  --rx: 22px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-glow: 0 0 20px var(--primary-glow);

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 0.2s;
}

html { font-size: 14px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Layout Shell --- */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main";
  height: 100vh;
  width: 100vw;
}

/* --- Sidebar --- */
.sidebar {
  grid-area: sidebar;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  position: relative;
  overflow: hidden;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 200px;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.06) 0%, transparent 100%);
  pointer-events: none;
}

.brand {
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r);
  background: linear-gradient(135deg, var(--primary), #818cf8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  box-shadow: 0 0 16px var(--primary-glow);
}

.brand-text h1 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
}

.brand-text span {
  display: block;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 14px 14px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--r);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  text-decoration: none;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.nav-item i {
  font-size: 18px;
  color: var(--text-muted);
  transition: color var(--duration) var(--ease);
  z-index: 1;
}

.nav-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0; width: 0;
  background: var(--primary-subtle);
  transition: width var(--duration) var(--ease);
  z-index: 0;
}

.nav-item:hover {
  color: var(--text);
}
.nav-item:hover i {
  color: var(--primary);
}

.nav-item.active {
  color: var(--primary);
  font-weight: 600;
  border-color: rgba(99, 102, 241, 0.2);
}

.nav-item.active::before {
  width: 100%;
}

.nav-item.active i {
  color: var(--primary);
}

.sidebar-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.version-info {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

/* --- Main Content Wrapper --- */
.main-wrapper {
  grid-area: main;
  display: flex;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-secondary);
}

/* --- Topbar --- */
.topbar {
  grid-area: topbar;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 90;
}

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

.view-title h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

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

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

.icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.icon-btn:hover {
  background: var(--surface-hover);
  color: var(--primary);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--r);
  border: 1px solid transparent;
  transition: all var(--duration) var(--ease);
}

.user-profile:hover {
  background: var(--surface-hover);
  border-color: var(--border);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: white;
}

.admin-avatar {
  background: linear-gradient(135deg, var(--dept-webdev), var(--dept-design));
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

.nav-item i {
  font-size: 18px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* --- Main Content --- */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 28px;
  background: var(--bg);
  scroll-behavior: smooth;
}

.main-content::-webkit-scrollbar { width: 6px; }
.main-content::-webkit-scrollbar-track { background: transparent; }
.main-content::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
  border-radius: 3px;
}
.main-content::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.2);
}

/* --- View Header --- */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 12px;
}

.view-header-left h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.view-header-left p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.view-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rl);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

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

.stat-card-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.stat-card-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-card-value.green { color: var(--success); }
.stat-card-value.red { color: var(--primary); }

.stat-card-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

/* --- Tables --- */
.table-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rl);
  overflow: hidden;
}

.table-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}

.table-panel-title {
  font-size: 14px;
  font-weight: 600;
}

.table-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--duration) var(--ease);
}

tbody tr:last-child { border-bottom: none; }

tbody tr:hover { background: var(--surface-hover); }

tbody td {
  padding: 14px 16px;
  font-size: 13px;
  vertical-align: middle;
  white-space: nowrap;
  color: var(--text);
}

/* --- Chips / Badges --- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.chip.success { background: var(--success-subtle); color: var(--success); }
.chip.danger { background: var(--danger-subtle); color: var(--danger); }
.chip.info { background: var(--info-subtle); color: var(--info); }
.chip.warning { background: var(--warning-subtle); color: var(--warning); }
.chip.primary { background: var(--primary-subtle); color: var(--primary); }

.chip.dept-webdev { background: rgba(99,102,241,0.1); color: var(--dept-webdev); }
.chip.dept-design { background: rgba(168,85,247,0.1); color: var(--dept-design); }
.chip.dept-hr { background: rgba(245,158,11,0.1); color: var(--dept-hr); }
.chip.dept-sales { background: rgba(34,197,94,0.1); color: var(--dept-sales); }
.chip.dept-finance { background: rgba(20,184,166,0.1); color: var(--dept-finance); }
.chip.dept-operations { background: rgba(249,115,22,0.1); color: var(--dept-operations); }
.chip.dept-marketing { background: rgba(236,72,153,0.1); color: var(--dept-marketing); }
.chip.dept-socialmedia { background: rgba(139,92,246,0.1); color: var(--dept-socialmedia); }

.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chip-dot.success { background: var(--success); }
.chip-dot.danger { background: var(--danger); }
.chip-dot.info { background: var(--info); }

/* --- Employee Cell --- */
.employee-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.employee-cell-info {
  display: flex;
  flex-direction: column;
}

.employee-cell-name {
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
}

.employee-cell-email {
  font-size: 11px;
  color: var(--text-muted);
}

/* --- Avatars --- */
.avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.avatar.sm { width: 28px; height: 28px; font-size: 10px; }
.avatar.lg { width: 48px; height: 48px; font-size: 16px; border-radius: var(--rl); }
.avatar.xl { width: 64px; height: 64px; font-size: 20px; border-radius: var(--rl); }

.employee-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.employee-cell-info { display: flex; flex-direction: column; }
.employee-cell-name { font-weight: 600; font-size: 13px; }
.employee-cell-email { font-size: 11px; color: var(--text-muted); }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--r);
  font-size: 12.5px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
  text-decoration: none;
}

.btn i { font-size: 16px; }

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 0 12px var(--primary-glow);
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 0 20px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface-raised);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: rgba(255,255,255,0.12);
}

.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover { background: #16a34a; }

.btn-danger {
  background: var(--danger-subtle);
  color: var(--danger);
  border-color: rgba(239,68,68,0.2);
}
.btn-danger:hover { background: rgba(239,68,68,0.2); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 10px;
}
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }

.btn-sm { padding: 5px 10px; font-size: 11.5px; }
.btn-sm i { font-size: 14px; }

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--r);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--duration) var(--ease);
}
.btn-icon:hover { background: var(--surface-hover); color: var(--text); }
.btn-icon.danger:hover { background: var(--danger-subtle); color: var(--danger); }

/* --- Search Input --- */
.search-box {
  position: relative;
  width: 260px;
}

.search-box i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 12.5px;
  font-family: var(--font);
  transition: all var(--duration) var(--ease);
  outline: none;
}

.search-box input::placeholder { color: var(--text-muted); }

.search-box input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

/* --- Forms --- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 16px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-label .required { color: var(--danger); margin-left: 2px; }

.form-input,
.form-select {
  padding: 9px 12px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  transition: all var(--duration) var(--ease);
  outline: none;
  width: 100%;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235a6178' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.form-select option {
  background: var(--surface);
  color: var(--text);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-section-title i { color: var(--primary); font-size: 16px; }

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  accent-color: var(--primary);
}

.form-check label {
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
}

/* Toggle Switch */
.toggle-group {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}

.toggle-option {
  flex: 1;
  padding: 8px 14px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  border: none;
  background: none;
  font-family: var(--font);
}

.toggle-option.active {
  background: var(--primary);
  color: white;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s var(--ease);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rx);
  width: 90%;
  max-width: 580px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s var(--ease);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal.lg { max-width: 700px; }

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

.modal-header-text h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.modal-header-text p {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all var(--duration) var(--ease);
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--danger-subtle);
  color: var(--danger);
  border-color: rgba(239,68,68,0.2);
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-body::-webkit-scrollbar { width: 4px; }
.modal-body::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* --- Toast --- */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--rl);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 500;
  pointer-events: auto;
  animation: toastSlideIn 0.35s var(--ease);
  max-width: 380px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--info); }

.toast i { font-size: 18px; flex-shrink: 0; }
.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.info i { color: var(--info); }

.toast.removing {
  animation: toastSlideOut 0.3s var(--ease) forwards;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastSlideOut {
  to { opacity: 0; transform: translateX(100px); }
}

/* --- Scanner --- */
.scanner-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.scanner-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rl);
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.scanner-ring-container {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 10px 0 28px;
}

.scanner-ring {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 3px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.4s var(--ease);
}

.scanner-ring i {
  font-size: 64px;
  color: var(--text-muted);
  transition: color 0.4s var(--ease);
}

.scanner-ring.scanning {
  border-color: var(--primary);
  animation: scanPulse 1.1s ease-in-out infinite;
  box-shadow: 0 0 30px var(--primary-glow);
}

.scanner-ring.scanning i { color: var(--primary); }

.scanner-ring.ok {
  border-color: var(--success);
  box-shadow: 0 0 40px rgba(34, 197, 94, 0.3);
}

.scanner-ring.ok i { color: var(--success); }

.scanner-ring.fail {
  border-color: var(--danger);
  box-shadow: 0 0 40px rgba(239, 68, 68, 0.3);
}

.scanner-ring.fail i { color: var(--danger); }

@keyframes scanPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.scanner-status {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 24px;
  min-height: 24px;
  text-align: center;
  transition: color 0.3s var(--ease);
}

.scanner-status.scanning { color: var(--primary); }
.scanner-status.ok { color: var(--success); }
.scanner-status.fail { color: var(--danger); }
.scanner-status.idle { color: var(--text-muted); }

.scanner-controls {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.scanner-select {
  width: 100%;
}

.scanner-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.scanner-btn {
  padding: 12px;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--duration) var(--ease);
}

.scanner-btn.check-in {
  background: var(--primary);
  color: white;
  box-shadow: 0 0 12px var(--primary-glow);
}
.scanner-btn.check-in:hover {
  background: var(--primary-hover);
  box-shadow: 0 0 20px var(--primary-glow);
  transform: translateY(-1px);
}

.scanner-btn.check-out {
  background: var(--surface-raised);
  color: var(--text);
  border: 1px solid var(--border);
}
.scanner-btn.check-out:hover {
  background: var(--surface-hover);
  border-color: rgba(255,255,255,0.12);
}

.scanner-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Scan Log */
.scan-log-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rl);
  display: flex;
  flex-direction: column;
  max-height: 600px;
}

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

.scan-log-header h3 {
  font-size: 14px;
  font-weight: 600;
}

.scan-log-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.scan-log-list::-webkit-scrollbar { width: 4px; }
.scan-log-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
}

.scan-log-entry {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r);
  transition: background var(--duration) var(--ease);
  animation: fadeSlideIn 0.3s var(--ease);
}

.scan-log-entry:hover { background: rgba(255,255,255,0.02); }

.scan-log-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.scan-log-dot.in { background: var(--success); box-shadow: 0 0 6px rgba(34,197,94,0.4); }
.scan-log-dot.out { background: var(--info); box-shadow: 0 0 6px rgba(59,130,246,0.4); }
.scan-log-dot.error { background: var(--danger); box-shadow: 0 0 6px rgba(239,68,68,0.4); }

.scan-log-content { flex: 1; }

.scan-log-name {
  font-size: 13px;
  font-weight: 600;
}

.scan-log-detail {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.scan-log-time {
  font-size: 10.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
  margin-top: 2px;
}

.scan-log-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-muted);
  text-align: center;
}

.scan-log-empty i { font-size: 36px; margin-bottom: 10px; opacity: 0.4; }
.scan-log-empty p { font-size: 12.5px; }

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

/* --- Salary Cards --- */
.salary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.salary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rl);
  overflow: hidden;
  transition: all 0.3s var(--ease);
}

.salary-card:hover {
  border-color: rgba(255,255,255,0.1);
  box-shadow: var(--shadow-md);
}

.salary-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.salary-card-info { flex: 1; }
.salary-card-name { font-size: 14px; font-weight: 700; }
.salary-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.salary-card-meta span { font-size: 11px; color: var(--text-secondary); }

.salary-card-body {
  padding: 14px 20px 18px;
}

.salary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  font-size: 12.5px;
}

.salary-row + .salary-row {
  border-top: 1px solid rgba(255,255,255,0.03);
}

.salary-row-label { color: var(--text-secondary); }
.salary-row-value { font-weight: 600; font-family: var(--font-mono); font-size: 12px; }
.salary-row-value.deduction { color: var(--danger); }
.salary-row-value.bonus { color: var(--success); }

.salary-row.total {
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding-top: 12px;
}

.salary-row.total .salary-row-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.salary-row.total .salary-row-value {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
}

/* --- Report Table --- */
.att-pct-bar {
  width: 60px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-left: 6px;
}

.att-pct-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s var(--ease);
}

.hours-bar {
  width: 80px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}

.hours-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), #818cf8);
  transition: width 0.5s var(--ease);
}

/* --- Empty State --- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px 20px;
  text-align: center;
}

.empty-state i {
  font-size: 48px;
  color: var(--text-muted);
  opacity: 0.3;
  margin-bottom: 14px;
}

.empty-state h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* --- View Employee Modal Extras --- */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.detail-item { display: flex; flex-direction: column; gap: 4px; padding: 10px 0; }
.detail-label { font-size: 11.5px; color: var(--text-secondary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.detail-value { font-size: 14px; font-weight: 600; color: var(--text); }
.detail-value.mono { font-family: var(--font-mono); font-size: 12.5px; }

.detail-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 2px solid var(--border);
}

.detail-section-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--primary-subtle), rgba(99,102,241,0.06));
  border-radius: var(--r);
  border-left: 4px solid var(--primary);
}
.detail-section-title i {
  font-size: 18px;
  color: var(--primary);
}

/* --- Mono / Code text --- */
.mono { font-family: var(--font-mono); font-size: 12px; }

/* --- Utility --- */
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }

.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

.gap-8 { gap: 8px; }
.mt-12 { margin-top: 12px; }
.mb-16 { margin-bottom: 16px; }

.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

.hidden { display: none !important; }

/* Active badge */
.active-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
  font-size: 11px;
  font-weight: 600;
}

.active-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ===== REPORT SYSTEM ===== */

/* --- Report Tabs --- */
.report-tabs {
  display: flex;
  gap: 4px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rl);
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.report-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration) var(--ease);
}

.report-tab i { font-size: 15px; }

.report-tab:hover {
  color: var(--text-secondary);
  background: var(--surface-hover);
}

.report-tab.active {
  color: var(--primary);
  background: var(--primary-subtle);
  border-color: rgba(99, 102, 241, 0.15);
}

.report-content {
  animation: fadeIn 0.25s var(--ease);
}

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

/* --- Extra Status Chip Colors --- */
.chip.teal { background: rgba(20, 184, 166, 0.12); color: #14b8a6; }
.chip.purple { background: rgba(168, 85, 247, 0.12); color: #a855f7; }

/* --- Compliance Cards --- */
.compliance-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.compliance-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rl);
  transition: all 0.3s var(--ease);
}

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

.compliance-card.alert {
  border-color: rgba(245, 158, 11, 0.25);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(245, 158, 11, 0.04) 100%);
}

.compliance-card.critical {
  border-color: rgba(239, 68, 68, 0.25);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(239, 68, 68, 0.04) 100%);
}

.compliance-card.ok {
  border-color: rgba(34, 197, 94, 0.15);
}

.compliance-card.active {
  border-color: var(--primary) !important;
  box-shadow: var(--shadow-md), 0 0 0 2px var(--primary-glow);
  transform: translateY(-2px);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(99, 102, 241, 0.08) 100%);
}

.compliance-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.compliance-card.alert .compliance-card-icon { background: var(--warning-subtle); color: var(--warning); }
.compliance-card.critical .compliance-card-icon { background: var(--danger-subtle); color: var(--danger); }
.compliance-card.ok .compliance-card-icon { background: var(--success-subtle); color: var(--success); }

.compliance-card-info { flex: 1; }
.compliance-card-info h4 { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.compliance-card-info p { font-size: 11.5px; color: var(--text-muted); }

.compliance-card-count {
  font-size: 24px;
  font-weight: 800;
  font-family: var(--font-mono);
  min-width: 36px;
  text-align: center;
}

.compliance-card-count.danger { color: var(--danger); }
.compliance-card-count.warning { color: var(--warning); }
.compliance-card-count.success { color: var(--success); }

/* --- Leave Balance Cards --- */
.leave-balance-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.leave-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px;
}

.leave-card-type {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.leave-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  padding: 3px 0;
  color: var(--text-secondary);
}

/* --- Weekly Summary Card --- */
.weekly-summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rl);
  overflow: hidden;
}

.weekly-summary-header {
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.04) 0%, transparent 100%);
}

.weekly-summary-header h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.weekly-summary-header p {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.weekly-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
}

.weekly-metric {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 20px;
  background: var(--surface);
  transition: background 0.2s var(--ease);
}

.weekly-metric:hover { background: var(--surface-hover); }

.weekly-metric-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.weekly-metric-info { display: flex; flex-direction: column; }

.weekly-metric-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 3px;
}

.weekly-metric-value {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* --- Responsive --- */
@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .salary-grid { grid-template-columns: 1fr; }
  .weekly-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .compliance-grid { grid-template-columns: 1fr; }
  .leave-balance-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "topbar"
      "main";
  }
  .sidebar { display: none; }
  .scanner-layout { grid-template-columns: 1fr; }
  .report-tabs { flex-wrap: nowrap; }
}

@media (max-width: 600px) {
  .stat-grid { grid-template-columns: 1fr; }
  .main-content { padding: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .modal { max-width: 95%; margin: 10px; }
  .detail-grid { grid-template-columns: 1fr; }
  .weekly-summary-grid { grid-template-columns: 1fr; }
}

/* ===== Notification System ===== */
.notif-wrapper { position: relative; }
.notif-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 18px; height: 18px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
  animation: notif-pulse 2s infinite;
  z-index: 2; pointer-events: none;
  padding: 0 4px;
}
@keyframes notif-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
.notif-dropdown {
  position: absolute; top: 100%; right: 0; margin-top: 8px;
  width: 380px; max-height: 440px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  z-index: 200; overflow: hidden;
  display: none;
}
.notif-dropdown.open { display: block; }
.notif-header {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 14px; font-weight: 700; color: var(--text);
}
.notif-unread-count {
  font-size: 11px; font-weight: 600; color: var(--primary);
  background: var(--primary-subtle); padding: 2px 8px; border-radius: 10px; margin-left: 8px;
}
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid var(--border); transition: background 0.15s;
}
.notif-item:hover { background: var(--surface-hover); }
.notif-item.unread { background: rgba(99, 102, 241, 0.04); }
.notif-item.unread::before {
  content: ''; position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
  width: 6px; height: 6px; background: var(--primary); border-radius: 50%;
}
.notif-item-icon { font-size: 18px; flex-shrink: 0; margin-top: 2px; }
.notif-item-content { flex: 1; min-width: 0; }
.notif-item-title { font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.4; }
.notif-item-msg { font-size: 11px; color: var(--text-secondary); margin-top: 2px; line-height: 1.3; }
.notif-item-time { font-size: 10px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.notif-empty {
  padding: 40px 20px; text-align: center; color: var(--text-muted);
}
.notif-empty i { font-size: 32px; display: block; margin-bottom: 8px; }

/* Late / Warning Toast */
.toast.late {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #1a1a2e; border-color: #f59e0b;
}
.toast.late i { color: #1a1a2e; }
.toast.warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #1a1a2e; border-color: #f59e0b;
}
.toast.warning i { color: #1a1a2e; }

/* ===== Detailed Salary Cards ===== */
.salary-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 8px 0 4px; margin-top: 10px; display: flex; align-items: center; gap: 6px;
}
.salary-section-title.earnings { color: var(--success); }
.salary-section-title.deductions { color: var(--danger); }
.salary-section-title i { font-size: 14px; }

.salary-row.subtotal {
  border-top: 1px dashed var(--border); padding-top: 8px; margin-top: 4px;
  font-weight: 600;
}
.salary-row.deduction-total .salary-row-value { color: var(--danger); }

.late-penalty-row {
  background: var(--danger-subtle); border-radius: 6px; padding: 6px 8px; margin: 2px 0;
}
.salary-row-value.penalty { color: var(--danger); font-weight: 700; }

.salary-attendance-summary {
  display: flex; gap: 12px; padding: 10px 0; margin: 6px 0;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.salary-att-item { display: flex; flex-direction: column; gap: 2px; flex: 1; text-align: center; }
.salary-att-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.salary-att-value { font-size: 14px; font-weight: 700; color: var(--text); }
.salary-att-value.text-danger { color: var(--danger); }

.salary-structure-info {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 16px; margin-bottom: 18px;
}
.salary-structure-header { display: flex; align-items: center; font-size: 12px; color: var(--text); }

.salary-card-penalty { border: 1px solid var(--danger) !important; box-shadow: 0 0 12px rgba(239, 68, 68, 0.1) !important; }
.text-danger { color: var(--danger) !important; }

/* --- Motion Graphics --- */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.stat-card {
  animation: slideUp 0.6s var(--ease) backwards;
}
.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

.table-panel {
  animation: slideUp 0.6s var(--ease) backwards;
  animation-delay: 0.5s;
}

.view-header {
  animation: slideUp 0.5s var(--ease) backwards;
}

/* --- Login Screen --- */
.login-wrapper {
  position: fixed;
  inset: 0;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.login-card {
  width: 100%;
  max-width: 400px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.4s var(--ease) backwards;
}

/* --- Payslip Print Styles --- */
@page {
  size: auto;
  margin: 0mm;
}
@media print {
  @page {
    size: auto;
    margin: 0mm;
  }
  html, body {
    padding: 15mm !important;
    margin: 0 !important;
    background: #fff !important;
  }
  body * {
    visibility: hidden;
  }
  #print-area, #print-area * {
    visibility: visible;
  }
  #print-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
  
  .payslip-container {
    padding: 40px;
    font-family: 'DM Sans', sans-serif;
    color: #000;
  }
  .payslip-header {
    text-align: center;
    border-bottom: 2px solid #000;
    padding-bottom: 20px;
    margin-bottom: 30px;
  }
  .payslip-header h2 { margin: 0 0 8px 0; font-size: 24px; letter-spacing: 1px; }
  .payslip-header p { margin: 0; color: #555; }
  
  .payslip-emp-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #ddd;
    background: #f9f9f9 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  .payslip-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
  }
  .payslip-table th, .payslip-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
  }
  .payslip-table th {
    background: #f1f1f1 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-weight: 600;
  }
  .payslip-totals td {
    border-top: 2px solid #000;
    background: #f9f9f9 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  .payslip-net {
    text-align: right;
    font-size: 20px;
    padding: 20px;
    border: 2px solid #000;
    margin-bottom: 40px;
  }
  .payslip-net h3 { margin: 0; }
  
  .payslip-footer {
    text-align: center;
    font-size: 12px;
    color: #888;
    border-top: 1px solid #ddd;
    padding-top: 20px;
  }
}

.login-wrapper::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 400px;
  background: linear-gradient(135deg, rgba(204,31,45,0.08) 0%, rgba(204,31,45,0) 100%);
  pointer-events: none;
}
.login-card {
  background: var(--card);
  width: 100%;
  max-width: 400px;
  padding: 40px;
  border-radius: 16px;
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
  position: relative;
  z-index: 1;
}

/* ===== QuantumClk Brand Banner ===== */
.quantumclk-dashboard-banner {
  background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
  border: 1px solid rgba(204, 31, 45, 0.3);
  border-radius: 16px;
  padding: 28px 36px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: 0 10px 30px rgba(204, 31, 45, 0.15);
  position: relative;
  overflow: hidden;
  color: #ffffff;
}

.quantum-banner-glow {
  position: absolute;
  top: -50%;
  left: -20%;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(204, 31, 45, 0.25) 0%, rgba(204, 31, 45, 0) 70%);
  pointer-events: none;
  animation: quantum-bg-shift 8s infinite alternate ease-in-out;
  z-index: 1;
}

.quantum-logo-container {
  background: #cc1f2d;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  box-shadow: 0 0 25px rgba(204, 31, 45, 0.6);
  animation: quantum-pulse 2s infinite alternate ease-in-out;
}

@keyframes quantum-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 20px rgba(204, 31, 45, 0.5);
  }
  100% {
    transform: scale(1.06);
    box-shadow: 0 0 35px rgba(204, 31, 45, 0.8), 0 0 15px rgba(255, 51, 68, 0.4);
  }
}

@keyframes quantum-blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

@keyframes quantum-bg-shift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(150px, 50px) scale(1.3); }
}

/* ===== Admin Settings Page ===== */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.settings-card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
}

.settings-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.settings-card-title-group h3 {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 700;
}

.settings-card-title-group p {
  margin: 0;
  font-size: 13px;
}

.settings-card-body {
  padding: 24px;
}

.settings-policy-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
}

.summary-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-color);
}

.settings-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.toggle-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toggle-label {
  font-weight: 600;
  font-size: 15px;
}

.toggle-desc {
  font-size: 13px;
  margin: 0;
}

/* Beautiful Switch Toggle CSS */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--success);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--success);
}

input:checked + .slider:before {
  -webkit-transform: translateX(24px);
  -ms-transform: translateX(24px);
  transform: translateX(24px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.settings-explainer {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.settings-explainer.enabled {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: #166534;
}

.settings-explainer.disabled {
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.2);
  color: #854d0e;
}

.settings-explainer i {
  font-size: 18px;
  margin-top: 2px;
}

.explainer-content strong {
  display: block;
  margin-bottom: 4px;
}

.explainer-content p {
  margin: 0;
}

/* --- Lifecycle Timeline --- */
.lifecycle-timeline {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin: 20px 0;
  padding: 20px 16px 28px;
  background: linear-gradient(135deg, rgba(99,102,241,0.04) 0%, rgba(16,185,129,0.04) 100%);
  border: 2px solid var(--border);
  border-radius: var(--rl);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.6);
}
.lifecycle-timeline::before {
  content: "";
  position: absolute;
  top: 38px;
  left: 50px;
  right: 50px;
  height: 4px;
  background: var(--timeline-progress, linear-gradient(90deg, var(--success) 0%, #cbd5e1 50%, #cbd5e1 100%));
  z-index: 1;
  border-radius: 2px;
  transition: background 0.3s ease;
}
.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  flex: 1;
}
.step-dot {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: bold;
  color: var(--text-muted);
  transition: all 0.3s ease;
  box-shadow: 0 0 0 4px var(--surface), 0 3px 10px rgba(0,0,0,0.1);
}
.timeline-step.completed .step-dot {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
  box-shadow: 0 0 0 5px rgba(16,185,129,0.15), 0 0 14px rgba(16, 185, 129, 0.35);
}
.timeline-step.active .step-dot {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 5px rgba(99,102,241,0.15), 0 0 14px rgba(99,102,241,0.4);
  animation: pulseActive 2s ease-in-out infinite;
}
@keyframes pulseActive {
  0%, 100% { box-shadow: 0 0 0 5px rgba(99,102,241,0.15), 0 0 14px rgba(99,102,241,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(99,102,241,0.2), 0 0 22px rgba(99,102,241,0.55); }
}
.timeline-step.active.danger .step-dot {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
  box-shadow: 0 0 0 5px rgba(239,68,68,0.15), 0 0 14px rgba(239, 68, 68, 0.4);
}
.step-label {
  font-size: 13px;
  font-weight: 800;
  margin-top: 12px;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.timeline-step.completed .step-label {
  color: var(--success);
}
.timeline-step.active .step-label {
  color: var(--primary);
}
.timeline-step.active.danger .step-label {
  color: var(--danger);
}
.step-date {
  font-size: 12px;
  color: var(--text);
  margin-top: 4px;
  font-weight: 600;
  background: var(--surface);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* --- Document Management UI --- */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.doc-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--rl);
  padding: 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
  min-height: 160px;
}
.doc-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
  transform: translateY(-3px);
}
.doc-card-icon {
  font-size: 28px;
  color: var(--primary);
  margin-bottom: 12px;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-subtle), rgba(99,102,241,0.18));
  border-radius: var(--r);
  border: 1px solid rgba(99,102,241,0.15);
}
.doc-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-card-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 14px;
  font-weight: 500;
}
.doc-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  border-top: 2px solid var(--border);
  padding-top: 12px;
  flex-wrap: wrap;
}
.doc-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-weight: 700;
  font-size: 10.5px;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
/* Upload success animation */
@keyframes docUploadSlideIn {
  from { opacity: 0; transform: translateY(16px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes docUploadGlow {
  0% { box-shadow: 0 0 0 0 rgba(16,185,129,0.4), var(--shadow-sm); }
  50% { box-shadow: 0 0 0 6px rgba(16,185,129,0.15), var(--shadow-md); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0), var(--shadow-sm); }
}
.doc-card.just-uploaded {
  animation: docUploadSlideIn 0.5s var(--ease) both, docUploadGlow 1.5s var(--ease) 0.3s;
  border-color: var(--success);
  background: linear-gradient(135deg, rgba(16,185,129,0.03), var(--surface));
}

/* --- Modal Tab Buttons --- */
.tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 20px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font);
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration) var(--ease);
  position: relative;
  margin-bottom: -1px;
}
.tab-btn:hover {
  color: var(--primary);
  background: var(--primary-subtle);
  border-radius: var(--r) var(--r) 0 0;
}
.tab-btn.active {
  color: var(--primary);
  border-bottom: 3px solid var(--primary);
  background: var(--primary-subtle);
  border-radius: var(--r) var(--r) 0 0;
}
.tab-btn .chip {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 8px;
  margin-left: 4px;
}

/* --- View Employee Section Animations --- */
.view-emp-section {
  animation: fadeIn 0.3s var(--ease);
  padding: 4px 0;
}

/* --- Lifecycle Info Grid Enhancement --- */
.lifecycle-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  background: var(--surface);
  border-radius: var(--rl);
  padding: 20px;
  font-size: 13.5px;
  border: 2px solid var(--border);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.lifecycle-info-grid .info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lifecycle-info-grid .info-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.lifecycle-info-grid .info-value {
  font-size: 14px;
  color: var(--text);
  font-weight: 700;
}

/* --- Detail Grid Card Styling --- */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rl);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

/* --- Salary Breakdown Card --- */
.salary-breakdown-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rl);
  padding: 18px;
  margin-top: 8px;
  box-shadow: var(--shadow-sm);
}

.powered-by-quantumclk {
  position: fixed;
  bottom: 12px;
  right: 18px;
  font-size: 8.5px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  z-index: 1000;
  pointer-events: none;
  opacity: 0.5;
  transition: opacity 0.2s;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
.powered-by-quantumclk img {
  height: 9px;
  width: auto;
  vertical-align: middle;
}

/* --- Lifecycle Timeline Customizations (overridden above) --- */

/* ===== Payment History Styles ===== */
.payment-history-section {
  margin-top: 40px;
}

.payment-history-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card-bg);
}

.payment-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.payment-history-table thead th {
  background: var(--hover-bg, #f1f5f9);
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.payment-history-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}

.payment-history-table tbody tr:last-child {
  border-bottom: none;
}

.payment-history-table tbody tr:hover {
  background: var(--hover-bg, #f8fafc);
}

.payment-history-table tbody td {
  padding: 12px 14px;
  vertical-align: middle;
  white-space: nowrap;
}

.ph-emp-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.ph-emp-id {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

/* Status Chips */
.chip-paid {
  background: #dcfce7;
  color: #166534;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  display: inline-block;
}

.chip-revised {
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  display: inline-block;
}

.revised-info {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 3px;
  cursor: help;
}

/* Empty State */
.payment-history-empty {
  text-align: center;
  padding: 60px 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Edit Payment Modal Grid */
.edit-payment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.edit-payment-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.edit-payment-group input {
  width: 100%;
  box-sizing: border-box;
  height: 36px;
  border-radius: 6px;
  padding: 0 10px;
}

/* Auto / Manual Badge */
.edit-net-auto-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  background: #dcfce7;
  color: #166534;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.edit-net-auto-badge.manual {
  background: #e0f2fe;
  color: #0369a1;
}

/* Spinner for loading */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Responsive: stack table on mobile */
@media (max-width: 768px) {
  .edit-payment-grid {
    grid-template-columns: 1fr;
  }
  .payment-history-table-wrap {
    font-size: 12px;
  }
}

