/**
 * Helport AI — Enterprise UI layer (SaaS HRMS)
 * Loads after style.css. Light + dark themes, glass, motion, a11y.
 */

:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --radius-full: 999px;

  --bg: #f1f5f9;
  --bg-elevated: #ffffff;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #ffffff;
  --surface-2: #f8fafc;
  --surface-muted: #f1f5f9;
  --surface-hover: #e2e8f0;
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --border: rgba(148, 163, 184, 0.35);
  --border-strong: #cbd5e1;

  --primary: #10b981;
  --primary-dark: #059669;
  --primary-soft: rgba(16, 185, 129, 0.14);
  --primary-glow: rgba(16, 185, 129, 0.35);
  --secondary: #14b8a6;
  --accent: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.14);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --info: #06b6d4;
  --info-soft: rgba(6, 182, 212, 0.14);

  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 28px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 8px 40px rgba(15, 23, 42, 0.12);
  --glass: blur(14px) saturate(1.2);
  --font: "Plus Jakarta Sans", "DM Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --focus: 0 0 0 3px rgba(16, 185, 129, 0.35);
  --sidebar-w: 272px;
  --topbar-h: 68px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --grad-brand: linear-gradient(135deg, #10b981 0%, #14b8a6 55%, #06b6d4 100%);
  --grad-bg: radial-gradient(1200px 600px at 10% -10%, rgba(16, 185, 129, 0.12), transparent 55%),
             radial-gradient(900px 500px at 100% 0%, rgba(6, 182, 212, 0.1), transparent 50%),
             var(--bg);
}

html[data-theme="dark"] {
  --bg: #0b1220;
  --bg-elevated: #111827;
  --surface: rgba(17, 24, 39, 0.78);
  --surface-solid: #111827;
  --surface-2: #1a2332;
  --surface-muted: #151c2a;
  --surface-hover: #243044;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --border: rgba(148, 163, 184, 0.18);
  --border-strong: rgba(148, 163, 184, 0.28);
  --primary-soft: rgba(16, 185, 129, 0.18);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.45);
  --grad-bg: radial-gradient(1000px 500px at 0% 0%, rgba(16, 185, 129, 0.16), transparent 50%),
             radial-gradient(800px 400px at 100% 0%, rgba(6, 182, 212, 0.12), transparent 45%),
             var(--bg);
}

body {
  font-family: var(--font);
  background: var(--grad-bg);
  background-attachment: fixed;
  color: var(--text);
  transition: background 0.35s var(--ease), color 0.25s ease;
}

/* —— Shell —— */
.sidebar {
  background: var(--surface);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow);
  width: var(--sidebar-w);
  transition: width 0.28s var(--ease), transform 0.28s var(--ease), background 0.3s ease;
}

.sidebar-brand {
  border-bottom-color: var(--border);
}

.sidebar-product {
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sidebar-sub { color: var(--text-dim); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }

.sidebar-group-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 14px 8px 8px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: left;
  margin-bottom: 2px;
}

.nav-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 56%;
  border-radius: 0 4px 4px 0;
  background: var(--grad-brand);
  transition: transform 0.22s var(--ease);
}

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

.nav-item.active {
  background: linear-gradient(90deg, var(--primary-soft), transparent);
  color: var(--primary-dark);
}

