/* ============================================
   ABSENSI SIDIK JARI — DESIGN SYSTEM
   Premium dark glassmorphism theme
   ============================================ */

:root {
  /* Color Palette */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.85);
  --bg-card-hover: rgba(30, 41, 59, 0.9);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --bg-glass-strong: rgba(255, 255, 255, 0.08);

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

  --accent-blue: #3b82f6;
  --accent-blue-glow: rgba(59, 130, 246, 0.3);
  --accent-green: #10b981;
  --accent-green-glow: rgba(16, 185, 129, 0.3);
  --accent-red: #ef4444;
  --accent-red-glow: rgba(239, 68, 68, 0.3);
  --accent-amber: #f59e0b;
  --accent-amber-glow: rgba(245, 158, 11, 0.3);
  --accent-purple: #8b5cf6;
  --accent-purple-glow: rgba(139, 92, 246, 0.3);
  --accent-cyan: #06b6d4;

  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(59, 130, 246, 0.2);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
  --shadow-glow-blue: 0 0 20px rgba(59, 130, 246, 0.15);
  --shadow-glow-green: 0 0 20px rgba(16, 185, 129, 0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --sidebar-width: 260px;
  --topbar-height: 64px;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background gradient mesh */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(59,130,246,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(139,92,246,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 10%, rgba(6,182,212,0.04) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

/* ============================================
   APP LAYOUT
   ============================================ */
.app {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.logo-icon {
  font-size: 32px;
  color: var(--accent-blue);
  filter: drop-shadow(0 0 8px var(--accent-blue-glow));
}

.logo h1 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
}

.sidebar-close:hover {
  background: var(--bg-glass-strong);
  color: var(--text-primary);
}

/* Navigation */
.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.93rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

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

.nav-item.active {
  background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(59,130,246,0.05));
  color: var(--accent-blue);
  box-shadow: inset 0 0 0 1px rgba(59,130,246,0.2);
}

.nav-item.active .material-icons-round {
  filter: drop-shadow(0 0 6px var(--accent-blue-glow));
}

.nav-item .material-icons-round {
  font-size: 22px;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
}

.device-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: var(--transition);
}

.status-dot.connected {
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green-glow);
  animation: pulse-dot 2s infinite;
}

.status-dot.disconnected {
  background: var(--accent-red);
  box-shadow: 0 0 8px var(--accent-red-glow);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  height: var(--topbar-height);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(10, 14, 26, 0.6);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
}

.menu-toggle:hover {
  background: var(--bg-glass-strong);
}

.topbar-info {
  flex: 1;
}

.topbar-info h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

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

.device-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 100px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Page container */
.page-container {
  padding: 24px;
  flex: 1;
}

.page {
  display: none;
}

.page.active {
  display: block;
  animation: fadeIn 0.35s ease;
}

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

/* ============================================
   STATS GRID
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow-blue);
}

.stat-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-wrap .material-icons-round {
  font-size: 24px;
}

.stat-total .stat-icon-wrap {
  background: linear-gradient(135deg, rgba(59,130,246,0.2), rgba(59,130,246,0.05));
  color: var(--accent-blue);
}

.stat-present .stat-icon-wrap {
  background: linear-gradient(135deg, rgba(16,185,129,0.2), rgba(16,185,129,0.05));
  color: var(--accent-green);
}

.stat-absent .stat-icon-wrap {
  background: linear-gradient(135deg, rgba(239,68,68,0.2), rgba(239,68,68,0.05));
  color: var(--accent-red);
}

.stat-checkout .stat-icon-wrap {
  background: linear-gradient(135deg, rgba(245,158,11,0.2), rgba(245,158,11,0.05));
  color: var(--accent-amber);
}

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

.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}

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

.card-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
}

.card-header h3 .material-icons-round {
  font-size: 20px;
  color: var(--accent-blue);
}

/* ============================================
   TABLE
   ============================================ */
.table-wrapper {
  overflow-x: auto;
}

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

.table thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table tbody td {
  padding: 12px 16px;
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  white-space: nowrap;
}

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

