/* ============================================
   AbsensiKu - Global Design System
   Dark Glassmorphism | Premium UI
   ============================================ */

:root {
  --bg-primary: #0a0a14;
  --bg-secondary: #0f0f1e;
  --bg-card: rgba(255,255,255,0.05);
  --bg-card-hover: rgba(255,255,255,0.08);
  --glass-border: rgba(255,255,255,0.1);
  --glass-border-hover: rgba(255,255,255,0.18);

  --accent: #6C63FF;
  --accent-2: #3ECFCF;
  --accent-grad: linear-gradient(135deg, #6C63FF 0%, #3ECFCF 100%);
  --accent-grad-r: linear-gradient(135deg, #3ECFCF 0%, #6C63FF 100%);

  --green: #2dd4bf;
  --yellow: #fbbf24;
  --red: #f87171;
  --blue: #60a5fa;
  --purple: #a78bfa;

  --text-primary: #f0f0ff;
  --text-secondary: rgba(240,240,255,0.6);
  --text-muted: rgba(240,240,255,0.35);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-accent: 0 8px 32px rgba(108,99,255,0.3);

  --font: 'Inter', sans-serif;
  --font-head: 'Outfit', sans-serif;

  --sidebar-width: 260px;
  --topbar-h: 64px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

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

/* ---- UTILITIES ---- */
.hidden { display: none !important; }
.screen { position: fixed; inset: 0; z-index: 50; display: none; }
.screen.active { display: flex; }

.glass {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.glass-subtle {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(108,99,255,0.4); border-radius: 999px; }

/* ============================================
   LOGIN SCREEN
   ============================================ */
#screen-login {
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  overflow: hidden;
}

.login-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.login-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  animation: floatGlow 8s ease-in-out infinite;
}
.g1 { width: 500px; height: 500px; background: var(--accent); top: -150px; left: -150px; animation-delay: 0s; }
.g2 { width: 400px; height: 400px; background: var(--accent-2); bottom: -100px; right: -100px; animation-delay: -3s; }
.g3 { width: 300px; height: 300px; background: #a78bfa; top: 50%; left: 50%; transform: translate(-50%,-50%); animation-delay: -5s; }

@keyframes floatGlow {
  0%, 100% { transform: scale(1) translate(0, 0); }
  33% { transform: scale(1.1) translate(20px, -20px); }
  66% { transform: scale(0.95) translate(-10px, 15px); }
}

.login-wrap { position: relative; z-index: 1; width: 100%; max-width: 440px; padding: 20px; }

.login-card {
  padding: 40px 36px;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}
.brand-icon svg { width: 48px; height: 48px; filter: drop-shadow(0 0 12px rgba(108,99,255,0.5)); }
.brand-name { font-family: var(--font-head); font-size: 26px; font-weight: 800; background: var(--accent-grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.brand-tagline { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.login-form { display: flex; flex-direction: column; gap: 20px; }

.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label { font-size: 13px; font-weight: 500; color: var(--text-secondary); letter-spacing: 0.02em; }

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}
.input-icon svg { width: 18px; height: 18px; }
.input-wrap input {
  width: 100%;
  padding: 13px 44px 13px 44px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.2);
}
.toggle-pass {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  transition: color var(--transition);
}
.toggle-pass:hover { color: var(--text-primary); }
.toggle-pass svg { width: 18px; height: 18px; }

.form-error { color: var(--red); font-size: 13px; margin-top: -8px; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  background: var(--accent-grad);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 20px rgba(108,99,255,0.35);
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 8px 28px rgba(108,99,255,0.45); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.4; pointer-events: none; }
.btn-primary svg { width: 17px; height: 17px; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.btn-secondary:hover { background: rgba(255,255,255,0.12); border-color: var(--glass-border-hover); transform: translateY(-1px); }
.btn-secondary svg { width: 16px; height: 16px; }
.btn-secondary.sm, .btn-primary.sm { padding: 9px 16px; font-size: 13px; }

.login-hint {
  margin-top: 24px;
  padding: 14px 16px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.8;
}
.login-hint code {
  background: rgba(108,99,255,0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  color: var(--accent-2);
  font-size: 12px;
}

/* ============================================
   APP SHELL
   ============================================ */
#app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--bg-primary);
}
#app-shell.hidden { display: none; }

/* ---- SIDEBAR ---- */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: rgba(12,12,26,0.95);
  border-right: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  z-index: 30;
  transition: transform var(--transition);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--glass-border);
}
.brand-sm {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 18px;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.brand-sm svg { width: 32px; height: 32px; flex-shrink: 0; }

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
}
.sidebar-close svg { width: 18px; height: 18px; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid var(--glass-border);
}
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(108,99,255,0.4);
}
.sidebar-name { font-weight: 600; font-size: 14px; }
.sidebar-role { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }
.nav-item.active {
  background: rgba(108,99,255,0.18);
  color: var(--accent-2);
  border: 1px solid rgba(108,99,255,0.25);
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--glass-border);
}
.btn-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  background: none;
  border: 1px solid rgba(248,113,113,0.2);
  border-radius: var(--radius-sm);
  color: var(--red);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.btn-logout:hover { background: rgba(248,113,113,0.1); border-color: rgba(248,113,113,0.4); }
.btn-logout svg { width: 16px; height: 16px; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 29;
  backdrop-filter: blur(4px);
}

/* ---- TOPBAR ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-h);
  background: rgba(10,10,20,0.9);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
}
.topbar-menu {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: color var(--transition);
}
.topbar-menu:hover { color: var(--text-primary); }
.topbar-menu svg { width: 22px; height: 22px; }
.topbar-center {
  flex: 1;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 18px;
}
.topbar-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.topbar-clock {
  font-family: 'Outfit', monospace;
  font-size: 16px;
  font-weight: 600;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.topbar-date { font-size: 11px; color: var(--text-muted); }

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

.page-screen {
  flex: 1;
  padding: 28px 28px 60px;
  animation: fadeIn 0.35s ease both;
  overflow-y: auto;
}
.page-screen.hidden { display: none !important; }
.page-screen.active { display: block; }

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

.page-header { margin-bottom: 28px; }
.page-header h2 { font-family: var(--font-head); font-size: 28px; font-weight: 800; }
.page-subtitle { color: var(--text-secondary); margin-top: 6px; font-size: 14px; }

/* ============================================
   DASHBOARD
   ============================================ */
.today-absen {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(108,99,255,0.15) 0%, rgba(62,207,207,0.1) 100%);
  border-color: rgba(108,99,255,0.3);
}
.today-icon { font-size: 36px; flex-shrink: 0; }
.today-label { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.08em; }
.today-status { font-family: var(--font-head); font-size: 22px; font-weight: 700; margin-top: 4px; }
.today-time { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.btn-absen-now {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: var(--accent-grad);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-family: var(--font); font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
  box-shadow: var(--shadow-accent);
  white-space: nowrap;
}
.btn-absen-now:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-absen-now svg { width: 16px; height: 16px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  transition: background var(--transition), transform var(--transition);
}
.stat-card:hover { background: var(--bg-card-hover); transform: translateY(-2px); }
.stat-icon { font-size: 28px; flex-shrink: 0; }
.stat-val { font-family: var(--font-head); font-size: 28px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 11px; color: var(--text-secondary); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.07em; }

.mini-section { margin-bottom: 28px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-header h3 { font-family: var(--font-head); font-size: 17px; font-weight: 700; }
.btn-link { background: none; border: none; color: var(--accent-2); font-size: 13px; cursor: pointer; font-family: var(--font); transition: opacity var(--transition); }
.btn-link:hover { opacity: 0.7; }

/* Mini cal */
.mini-cal { padding: 20px; }
.mini-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mini-cal-header { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px; }
.mini-cal-dayname { text-align: center; font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
.mini-cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition);
}
.mini-cal-day.hadir { background: rgba(45,212,191,0.25); color: var(--green); font-weight: 600; }
.mini-cal-day.izin { background: rgba(251,191,36,0.25); color: var(--yellow); font-weight: 600; }
.mini-cal-day.alfa { background: rgba(248,113,113,0.2); color: var(--red); font-weight: 600; }
.mini-cal-day.today { outline: 2px solid var(--accent); outline-offset: 1px; }
.mini-cal-day.empty { opacity: 0; pointer-events: none; }

/* Recent list */
.recent-list { padding: 8px 0; }
.recent-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--glass-border);
  transition: background var(--transition);
}
.recent-item:last-child { border-bottom: none; }
.recent-item:hover { background: rgba(255,255,255,0.03); }
.recent-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.recent-badge.hadir { background: rgba(45,212,191,0.15); }
.recent-badge.izin { background: rgba(251,191,36,0.15); }
.recent-badge.alfa { background: rgba(248,113,113,0.12); }
.recent-date { font-size: 13px; font-weight: 500; }
.recent-time { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.recent-pill {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.recent-pill.hadir { background: rgba(45,212,191,0.15); color: var(--green); }
.recent-pill.izin { background: rgba(251,191,36,0.15); color: var(--yellow); }
.recent-pill.alfa { background: rgba(248,113,113,0.12); color: var(--red); }

.empty-msg { padding: 24px; text-align: center; color: var(--text-muted); font-size: 14px; }

/* ============================================
   ABSEN SCREEN
   ============================================ */
.absen-container { max-width: 760px; margin: 0 auto; }

.step-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 4px;
}
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  transition: all var(--transition);
}
.step span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}
.step.active {
  color: var(--accent-2);
  background: rgba(108,99,255,0.15);
  border-color: rgba(108,99,255,0.35);
}
.step.active span { background: var(--accent-grad); color: white; }
.step.done { color: var(--green); border-color: rgba(45,212,191,0.3); background: rgba(45,212,191,0.08); }
.step.done span { background: var(--green); color: #000; }
.step-line { flex: 1; height: 1px; min-width: 20px; background: var(--glass-border); }

.validation-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.val-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  transition: all var(--transition);
}
.val-card.ok { border-color: rgba(45,212,191,0.4); background: rgba(45,212,191,0.06); }
.val-card.err { border-color: rgba(248,113,113,0.4); background: rgba(248,113,113,0.06); }
.val-icon { font-size: 28px; flex-shrink: 0; }
.val-title { font-weight: 600; font-size: 14px; }
.val-desc { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }
.val-coord { font-size: 11px; color: var(--text-muted); margin-top: 3px; font-family: monospace; }
.val-status { margin-left: auto; font-size: 20px; flex-shrink: 0; }