html[data-theme="dark"] .nav-item.active { color: #6ee7b7; }

.nav-item.active::before { transform: translateY(-50%) scaleY(1); }
.nav-item.active .nav-ico { color: var(--primary); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 22px;
  background: var(--surface);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset;
}

html[data-theme="dark"] .topbar {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.page-eyebrow { color: var(--text-dim); }
.page-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 600;
  margin-top: 2px;
}
.breadcrumb span[aria-current="page"] { color: var(--primary-dark); }
html[data-theme="dark"] .breadcrumb span[aria-current="page"] { color: #6ee7b7; }
.breadcrumb-sep { opacity: 0.5; }

.header-search-wrap {
  background: var(--surface-muted);
  border-radius: var(--radius-full);
  border-color: var(--border);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.header-search-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: var(--focus);
}

.icon-btn {
  display: inline-flex;
  background: var(--surface-solid);
  border-color: var(--border);
  color: var(--text);
  border-radius: 12px;
  transition: transform 0.15s var(--ease), background 0.15s ease, box-shadow 0.2s ease;
}
.icon-btn:hover {
  background: var(--primary-soft);
  border-color: transparent;
  transform: translateY(-1px);
}

.role-badge {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-color: rgba(16, 185, 129, 0.3);
}
html[data-theme="dark"] .role-badge { color: #6ee7b7; }

.live-clock {
  background: var(--surface-solid);
  border-color: var(--border);
  color: var(--text-muted);
}

.conn-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}
.conn-badge--ok {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-color: rgba(16, 185, 129, 0.35);
}
.conn-badge--warn {
  background: var(--warning-soft);
  color: #b45309;
}

.main-content {
  padding: var(--space-5) var(--space-5) 40px;
  max-width: 1440px;
}

.main-column {
  margin-left: var(--sidebar-w);
  min-width: 0;
  flex: 1;
  transition: margin-left 0.28s var(--ease);
}

body.sidebar-collapsed .main-column { margin-left: 76px; }

/* —— Cards / glass —— */
.card,
.card--glass,
.kpi-card,
.log-filters,
.settings-card,
.auth-box,
.manual-box {
  background: var(--surface);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card:hover,
.card--glass:hover {
  box-shadow: var(--shadow-lg);
}

.kpi-card {
  padding: 18px 18px 16px;
  overflow: hidden;
  transition: transform 0.22s var(--ease), box-shadow 0.22s ease, border-color 0.2s ease;
}
.kpi-card::before {
  width: 3px;
  background: var(--grad-brand);
  opacity: 0.85;
}
.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  background: var(--surface-solid);
  border-color: rgba(16, 185, 129, 0.25);
}
.kpi-card--accent::before { background: var(--primary); }
.kpi-card--warn::before { background: var(--warning); }
.kpi-card--danger::before { background: var(--danger); }
.kpi-card--info::before { background: var(--accent); }
.kpi-card--muted::before { background: var(--text-dim); }

.kpi-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.kpi-ico {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary-dark);
  flex-shrink: 0;
}
.kpi-ico--warn { background: var(--warning-soft); color: #b45309; }
.kpi-ico--danger { background: var(--danger-soft); color: #dc2626; }
.kpi-ico--info { background: var(--info-soft); color: #0891b2; }
.kpi-ico--muted { background: var(--surface-muted); color: var(--text-dim); }

.kpi-label {
  color: var(--text-muted);
  font-size: 0.7rem;
}
.kpi-value {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  background: linear-gradient(180deg, var(--text), var(--text-muted));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
html[data-theme="dark"] .kpi-value {
  background: none;
  color: var(--text);
}

.kpi-grid { gap: 14px; }
.kpi-grid--4 { grid-template-columns: repeat(4, 1fr); }

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 4px;
}
.quick-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-solid);
  box-shadow: var(--shadow);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  color: var(--text);
  text-align: left;
  transition: transform 0.2s var(--ease), border-color 0.2s ease, box-shadow 0.2s ease;
}
.quick-action:hover {
  transform: translateY(-2px);
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: var(--shadow-lg);
}
.quick-action .qa-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--grad-brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.quick-action small {
  display: block;
  font-weight: 500;
  color: var(--text-dim);
  font-size: 0.72rem;
  margin-top: 2px;
}

/* —— Buttons —— */
.btn, button.btn {
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--rx, 50%) var(--ry, 50%), rgba(255, 255, 255, 0.35), transparent 55%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.btn:active::after { opacity: 1; }

.btn.btn-primary, button.btn-primary {
  background: var(--grad-brand);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.28);
}
.btn.btn-primary:hover, button.btn-primary:hover {
  filter: brightness(1.05);
  background: var(--grad-brand);
  border-color: transparent;
  color: #fff;
}

.btn.btn-danger, button.btn-danger {
  background: var(--danger-soft);
  border-color: rgba(239, 68, 68, 0.35);
  color: #b91c1c;
}
html[data-theme="dark"] .btn.btn-danger {
  color: #fecaca;
}

.btn.btn-ghost:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.select, .filter-grid input, .filter-grid select, .auth-box input, .manual-box input {
  background: var(--surface-solid);
  border-color: var(--border-strong);
  border-radius: 12px;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.select:focus, .filter-grid input:focus, .filter-grid select:focus,
.auth-box input:focus, .manual-box input:focus {
  border-color: var(--primary);
  box-shadow: var(--focus);
  outline: none;
}
.select option, .filter-grid select option {
  background: var(--surface-solid);
  color: var(--text);
}

/* —— Tables —— */
.table-wrap--rounded,
.table-wrap {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-solid);
}
.data-table thead th {
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 1;
}
.data-table tbody tr {
  transition: background 0.15s ease, transform 0.15s ease;
}
.data-table tbody tr:hover {
  background: rgba(16, 185, 129, 0.08) !important;
}
.data-table--zebra tbody tr:nth-child(even) {
  background: var(--surface-muted);
}
.badge {
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.72rem;
  padding: 4px 10px;
}
.badge--complete { background: var(--primary-soft); color: #047857; border-color: rgba(16, 185, 129, 0.3); }
.badge--late { background: var(--warning-soft); color: #b45309; }
.badge--missing_out, .badge--working, .badge--logged_in {
  background: var(--info-soft); color: #0e7490;
}
.badge--draft { background: var(--surface-muted); color: var(--text-muted); }
.badge--pending { background: var(--warning-soft); color: #b45309; }
.badge--approved { background: var(--primary-soft); color: #047857; }
.badge--rejected { background: rgba(239, 68, 68, 0.12); color: #b91c1c; }
.badge--archived { background: rgba(100, 116, 139, 0.15); color: #475569; }
.badge--active { background: var(--primary-soft); color: #047857; }
.badge--pending_onboarding { background: var(--info-soft); color: #0e7490; }
.badge--trainee { background: rgba(99, 102, 241, 0.12); color: #4338ca; }
.badge--inactive { background: rgba(100, 116, 139, 0.15); color: #475569; }

/* —— My Employees (Super Admin UX) —— */
.my-emp-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.my-emp-view-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
}
.my-emp-view-toggle .btn.is-active {
  background: var(--surface);
  color: var(--primary-dark);
  box-shadow: var(--shadow);
}
.my-emp-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.my-emp-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 120px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.my-emp-chip strong {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.my-emp-chip span {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}
.my-emp-chip:hover { transform: translateY(-1px); }
.my-emp-chip.is-active {
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}
.my-emp-chip--warn.is-active { border-color: rgba(245, 158, 11, 0.55); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12); }
.my-emp-chip--info.is-active { border-color: rgba(6, 182, 212, 0.5); box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.12); }
.my-emp-filter-actions {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.my-emp-toolbar {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.my-emp-bulk {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.my-emp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.my-emp-card--tl { cursor: default; }
.my-emp-card-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.my-emp-card-id { flex: 1; min-width: 0; }
.my-emp-card-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin: 0;
  font-size: 0.88rem;
}
.my-emp-card-meta dt {
  color: var(--text-muted);
  font-size: 0.75rem;
}
.my-emp-card-meta dd { margin: 0; font-weight: 600; }
.my-emp-card-times { margin-top: 10px; font-size: 0.82rem; }
.my-emp-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.my-emp-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}
.my-emp-card.is-pending {
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.12);
}
.my-emp-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.my-emp-check { display: grid; place-items: center; }
.my-emp-card-titles {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.my-emp-card-titles strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.my-emp-card-summary {
  display: grid;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text);
}
.my-emp-card-summary em {
  font-style: normal;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 6px;
}
.my-emp-missing {
  margin-top: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #b45309;
}
.emp-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}
.emp-avatar--lg { width: 52px; height: 52px; border-radius: 14px; }
.emp-avatar--fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.18));
  color: #047857;
  font-weight: 800;
  font-size: 0.78rem;
}
.my-emp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.my-emp-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}
.my-emp-table tr.is-pending-row td {
  background: rgba(245, 158, 11, 0.06);
}
.my-emp-empty {
  text-align: center;
  padding: 40px 16px;
}
.my-emp-empty strong { display: block; margin-bottom: 6px; font-size: 1.05rem; }
.my-emp-empty .btn { margin-top: 12px; }
.my-emp-skel {
  height: 120px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface-muted), var(--surface-hover), var(--surface-muted));
  background-size: 200% 100%;
  animation: myEmpShimmer 1.2s ease-in-out infinite;
  margin-bottom: 10px;
}
@keyframes myEmpShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Drawer */
.my-emp-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}
.my-emp-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 81;
  width: min(420px, 100vw);
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 40px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  animation: myEmpDrawerIn 0.28s var(--ease) both;
}
.my-emp-drawer.hidden,
.my-emp-drawer-backdrop.hidden { display: none !important; }
@keyframes myEmpDrawerIn {
  from { transform: translateX(18px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.my-emp-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.my-emp-drawer-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.my-emp-drawer-title-row h2 {
  font-size: 1.05rem;
  margin: 0;
  line-height: 1.25;
}
.my-emp-drawer-body {
  flex: 1;
  overflow: auto;
  padding: 14px 16px 20px;
}
.my-emp-drawer-section {
  margin-bottom: 16px;
}
.my-emp-drawer-section h3 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 10px;
}
.my-emp-drawer-ro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  font-size: 0.82rem;
}
.my-emp-drawer-ro dt {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}
.my-emp-drawer-ro dd { margin: 2px 0 0; font-weight: 600; }
.my-emp-drawer-section .auth-label { margin-top: 8px; }
.my-emp-drawer-section input,
.my-emp-drawer-section select,
.my-emp-drawer-section textarea {
  width: 100%;
  margin-top: 4px;
}
.my-emp-drawer-section textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font: inherit;
  background: var(--surface);
  color: var(--text);
  resize: vertical;
}
.my-emp-drawer-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

