/* ── Google Font ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Design Tokens ───────────────────────────────────────────── */
:root {
  --sidebar-w: 258px;
  --topbar-h: 64px;

  /* Backgrounds */
  --bg: #f1f5f9;
  --card-bg: #ffffff;

  /* Sidebar */
  --sidebar-bg: #0d1117;
  --sidebar-border: rgba(255,255,255,.06);
  --sidebar-text: #8b949e;
  --sidebar-hover: rgba(255,255,255,.06);
  --sidebar-active-bg: rgba(59,130,246,.14);
  --sidebar-active-text: #58a6ff;

  /* Accent palette */
  --accent-blue:   #3b82f6;
  --accent-indigo: #6366f1;
  --accent-green:  #10b981;
  --accent-orange: #f59e0b;
  --accent-purple: #8b5cf6;
  --accent-teal:   #06b6d4;
  --accent-pink:   #ec4899;
  --accent-red:    #ef4444;

  /* Text */
  --text:       #0f172a;
  --text-light: #64748b;
  --text-xs:    #94a3b8;

  /* Border */
  --border: #e2e8f0;

  /* Radius */
  --radius:    12px;
  --radius-sm:  8px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow:    0 1px 3px rgba(0,0,0,.1),  0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px  -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.1), 0 10px 10px -5px rgba(0,0,0,.04);
}

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

/* ── Anti-FOUC / tab-switch flash ───────────────────────────── */
.preload *,
.no-transition *,
.no-transition *::before,
.no-transition *::after {
  transition: none !important;
  animation-duration: 0.001s !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── App Layout ──────────────────────────────────────────────── */
#wrapper { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1000;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}

/* Ambient blue glow at top of sidebar */
.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 180% 100px at 50% 0%, rgba(59,130,246,.1) 0%, transparent 100%);
  pointer-events: none;
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Sidebar Brand ───────────────────────────────────────────── */
.sidebar-brand {
  display: flex;
  align-items: flex-start;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--sidebar-border);
}

.brand-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
}

.brand-logo-img {
  height: 40px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.brand-sub { display: block; color: var(--sidebar-text); font-size: 11px; font-weight: 500; padding-left: 2px; }

/* ── Sidebar Nav ─────────────────────────────────────────────── */
.sidebar-nav { flex: 1; padding: 10px 12px; overflow-y: auto; }

.nav-section {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: rgba(139,148,158,.45);
  padding: 14px 8px 6px; margin-top: 2px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 8px;
  transition: all .18s;
  font-size: 13.5px; font-weight: 500;
  margin-bottom: 2px;
}

.nav-item i { font-size: 16px; flex-shrink: 0; width: 20px; text-align: center; }
.nav-item:hover { background: var(--sidebar-hover); color: #e6edf3; }
.nav-item.active { background: var(--sidebar-active-bg); color: var(--sidebar-active-text); font-weight: 600; }
.nav-item.active i { color: var(--sidebar-active-text); }

/* ── Sidebar Footer ──────────────────────────────────────────── */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--sidebar-border);
  display: flex; align-items: center; gap: 10px;
}

.user-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(59,130,246,.3);
}

.user-name { color: #e6edf3; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.user-role { color: var(--sidebar-text); font-size: 11px; display: block; }

.logout-btn {
  margin-left: auto; color: var(--sidebar-text);
  text-decoration: none; font-size: 18px;
  transition: all .2s; padding: 5px; border-radius: 7px;
}
.logout-btn:hover { color: #ef4444; background: rgba(239,68,68,.1); }

/* ── Topbar ──────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 28px; gap: 16px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-xs);
}

.sidebar-toggle {
  background: none; border: none; font-size: 22px;
  cursor: pointer; color: var(--text-light);
  padding: 4px 8px; border-radius: 8px; transition: all .2s; line-height: 1;
}
.sidebar-toggle:hover { background: var(--bg); color: var(--text); }

.page-title { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -.2px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ── Content Area ────────────────────────────────────────────── */
.content-area { padding: 28px; flex: 1; }

.section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-xs);
  margin-bottom: 14px; margin-top: 4px;
}

/* ── Cards ───────────────────────────────────────────────────── */
.gcard {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--card-bg);
}

.gcard-header {
  padding: 14px 20px;
  font-weight: 600; font-size: 14px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex; align-items: center; gap: 8px;
}
.gcard-header i { color: var(--accent-blue); }

/* ── Stat Cards ──────────────────────────────────────────────── */
.stat-card {
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  display: flex; align-items: flex-start; gap: 16px;
  color: #fff; position: relative; overflow: hidden;
}