/* Camera */
.camera-section { padding: 24px; margin-bottom: 20px; }
.camera-title { font-family: var(--font-head); font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.camera-hint { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; }
.camera-wrap {
  position: relative;
  width: 100%;
  max-width: 380px;
  margin: 0 auto 20px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  aspect-ratio: 4/3;
}
#camera-feed { width: 100%; height: 100%; object-fit: cover; display: block; }
#camera-canvas { display: none; }
.camera-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.camera-frame {
  width: 70%;
  height: 70%;
  border: 2.5px solid rgba(108,99,255,0.7);
  border-radius: 50%;
  box-shadow: 0 0 0 2000px rgba(0,0,0,0.25), inset 0 0 24px rgba(108,99,255,0.15);
}
.camera-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.photo-preview-wrap {
  margin-top: 20px;
  text-align: center;
  position: relative;
}
#photo-preview {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--accent);
  box-shadow: 0 0 24px rgba(108,99,255,0.4);
  margin-bottom: 10px;
  display: block;
  margin: 0 auto 10px;
}
.photo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(45,212,191,0.15);
  border: 1px solid rgba(45,212,191,0.3);
  border-radius: 999px;
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  margin-top: 10px;
}

/* Keterangan */
.keterangan-section { padding: 22px; margin-bottom: 20px; }
.keterangan-section h3 { font-family: var(--font-head); font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.input-select, .input-textarea, .input-field {
  width: 100%;
  padding: 11px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  margin-bottom: 12px;
}
.input-select { cursor: pointer; }
.input-select:focus, .input-textarea:focus, .input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}
.input-select option { background: #1a1a2e; color: var(--text-primary); }
.input-textarea { resize: vertical; min-height: 80px; }
.input-search {
  padding: 10px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  flex: 1;
}
.input-search:focus { border-color: var(--accent); }

.absen-actions { text-align: center; padding: 12px 0; }
.btn-big { padding: 16px 40px; font-size: 16px; border-radius: var(--radius-md); min-width: 220px; }
.btn-big svg { width: 20px; height: 20px; }
.submit-hint { font-size: 12px; color: var(--text-muted); margin-top: 12px; }

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease both;
}
.modal-card {
  width: 100%;
  max-width: 480px;
  padding: 36px;
  text-align: center;
  position: relative;
}
.modal-card h3 { font-family: var(--font-head); font-size: 22px; font-weight: 800; margin-bottom: 12px; }
.modal-card p { color: var(--text-secondary); font-size: 14px; margin-bottom: 20px; }
.modal-icon { font-size: 56px; margin-bottom: 16px; display: block; }
.success-anim { animation: popIn 0.5s cubic-bezier(0.34,1.56,0.64,1) both; }
@keyframes popIn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-photo-wrap { margin-bottom: 20px; }
.modal-photo-wrap img { width: 140px; height: 140px; object-fit: cover; border-radius: 50%; border: 3px solid var(--accent); box-shadow: 0 0 20px rgba(108,99,255,0.4); margin: 0 auto; display: block; }
.modal-actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; }

