:root {
  --bg: #f1f5f9;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-muted: #f1f5f9;
  --surface-hover: #e2e8f0;
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --primary: #10b981;
  --primary-dark: #059669;
  --primary-soft: rgba(16, 185, 129, 0.14);
  --primary-glow: rgba(16, 185, 129, 0.32);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.14);
  --info: #06b6d4;
  --info-soft: rgba(6, 182, 212, 0.14);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --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.32);
  --sidebar-w: 272px;
  --topbar-h: 68px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body.auth-locked .app-shell {
  pointer-events: none;
  filter: saturate(0.85) brightness(0.72);
}

body.auth-locked .auth-modal {
  pointer-events: auto;
  filter: none;
}

/* —— Shell —— */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 14px 16px;
  transition: transform 0.28s var(--ease), width 0.28s var(--ease);
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

[data-roles-hide="1"] { display: none !important; }
.role-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: #0f766e;
  border: 1px solid rgba(13, 148, 136, 0.25);
  white-space: nowrap;
}
.skel {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skel 1.2s ease infinite;
  border-radius: 8px;
  min-height: 14px;
}
@keyframes skel {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.tab-panel.active { animation: helportIn 0.32s var(--ease) both; }
.nav-item { transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.15s var(--ease); }
.nav-item:active { transform: scale(0.98); }
.btn { transition: background 0.18s var(--ease), transform 0.12s var(--ease), box-shadow 0.18s var(--ease); }
.btn:hover { transform: translateY(-1px); }
.kpi-card { transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s; }
.kpi-card:hover { box-shadow: var(--shadow); }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

.sidebar-logo {
  display: inline-flex;
  background: #fff;
  border-radius: 8px;
  padding: 4px 6px;
  line-height: 0;
  border: 1px solid var(--border);
}

.sidebar-logo-img {
  display: block;
  height: 40px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
}

.sidebar-product {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
}

.sidebar-sub {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
  padding: 0 2px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.nav-item:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-color: rgba(13, 148, 136, 0.28);
  box-shadow: 0 0 0 1px rgba(13, 148, 136, 0.08);
}

.nav-item.active .nav-ico { color: var(--primary-dark); }
.nav-ico { display: inline-flex; color: inherit; opacity: 0.9; }
.nav-label { flex: 1; }

.sidebar-footer {
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: 12px;
}

.system-online {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.system-online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
  animation: pulseDot 2.2s ease infinite;
}

.system-online.is-offline .system-online-dot {
  background: var(--warning);
  box-shadow: 0 0 10px rgba(247, 144, 9, 0.45);
  animation: none;
}

.system-online.is-offline .system-online-text { color: var(--warning); }

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 35;
  backdrop-filter: blur(2px);
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-brand-compact {
  display: none;
  background: #000;
  border-radius: 6px;
  padding: 4px 6px;
  line-height: 0;
  border: 1px solid var(--border);
}
.topbar-brand-compact img {
  display: block;
  height: 28px;
  width: auto;
  object-fit: contain;
}

.page-heading { min-width: 0; }
.page-eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 2px;
}
.page-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.live-clock {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-hover); }

.main-content {
  flex: 1;
  padding: 20px 22px 28px;
  max-width: 1400px;
  width: 100%;
}

.app-footer {
  text-align: center;
  padding: 16px 20px 24px;
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* —— Controls —— */
.btn, button.btn {
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: 40px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.btn:hover, button.btn:hover {
  background: var(--surface-hover);
  border-color: rgba(255, 255, 255, 0.18);
}

.btn:active { transform: translateY(1px); }

.btn:focus-visible, button:focus-visible, .select:focus-visible, input:focus-visible, .nav-item:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.btn.btn-primary, button.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 6px 16px var(--primary-glow);
}
.btn.btn-primary:hover, button.btn-primary:hover {
  background: var(--primary-dark);
  color: #ffffff;
  border-color: var(--primary-dark);
}

.btn.btn-danger, button.btn-danger {
  background: var(--danger-soft);
  border-color: rgba(239, 68, 68, 0.35);
  color: #b91c1c;
}
.btn.btn-ghost, button.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}
.btn.btn-ghost:hover, button.btn-ghost:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.btn-ico {
  display: inline-block;
  margin-right: 4px;
  font-size: 0.7em;
}