@media (max-width: 720px) {
  .my-emp-drawer { width: 100vw; }
  .my-emp-chip { min-width: calc(50% - 6px); }
}

/* —— Onboarding modal —— */
.onboard-box {
  max-width: 440px;
  max-height: min(92vh, 720px);
  overflow: auto;
}
.onboard-welcome {
  text-align: center;
  margin-bottom: 12px;
}
.onboard-check {
  width: 52px;
  height: 52px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
  animation: helportIn 0.45s var(--ease) both;
}
.onboard-readonly {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 0.88rem;
}
.onboard-readonly p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0;
}
.onboard-readonly .k {
  color: var(--text-muted);
  font-weight: 600;
}
.onboard-box textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font: inherit;
  background: var(--surface);
  color: var(--text);
  resize: vertical;
}
.qr-gen-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
  align-items: start;
}
.qr-gen-compose .qr-compose-actions,
.qr-download-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.qr-preview-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 30% 20%, rgba(16, 185, 129, 0.12), transparent 55%),
    linear-gradient(160deg, var(--surface-muted), var(--surface));
  border: 1px solid var(--border);
  animation: helportIn 0.4s var(--ease) both;
  position: relative;
}
.qr-preview-stage.is-locked {
  background:
    radial-gradient(circle at 50% 40%, rgba(100, 116, 139, 0.1), transparent 55%),
    linear-gradient(160deg, var(--surface-muted), var(--surface));
}
.qr-preview-lock {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 280px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
  padding: 12px;
}
.qr-preview-lock strong {
  display: block;
  color: var(--text);
  font-size: 1rem;
  letter-spacing: 0.01em;
}
.qr-preview-stage.is-locked .qr-preview-lock {
  display: flex;
}
.qr-preview-stage.is-locked #qrGenCanvas {
  display: none !important;
}
#qrGenCanvas {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  background: #fff;
  transition: width 0.2s var(--ease), transform 0.25s var(--ease);
}
#qrGenCanvas:hover {
  transform: scale(1.02);
}
.qr-preview-status--locked {
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.28);
}
.qr-preview-status--approved {
  color: #047857;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.28);
}
.qr-preview-info {
  margin-top: 12px;
  line-height: 1.45;
  font-size: 0.92rem;
}
.qr-payload-pre {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--surface-muted);
  border: 1px dashed var(--border);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  white-space: pre-wrap;
  color: var(--text);
}
.banner-hint {
  margin-bottom: 14px;
  padding: 12px 14px;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.range-label {
  display: block;
  margin: 10px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.range-label input[type="range"] {
  width: 100%;
  margin-top: 6px;
}
.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  margin-top: 8px;
}
.skeleton-block {
  height: 120px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface-muted), rgba(16, 185, 129, 0.08), var(--surface-muted));
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
@media (max-width: 960px) {
  .qr-gen-layout { grid-template-columns: 1fr; }
}