/* ============================================
   KALENDER
   ============================================ */
.cal-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  margin-bottom: 16px;
}
.cal-controls h3 { font-family: var(--font-head); font-size: 20px; font-weight: 700; }
.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-icon:hover { background: rgba(255,255,255,0.14); border-color: var(--accent); }
.btn-icon svg { width: 16px; height: 16px; }

.cal-legend {
  display: flex;
  gap: 16px;
  padding: 12px 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.leg { font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.leg.hadir { color: var(--green); }
.leg.izin { color: var(--yellow); }
.leg.alfa { color: var(--red); }
.leg.libur { color: var(--text-muted); }

.calendar-grid {
  padding: 20px;
}
.cal-grid-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
.cal-grid-dayname {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cal-grid-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  border: 1px solid transparent;
  position: relative;
  gap: 4px;
  padding: 8px 4px;
}
.cal-day:hover { border-color: var(--glass-border); background: rgba(255,255,255,0.05); }
.cal-day.empty { pointer-events: none; }
.cal-day.today { border-color: rgba(108,99,255,0.5); background: rgba(108,99,255,0.1); }
.cal-day.hadir { background: rgba(45,212,191,0.12); border-color: rgba(45,212,191,0.25); color: var(--green); }
.cal-day.izin { background: rgba(251,191,36,0.12); border-color: rgba(251,191,36,0.25); color: var(--yellow); }
.cal-day.alfa { background: rgba(248,113,113,0.1); border-color: rgba(248,113,113,0.2); color: var(--red); }
.cal-day.libur { background: rgba(255,255,255,0.03); color: var(--text-muted); }
.cal-day-num { font-size: 14px; font-weight: 600; }
.cal-day-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.cal-detail {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 280px;
  padding: 20px;
  z-index: 40;
  animation: slideUp 0.3s ease both;
}
.cal-detail h4 { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.cal-detail p { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.cal-detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  transition: color var(--transition);
}
.cal-detail-close:hover { color: var(--text-primary); }
.cal-detail-photo { width: 100%; border-radius: var(--radius-sm); margin-top: 10px; }

/* ============================================
   RIWAYAT TABLE
   ============================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-bar .input-select.sm { width: auto; flex: 1; min-width: 140px; margin-bottom: 0; }

.riwayat-table-wrap { overflow-x: auto; border-radius: var(--radius-lg); }
.riwayat-table { width: 100%; border-collapse: collapse; }
.riwayat-table th {
  text-align: left;
  padding: 14px 18px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
}
.riwayat-table td {
  padding: 14px 18px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
.riwayat-table tr:last-child td { border-bottom: none; }
.riwayat-table tr:hover td { background: rgba(255,255,255,0.02); }
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}
.status-pill.hadir { background: rgba(45,212,191,0.15); color: var(--green); }
.status-pill.izin { background: rgba(251,191,36,0.15); color: var(--yellow); }
.status-pill.alfa { background: rgba(248,113,113,0.12); color: var(--red); }
.table-photo {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: transform var(--transition);
}
.table-photo:hover { transform: scale(1.1); }

/* ============================================
   ADMIN PANEL
   ============================================ */
.tab-bar {
  display: flex;
  gap: 4px;
  padding: 6px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.tab {
  flex: 1;
  padding: 11px 16px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  min-width: max-content;
}
.tab:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }
.tab.active { background: var(--accent-grad); color: white; box-shadow: var(--shadow-accent); }

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }

.admin-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.emp-list-wrap { overflow-x: auto; }
.emp-table { width: 100%; border-collapse: collapse; }
.emp-table th {
  text-align: left;
  padding: 13px 16px;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.07em;
  border-bottom: 1px solid var(--glass-border);
}
.emp-table td { padding: 12px 16px; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }
.emp-table tr:hover td { background: rgba(255,255,255,0.02); }
.emp-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}
.btn-danger-sm {
  padding: 6px 12px;
  background: rgba(248,113,113,0.12);
  border: 1px solid rgba(248,113,113,0.25);
  border-radius: 6px;
  color: var(--red);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-danger-sm:hover { background: rgba(248,113,113,0.2); }

/* Pengaturan */
.settings-wrap { padding: 28px; max-width: 520px; }
.settings-wrap h4 { font-family: var(--font-head); font-size: 18px; font-weight: 700; margin-bottom: 24px; }
.settings-item { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.settings-item label { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.settings-note { margin-top: 16px; font-size: 12px; font-weight: 600; }
.settings-note.ok { color: var(--green); }
.settings-note.err { color: var(--red); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .validation-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 280px; }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: 4px 0 40px rgba(0,0,0,0.5);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: flex; }
  .sidebar-overlay.open { display: block; }

  .main-content { margin-left: 0; }

  .topbar-menu { display: flex; }
  .topbar-date { display: none; }

  .page-screen { padding: 18px 16px 60px; }
  .page-header h2 { font-size: 22px; }

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

  .today-absen { gap: 12px; }
  .btn-absen-now { margin-left: 0; width: 100%; justify-content: center; }

  .cal-detail { right: 12px; bottom: 12px; left: 12px; width: auto; }

  .filter-bar { gap: 8px; }
  .filter-bar .input-select.sm { min-width: 120px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .step-bar { gap: 2px; }
  .step { padding: 6px 10px; font-size: 11px; }
}