.select, .filter-grid input, .filter-grid select, .auth-box input, .manual-box input {
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  min-height: 40px;
}

.select option, .filter-grid select option { background: var(--surface); color: var(--text); }

.attendance-mode-select {
  min-width: 150px;
  font-weight: 600;
}

.flex { display: flex; align-items: center; gap: 8px; }
input[type="file"] { display: none; }

.card {
  background: var(--surface);
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.card--flush { padding: 14px; }
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 8px;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: helportIn 0.28s var(--ease) both; }

.page-intro { margin-bottom: 16px; }
.section-title { font-size: 1.1rem; margin-bottom: 4px; font-weight: 700; letter-spacing: -0.02em; }
.section-sub { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 0; }

/* —— Dashboard —— */
.dashboard { display: grid; gap: 16px; }

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

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: border-color 0.18s ease, transform 0.18s var(--ease), background 0.18s ease;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-strong);
}

.kpi-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
  background: var(--surface-2);
}

.kpi-card--accent::before { background: var(--primary); box-shadow: 0 0 12px var(--primary-glow); }
.kpi-card--warn::before { background: var(--warning); }
.kpi-card--danger::before { background: var(--danger); }
.kpi-card--info::before { background: var(--info); }
.kpi-card--muted::before { background: var(--text-dim); }

.kpi-card--compact { padding: 12px 14px; }

.kpi-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-value {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 1;
}

.kpi-card--compact .kpi-value { font-size: 1.35rem; }

.content-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 14px;
  align-items: start;
}

.dash-bars { display: grid; gap: 10px; margin-top: 12px; }
.dash-bar-row {
  display: grid;
  grid-template-columns: 120px 1fr 36px;
  gap: 10px;
  align-items: center;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.dash-bar-track {
  height: 8px;
  background: var(--surface-muted);
  border-radius: 999px;
  overflow: hidden;
}
.dash-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.35s var(--ease);
  box-shadow: 0 0 12px rgba(29, 185, 84, 0.35);
}
.dash-bar-fill--warn { background: var(--danger); box-shadow: none; }
.dash-bar-fill--late { background: var(--warning); box-shadow: none; }

.today-kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

/* —— Scanner —— */
.scanner-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.toolbar-primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.toolbar-secondary { margin-left: auto; }

.scanner-more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px 14px;
  background: var(--surface-muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.layout--scanner {
  display: grid;
  grid-template-columns: 1.45fr minmax(280px, 340px);
  gap: 14px;
  align-items: start;
}

.scanner-stage { min-width: 0; }

.scanner-hero {
  border-radius: calc(var(--radius) + 2px);
  padding: 2px;
  background: linear-gradient(145deg, rgba(29, 185, 84, 0.35), rgba(255, 255, 255, 0.05) 40%, rgba(29, 185, 84, 0.12));
  box-shadow: 0 0 40px rgba(29, 185, 84, 0.08);
}

.video-wrap--hero {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius);
  background: #050807;
  border: 1px solid rgba(0, 0, 0, 0.4);
}

#video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #050807;
}

#overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.scan-frame {
  position: absolute;
  inset: 12% 18%;
  pointer-events: none;
  z-index: 2;
}

.scan-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: var(--primary);
  border-style: solid;
  opacity: 0.9;
  filter: drop-shadow(0 0 6px var(--primary-glow));
}
.scan-corner.tl { top: 0; left: 0; border-width: 2px 0 0 2px; }
.scan-corner.tr { top: 0; right: 0; border-width: 2px 2px 0 0; }
.scan-corner.bl { bottom: 0; left: 0; border-width: 0 0 2px 2px; }
.scan-corner.br { bottom: 0; right: 0; border-width: 0 2px 2px 0; }

.scan-line {
  position: absolute;
  left: 6%;
  right: 6%;
  height: 2px;
  top: 0;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  box-shadow: 0 0 12px var(--primary-glow);
  opacity: 0;
  pointer-events: none;
}

.scanner-hero[data-scan-state="scanning"] .scan-line,
.scanner-hero[data-scan-state="detected"] .scan-line {
  opacity: 1;
  animation: scanSweep 2.2s linear infinite;
}