/* —— Scanner —— */
.scanner-hero, .video-wrap--hero {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  background: #020617;
}
.scan-frame {
  box-shadow: 0 0 0 9999px rgba(2, 6, 23, 0.45);
}
.scan-corner {
  border-color: #34d399;
  filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.8));
}
.scan-line {
  position: absolute;
  left: 8%;
  right: 8%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #34d399, #22d3ee, #34d399, transparent);
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.9);
  animation: scanLaser 2.2s var(--ease) infinite;
  top: 12%;
}
@keyframes scanLaser {
  0% { top: 12%; opacity: 0.4; }
  50% { opacity: 1; }
  100% { top: 88%; opacity: 0.4; }
}
.scanner-hero[data-scan-state="success"] .scan-frame {
  animation: scanPulse 0.6s var(--ease);
}
.scanner-hero[data-scan-state="error"] .video-wrap--hero {
  animation: scanShake 0.45s var(--ease);
}
@keyframes scanPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  50% { box-shadow: 0 0 0 12px rgba(16, 185, 129, 0); }
}
@keyframes scanShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
.scan-employee-banner {
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: var(--shadow);
  animation: helportIn 0.35s var(--ease) both;
}
.video-status-chip {
  backdrop-filter: blur(10px);
  background: rgba(15, 23, 42, 0.65);
  border-radius: var(--radius-full);
}
.live-feed-card { max-height: 640px; }
body.role-scanner .live-feed-card { max-height: none; }