/* Glass orb accent */
.stat-card::after {
  content: '';
  position: absolute; top: -30%; right: -5%;
  width: 110px; height: 110px; border-radius: 50%;
  background: rgba(255,255,255,.1);
  pointer-events: none;
}

.stat-card.blue   { background: linear-gradient(135deg,#3b82f6,#2563eb); box-shadow:0 4px 20px rgba(59,130,246,.4); }
.stat-card.green  { background: linear-gradient(135deg,#10b981,#059669); box-shadow:0 4px 20px rgba(16,185,129,.4); }
.stat-card.orange { background: linear-gradient(135deg,#f59e0b,#d97706); box-shadow:0 4px 20px rgba(245,158,11,.4); }
.stat-card.purple { background: linear-gradient(135deg,#8b5cf6,#7c3aed); box-shadow:0 4px 20px rgba(139,92,246,.4); }
.stat-card.teal   { background: linear-gradient(135deg,#06b6d4,#0891b2); box-shadow:0 4px 20px rgba(6,182,212,.4); }
.stat-card.pink   { background: linear-gradient(135deg,#ec4899,#db2777); box-shadow:0 4px 20px rgba(236,72,153,.4); }

.stat-icon {
  width: 54px; height: 54px; border-radius: 14px;
  background: rgba(255,255,255,.2); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; flex-shrink: 0;
}

.stat-info { flex: 1; }
.stat-value { font-size: 32px; font-weight: 800; line-height: 1; letter-spacing: -1.5px; }
.stat-label { font-size: 12px; opacity: .85; margin-top: 4px; font-weight: 500; }

/* ── Use Case Cards ──────────────────────────────────────────── */
.usecase-card {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  text-decoration: none; color: var(--text);
  transition: all .25s cubic-bezier(.4,0,.2,1);
  position: relative; overflow: hidden;
}

.usecase-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: #bfdbfe;
  color: var(--text);
}

.usecase-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; margin-bottom: 14px; color: #fff;
}

.usecase-icon.blue   { background:linear-gradient(135deg,#3b82f6,#2563eb); box-shadow:0 4px 12px rgba(59,130,246,.3); }
.usecase-icon.green  { background:linear-gradient(135deg,#10b981,#059669); box-shadow:0 4px 12px rgba(16,185,129,.3); }
.usecase-icon.orange { background:linear-gradient(135deg,#f59e0b,#d97706); box-shadow:0 4px 12px rgba(245,158,11,.3); }
.usecase-icon.purple { background:linear-gradient(135deg,#8b5cf6,#7c3aed); box-shadow:0 4px 12px rgba(139,92,246,.3); }
.usecase-icon.teal   { background:linear-gradient(135deg,#06b6d4,#0891b2); box-shadow:0 4px 12px rgba(6,182,212,.3); }

.usecase-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; letter-spacing: -.2px; }
.usecase-desc  { font-size: 12.5px; color: var(--text-light); line-height: 1.55; }
.usecase-arrow {
  position: absolute; right: 18px; top: 22px;
  font-size: 20px; color: var(--border); transition: all .2s;
}
.usecase-card:hover .usecase-arrow { color: var(--accent-blue); transform: translateX(4px); }

/* ── Upload Zone ─────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 38px 20px;
  text-align: center; cursor: pointer;
  transition: all .25s; background: #fafbfc; position: relative;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent-blue); background: #eff6ff;
}
.upload-zone i { font-size: 42px; color: var(--text-xs); display: block; margin-bottom: 10px; transition: color .2s; }
.upload-zone:hover i, .upload-zone.dragover i { color: var(--accent-blue); }
.upload-zone p { margin: 0; color: var(--text-light); font-size: 14px; font-weight: 500; }
.upload-zone small { color: var(--text-xs); font-size: 12px; }
.file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

/* ── Preview ─────────────────────────────────────────────────── */
.preview-area { margin-top: 14px; }
.preview-area img {
  width: 100%; max-height: 240px; object-fit: contain;
  border-radius: var(--radius); border: 1px solid var(--border); background: #f8fafc;
}

/* ── Result Boxes ────────────────────────────────────────────── */
.result-success {
  background: linear-gradient(135deg,#f0fdf4,#dcfce7);
  color: #166534; padding: 12px 16px;
  border-radius: var(--radius); border: 1px solid #bbf7d0;
  font-size: 13.5px; font-weight: 500;
}

.result-error {
  background: linear-gradient(135deg,#fef2f2,#fee2e2);
  color: #991b1b; padding: 12px 16px;
  border-radius: var(--radius); border: 1px solid #fecaca;
  font-size: 13.5px; font-weight: 500;
}

.result-warning {
  background: linear-gradient(135deg,#fffbeb,#fef3c7);
  color: #92400e; padding: 12px 16px;
  border-radius: var(--radius); border: 1px solid #fde68a;
  font-size: 13.5px; font-weight: 500;
}

.result-info {
  background: linear-gradient(135deg,#eff6ff,#dbeafe);
  color: #1e40af; padding: 12px 16px;
  border-radius: var(--radius); border: 1px solid #bfdbfe;
  font-size: 13.5px; font-weight: 500;
}

/* ── Match Card ──────────────────────────────────────────────── */
.match-card {
  background: #fafbfc; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 10px;
  transition: box-shadow .2s;
}
.match-card:hover { box-shadow: var(--shadow-md); }
.match-rank { font-size: 11px; font-weight: 700; color: var(--text-xs); float: right; }
.match-imgs { display: flex; gap: 10px; margin-bottom: 12px; }
.match-img-box { text-align: center; }
.match-img-box img { width: 88px; height: 88px; object-fit: cover; border-radius: 10px; border: 2px solid var(--border); }
.match-img-box small { display: block; font-size: 10px; color: var(--text-xs); margin-top: 4px; }
.match-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 13px; border-bottom: 1px solid #f1f5f9; }
.match-row:last-child { border-bottom: none; }
.match-row span:first-child { color: var(--text-light); font-size: 12px; }

/* ── Confidence Badge ────────────────────────────────────────── */
.conf-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.conf-badge.high { background:#dcfce7; color:#166534; }
.conf-badge.mid  { background:#fef9c3; color:#854d0e; }
.conf-badge.low  { background:#fee2e2; color:#991b1b; }

/* ── Activity Badges ─────────────────────────────────────────── */
.activity-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  background: #f1f5f9; color: #475569;
}
.activity-badge::before { content:''; width:6px; height:6px; border-radius:50%; background:currentColor; opacity:.55; flex-shrink:0; }
.activity-badge.face_add           { background:#dbeafe; color:#1d4ed8; }
.activity-badge.face_verify        { background:#dcfce7; color:#166534; }
.activity-badge.face_search        { background:#f3e8ff; color:#6d28d9; }
.activity-badge.helmet_detect      { background:#ffedd5; color:#c2410c; }
.activity-badge.face_detect        { background:#fce7f3; color:#be185d; }
.activity-badge.login              { background:#ecfdf5; color:#065f46; }
.activity-badge.logout             { background:#fef2f2; color:#dc2626; }
.activity-badge.face_upload_failed { background:#fee2e2; color:#991b1b; }

/* ── Tables ──────────────────────────────────────────────────── */
.table { font-size: 13.5px; }
.table th {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-xs); font-weight: 700;
  border-bottom: 1px solid var(--border);
  padding: 12px 16px; background: #fafbfc; white-space: nowrap;
}
.table td { padding: 13px 16px; vertical-align: middle; border-color: #f1f5f9; }
.table-hover tbody tr:hover { background: #f8fafc; }

/* ── Empty State ─────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 56px 24px; color: var(--text-light); }
.empty-state i { font-size: 52px; display: block; margin-bottom: 14px; opacity: .22; }
.empty-state p { margin: 0; font-size: 15px; font-weight: 500; }

/* ── Loading ─────────────────────────────────────────────────── */
.loading-text { color:var(--text-light); font-size:13px; padding:10px 0; display:flex; align-items:center; gap:8px; }

/* ── Detection Cards ─────────────────────────────────────────── */
.detection-result-card {
  border-radius: var(--radius-lg); padding: 22px;
  display: flex; gap: 18px; align-items: flex-start;
}
.detection-result-card.success { background:linear-gradient(135deg,#f0fdf4,#dcfce7); border:1px solid #bbf7d0; }
.detection-result-card.warning { background:linear-gradient(135deg,#fffbeb,#fef3c7); border:1px solid #fde68a; }
.detection-result-card.danger  { background:linear-gradient(135deg,#fef2f2,#fee2e2); border:1px solid #fecaca; }
.det-icon    { font-size: 40px; flex-shrink: 0; }
.det-title   { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.det-status  { font-size: 15px; font-weight: 600; }
.det-message { font-size: 13px; color: var(--text-light); margin-top: 4px; }
.result-image { max-width:100%; max-height:280px; border-radius:var(--radius); border:1px solid var(--border); object-fit:contain; }

/* ── Detection Option Selector ───────────────────────────────── */
.detect-option-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 8px; border: 2px solid var(--border);
  border-radius: var(--radius); cursor: pointer; transition: all .2s;
  color: var(--text-light); font-size: 13px; font-weight: 500;
  background: #fafbfc; text-align: center; gap: 8px;
}
.detect-option-card i { font-size: 26px; }
.detect-option-card:hover { border-color: var(--accent-blue); color: var(--accent-blue); background: #eff6ff; }
.detect-option-card.selected {
  border-color: var(--accent-blue); background: #eff6ff;
  color: var(--accent-blue); box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

/* ── Log Thumbnail ───────────────────────────────────────────── */
.log-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }

/* ── Face Card (used in admin & list views) ──────────────────── */
.face-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.face-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.face-img-wrap { position: relative; }
.face-img { width: 100%; height: 180px; object-fit: cover; }
.face-id-badge {
  position: absolute; bottom: 8px; left: 8px;
  background: rgba(0,0,0,.72); backdrop-filter: blur(4px);
  color: #fff; font-size: 11px; padding: 3px 10px;
  border-radius: 20px; font-weight: 600;
}
.face-card-body { padding: 12px 14px; }
.face-name  { font-weight: 700; font-size: 14px; margin-bottom: 5px; }
.face-meta  { font-size: 12px; color: var(--text-light); display: flex; align-items: center; gap: 5px; margin-bottom: 2px; }
.face-card-actions { padding: 10px 14px; border-top: 1px solid var(--border); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn { font-weight: 500; border-radius: var(--radius-sm); font-size: 13.5px; transition: all .2s; }

.btn-primary { background:linear-gradient(135deg,#3b82f6,#2563eb); border:none; color:#fff; }
.btn-primary:hover { background:linear-gradient(135deg,#2563eb,#1d4ed8); color:#fff; box-shadow:0 4px 14px rgba(59,130,246,.35); transform:translateY(-1px); }

.btn-danger { background:linear-gradient(135deg,#ef4444,#dc2626); border:none; color:#fff; }
.btn-danger:hover { background:linear-gradient(135deg,#dc2626,#b91c1c); color:#fff; box-shadow:0 4px 14px rgba(239,68,68,.35); }

.btn-success { background:linear-gradient(135deg,#10b981,#059669); border:none; color:#fff; }
.btn-success:hover { background:linear-gradient(135deg,#059669,#047857); color:#fff; box-shadow:0 4px 14px rgba(16,185,129,.35); }

/* ── Form Controls ───────────────────────────────────────────── */
.form-control, .form-select {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px; padding: 9px 14px;
  transition: border-color .2s, box-shadow .2s;
  color: var(--text);
}
.form-control:focus, .form-select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
  outline: none;
}
.form-label { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }

/* ── Login / Register ────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0d1117 0%, #0f172a 45%, #1e1b4b 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; position: relative; overflow: hidden;
}

/* Ambient background orbs */
.login-page::before {
  content: '';
  position: absolute; width: 700px; height: 700px; border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,.12) 0%, transparent 70%);
  top: -250px; left: -200px; pointer-events: none;
}
.login-page::after {
  content: '';
  position: absolute; width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, rgba(139,92,246,.1) 0%, transparent 70%);
  bottom: -200px; right: -150px; pointer-events: none;
}

.login-card {
  background: rgba(255,255,255,.99);
  border-radius: 24px; padding: 44px 40px;
  width: 100%; max-width: 440px;
  box-shadow: 0 32px 64px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.06);
  position: relative; z-index: 1;
  margin-top: 32px;
}

.login-card-logo {
  position: absolute;
  top: -32px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border-radius: 14px;
  padding: 8px 14px;
  box-shadow: 0 4px 18px rgba(0,0,0,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

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

.login-logo {
  margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
}

.login-logo img { height: 64px; width: auto; object-fit: contain; }

.login-header h2 { margin: 0 0 6px; font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.login-header p  { margin: 0; color: var(--text-light); font-size: 13.5px; }

.panel-toggle {
  display: flex; background: var(--bg);
  border-radius: 10px; padding: 4px;
  margin-bottom: 22px; border: 1px solid var(--border);
}

.panel-btn {
  flex: 1; text-align: center; padding: 9px;
  border-radius: 7px; text-decoration: none;
  color: var(--text-light); font-size: 13px; font-weight: 500;
  transition: all .2s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.panel-btn.active { background: var(--card-bg); color: var(--accent-blue); box-shadow: var(--shadow); font-weight: 600; }

.input-icon { position: relative; }
.input-icon i {
  position: absolute; left: 13px; top: 50%;
  transform: translateY(-50%); color: var(--text-xs);
  pointer-events: none; font-size: 15px;
}
.input-icon input { padding-left: 38px !important; }

.btn-login {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff; border: none; padding: 13px;
  font-size: 14.5px; font-weight: 600; border-radius: var(--radius);
  transition: all .2s; letter-spacing: .1px; width: 100%;
}
.btn-login:hover {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff; transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(59,130,246,.45);
}

.login-footer { text-align: center; color: var(--text-light); font-size: 13px; margin-top: 18px; }
.login-footer a { color: var(--accent-blue); text-decoration: none; font-weight: 600; }

.demo-hint {
  background: #f8fafc; border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px;
  text-align: center; margin-top: 14px;
}

/* ── Auth v2 — Split Panel ───────────────────────────────────── */
body.auth-layout { margin:0; padding:0; background:#0b1120; overflow:hidden; }
body.auth-layout .fa-auth { height:100vh; overflow:hidden auto; }
.fa-auth { display:flex; min-height:100vh; font-family:var(--font); }

.fa-brand {
  position:relative; width:42%; min-width:300px;
  overflow:hidden; display:flex; flex-direction:column; background:#0b1120;
}
.fa-scan-canvas { position:absolute; inset:0; width:100%; height:100%; display:block; }
.fa-brand-inner {
  position:relative; z-index:2; display:flex; flex-direction:column;
  min-height:100vh; padding:38px 36px; box-sizing:border-box;
}
.fa-brand-logo { height:34px; width:auto; object-fit:contain; filter:brightness(0) invert(1); opacity:.8; }
.fa-brand-spacer { flex:1; }
.fa-scan-status {
  display:inline-flex; align-items:center; gap:8px;
  font-size:10px; font-weight:700; letter-spacing:2.5px;
  text-transform:uppercase; color:var(--fc-css,#3b82f6); margin-bottom:16px;
}
.fa-scan-pulse {
  width:7px; height:7px; border-radius:50%;
  background:var(--fc-css,#3b82f6); animation:faPulse 1.8s ease-in-out infinite;
}
@keyframes faPulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:.3; transform:scale(.6); }
}
.fa-brand-title { font-size:28px; font-weight:800; color:#fff; line-height:1.2; margin:0 0 10px; letter-spacing:-.4px; }
.fa-brand-desc  { font-size:13px; color:rgba(255,255,255,.38); margin:0 0 26px; line-height:1.65; }
.fa-brand-features { display:flex; flex-direction:column; gap:10px; }
.fa-brand-feature  { display:flex; align-items:center; gap:10px; font-size:13px; color:rgba(255,255,255,.5); }
.fa-feat-chip {
  width:30px; height:30px; border-radius:8px;
  background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.09);
  display:flex; align-items:center; justify-content:center;
  font-size:14px; color:var(--fc-css,#3b82f6); flex-shrink:0;
}

.fa-form-panel {
  flex:1; background:#fff;
  display:flex; align-items:center; justify-content:center;
  padding:60px 48px; overflow-y:auto;
}
.fa-form-inner { width:100%; max-width:360px; }
.fa-form-logo  { display:block; height:34px; width:auto; object-fit:contain; margin:0 auto 32px; }
.fa-form-badge {
  display:inline-flex; align-items:center; gap:6px;
  font-size:10.5px; font-weight:700; letter-spacing:1.5px;
  text-transform:uppercase; padding:5px 12px; border-radius:99px; margin-bottom:14px;
}
.fa-form-badge.user  { background:#eff6ff; color:#1d4ed8; }
.fa-form-badge.admin { background:#fffbeb; color:#b45309; }
.fa-form-title { font-size:25px; font-weight:800; color:#0f172a; margin:0 0 6px; letter-spacing:-.4px; }
.fa-form-sub   { font-size:13.5px; color:#64748b; margin:0 0 26px; line-height:1.55; }
.fa-divider    { height:1px; background:#e2e8f0; margin:24px 0; }

.fa-flash { padding:10px 14px; border-radius:10px; font-size:13px; margin-bottom:16px; border:1px solid; display:flex; align-items:flex-start; gap:8px; }
.fa-flash.danger  { background:#fef2f2; border-color:#fecaca; color:#991b1b; }
.fa-flash.warning { background:#fffbeb; border-color:#fde68a; color:#92400e; }
.fa-flash.success { background:#f0fdf4; border-color:#bbf7d0; color:#166534; }
.fa-flash.info    { background:#eff6ff; border-color:#bfdbfe; color:#1e40af; }

.fa-field { margin-bottom:15px; }
.fa-label { display:block; font-size:12.5px; font-weight:600; color:#0f172a; margin-bottom:6px; }
.fa-input-wrap { position:relative; }
.fa-input-wrap .fa-input-icon {
  position:absolute; left:13px; top:50%; transform:translateY(-50%);
  color:#94a3b8; font-size:15px; pointer-events:none; transition:color .2s;
}
.fa-input {
  width:100%; box-sizing:border-box; height:46px; padding:0 14px 0 40px;
  border:1.5px solid #e2e8f0; border-radius:11px; font-size:14px; color:#0f172a;
  background:#f8fafc; outline:none; font-family:inherit;
  transition:border-color .2s,box-shadow .2s,background .2s;
}
.fa-input:focus { border-color:#3b82f6; background:#fff; box-shadow:0 0 0 3px rgba(59,130,246,.1); }
.fa-input.admin-input:focus { border-color:#f59e0b; box-shadow:0 0 0 3px rgba(245,158,11,.12); }

.fa-btn {
  width:100%; height:48px; border:none; border-radius:11px;
  color:#fff; font-size:14.5px; font-weight:700; cursor:pointer;
  display:flex; align-items:center; justify-content:center; gap:8px;
  letter-spacing:.15px; margin-top:4px; font-family:inherit;
  transition:transform .15s,box-shadow .2s;
}
.fa-btn.user-btn  { background:linear-gradient(135deg,#1d4ed8,#3b82f6); box-shadow:0 4px 18px rgba(29,78,216,.28); }
.fa-btn.user-btn:hover  { transform:translateY(-1px); box-shadow:0 8px 26px rgba(29,78,216,.4); }
.fa-btn.admin-btn { background:linear-gradient(135deg,#b45309,#f59e0b); box-shadow:0 4px 18px rgba(180,83,9,.28); }
.fa-btn.admin-btn:hover { transform:translateY(-1px); box-shadow:0 8px 26px rgba(180,83,9,.4); }
.fa-btn:active { transform:translateY(0) !important; }

.fa-form-footer { text-align:center; margin-top:20px; font-size:13px; color:#64748b; }
.fa-form-footer a { color:#3b82f6; text-decoration:none; font-weight:600; }
.fa-form-footer a:hover { text-decoration:underline; }

@media (max-width:768px) {
  .fa-brand { display:none; }
  .fa-form-panel { padding:40px 24px; }
}

/* ── Profile ─────────────────────────────────────────────────── */
.profile-avatar {
  width: 90px; height: 90px; border-radius: 22px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff; font-size: 38px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
  box-shadow: 0 10px 28px rgba(59,130,246,.38);
}

.profile-info { background: var(--bg); border-radius: var(--radius); padding: 4px 0; }
.profile-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; font-size: 13.5px;
  border-bottom: 1px solid var(--border);
}
.profile-row:last-child { border-bottom: none; }
.profile-row > i { color: var(--accent-blue); width: 18px; text-align: center; }

.mini-avatar {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .content-area { padding: 18px; }
  .stat-value { font-size: 24px; }
  .login-card { padding: 32px 24px; }
}

/* ══════════════════════════════════════════════════════════════
   Premium Content UI — v2
   ══════════════════════════════════════════════════════════════ */

/* ── Page Header ─────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 28px; flex-wrap: wrap;
}
.page-header-left { display: flex; align-items: center; gap: 16px; }
.ph-icon {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff;
}
.ph-icon.blue   { background: linear-gradient(135deg,#3b82f6,#2563eb); box-shadow:0 4px 14px rgba(59,130,246,.35); }
.ph-icon.green  { background: linear-gradient(135deg,#10b981,#059669); box-shadow:0 4px 14px rgba(16,185,129,.35); }
.ph-icon.orange { background: linear-gradient(135deg,#f59e0b,#d97706); box-shadow:0 4px 14px rgba(245,158,11,.35); }
.ph-icon.purple { background: linear-gradient(135deg,#8b5cf6,#7c3aed); box-shadow:0 4px 14px rgba(139,92,246,.35); }
.ph-icon.teal   { background: linear-gradient(135deg,#06b6d4,#0891b2); box-shadow:0 4px 14px rgba(6,182,212,.35); }
.ph-icon.pink   { background: linear-gradient(135deg,#ec4899,#db2777); box-shadow:0 4px 14px rgba(236,72,153,.35); }
.ph-title { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -.4px; margin: 0 0 3px; }
.ph-sub   { font-size: 13px; color: var(--text-light); margin: 0; }
.ph-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ── Welcome Banner ──────────────────────────────────────────── */
.welcome-banner {
  background: linear-gradient(135deg, #0b1120, #1e293b);
  border-radius: var(--radius-xl); padding: 26px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 28px; position: relative; overflow: hidden;
}
.welcome-banner::before {
  content: ''; position: absolute; top: -40px; right: 60px;
  width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,.2) 0%, transparent 70%);
  pointer-events: none;
}
.welcome-banner::after {
  content: ''; position: absolute; bottom: -30px; right: -20px;
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,.15) 0%, transparent 70%);
  pointer-events: none;
}
.wb-title { font-size: 20px; font-weight: 800; color: #fff; margin: 0 0 4px; letter-spacing: -.3px; }
.wb-sub   { font-size: 13px; color: rgba(255,255,255,.45); margin: 0; }
.wb-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(59,130,246,.2); border: 1px solid rgba(59,130,246,.3);
  color: #93c5fd; font-size: 11px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  padding: 4px 12px; border-radius: 99px; margin-bottom: 10px;
}
.wb-icon { font-size: 52px; color: rgba(99,102,241,.25); flex-shrink: 0; position: relative; z-index: 1; }

/* ── Enhanced Card Header ────────────────────────────────────── */
.card-hdr {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 15px 20px;
  font-weight: 700; font-size: 14px; letter-spacing: -.1px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to right, #fafbff, #f8fafc);
  border-radius: var(--radius) var(--radius) 0 0;
}
.card-hdr-left { display: flex; align-items: center; gap: 10px; }
.card-hdr-icon {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: #fff;
}
.card-hdr-icon.blue   { background: linear-gradient(135deg,#3b82f6,#2563eb); }
.card-hdr-icon.green  { background: linear-gradient(135deg,#10b981,#059669); }
.card-hdr-icon.orange { background: linear-gradient(135deg,#f59e0b,#d97706); }
.card-hdr-icon.purple { background: linear-gradient(135deg,#8b5cf6,#7c3aed); }
.card-hdr-icon.teal   { background: linear-gradient(135deg,#06b6d4,#0891b2); }
.card-hdr-icon.pink   { background: linear-gradient(135deg,#ec4899,#db2777); }

/* ── Step Header ─────────────────────────────────────────────── */
.step-header {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 20px; border-bottom: 1px solid var(--border);
  background: linear-gradient(to right, #fafbff, #f8fafc);
  border-radius: var(--radius) var(--radius) 0 0;
}
.step-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg,#3b82f6,#2563eb); color: #fff;
  font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(59,130,246,.35);
}
.step-num.done { background: linear-gradient(135deg,#10b981,#059669); box-shadow: 0 2px 8px rgba(16,185,129,.35); }
.step-title { font-size: 14px; font-weight: 700; color: var(--text); margin: 0; }
.step-sub   { font-size: 12px; color: var(--text-xs); margin: 0; }

/* ── Section Label ───────────────────────────────────────────── */
.section-lbl {
  display: flex; align-items: center; justify-content: space-between;
  margin: 24px 0 14px;
}
.section-lbl-text {
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-xs);
}

/* ── Filter Bar ──────────────────────────────────────────────── */
.filter-bar {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 13px 18px; display: flex; gap: 10px; flex-wrap: wrap;
  align-items: center; margin-bottom: 20px; box-shadow: var(--shadow-xs);
}
.filter-bar-label {
  font-size: 11px; font-weight: 700; color: var(--text-xs);
  text-transform: uppercase; letter-spacing: .07em; white-space: nowrap;
}

/* ── Premium Table ───────────────────────────────────────────── */
.ptable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ptable thead th {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-xs); font-weight: 700; padding: 11px 16px;
  border-bottom: 1.5px solid var(--border); background: #fafbfc; white-space: nowrap;
}
.ptable tbody td { padding: 13px 16px; vertical-align: middle; border-bottom: 1px solid #f1f5f9; }
.ptable tbody tr:last-child td { border-bottom: none; }
.ptable tbody tr:hover td { background: #f8fafc; }

/* ── Action Buttons ──────────────────────────────────────────── */
.action-group { display: flex; gap: 5px; align-items: center; }
.action-btn {
  width: 31px; height: 31px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; cursor: pointer; transition: all .18s;
  border: 1px solid var(--border); background: #fff; color: var(--text-light);
  text-decoration: none;
}
.action-btn:hover { transform: translateY(-1px); }
.action-btn.view   { color:#0891b2; border-color:#bae6fd; background:#f0f9ff; }
.action-btn.view:hover   { background:#e0f2fe; }
.action-btn.edit   { color:#6366f1; border-color:#c7d2fe; background:#eef2ff; }
.action-btn.edit:hover   { background:#e0e7ff; }
.action-btn.pause  { color:#d97706; border-color:#fde68a; background:#fffbeb; }
.action-btn.pause:hover  { background:#fef3c7; }
.action-btn.play   { color:#059669; border-color:#a7f3d0; background:#ecfdf5; }
.action-btn.play:hover   { background:#d1fae5; }
.action-btn.delete { color:#dc2626; border-color:#fecaca; background:#fef2f2; }
.action-btn.delete:hover { background:#fee2e2; }

/* ── Profile Hero ────────────────────────────────────────────── */
.profile-hero {
  background: linear-gradient(135deg, #0b1120, #1e293b);
  border-radius: var(--radius-xl); padding: 32px 28px 24px;
  position: relative; overflow: hidden; margin-bottom: 0;
}
.profile-hero::before {
  content: ''; position: absolute; top: -60px; right: -40px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,.2) 0%, transparent 70%);
  pointer-events: none;
}
.ph-avatar {
  width: 72px; height: 72px; border-radius: 18px;
  background: linear-gradient(135deg, #3b82f6, #6366f1); color: #fff;
  font-size: 28px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(59,130,246,.4); border: 2px solid rgba(255,255,255,.15);
  margin-bottom: 14px;
}
.ph-name { font-size: 20px; font-weight: 800; color: #fff; margin: 0 0 4px; letter-spacing: -.3px; }
.ph-role-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(59,130,246,.2); border: 1px solid rgba(59,130,246,.3);
  color: #93c5fd; font-size: 11px; font-weight: 700;
  padding: 3px 12px; border-radius: 99px; margin-bottom: 18px;
}
.ph-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.ph-stat {
  display: flex; flex-direction: column; padding: 10px 16px;
  background: rgba(255,255,255,.07); border-radius: 10px;
  border: 1px solid rgba(255,255,255,.1); min-width: 80px;
}
.ph-stat-val { font-size: 20px; font-weight: 800; color: #fff; line-height: 1; }
.ph-stat-lbl { font-size: 11px; color: rgba(255,255,255,.45); margin-top: 3px; }

.pinfo-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 13.5px;
}
.pinfo-row:last-child { border-bottom: none; }
.pinfo-ico {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: #f1f5f9; display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: var(--accent-blue);
}
.pinfo-lbl { font-size: 11px; color: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.pinfo-val { font-size: 13.5px; color: var(--text); font-weight: 500; }

/* ── Stat card v2 (optional trend line) ─────────────────────── */
.stat-trend {
  font-size: 11px; font-weight: 600; opacity: .75;
  display: flex; align-items: center; gap: 3px; margin-top: 6px;
}

/* ── Report Bar ──────────────────────────────────────────────── */
.report-item {
  display: flex; flex-direction: column; gap: 5px;
  padding: 12px 0; border-bottom: 1px solid #f1f5f9;
}
.report-item:last-child { border-bottom: none; }
.report-item-top { display: flex; justify-content: space-between; align-items: center; }
.report-bar {
  height: 6px; border-radius: 99px; background: #f1f5f9; overflow: hidden;
}
.report-bar-fill {
  height: 100%; border-radius: 99px; transition: width .6s cubic-bezier(.4,0,.2,1);
  background: linear-gradient(90deg, #3b82f6, #6366f1);
}
.report-bar-fill.green { background: linear-gradient(90deg, #10b981, #059669); }

/* ── Checkin status pills ────────────────────────────────────── */
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 12px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.status-pill.approved { background:#d1fae5; color:#065f46; }
.status-pill.rejected { background:#fee2e2; color:#991b1b; }
.status-pill.active   { background:#dbeafe; color:#1e40af; }
.status-pill.inactive { background:#f1f5f9; color:#64748b; }

/* ── Code chip ───────────────────────────────────────────────── */
.code-chip { font-size:11.5px; background:#f1f5f9; border:1px solid #e2e8f0; padding:2px 8px; border-radius:6px; font-family:monospace; color:#334155; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 992px) {
  .page-header { flex-direction: column; gap: 12px; }
  .ph-actions { width: 100%; }
  .welcome-banner { flex-direction: column; align-items: flex-start; }
  .wb-icon { display: none; }
}
@media (max-width: 576px) {
  .ph-icon { width: 42px; height: 42px; font-size: 18px; border-radius: 11px; }
  .ph-title { font-size: 18px; }
  .ph-stats { gap: 8px; }
  .ph-stat { padding: 8px 12px; }
}