@keyframes scanSweep {
  0% { top: 4%; opacity: 0.2; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 96%; opacity: 0.2; }
}

.scanner-ready-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  background: radial-gradient(ellipse at center, rgba(5, 8, 7, 0.35), rgba(5, 8, 7, 0.72));
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.scanner-hero[data-scan-state="scanning"] .scanner-ready-overlay,
.scanner-hero[data-scan-state="detected"] .scanner-ready-overlay,
.scanner-hero[data-scan-state="success"] .scanner-ready-overlay {
  opacity: 0;
}

.scanner-ready-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 24px rgba(29, 185, 84, 0.45);
}

.scanner-ready-hint {
  max-width: 280px;
  font-size: 0.9rem;
  color: rgba(238, 243, 240, 0.78);
}

.video-status-chip {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(5, 8, 7, 0.78);
  border: 1px solid var(--border);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
}

.video-status-light {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
  flex-shrink: 0;
}
.video-status-light.login { background: var(--primary); box-shadow: 0 0 8px var(--primary-glow); }
.video-status-light.logout { background: var(--danger); box-shadow: 0 0 8px rgba(240, 68, 56, 0.5); }

.scan-feedback {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 4;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(29, 185, 84, 0.92);
  color: #041208;
  font-weight: 700;
  font-size: 0.85rem;
}

.scan-success-overlay {
  margin-top: 12px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(29, 185, 84, 0.18), rgba(29, 185, 84, 0.06));
  border: 1px solid rgba(29, 185, 84, 0.4);
  color: var(--text);
  animation: successPop 0.35s var(--ease) both;
  box-shadow: 0 0 32px rgba(29, 185, 84, 0.12);
}

.scan-success-overlay.scan-success-strip--out {
  background: linear-gradient(135deg, rgba(240, 68, 56, 0.18), rgba(240, 68, 56, 0.06));
  border-color: rgba(240, 68, 56, 0.4);
  box-shadow: 0 0 32px rgba(240, 68, 56, 0.1);
}