/* —— Auth —— */
.auth-modal {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
}
.auth-box {
  max-width: 420px;
  padding: 28px;
  border-radius: var(--radius-lg);
  animation: helportIn 0.4s var(--ease) both;
}
.auth-box h2 {
  font-weight: 800;
  letter-spacing: -0.04em;
}
.auth-sub { color: var(--text-muted); }

/* —— Charts / heatmap —— */
.bar-fill {
  background: var(--grad-brand);
}
.gbar--present { background: #10b981; }
.gbar--late { background: #f59e0b; }
.gbar--done { background: #64748b; }
.hm-l1 { background: #d1fae5; }
.hm-l2 { background: #6ee7b7; }
.hm-l3 { background: #34d399; }
.hm-l4 { background: #059669; }
html[data-theme="dark"] .hm-l0 { background: #1e293b; }
html[data-theme="dark"] .hm-l1 { background: #064e3b; }
html[data-theme="dark"] .hm-l2 { background: #047857; }
html[data-theme="dark"] .hm-l3 { background: #10b981; }
html[data-theme="dark"] .hm-l4 { background: #34d399; }

.dash-bar-fill {
  background: var(--grad-brand);
  border-radius: 6px;
  transition: width 0.55s var(--ease);
}

/* —— Empty / skeleton —— */
.empty-state--rich {
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-ico {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  font-size: 1.5rem;
}
.skel {
  background: linear-gradient(90deg, var(--surface-muted) 25%, var(--surface-hover) 50%, var(--surface-muted) 75%);
  background-size: 200% 100%;
}

/* —— Toasts —— */
.toast-host {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(380px, calc(100vw - 24px));
}
.toast {
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  color: var(--text);
  font-weight: 600;
  font-size: 0.88rem;
  transform: translateX(24px);
  opacity: 0;
  transition: transform 0.28s var(--ease), opacity 0.28s ease;
}
.toast--show { transform: translateX(0); opacity: 1; }
.toast--success { border-left: 3px solid var(--success); }
.toast--error { border-left: 3px solid var(--danger); }
.toast--info { border-left: 3px solid var(--accent); }

/* —— Theme toggle —— */
.theme-toggle {
  width: 40px;
  height: 40px;
}
.theme-toggle .ico-sun { display: none; }
html[data-theme="dark"] .theme-toggle .ico-moon { display: none; }
html[data-theme="dark"] .theme-toggle .ico-sun { display: block; }

/* —— Motion —— */
@keyframes helportIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.tab-panel.active {
  animation: helportIn 0.34s var(--ease) both;
}
.row-enter {
  animation: helportIn 0.35s var(--ease) both;
}

.system-online-dot {
  background: var(--primary);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  animation: onlinePulse 2s ease infinite;
}
@keyframes onlinePulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Sidebar collapsed */
body.sidebar-collapsed .sidebar { width: 76px; }
body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .sidebar-search,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .sidebar-group-label,
body.sidebar-collapsed .system-online-text {
  display: none !important;
}
body.sidebar-collapsed .nav-item { justify-content: center; padding: 12px; }
body.sidebar-collapsed .nav-item::before { display: none; }

/* Responsive */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .main-column { margin-left: 0; }
  body.sidebar-collapsed .main-column { margin-left: 0; }
  .sidebar-collapse-btn { display: none; }
  .header-search-wrap { display: none; }
  .mobile-nav-toggle { display: inline-flex !important; }
  .sidebar {
    transform: translateX(-105%);
  }
  .sidebar.is-open { transform: translateX(0); }
}
@media (max-width: 640px) {
  .kpi-grid, .kpi-grid--4, .quick-actions { grid-template-columns: 1fr; }
  .page-title { font-size: 1.05rem; }
  .main-content { padding: 14px 12px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .scan-line, .system-online-dot { animation: none !important; }
  .tab-panel.active, .row-enter, .kpi-card, .btn, .nav-item {
    animation: none !important;
    transition: none !important;
  }
}

/* Focus a11y */
:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}
.nav-item:focus-visible,
.btn:focus-visible,
.icon-btn:focus-visible {
  box-shadow: var(--focus);
}

/* —— QR mode tabs —— */
.qr-mode-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  border-radius: var(--radius-full);
  background: var(--surface-muted);
  border: 1px solid var(--border);
}
.qr-mode-tab {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.qr-mode-tab.is-active {
  background: var(--surface-solid);
  color: var(--primary);
  box-shadow: var(--shadow);
}
.qr-mode-tab:hover { color: var(--text); }

/* —— Notification badge & panel —— */
.header-notif-btn { position: relative; }
.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--surface-solid);
}
.notif-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 2px var(--surface-solid);
}
.header-notif-btn[data-unread="1"] .notif-dot { display: none; }
.notif-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(2px);
  z-index: 80;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.notif-backdrop.is-open { opacity: 1; }
.notif-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100vw);
  height: 100vh;
  z-index: 90;
  display: flex;
  flex-direction: column;
  background: var(--surface-solid);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: translateX(104%);
  transition: transform 0.28s var(--ease);
}
.notif-panel.is-open { transform: translateX(0); }
.notif-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 10px;
  border-bottom: 1px solid var(--border);
}
.notif-panel-title { margin: 0; font-size: 1.1rem; }
.notif-panel-sub { margin: 4px 0 0; font-size: 0.82rem; }
.notif-panel-tools {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px 16px 0;
}
.notif-panel-actions {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  flex-wrap: wrap;
}
.notif-panel-list,
.notif-page-list {
  flex: 1;
  overflow: auto;
  padding: 8px 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.notif-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: transform 0.18s var(--ease), border-color 0.18s ease, box-shadow 0.18s ease;
}
.notif-item:hover {
  transform: translateY(-1px);
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: var(--shadow);
}
.notif-item.is-unread {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.28);
}
.notif-item-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.notif-item-top time {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.notif-item-body p {
  margin: 4px 0 8px;
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.notif-item-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.notif-cat {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  background: var(--surface-muted);
  color: var(--text);
}
.notif-cat--approval, .badge--approval, .badge--success { background: var(--primary-soft); color: #047857; }
.notif-cat--rejection, .badge--rejection { background: rgba(239, 68, 68, 0.12); color: #b91c1c; }
.notif-cat--warning, .badge--warning { background: var(--warning-soft); color: #b45309; }
.notif-cat--qr_request, .badge--qr_request { background: var(--info-soft); color: #0e7490; }
.notif-cat--system, .badge--system { background: rgba(100, 116, 139, 0.15); color: #475569; }
.notif-empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-muted);
}
.notif-empty-ico { font-size: 1.6rem; margin-bottom: 8px; }
.notif-page-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.notif-page-toolbar input[type="search"] { flex: 1; min-width: 160px; }

@media (max-width: 640px) {
  .notif-panel { width: 100vw; }
  .qr-mode-tabs { width: 100%; display: flex; }
  .qr-mode-tab { flex: 1; text-align: center; }
}

/* —— QR live preview polish —— */
.qr-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.qr-preview-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text-muted);
}
.qr-preview-status--waiting { color: #64748b; }
.qr-preview-status--invalid {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
}
.qr-preview-status--generating {
  color: #0e7490;
  background: var(--info-soft);
}
.qr-preview-status--ready {
  color: #047857;
  background: var(--primary-soft);
  border-color: rgba(16, 185, 129, 0.35);
}
.qr-preview-stage {
  position: relative;
  min-height: 260px;
}
.qr-preview-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 250, 252, 0.55);
  z-index: 2;
  border-radius: inherit;
}
html[data-theme="dark"] .qr-preview-spinner {
  background: rgba(15, 23, 42, 0.45);
}
#qrGenCanvas.qr-fade {
  animation: qrFadeIn 0.35s var(--ease) both;
}
#qrGenCanvas.is-generating { opacity: 0.55; }
.qr-preview-stage.is-success-flash {
  animation: qrReadyPulse 0.55s var(--ease);
}
@keyframes qrFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes qrReadyPulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.35); }
  100% { box-shadow: 0 0 0 14px rgba(16, 185, 129, 0); }
}
.qr-validation {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #b91c1c;
  font-size: 0.86rem;
}
.qr-validation ul {
  margin: 0;
  padding-left: 18px;
}
.qr-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin-bottom: 8px;
}
.qr-meta-grid .k {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 700;
}
.qr-meta-grid .v {
  font-weight: 650;
  color: var(--text);
}
.qr-compose-actions .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
@media (max-width: 640px) {
  .qr-meta-grid { grid-template-columns: 1fr; }
}

/* —— Live Attendance Feed (table) —— */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.live-feed-toolbar {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 8px;
  padding: 0 14px 12px;
}
.live-feed-toolbar .select,
.live-feed-search input {
  width: 100%;
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 6px 10px;
  font: inherit;
}
.live-feed-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.live-feed-table-wrap {
  max-height: min(520px, 58vh);
  overflow: auto;
  border-top: 1px solid var(--border);
}
.live-feed-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}
.live-feed-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-muted, #f1f5f9);
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 800;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.live-feed-table tbody tr {
  transition: background 0.25s ease, box-shadow 0.35s ease;
  animation: liveFeedRowIn 0.35s ease both;
}
.live-feed-table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.02);
}
.live-feed-table tbody tr:hover {
  background: rgba(16, 185, 129, 0.08);
}
.live-feed-table tbody tr.is-highlight {
  box-shadow: inset 3px 0 0 #10b981;
  background: rgba(16, 185, 129, 0.12);
}
.live-feed-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
.live-feed-emp {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
}
.live-feed-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.8rem;
  background: linear-gradient(145deg, #10b981, #0d9488);
  color: #fff;
  flex-shrink: 0;
}
.live-feed-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.live-feed-name {
  display: block;
  font-size: 0.98rem;
  font-weight: 750;
  line-height: 1.25;
}
.live-feed-nick {
  font-size: 0.78rem;
}
.live-feed-time {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 650;
}
.live-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 750;
  white-space: nowrap;
  border: 1px solid transparent;
}
.live-status-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.live-status-badge--present,
.live-status-badge--timed_in {
  color: #047857;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.28);
}
.live-status-badge--completed {
  color: #1d4ed8;
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.28);
}
.live-status-badge--late {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.28);
}
.live-status-badge--absent {
  color: #64748b;
  background: rgba(100, 116, 139, 0.12);
  border-color: rgba(100, 116, 139, 0.25);
}
.live-feed-empty {
  padding: 36px 16px;
}
@keyframes liveFeedRowIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* —— Scanner snapshot gate —— */
.scanner-gate-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
}
.scanner-gate-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.scanner-gate-copy {
  flex: 1;
  min-width: 180px;
}
.scanner-gate-copy strong {
  display: block;
  font-size: 0.95rem;
}
.scanner-gate-copy p {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.scanner-gate-status--ready {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}
.scanner-gate-status--ready .scanner-gate-dot {
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}
.scanner-gate-status--warn {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
}
.scanner-gate-status--warn .scanner-gate-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
}
.scanner-gate-status--error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.32);
}
.scanner-gate-status--error .scanner-gate-dot {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.18);
}
.scanner-hero.is-gate-blocked {
  opacity: 0.72;
  filter: grayscale(0.15);
}
.snapshot-gate-box p {
  margin: 0 0 10px;
  line-height: 1.45;
}