.table tbody tr:hover {
  background: var(--bg-glass);
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 16px !important;
  font-style: italic;
}

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success {
  background: rgba(16,185,129,0.15);
  color: var(--accent-green);
}

.badge-warning {
  background: rgba(245,158,11,0.15);
  color: var(--accent-amber);
}

.badge-danger {
  background: rgba(239,68,68,0.15);
  color: var(--accent-red);
}

.badge-info {
  background: rgba(59,130,246,0.15);
  color: var(--accent-blue);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn .material-icons-round {
  font-size: 18px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), #2563eb);
  color: white;
  box-shadow: 0 2px 8px var(--accent-blue-glow);
}

.btn-primary:hover {
  box-shadow: 0 4px 16px var(--accent-blue-glow);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, var(--accent-green), #059669);
  color: white;
  box-shadow: 0 2px 8px var(--accent-green-glow);
}

.btn-danger {
  background: linear-gradient(135deg, var(--accent-red), #dc2626);
  color: white;
  box-shadow: 0 2px 8px var(--accent-red-glow);
}

.btn-ghost {
  background: var(--bg-glass);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

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

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  background: var(--bg-glass);
  border-color: var(--border-glow);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.btn-sm .material-icons-round {
  font-size: 16px;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  transition: var(--transition);
}

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

/* ============================================
   FORMS & INPUTS
   ============================================ */
.input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
}

.input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

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

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-body {
  padding: 24px;
}

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

/* ============================================
   SCAN PAGE
   ============================================ */
.scan-page-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.scan-area {
  text-align: center;
  padding: 40px 20px;
}

.fingerprint-visual {
  width: 200px;
  height: 200px;
  margin: 0 auto 30px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fp-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid;
  animation: fp-pulse 3s infinite ease-in-out;
}

.fp-ring-outer {
  width: 200px;
  height: 200px;
  border-color: rgba(59,130,246,0.15);
  animation-delay: 0s;
}

.fp-ring-middle {
  width: 160px;
  height: 160px;
  border-color: rgba(59,130,246,0.2);
  animation-delay: 0.5s;
}

.fp-ring-inner {
  width: 120px;
  height: 120px;
  border-color: rgba(59,130,246,0.3);
  animation-delay: 1s;
}

@keyframes fp-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

.fp-icon {
  font-size: 64px;
  color: var(--accent-blue);
  filter: drop-shadow(0 0 16px var(--accent-blue-glow));
  z-index: 2;
  animation: fp-glow 2s infinite ease-in-out;
}

@keyframes fp-glow {
  0%, 100% { filter: drop-shadow(0 0 10px var(--accent-blue-glow)); }
  50% { filter: drop-shadow(0 0 24px rgba(59,130,246,0.5)); }
}

.fp-scan-line {
  position: absolute;
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
  z-index: 3;
  animation: scan-sweep 2s infinite ease-in-out;
  opacity: 0.7;
}

@keyframes scan-sweep {
  0% { transform: translateY(-40px); }
  50% { transform: translateY(40px); }
  100% { transform: translateY(-40px); }
}

.scan-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.scan-subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 30px;
}

/* Simulation controls */
.sim-controls {
  background: var(--bg-glass);
  border: 1px dashed rgba(245,158,11,0.3);
  border-radius: var(--radius-lg);
  padding: 20px;
  max-width: 400px;
  margin: 0 auto;
}

.sim-label {
  font-size: 0.82rem;
  color: var(--accent-amber);
  font-weight: 600;
  margin-bottom: 12px;
}

.sim-buttons {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Scan log */
.scan-log-list {
  max-height: 500px;
  overflow-y: auto;
  padding: 12px;
}

.log-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  background: var(--bg-glass);
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.log-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.log-icon.success {
  background: rgba(16,185,129,0.15);
  color: var(--accent-green);
}

.log-icon.error {
  background: rgba(239,68,68,0.15);
  color: var(--accent-red);
}

.log-icon.info {
  background: rgba(59,130,246,0.15);
  color: var(--accent-blue);
}

.log-details {
  flex: 1;
}

.log-name {
  font-weight: 600;
  font-size: 0.9rem;
}

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

.log-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ============================================
   SCAN OVERLAY (Full-screen notification)
   ============================================ */
.scan-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  pointer-events: none;
}