.scan-success-overlay .success-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 6px;
}
.scan-success-overlay.scan-success-strip--out .success-kicker { color: #fca5a5; }

.scan-success-overlay .success-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.scan-success-overlay .success-meta {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.scan-success-overlay .success-action {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: baseline;
  font-weight: 700;
}

.scan-success-overlay .success-action .label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.scan-success-overlay .success-foot {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.scan-success-overlay .success-foot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
}

@keyframes successPop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.scanner-info {
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.scanner-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#lastResult {
  word-break: break-all;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.muted { color: var(--text-muted); font-size: 0.85rem; }

.scan-employee-banner {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid rgba(13, 148, 136, 0.22);
}

.live-feed-title { display: block; font-size: 0.95rem; }
.live-feed-sub { margin-top: 2px; font-size: 0.78rem; }

.log {
  max-height: 560px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}

.entry {
  background: var(--surface-muted);
  padding: 12px 12px 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  animation: feedIn 0.35s var(--ease) both;
}
.entry.is-out { border-left-color: var(--danger); }
.entry.is-late { border-left-color: var(--warning); }
.entry small { color: var(--text-muted); display: block; margin-top: 6px; line-height: 1.45; }
.entry .eid-mono {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
}
.entry .entry-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.entry .entry-status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
}
.entry .entry-status.is-working .dot { background: var(--primary); box-shadow: 0 0 8px var(--primary-glow); }
.entry .entry-status.is-completed .dot { background: #94a3b8; }
.entry .entry-status.is-late .dot { background: var(--warning); }

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

.time-in { font-weight: 700; color: #0f766e; }
.time-out { font-weight: 700; color: #b91c1c; }

.indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.indicator.in { background: var(--primary); }
.indicator.out { background: var(--danger); }

/* —— Tables —— */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table th {
  color: var(--text-dim);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(0, 0, 0, 0.18);
}
.data-table tbody tr { transition: background 0.15s ease; }
.data-table tbody tr:hover { background: var(--surface-muted); }
.data-table .eid-mono { font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-muted); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.badge--complete { background: var(--primary-soft); color: #0f766e; border-color: rgba(13, 148, 136, 0.25); }
.badge--late { background: var(--warning-soft); color: #b45309; border-color: rgba(217, 119, 6, 0.28); }
.badge--missing_out, .badge--logged_in { background: var(--info-soft); color: #1d4ed8; border-color: rgba(37, 99, 235, 0.28); }
.badge--logout_only { background: var(--danger-soft); color: #b91c1c; border-color: rgba(220, 38, 38, 0.28); }

.log-cards { display: grid; gap: 10px; }
.log-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--surface-2);
}
.log-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}
.log-card-name { font-weight: 700; }
.log-card-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.log-card-times {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 0.88rem;
  margin-bottom: 8px;
}
.log-card-actions { margin-top: 8px; }

.filter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
.filter-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}
.filter-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.log-filters { margin-bottom: 14px; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.loading-row {
  padding: 28px;
  text-align: center;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.hidden { display: none !important; }

/* —— Latest —— */
.latest-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.latest-title { margin: 0 0 12px; color: var(--text); font-size: 1.15rem; }
.latest-img-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 10px;
  overflow: hidden;
  background: #050807;
  border: 1px solid var(--border);
}
#latestSnapshotImg { width: 100%; height: 100%; object-fit: cover; display: none; }
.latest-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  color: rgba(238, 243, 240, 0.75);
  text-align: center;
  font-weight: 600;
}
.latest-meta {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 10px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
}
.latest-meta .k { color: var(--text-muted); font-weight: 600; font-size: 0.8rem; }
.latest-meta .v { font-weight: 600; margin-left: 6px; }
.latest-meta .v.mono { font-family: var(--font-mono); }
.latest-qr {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  word-break: break-word;
  white-space: pre-wrap;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.reports-actions, .settings-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.settings-row + .settings-row {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.reports-note, .settings-note { margin-top: 16px; }

/* —— Auth / Modals —— */
.auth-modal {
  display: flex;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(8px);
}
.auth-modal.hidden { display: none; }

.auth-box {
  background: var(--surface);
  padding: 28px 26px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 400px;
  text-align: left;
  border: 1px solid var(--border-strong);
  max-height: 90vh;
  overflow-y: auto;
}

.auth-brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  text-align: center;
  background: #fff;
  border-radius: 8px;
  padding: 14px 16px;
  border: 1px solid var(--border);
}
.auth-modal {
  background: rgba(15, 23, 42, 0.35) !important;
}
.auth-logo-img {
  display: block;
  height: 72px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  margin: 0 auto;
}
.auth-box--login { text-align: center; }
.auth-box--login .auth-label { text-align: left; }
.auth-box--login input { text-align: left; }
.auth-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: -4px 0 20px;
}
.auth-box h2 {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 1.35rem;
  text-align: center;
  letter-spacing: -0.02em;
}
.auth-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}
.auth-box input { width: 100%; margin-bottom: 14px; }
.auth-box .btn-primary { width: 100%; margin-bottom: 14px; }
.auth-box p { color: var(--text-muted); font-size: 0.9rem; }
.auth-box a { color: var(--primary-dark); font-weight: 600; text-decoration: none; }
.auth-box a:hover { text-decoration: underline; }

.form-error {
  color: #fecaca;
  background: var(--danger-soft);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 12px;
  text-align: left;
  border: 1px solid rgba(240, 68, 56, 0.25);
}

.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.modal-actions .btn { min-width: 100px; }

.conn-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid var(--border);
}
.conn-badge--ok {
  background: var(--primary-soft);
  color: #0f766e;
  border-color: rgba(13, 148, 136, 0.28);
}
.conn-badge--warn {
  background: var(--warning-soft);
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.28);
}

.user-info-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.user-info-bar #userName {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-logout-btn {
  width: auto !important;
  padding: 6px 12px !important;
  min-height: 32px !important;
  border-radius: 999px !important;
}

.toast-host {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  padding: 12px 14px;
  border-radius: 10px;
  background: #15201c;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: var(--shadow);
}
.toast--show { opacity: 1; transform: translateY(0); }
.toast--success { background: #0f2a1a; border-color: rgba(29, 185, 84, 0.35); }
.toast--error { background: #2a1210; border-color: rgba(240, 68, 56, 0.35); }
.toast--info { background: #121820; }

.snapshot-required { border-color: var(--warning) !important; color: var(--warning); }
.snapshot-warning { color: #fca5a5; font-weight: 700; }

@keyframes helportIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.animate-in { animation: helportIn 0.35s var(--ease) both; }

/* Legacy class aliases used by JS */
.stat-card { /* unused in new markup; kept for safety */ }
.dash-primary, .dash-secondary { display: contents; }
.stat-label { color: var(--text-muted); }
.stat-value { color: var(--text); }

/* —— Responsive —— */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .today-kpi-row { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-105%);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-backdrop:not([hidden]) { display: block; }
  .main-column { margin-left: 0; }
  .icon-btn.mobile-nav-toggle { display: inline-flex; }
  .topbar-brand-compact { display: inline-flex; }
  .page-eyebrow { display: none; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .layout--scanner { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .main-content { padding: 14px 14px 24px; }
  .latest-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .today-kpi-row { grid-template-columns: 1fr 1fr; }
  .filter-grid { grid-template-columns: 1fr; }
  .toolbar-primary { width: 100%; }
  .toolbar-primary .btn,
  .toolbar-primary .select { flex: 1 1 auto; }
  .toolbar-secondary { margin-left: 0; width: 100%; }
  .toolbar-secondary .btn { width: 100%; }
  .live-clock { font-size: 0.7rem; padding: 6px 8px; }
  .dash-bar-row { grid-template-columns: 90px 1fr 32px; }
  .scan-frame { inset: 14% 12%; }
  .kpi-value { font-size: 1.5rem; }

  .data-table--desktop { display: none !important; }
  .log-cards:not([hidden]) { display: grid !important; }
  #dashRecentCards:not([hidden]) { display: grid !important; }

  .user-info-bar #userName { max-width: 90px; }
}

@media (min-width: 769px) {
  .log-cards { display: none !important; }
  #dashRecentCards { display: none !important; }
  #attLogCards { display: none !important; }
}

@media (max-width: 420px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .today-kpi-row { grid-template-columns: 1fr; }
  .header-meta .live-clock { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* —— Phase A+B: enterprise polish + analytics (white theme) —— */
.sidebar-brand { position: relative; }
.sidebar-collapse-btn {
  margin-left: auto;
  width: 32px;
  height: 32px;
  min-width: 32px;
  display: inline-flex;
}
.sidebar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 4px 12px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-muted);
}
.sidebar-search input {
  border: 0;
  background: transparent;
  width: 100%;
  font: inherit;
  font-size: 0.85rem;
  color: var(--text);
  outline: none;
  min-height: 24px;
}
.sidebar-search-ico { color: var(--text-dim); flex-shrink: 0; }

body.sidebar-collapsed {
  --sidebar-w: 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: 10px;
}
body.sidebar-collapsed .sidebar-collapse-btn svg {
  transform: rotate(180deg);
}

.header-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-muted);
  min-width: 200px;
}
.header-search-wrap input {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.85rem;
  color: var(--text);
  width: 100%;
  outline: none;
  min-height: 28px;
}
.header-search-wrap svg { color: var(--text-dim); flex-shrink: 0; }
.header-notif-btn { position: relative; display: inline-flex; }
.notif-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 2px #fff;
}

.card--glass {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 0.8rem; }
.btn.is-loading { pointer-events: none; opacity: 0.75; position: relative; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }

.kpi-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kpi-grid--4 {
  grid-template-columns: repeat(4, 1fr);
}
.inline-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.table-wrap--rounded {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
  max-height: 420px;
}
.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
}
.data-table--zebra tbody tr:nth-child(even) {
  background: #f8fafc;
}
.data-table tbody tr {
  transition: background 0.15s ease;
}
.data-table tbody tr:hover {
  background: #ecfdf5 !important;
}

.empty-state--rich {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 36px 16px;
}
.empty-ico {
  font-size: 1.75rem;
  margin-bottom: 4px;
  filter: grayscale(0.2);
}

/* Charts */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  min-height: 160px;
  padding: 8px 4px 0;
}
.bar-chart--dense { gap: 4px; overflow-x: auto; }
.bar-col {
  flex: 1;
  min-width: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.bar-col--sm { min-width: 14px; }
.bar-track {
  width: 100%;
  max-width: 36px;
  height: 120px;
  background: var(--surface-2);
  border-radius: 8px 8px 4px 4px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.bar-chart--dense .bar-track { max-width: 18px; height: 100px; }
.bar-fill {
  width: 100%;
  background: linear-gradient(180deg, #14b8a6, #0d9488);
  border-radius: 8px 8px 0 0;
  min-height: 2px;
  transition: height 0.45s var(--ease);
}
.bar-val { font-size: 0.72rem; font-weight: 700; color: var(--text); }
.bar-label { font-size: 0.68rem; color: var(--text-muted); font-weight: 600; }

.grouped-bars {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  min-height: 180px;
  padding-top: 8px;
}
.gbar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.gbar-group {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 140px;
}
.gbar {
  width: 10px;
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: height 0.4s var(--ease);
}
.gbar--present { background: #0d9488; }
.gbar--late { background: #d97706; }
.gbar--done { background: #64748b; }

.heatmap {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 5px;
}
.heatmap--lg { grid-template-columns: repeat(14, 1fr); gap: 6px; }
.hm-cell {
  aspect-ratio: 1;
  border: 0;
  border-radius: 4px;
  cursor: default;
  background: #e2e8f0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.hm-cell:hover { transform: scale(1.08); box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.25); }
.hm-l0 { background: #e2e8f0; }
.hm-l1 { background: #ccfbf1; }
.hm-l2 { background: #5eead4; }
.hm-l3 { background: #14b8a6; }
.hm-l4 { background: #0f766e; }
.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 0.75rem;
}
.hm-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: #ccfbf1;
  display: inline-block;
}
.hm-swatch.hm-2 { background: #5eead4; }
.hm-swatch.hm-3 { background: #14b8a6; }
.hm-swatch.hm-4 { background: #0f766e; }

.cal-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
  text-align: center;
  text-transform: uppercase;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-cell {
  min-height: 54px;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #fff;
}
.cal-empty { visibility: hidden; border: 0; }
.cal-day { font-size: 0.75rem; font-weight: 700; color: var(--text); }
.cal-count { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; }
.cal-cell.is-today { outline: 2px solid var(--primary); outline-offset: -1px; }
.cal-cell.hm-l1 { background: #f0fdfa; }
.cal-cell.hm-l2 { background: #ccfbf1; }
.cal-cell.hm-l3 { background: #99f6e4; }
.cal-cell.hm-l4 { background: #5eead4; }

.filter-grid input,
.filter-grid select,
.auth-box input,
.manual-box input,
.select {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.filter-grid input:focus,
.filter-grid select:focus,
.auth-box input:focus,
.manual-box input:focus,
.select:focus {
  border-color: var(--primary);
}

@media (max-width: 1100px) {
  .kpi-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .header-search-wrap { min-width: 140px; }
}
@media (max-width: 900px) {
  .sidebar-collapse-btn { display: none; }
  body.sidebar-collapsed { --sidebar-w: 260px; }
  .header-search-wrap { display: none; }
}
@media (max-width: 768px) {
  .heatmap, .heatmap--lg { grid-template-columns: repeat(7, 1fr); }
  .cal-cell { min-height: 44px; }
}

/* Employee / Team Leader Management */
.subsection-title {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 650;
}
.emp-mgmt-toolbar { margin-bottom: 0; }
.emp-mgmt-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.emp-mgmt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.emp-mgmt-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
}
.emp-import-progress { margin-top: 12px; }
.emp-import-progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  overflow: hidden;
}
.emp-import-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  transition: width 0.25s ease;
}
.emp-import-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.45);
}
.emp-import-modal[hidden] { display: none !important; }
.emp-import-modal-card {
  width: min(520px, 100%);
  max-height: 80vh;
  overflow: auto;
}
.emp-import-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 12px 0;
}
.emp-import-stats strong {
  display: block;
  font-size: 1.4rem;
}
.emp-import-errors {
  max-height: 200px;
  overflow: auto;
  font-size: 0.85rem;
  margin-bottom: 12px;
}
.emp-mgmt-table { min-width: 720px; }

/* Account Management */
.acc-tl-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.acc-eid-wrap { position: relative; }

/* Smart Auto-Fill (shared identity typeahead) */
.id-af-wrap {
  position: relative;
  display: block;
  width: 100%;
}
.id-af-results,
.acc-eid-results {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 240px;
  overflow: auto;
  background: var(--surface, #fff);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.id-af-empty {
  margin: 0;
  padding: 10px 12px;
  font-size: 0.88rem;
}
.id-af-option,
.acc-eid-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
}
.id-af-option:hover,
.id-af-option.is-active,
.acc-eid-option:hover {
  background: var(--primary-soft);
}
.id-af-option.is-disabled,
.acc-eid-option.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.id-af-chip {
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
}
.id-af-chip:not([hidden]) {
  display: block;
}
.id-af-nudge {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(37, 99, 235, 0.25);
  background: var(--primary-soft, #eff6ff);
  font-size: 0.88rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.acc-check-label {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}
.acc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.acc-role-select { min-width: 140px; }
.acc-reset-result code {
  font-family: var(--font-mono);
  font-size: 1rem;
  padding: 4px 8px;
  background: var(--primary-soft);
  border-radius: 6px;
}
.badge--warn {
  background: var(--warning-soft, #fff7ed);
  color: #b45309;
  border: 1px solid rgba(217, 119, 6, 0.28);
}

/* Correction Requests */
.corr-drop {
  margin-top: 12px;
  padding: 16px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  text-align: center;
}
.corr-drop.is-drag {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.corr-detail { position: relative; }
.corr-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.corr-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0;
  padding: 12px;
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
}
.corr-timeline {
  list-style: none;
  margin: 12px 0;
  padding: 0;
  border-left: 2px solid var(--border);
}
.corr-timeline li {
  position: relative;
  padding: 0 0 12px 16px;
  margin-left: 8px;
}
.corr-timeline li::before {
  content: '';
  position: absolute;
  left: -13px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-strong);
}
.corr-timeline li.is-done::before { background: var(--primary); }
.status-pill.status-pending { background: var(--warning-soft); color: #92400e; }
.status-pill.status-pending-sa { background: var(--info-soft); color: #0e7490; }
.status-pill.status-approved { background: var(--primary-soft); color: #047857; }
.status-pill.status-rejected { background: var(--danger-soft); color: #b91c1c; }
.status-pill.status-revision { background: var(--warning-soft); color: #a16207; }
.corr-table tr.is-focus { outline: 2px solid var(--primary); }
@media (max-width: 700px) {
  .corr-compare { grid-template-columns: 1fr; }
}

/* Employee My Day + Profile */
.emp-home-status-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
}
.emp-home-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.emp-home-punch-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.emp-home-punch-grid strong {
  display: block;
  font-size: 1.15rem;
  margin-top: 2px;
}
.emp-home-alerts {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.emp-alert {
  text-align: left;
  cursor: pointer;
  border: 1px solid var(--border);
  padding: 14px 16px;
}
.emp-alert strong {
  display: block;
  font-size: 1.35rem;
}
.emp-alert--warn {
  border-color: #f59e0b;
  background: var(--warning-soft);
}
.emp-week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.emp-week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: default;
  font-size: 0.75rem;
}
.emp-week-day.is-today { outline: 2px solid var(--primary); }
.emp-week-dow { font-weight: 650; color: var(--text-muted); }
.emp-week-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-strong);
}
.emp-week--ok .emp-week-dot { background: var(--primary); }
.emp-week--late .emp-week-dot { background: #f59e0b; }
.emp-week--work .emp-week-dot { background: #06b6d4; }
.emp-week--rest .emp-week-dot { background: #94a3b8; }
.emp-week--absent .emp-week-dot { background: #ef4444; }
.emp-week-lab { color: var(--text-dim); text-align: center; line-height: 1.2; }
.emp-profile-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
}
.emp-profile-card { text-align: left; }
.emp-profile-head { text-align: center; margin-bottom: 8px; }
.emp-profile-avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  font-weight: 700;
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.emp-profile-dl {
  text-align: left;
  margin: 14px 0 0;
}
.emp-profile-dl > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.emp-profile-dl dt { color: var(--text-muted); }
.emp-profile-dl dd { margin: 0; font-weight: 600; }
.emp-profile-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  text-align: left;
}
.emp-profile-form .auth-label { margin-top: 2px; }
.emp-profile-form input,
.emp-profile-form select { width: 100%; }
.emp-profile-form .field-readonly {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2, rgba(15, 23, 42, 0.04));
}
.emp-profile-form .field-readonly span:first-child {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.emp-profile-name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 900px) {
  .emp-home-status-row,
  .emp-profile-grid { grid-template-columns: 1fr; }
  .emp-week-strip { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 640px) {
  .emp-profile-name-row { grid-template-columns: 1fr; }
}

/* —— Operations Command Center —— */
.dash-command-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.dash-search-wrap {
  position: relative;
  min-width: min(360px, 100%);
  flex: 1 1 280px;
  max-width: 420px;
}
.dash-search-wrap input {
  width: 100%;
}
.dash-search-results {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 320px;
  overflow: auto;
  background: var(--surface, #fff);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.dash-search-hit {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
}
.dash-search-hit:hover { background: var(--primary-soft); }
.quick-actions--command {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.quick-actions--command .quick-action {
  min-height: 72px;
  padding: 12px 14px;
}
.kpi-card--click {
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  border: 1px solid var(--border);
  width: 100%;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.kpi-card--click:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.kpi-trend {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.kpi-trend--up { color: #0f766e; }
.kpi-trend--down { color: #b91c1c; }
.kpi-trend--flat { color: var(--text-muted); }
.kpi-unit { font-size: 0.85em; margin-left: 2px; opacity: 0.85; }
.dash-attention-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.dash-attention-list,
.dash-approval-list { display: grid; gap: 10px; }
.dash-attention-item,
.dash-approval-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2, rgba(15, 23, 42, 0.03));
}
.dash-attention-item > div,
.dash-approval-item > div {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dash-attn-pri {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}
.dash-attention-item--high .dash-attn-pri { background: #ef4444; }
.dash-attention-item--med .dash-attn-pri { background: #f59e0b; }
.dash-attn-count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 0.85rem;
}
.dash-insights {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}
.dash-insights li { color: var(--text); }
.dash-scanner-status { display: grid; gap: 8px; }
.dash-status-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.dash-status-pill {
  font-size: 0.85rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2, #f1f5f9);
}
.dash-status-pill--ok { background: var(--primary-soft); color: #0f766e; }
.dash-status-pill--warn { background: var(--warning-soft, #fff7ed); color: #b45309; }
.dash-trend-filters { align-items: end; }
.dash-trend-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; }
.dash-trend-tabs .is-active {
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.dash-trend-chart { min-height: 140px; }
.dash-live-feed,
.dash-timeline {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
}
.dash-live-row {
  display: grid;
  grid-template-columns: 44px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}
.dash-live-row.is-new {
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px rgba(13, 148, 136, 0.25);
}
.dash-live-photo,
.dash-live-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}
.dash-live-avatar {
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 700;
}
.dash-live-main { display: grid; gap: 2px; min-width: 0; }
.dash-live-main strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-live-times {
  display: grid;
  gap: 2px;
  font-size: 0.85rem;
  text-align: right;
  color: var(--text-muted);
}
.dash-tl-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.dash-tl-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.dash-tl-item--time_out .dash-tl-ico { background: var(--info-soft, #eff6ff); color: #1d4ed8; }
.dash-tl-item--correction_submitted .dash-tl-ico { background: var(--warning-soft, #fff7ed); color: #b45309; }
.dash-tl-item--correction_approved .dash-tl-ico { background: var(--primary-soft); color: #0f766e; }
.dash-tl-item--employee_added .dash-tl-ico { background: #f5f3ff; color: #6d28d9; }
@media (max-width: 1100px) {
  .dash-attention-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .dash-attention-row { grid-template-columns: 1fr; }
  .dash-live-row { grid-template-columns: 44px 1fr; }
  .dash-live-times { text-align: left; grid-column: 2; }
  .dash-live-row .badge { grid-column: 2; justify-self: start; }
}