@media (max-width: 1100px) {
  .live-feed-toolbar {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 720px) {
  .live-feed-toolbar {
    grid-template-columns: 1fr;
  }
  .live-feed-table-wrap {
    max-height: 420px;
  }
  .live-feed-table thead th:nth-child(2),
  .live-feed-table tbody td:nth-child(2),
  .live-feed-table thead th:nth-child(3),
  .live-feed-table tbody td:nth-child(3) {
    display: none;
  }
}

body.role-scanner .live-feed-table thead th {
  background: rgba(12, 18, 24, 0.96);
  color: var(--sc-muted, #8b9aab);
  border-color: var(--sc-border, rgba(0, 230, 118, 0.22));
}
body.role-scanner .live-feed-table td {
  border-color: rgba(0, 230, 118, 0.1);
  color: var(--sc-text, #f4f7fa);
}
body.role-scanner .live-feed-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}
body.role-scanner .live-feed-toolbar .select,
body.role-scanner .live-feed-search input {
  background: #0a1016;
  border-color: var(--sc-border, rgba(0, 230, 118, 0.22));
  color: var(--sc-text, #f4f7fa);
}
html[data-theme='light'] body.role-scanner .live-feed-table thead th {
  background: #f4f8f6;
  color: var(--sc-muted, #5b6f68);
}
html[data-theme='light'] body.role-scanner .live-feed-toolbar .select,
html[data-theme='light'] body.role-scanner .live-feed-search input {
  background: #f4f8f6;
  color: var(--sc-text, #0f1f1a);
}