.scan-overlay.hidden {
  display: none;
}

.scan-overlay-content {
  text-align: center;
  padding: 40px;
  border-radius: var(--radius-xl);
  background: rgba(10, 14, 26, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  min-width: 300px;
  animation: overlayPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes overlayPop {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

.scan-icon-wrapper {
  margin-bottom: 16px;
}

.scan-icon {
  font-size: 72px;
}

.scan-overlay.success .scan-icon {
  color: var(--accent-green);
  filter: drop-shadow(0 0 20px var(--accent-green-glow));
}

.scan-overlay.error .scan-icon {
  color: var(--accent-red);
  filter: drop-shadow(0 0 20px var(--accent-red-glow));
}

.scan-overlay.info .scan-icon {
  color: var(--accent-blue);
  filter: drop-shadow(0 0 20px var(--accent-blue-glow));
}

.scan-overlay h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.scan-overlay p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.scan-time {
  margin-top: 8px;
  font-size: 0.82rem !important;
  color: var(--text-muted) !important;
}

/* ============================================
   REPORT FILTERS & TABS
   ============================================ */
.report-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.report-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  flex: 1;
  justify-content: center;
}

.report-tab:hover {
  background: var(--bg-glass-strong);
  color: var(--text-primary);
}

.report-tab.active {
  background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(59,130,246,0.05));
  color: var(--accent-blue);
  border-color: rgba(59,130,246,0.3);
  box-shadow: 0 0 12px var(--accent-blue-glow);
}

.report-tab .material-icons-round {
  font-size: 20px;
}

.report-panel {
  display: none;
}

.report-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.report-filters {
  padding: 20px;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.report-filters .form-group {
  margin-bottom: 0;
  flex: 1;
  min-width: 140px;
}

.report-filters .btn {
  height: 42px;
}

/* Percentage bar for recap */
.pct-bar {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

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

.pct-high { background: var(--accent-green); }
.pct-mid { background: var(--accent-amber); }
.pct-low { background: var(--accent-red); }

/* ============================================
   ACTION BUTTONS IN TABLE
   ============================================ */
.action-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .sidebar-close {
    display: block;
  }

  .main {
    margin-left: 0;
  }

  .menu-toggle {
    display: flex;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .scan-page-layout {
    grid-template-columns: 1fr;
  }

  .page-container {
    padding: 12px;
    padding-bottom: env(safe-area-inset-bottom, 12px);
  }

  .report-filters {
    flex-direction: column;
  }

  .report-filters .form-group {
    width: 100%;
  }

  .report-tabs {
    gap: 6px;
  }

  .report-tab {
    padding: 8px 12px;
    font-size: 0.82rem;
  }

  .card-header {
    padding: 12px 14px;
    gap: 8px;
  }

  .card-header h3 {
    font-size: 0.88rem;
  }

  /* Table compact on mobile */
  .table thead th {
    padding: 8px 10px;
    font-size: 0.7rem;
  }

  .table tbody td {
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  /* Scan area smaller on mobile */
  .fingerprint-visual {
    width: 150px;
    height: 150px;
    margin-bottom: 20px;
  }

  .fp-ring-outer { width: 150px; height: 150px; }
  .fp-ring-middle { width: 120px; height: 120px; }
  .fp-ring-inner { width: 90px; height: 90px; }
  .fp-icon { font-size: 48px; }

  .scan-title {
    font-size: 1.1rem;
  }

  .sim-controls {
    padding: 14px;
  }

  .sim-buttons {
    flex-direction: column;
  }

  /* Modal compact */
  .modal {
    max-width: 100%;
    margin: 8px;
    border-radius: var(--radius-lg);
  }

  .modal-header {
    padding: 14px 16px;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-footer {
    padding: 12px 16px;
  }

  /* Scan overlay compact */
  .scan-overlay-content {
    padding: 24px;
    min-width: 260px;
    margin: 16px;
  }

  .scan-icon {
    font-size: 56px;
  }

  /* Device badge compact */
  .device-badge {
    padding: 4px 10px;
    font-size: 0.72rem;
  }

  .topbar {
    height: auto;
    min-height: var(--topbar-height);
    padding: 8px 12px;
    padding-top: max(8px, env(safe-area-inset-top));
  }

  .topbar-info h2 {
    font-size: 1rem;
  }

  .topbar-date {
    font-size: 0.72rem;
  }
}

@media (max-width: 420px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .stat-card {
    padding: 12px;
  }

  .stat-value {
    font-size: 1.3rem;
  }

  .stat-label {
    font-size: 0.72rem;
  }

  .stat-icon-wrap {
    width: 40px;
    height: 40px;
  }

  .stat-icon-wrap .material-icons-round {
    font-size: 20px;
  }

  /* Extra small text for tables */
  .table thead th {
    padding: 6px 8px;
    font-size: 0.68rem;
  }

  .table tbody td {
    padding: 6px 8px;
    font-size: 0.75rem;
  }

  .badge {
    padding: 2px 6px;
    font-size: 0.68rem;
  }

  .btn {
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  .btn .material-icons-round {
    font-size: 16px;
  }

  .report-filters {
    padding: 12px;
  }

  .input {
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  .form-group label {
    font-size: 0.76rem;
  }
}

/* ============================================
   SIDEBAR OVERLAY
   ============================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
  display: block;
}

/* ============================================
   BTN DANGER
   ============================================ */
.btn-danger {
  background: var(--accent-red);
  color: #fff;
  border: none;
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

/* ============================================
   REPORT EXPORT
   ============================================ */
.rpt-export {
  padding: 10px 14px;
  border-top: 1px solid rgba(255,255,255,0.04);
  display: flex;
  justify-content: flex-end;
}

/* ============================================
   REPORT CARD LISTS
   ============================================ */
.rpt-card-list {
  padding: 8px;
}

/* Per-employee daily item */
.rpt-item {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: var(--transition);
}

.rpt-item:last-child {
  border-bottom: none;
}

.rpt-item:hover {
  background: var(--bg-glass);
}

.rpt-item-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.rpt-item-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.rpt-time {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
  font-weight: 600;
}

.rpt-icon-in {
  font-size: 18px;
  color: var(--accent-green);
}

.rpt-icon-out {
  font-size: 18px;
  color: var(--accent-amber);
}

/* Recap item */
.rpt-recap-item {
  padding: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.rpt-recap-item:last-child {
  border-bottom: none;
}

.rpt-recap-item:hover {
  background: var(--bg-glass);
}

.rpt-recap-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.rpt-recap-name {
  display: flex;
  flex-direction: column;
}

.rpt-recap-name strong {
  font-size: 0.92rem;
}

.rpt-recap-pos {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.rpt-recap-pct {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -1px;
}

.pct-high-text { color: var(--accent-green); }
.pct-mid-text { color: var(--accent-amber); }
.pct-low-text { color: var(--accent-red); }

.rpt-recap-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.rpt-recap-days {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* Employee card list */
.emp-card-list {
  padding: 8px;
}

.emp-card {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: var(--transition);
}

.emp-card:last-child {
  border-bottom: none;
}

.emp-card:hover {
  background: var(--bg-glass);
}

.emp-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.emp-card-info {
  display: flex;
  flex-direction: column;
}

.emp-card-info strong {
  font-size: 0.92rem;
}

.emp-card-pos {
  font-size: 0.75rem;
  color: var(--text-muted);
}

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

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.2);
}

/* ============================================
   TOAST NOTIFICATION (for actions)
   ============================================ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-size: 0.88rem;
  box-shadow: var(--shadow-lg);
  animation: slideInToast 0.3s ease, fadeOutToast 0.3s ease 2.7s forwards;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 380px;
}

.toast-success { border-left: 3px solid var(--accent-green); }
.toast-error { border-left: 3px solid var(--accent-red); }
.toast-info { border-left: 3px solid var(--accent-blue); }

@keyframes slideInToast {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOutToast {
  to { opacity: 0; transform: translateX(40px); }
}

/* select styling */
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394a3b8'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 20px;
  padding-right: 36px;
}

select.input option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}
