/* ============================================================
   ABSENSI APP — Premium Modern Redesign
   PT. Bojana Service Indonesia
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  --primary: #0f4c81;
  --primary-mid: #1a6bb5;
  --primary-light: #dbeafe;
  --primary-soft: #f0f7ff;
  --accent: #f59e0b;
  --accent-light: #fef3c7;
  --success: #059669;
  --success-light: #d1fae5;
  --warning: #d97706;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --bg: #f0f4f8;
  --bg-card: #ffffff;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 4px 24px rgba(15,76,129,0.10);
  --shadow-sm: 0 2px 10px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 32px rgba(15,76,129,0.13);
  --radius: 20px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --navbar-h: 72px;
  --header-h: 64px;
  --font: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%; width: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

/* ==================== LOGIN ==================== */
.login-bg {
  position: fixed; inset: 0;
  background: linear-gradient(150deg, #0a3460 0%, #1557a0 45%, #0f4c81 100%);
}
.login-bg::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 10% 90%, rgba(245,158,11,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 90% 10%, rgba(96,165,250,0.12) 0%, transparent 60%);
}
.login-bg::after {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 28px 28px;
}

.login-container {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 1;
}
.login-card {
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(24px);
  border-radius: 28px;
  padding: 40px 32px 36px; width: 100%; max-width: 400px;
  box-shadow: 0 40px 100px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.5);
  position: relative; overflow: hidden;
}
.login-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--primary-mid) 60%, var(--primary) 100%);
}
.login-card::after {
  content: '';
  position: absolute; bottom: -60px; right: -60px;
  width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(15,76,129,0.05), transparent 70%);
  pointer-events: none;
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-icon { display: flex; justify-content: center; margin-bottom: 14px; }
.login-logo h1 {
  font-size: 19px; font-weight: 800; color: var(--primary);
  line-height: 1.3; letter-spacing: -0.4px;
}
.login-logo p { font-size: 12px; color: var(--text-muted); margin-top: 5px; font-weight: 500; }

/* Floating label fields */
.login-field-wrap { position: relative; margin-bottom: 18px; }
.login-field-input {
  width: 100%; padding: 16px 48px 16px 16px;
  border: 1.5px solid #e2e8f0; border-radius: 14px;
  font-size: 15px; color: var(--text);
  background: #f8fafc; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  font-family: var(--font);
  appearance: none;
}
.login-field-input:focus {
  border-color: var(--primary); background: white;
  box-shadow: 0 0 0 4px rgba(15,76,129,0.09);
}
.login-field-label {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
  font-size: 15px; color: #94a3b8;
  pointer-events: none; transition: all 0.18s ease;
  background: #f8fafc; padding: 0 4px; line-height: 1;
  font-family: var(--font); font-weight: 500;
}
.login-field-input:focus + .login-field-label,
.login-field-input:not(:placeholder-shown) + .login-field-label {
  top: 0; transform: translateY(-50%);
  font-size: 11px; color: var(--primary); font-weight: 700;
  background: white; letter-spacing: 0.3px;
}
.login-field-input:not(:focus):not(:placeholder-shown) + .login-field-label { color: #64748b; }
.login-field-input::placeholder { color: transparent; }
.login-toggle-pw {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  padding: 4px; display: flex; align-items: center; z-index: 2;
}
.btn-login {
  width: 100%; padding: 16px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 100%);
  color: white; border: none; border-radius: 14px;
  font-size: 15px; font-weight: 800; cursor: pointer; margin-top: 6px;
  transition: all 0.22s; letter-spacing: 0.3px;
  font-family: var(--font);
  box-shadow: 0 8px 24px rgba(15,76,129,0.38);
  position: relative; overflow: hidden;
}
.btn-login::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 100%);
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(15,76,129,0.48); }
.btn-login:active { transform: scale(0.98); }

/* ==================== HEADER ==================== */
.app-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: linear-gradient(135deg, #0a3460 0%, var(--primary) 60%, #1557a0 100%);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; z-index: 100;
  box-shadow: 0 4px 20px rgba(10,52,96,0.35);
}
.app-header::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, rgba(245,158,11,0.2) 50%, transparent 100%);
}
.header-left { display: flex; align-items: center; gap: 10px; }
.header-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: white;
  border: 2px solid rgba(255,255,255,0.28);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.header-greeting { font-size: 10px; color: rgba(255,255,255,0.65); font-weight: 500; text-transform: uppercase; letter-spacing: 0.6px; }
.header-name { font-size: 14px; font-weight: 800; color: white; letter-spacing: -0.2px; }
.header-right { display: flex; align-items: center; gap: 8px; }
.header-date { font-size: 10px; color: rgba(255,255,255,0.7); text-align: right; font-weight: 500; line-height: 1.6; }
.btn-logout {
  background: rgba(255,255,255,0.1); border: 1.5px solid rgba(255,255,255,0.2);
  color: white; width: 34px; height: 34px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all 0.2s;
}
.btn-logout:hover { background: rgba(255,255,255,0.22); }

/* ==================== MAIN CONTENT ==================== */
.app-content {
  padding-top: calc(var(--header-h) + 14px);
  padding-bottom: calc(var(--navbar-h) + 16px);
  padding-left: 14px; padding-right: 14px;
  min-height: 100vh;
}
.page-section { animation: fadeIn 0.3s ease; }

/* ==================== BOTTOM NAV ==================== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--navbar-h);
  background: white;
  display: flex; align-items: center;
  border-top: 1px solid rgba(226,232,240,0.8);
  box-shadow: 0 -6px 28px rgba(0,0,0,0.08);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  padding: 6px 4px; gap: 3px;
  transition: all 0.2s;
  color: #94a3b8;
  position: relative;
}
.nav-btn.active { color: var(--primary); }
.nav-icon-wrap {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: all 0.22s;
}
.nav-btn.active .nav-icon-wrap {
  background: var(--primary);
}
.nav-icon { display: flex; align-items: center; justify-content: center; }
.nav-btn:not(.active) .nav-icon svg { color: #94a3b8; }
.nav-btn.active .nav-icon svg { color: white; }
.nav-label { font-size: 9.5px; font-weight: 700; letter-spacing: 0.2px; }
.nav-btn.active .nav-label { color: var(--primary); }
.nav-btn:not(.active) .nav-label { color: #94a3b8; }
.nav-badge {
  position: absolute; top: 4px; right: calc(50% - 22px);
  min-width: 16px; height: 16px; border-radius: 8px;
  background: var(--danger); border: 2px solid white;
  color: white; font-size: 9px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px; line-height: 1;
}

/* ==================== HOME: STATUS CARD ==================== */
.home-clock-card {
  background: linear-gradient(140deg, #0a3460 0%, var(--primary) 50%, #1762b0 100%);
  border-radius: var(--radius); padding: 22px 20px 0;
  color: white; margin-bottom: 14px;
  box-shadow: 0 10px 36px rgba(10,52,96,0.32);
  overflow: hidden; position: relative;
}
.home-clock-card::before {
  content: '';
  position: absolute; top: -40px; right: -40px;
  width: 160px; height: 160px; border-radius: 50%;
  background: rgba(255,255,255,0.04);
}
.home-clock-card::after {
  content: '';
  position: absolute; bottom: 0; right: 18px;
  width: 90px; height: 90px; border-radius: 50%;
  background: rgba(245,158,11,0.08);
}
.home-clock-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 6px;
}
.home-clock-greeting { font-size: 12px; opacity: 0.7; font-weight: 500; }
.home-clock-date { font-size: 12px; opacity: 0.8; font-weight: 600; text-align: right; }
.live-clock {
  font-family: var(--font-mono);
  font-size: 46px; font-weight: 700;
  letter-spacing: 3px; text-align: center;
  margin: 8px 0 18px; position: relative; z-index: 1;
  text-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

/* Timeline checkpoint row */
.timeline-checkpoint {
  display: flex; gap: 0; margin: 0 -20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.12);
}
.checkpoint-item {
  flex: 1; padding: 14px 16px; text-align: center;
  position: relative;
}
.checkpoint-item:not(:last-child)::after {
  content: '';
  position: absolute; right: 0; top: 22%; bottom: 22%;
  width: 1px; background: rgba(255,255,255,0.12);
}
.checkpoint-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,0.2);
  margin: 0 auto 6px; border: 2px solid rgba(255,255,255,0.35);
  transition: all 0.3s;
}
.checkpoint-dot.done {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(245,158,11,0.7);
}
.checkpoint-label { font-size: 10px; opacity: 0.6; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; }
.checkpoint-time {
  font-family: var(--font-mono);
  font-size: 15px; font-weight: 700; margin-top: 3px;
  color: rgba(255,255,255,0.85);
}
.checkpoint-time.done { color: var(--accent); }

/* ==================== NOTICE BANNER ==================== */
.notice-banner {
  background: linear-gradient(135deg, #fffbeb, #fef9ec);
  border: 1.5px solid rgba(245,158,11,0.4);
  border-radius: var(--radius-sm); padding: 11px 14px;
  display: flex; gap: 8px; align-items: center;
  font-size: 13px; color: #92400e; margin-bottom: 12px;
  font-weight: 600; box-shadow: 0 2px 10px rgba(245,158,11,0.1);
}

/* ==================== STATS GRID ==================== */
.stats-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; margin-bottom: 16px;
}
.stat-card {
  background: white; border-radius: var(--radius-sm);
  padding: 12px 14px; box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  transition: transform 0.18s, box-shadow 0.18s;
}
.stat-card:active { transform: scale(0.97); }
.stat-icon {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { display: block; }
.stat-icon.ic-green  { background: #d1fae5; }
.stat-icon.ic-amber  { background: #fef3c7; }
.stat-icon.ic-red    { background: #fee2e2; }
.stat-icon.ic-purple { background: #ede9fe; }
.stat-icon.ic-blue   { background: #dbeafe; }
.stat-body { min-width: 0; }
.stat-value { font-size: 22px; font-weight: 800; color: var(--text); font-family: var(--font-mono); line-height: 1; }
.stat-label { font-size: 10px; color: var(--text-muted); font-weight: 700; margin-top: 3px; text-transform: uppercase; letter-spacing: 0.4px; }

.section-title {
  font-size: 13px; font-weight: 800; color: var(--text);
  margin-bottom: 10px; margin-top: 4px;
  letter-spacing: 0.2px; text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  content: '';
  width: 4px; height: 16px; border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), #f59e0b88);
  display: inline-block; flex-shrink: 0;
}

/* ==================== RECENT ABSENSI ==================== */
.recent-list { display: flex; flex-direction: column; gap: 0; }
.absensi-card {
  background: white; border-radius: 0; padding: 12px 14px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.absensi-card:first-child { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.absensi-card:last-child { border-radius: 0 0 var(--radius-sm) var(--radius-sm); border-bottom: none; }
.absensi-card:only-child { border-radius: var(--radius-sm); }
.absensi-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--border); border-radius: 3px 0 0 3px;
}
.absensi-card.status-hadir::before { background: var(--success); }
.absensi-card.status-ijin::before { background: var(--warning); }
.absensi-card.status-alpha::before { background: var(--danger); }
.absensi-card-left { padding-left: 8px; }
.absensi-card-date { font-size: 13px; font-weight: 700; color: var(--text); }
.absensi-card-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; font-weight: 500; font-family: var(--font-mono); }
.absensi-card-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.badge {
  font-size: 11px; font-weight: 700; padding: 4px 11px;
  border-radius: 20px; display: inline-block; letter-spacing: 0.3px;
}
.badge-hadir { background: var(--success-light); color: var(--success); }
.badge-ijin { background: var(--accent-light); color: var(--warning); }
.badge-alpha { background: var(--danger-light); color: var(--danger); }
.badge-terlambat { background: #fef2f2; color: var(--danger); font-size: 10px; }

/* ==================== ABSENSI PAGE TABS ==================== */
.absensi-tabs {
  display: flex; gap: 0; margin-bottom: 16px;
  background: white; border-radius: var(--radius-sm);
  padding: 5px; box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.tab-btn {
  flex: 1; padding: 10px 8px;
  background: none; border: none; cursor: pointer;
  font-size: 13px; font-weight: 700; color: var(--text-muted);
  border-radius: var(--radius-xs); transition: all 0.2s;
  font-family: var(--font);
}
.tab-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  color: white;
  box-shadow: 0 3px 10px rgba(15,76,129,0.28);
}

/* ==================== ABSENSI STATUS CHIPS ==================== */
.absen-status-row {
  display: flex; gap: 10px; margin-bottom: 14px;
}
.absen-status-chip {
  flex: 1; padding: 12px 10px; text-align: center;
  background: #f8fafc; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  border: 1.5px solid var(--border); transition: all 0.3s;
  font-family: var(--font-mono);
}

/* ==================== GPS BAR (inline compact, menggantikan gps-card) ==================== */
.gps-bar {
  display: flex; align-items: center; gap: 8px;
  background: white; border-radius: var(--radius-xs);
  padding: 9px 12px; margin-bottom: 8px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm); transition: all 0.25s;
  min-height: 40px;
}
.gps-bar.state-ok   { border-color: rgba(5,150,105,0.45);  background: #f0fdf4; }
.gps-bar.state-warn { border-color: rgba(245,158,11,0.45); background: #fffbeb; }
.gps-bar.state-err  { border-color: rgba(220,38,38,0.45);  background: #fef2f2; }
.gps-bar-icon  { font-size: 16px; flex-shrink: 0; }
.gps-bar-label { font-size: 12px; font-weight: 600; color: var(--text); flex: 1; line-height: 1.35; }
.gps-bar-dist  { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); white-space: nowrap; flex-shrink: 0; }
.gps-bar-retry {
  background: none; border: 1.5px solid var(--danger); color: var(--danger);
  border-radius: 8px; padding: 3px 9px; font-size: 13px; cursor: pointer;
  flex-shrink: 0; font-family: var(--font);
}
/* Tetap support .gps-card class lama agar JS setGpsCard tetap bekerja */
.gps-card { display: none !important; }

/* ==================== STATIC MAP ==================== */
.staticmap-wrap {
  border-radius: var(--radius-xs); overflow: hidden;
  margin-bottom: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.10);
  border: 1px solid var(--border); background: #e8e0d8;
  position: relative; max-width: 100%;
}
/* HP: batasi tinggi peta agar tidak terlalu besar */
@media (max-width: 599px) {
  .staticmap-wrap { max-height: 160px; overflow: hidden; }
  .staticmap-canvas { max-height: 140px; object-fit: cover; }
}
/* PC/tablet: peta terpusat, lebar sedang */
@media (min-width: 600px) {
  .staticmap-wrap { max-width: 360px; margin-left: auto; margin-right: auto; }
}
.staticmap-canvas {
  display: block; width: 100%; height: auto;
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
}
.staticmap-legend {
  display: flex; gap: 14px; padding: 5px 10px;
  background: white; border-top: 1px solid var(--border);
  font-size: 10px; color: var(--text-muted); font-weight: 600;
}
.sml-item { display: flex; align-items: center; gap: 4px; }
.sml-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.sml-office { background: var(--primary); }
.sml-user   { background: #059669; }

/* ==================== ABSEN BUTTONS ==================== */
.absen-btn-row {
  display: flex; flex-direction: column; gap: 12px;
}
.btn-absen {
  width: 100%; padding: 0; border: none; cursor: pointer;
  border-radius: 18px; overflow: hidden;
  transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
  font-family: var(--font);
  position: relative;
}
.btn-absen:not(:disabled):active { transform: scale(0.97); }
.btn-absen-inner {
  display: flex; align-items: center;
  padding: 18px 20px; gap: 14px;
  position: relative; z-index: 1;
}
.btn-absen-icon-wrap {
  width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.btn-absen-text { text-align: left; flex: 1; }
.btn-absen-label {
  font-size: 16px; font-weight: 800; display: block;
  letter-spacing: -0.2px;
}
.btn-absen-sub { font-size: 12px; font-weight: 500; opacity: 0.75; margin-top: 1px; display: block; }
.btn-absen-arrow { font-size: 18px; opacity: 0.6; }

/* Masuk */
.btn-masuk {
  background: linear-gradient(135deg, #0a3460 0%, var(--primary-mid) 100%);
  box-shadow: 0 8px 28px rgba(10,52,96,0.38);
  color: white;
}
.btn-masuk .btn-absen-icon-wrap { background: rgba(255,255,255,0.18); }
.btn-masuk:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(10,52,96,0.48); }

/* Pulang */
.btn-pulang {
  background: linear-gradient(135deg, #6d28d9 0%, #7c3aed 100%);
  box-shadow: 0 8px 28px rgba(109,40,217,0.38);
  color: white;
}
.btn-pulang .btn-absen-icon-wrap { background: rgba(255,255,255,0.18); }
.btn-pulang:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(109,40,217,0.48); }

/* DISABLED state */
.btn-absen:disabled {
  cursor: not-allowed; opacity: 0.45;
  transform: none !important;
  box-shadow: none !important;
  filter: grayscale(0.3);
}

/* DONE / Sudah Absen state */
.btn-absen.btn-done {
  cursor: not-allowed;
  background: #f1f5f9 !important;
  box-shadow: none !important;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  transform: none !important;
}
.btn-absen.btn-done .btn-absen-icon-wrap { background: var(--success-light); }
.btn-absen.btn-done .btn-absen-label { color: var(--success); }
.btn-absen.btn-done .btn-absen-sub { color: var(--text-muted); }

/* ==================== FORMS ==================== */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block; font-size: 11px; font-weight: 700;
  color: var(--text-muted); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.form-input {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-xs);
  font-size: 14px; color: var(--text);
  background: white; outline: none; transition: all 0.2s;
  appearance: none; font-family: var(--font);
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(15,76,129,0.07);
  background: white;
}
.form-input-sm {
  padding: 9px 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius-xs);
  font-size: 13px; color: var(--text);
  background: white; outline: none; appearance: none;
  cursor: pointer; font-family: var(--font);
}
.form-input-sm:focus { border-color: var(--primary); }
textarea.form-input { resize: vertical; min-height: 80px; }
.filter-row { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }

/* ==================== BUTTONS ==================== */
.btn-primary {
  width: 100%; padding: 13px; border: none;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 100%);
  color: white; border-radius: var(--radius-xs);
  font-size: 15px; font-weight: 800; cursor: pointer;
  box-shadow: 0 4px 16px rgba(15,76,129,0.3);
  transition: all 0.2s; font-family: var(--font);
}
.btn-primary:active { transform: scale(0.98); }
.btn-secondary {
  padding: 11px 20px; border: 1.5px solid var(--border);
  background: white; color: var(--text); border-radius: var(--radius-xs);
  font-size: 14px; font-weight: 600; cursor: pointer; font-family: var(--font);
  transition: all 0.15s;
}
.btn-secondary:hover { background: #f8fafc; }
.btn-add {
  padding: 9px 16px; background: linear-gradient(135deg, var(--primary), var(--primary-mid)); color: white;
  border: none; border-radius: var(--radius-xs);
  font-size: 13px; font-weight: 700; cursor: pointer;
  white-space: nowrap; font-family: var(--font);
  box-shadow: 0 3px 10px rgba(15,76,129,0.25);
}
.btn-sm {
  padding: 8px 14px; background: var(--primary-light); color: var(--primary);
  border: none; border-radius: 8px; font-size: 13px;
  font-weight: 700; cursor: pointer; font-family: var(--font);
  transition: all 0.15s;
}
.btn-sm:hover { background: var(--primary); color: white; }
.btn-success {
  background: #dcfce7; color: #059669;
}
.btn-icon {
  background: none; border: none; cursor: pointer;
  font-size: 18px; padding: 4px; border-radius: 6px;
  transition: background 0.2s;
}
.btn-icon:hover { background: var(--bg); }

/* ==================== REKAP LIST ==================== */
.rekap-list { display: flex; flex-direction: column; gap: 8px; }
.rekap-card {
  background: white; border-radius: var(--radius-sm);
  padding: 12px 14px; display: flex;
  justify-content: space-between; align-items: center;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  border-left: 4px solid var(--border);
}
.rekap-card.status-hadir { border-left-color: var(--success); }
.rekap-card.status-ijin { border-left-color: var(--accent); }
.rekap-card.status-alpha { border-left-color: var(--danger); }
.rekap-card.status-libur { border-left-color: #8b5cf6; }

/* ==================== GAJI ==================== */
.gaji-card {
  background: white; border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
  border: 1px solid var(--border); margin-bottom: 14px;
}
.gaji-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.gaji-header h2 { font-size: 18px; font-weight: 800; color: var(--primary); }
.gaji-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.gaji-row:last-child { border-bottom: none; }
.gaji-row.total { font-weight: 800; font-size: 15px; color: var(--success); border-top: 2px solid var(--text); margin-top: 4px; padding-top: 12px; }

/* ==================== PROFILE ==================== */
.profile-header {
  background: white; border-radius: var(--radius);
  padding: 28px 20px 24px; text-align: center;
  box-shadow: var(--shadow-sm); margin-bottom: 14px;
  border: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.profile-header::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 72px;
  background: linear-gradient(135deg, #0a3460, var(--primary-mid));
  border-radius: var(--radius) var(--radius) 0 0;
}
.profile-photo-wrap {
  position: relative;
  display: block;
  width: 90px;
  margin: 0 auto 12px;
  cursor: pointer;
  z-index: 1;
}
.profile-avatar-container {
  width: 90px; height: 90px; border-radius: 50%;
  overflow: hidden;
  border: 3px solid white; box-shadow: 0 6px 20px rgba(15,76,129,0.28);
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  flex-shrink: 0;
  position: relative;
}
.profile-avatar-large {
  width: 90px; height: 90px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  color: white; font-size: 36px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
img.profile-avatar-large {
  width: 90px; height: 90px; border-radius: 50%;
  object-fit: cover; display: block; flex-shrink: 0;
}
.profile-photo-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.35);
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; opacity: 0; transition: opacity 0.2s;
}
.profile-avatar-container:hover .profile-photo-overlay,
.profile-avatar-container:active .profile-photo-overlay { opacity: 1; }
.btn-change-photo {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--primary-light); color: var(--primary);
  border-radius: 20px; padding: 5px 14px;
  font-size: 12px; font-weight: 700; cursor: pointer;
  margin-bottom: 8px; border: none; font-family: var(--font);
  position: relative; z-index: 1;
}
.profile-header h2 { font-size: 20px; font-weight: 800; margin: 4px 0; position: relative; z-index: 1; }
.profile-role-badge {
  display: inline-block; background: var(--primary-light);
  color: var(--primary); border-radius: 20px;
  padding: 4px 14px; font-size: 11px; font-weight: 800;
  margin-top: 6px; letter-spacing: 0.3px; text-transform: uppercase;
  position: relative; z-index: 1;
}
.profile-status-wrap {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 10px; cursor: pointer; padding: 6px 14px;
  border-radius: 20px; background: #f0f4f8;
  border: 1px dashed var(--border); max-width: 90%;
  transition: background 0.15s; position: relative; z-index: 1;
}
.profile-status-wrap:hover { background: var(--primary-light); }
.profile-status-text {
  font-size: 12px; color: var(--text-muted); font-style: italic;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px;
}
.profile-status-text.has-status {
  color: var(--text); font-style: normal; font-weight: 600;
}
.profile-status-edit-icon { opacity: 0.4; flex-shrink: 0; }
.status-suggestions { margin-top: 10px; }
.status-sug-label { font-size: 11px; color: var(--text-muted); font-weight: 700; margin-bottom: 8px; }
.status-sug-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.status-sug-chips span {
  background: var(--primary-light); color: var(--primary);
  border-radius: 20px; padding: 5px 12px; font-size: 11px; font-weight: 700;
  cursor: pointer; transition: background 0.15s;
}
.status-sug-chips span:hover { background: var(--primary); color: white; }
.btn-danger-sm {
  background: #fee2e2; color: #dc2626; border: none; border-radius: 8px;
  padding: 8px 14px; font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all 0.15s;
}
.btn-danger-sm:hover { background: #dc2626; color: white; }
.label-hint {
  font-size: 10px; color: var(--text-muted); font-weight: 500; font-style: italic;
}
.photo-lightbox {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.88);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease; backdrop-filter: blur(8px);
}
.photo-lightbox-inner { position: relative; animation: lightboxZoom 0.25s cubic-bezier(0.34,1.56,0.64,1); }
.photo-lightbox-avatar {
  width: 260px; height: 260px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  color: white; font-size: 96px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  object-fit: cover; box-shadow: 0 24px 70px rgba(0,0,0,0.5);
  border: 4px solid rgba(255,255,255,0.2);
}
.photo-lightbox-close {
  position: absolute; top: -12px; right: -12px;
  background: rgba(255,255,255,0.15); border: none; border-radius: 50%;
  width: 36px; height: 36px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 16px;
}
img.photo-lightbox-avatar { width: 260px; height: 260px; border-radius: 50%; object-fit: cover; box-shadow: 0 24px 70px rgba(0,0,0,0.5); border: 4px solid rgba(255,255,255,0.2); display: block; }
.profile-info-card {
  background: white; border-radius: var(--radius-sm);
  padding: 16px; box-shadow: var(--shadow-sm);
  margin-bottom: 16px; border: 1px solid var(--border);
}
.info-row {
  display: flex; justify-content: space-between; padding: 9px 0;
  border-bottom: 1px solid var(--border); font-size: 13px;
}
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-muted); font-weight: 600; }
.info-value { font-weight: 700; text-align: right; max-width: 60%; }

/* ==================== ADMIN ==================== */
.admin-toolbar { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; }
.settings-card {
  background: white; border-radius: var(--radius-sm);
  padding: 16px; box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: 14px;
}
.settings-card:last-child { margin-bottom: 0; }
.settings-card h3 {
  font-size: 13px; font-weight: 800; color: var(--primary);
  margin: 0 0 12px; text-transform: uppercase; letter-spacing: 0.5px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.settings-card-footer {
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end;
}
.settings-note {
  font-size: 11px; color: var(--text-muted); font-weight: 500;
  background: var(--primary-soft); border-radius: 8px; padding: 8px 10px;
  margin-bottom: 12px; line-height: 1.5;
  border-left: 3px solid var(--primary-light);
}

/* ==================== SETTINGS REDESIGN (sett-*) ==================== */
.sett-card {
  background: white;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: 14px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.sett-card:last-child { margin-bottom: 0; }
.sett-card:hover { box-shadow: var(--shadow); }

.sett-card-header {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to right, var(--primary-soft), white);
}
.sett-card-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.sett-card-title {
  font-size: 13px; font-weight: 800; color: var(--text);
  letter-spacing: 0.2px;
}
.sett-card-subtitle {
  font-size: 11px; color: var(--text-muted); font-weight: 500; margin-top: 2px;
}

.sett-field-group {
  padding: 14px 16px 0;
  display: flex; flex-direction: column; gap: 12px;
}
.sett-field-row {
  flex-direction: row; gap: 10px;
}
.sett-field-row .sett-field { flex: 1; min-width: 0; }

.sett-field { display: flex; flex-direction: column; gap: 5px; }

.sett-label {
  font-size: 11px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px;
  display: flex; align-items: center; gap: 4px;
}
.sett-input {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 13px; font-weight: 600;
  font-family: var(--font); color: var(--text);
  background: #fafbfc;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  outline: none;
}
.sett-input:focus {
  border-color: var(--primary-mid);
  background: white;
  box-shadow: 0 0 0 3px rgba(15,76,129,0.10);
}
.sett-input-time {
  font-family: var(--font-mono); font-size: 15px; letter-spacing: 0.5px;
}
.sett-divider-v {
  display: flex; align-items: flex-end; padding-bottom: 11px;
  color: var(--text-muted); font-size: 16px; font-weight: 700; flex-shrink: 0;
}

/* Prefix Rp wrapper */
.sett-input-prefix-wrap {
  display: flex; align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  overflow: hidden;
  background: #fafbfc;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.sett-input-prefix-wrap:focus-within {
  border-color: var(--primary-mid);
  background: white;
  box-shadow: 0 0 0 3px rgba(15,76,129,0.10);
}
.sett-input-prefix {
  padding: 0 10px; font-size: 12px; font-weight: 800;
  color: var(--text-muted); background: #f1f5f9;
  border-right: 1.5px solid var(--border);
  align-self: stretch; display: flex; align-items: center;
  white-space: nowrap; flex-shrink: 0;
}
.sett-input-prefixed {
  border: none; border-radius: 0; background: transparent;
  box-shadow: none; flex: 1;
}
.sett-input-prefixed:focus { box-shadow: none; }

/* Sub-section gaji */
.sett-gaji-section { padding: 12px 16px 0; }
.sett-gaji-section:first-of-type { padding-top: 14px; }
.sett-gaji-section-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 10px; font-weight: 800; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.sett-gaji-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}

.sett-card-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: #fafbfc;
  display: flex; justify-content: flex-end;
  margin-top: 14px;
}
.sett-btn-save {
  display: inline-flex; align-items: center; gap: 7px;
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  color: white; border: none; border-radius: 10px;
  padding: 10px 20px; font-size: 13px; font-weight: 700;
  font-family: var(--font); cursor: pointer;
  box-shadow: 0 4px 14px rgba(15,76,129,0.28);
  transition: all 0.2s;
}
.sett-btn-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15,76,129,0.35);
}
.sett-btn-save:active { transform: scale(0.97); }
.sett-favicon-upload-label {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; background: #f1f5f9; border: 1.5px dashed #94a3b8;
  border-radius: 8px; cursor: pointer; font-size: 13px; color: #334155;
  font-weight: 600; transition: background .15s, border-color .15s;
}
.sett-favicon-upload-label:hover { background: #e2e8f0; border-color: #7c3aed; color: #7c3aed; }
.libur-card {
  background: white; border-radius: var(--radius-sm);
  padding: 12px 14px; display: flex;
  justify-content: space-between; align-items: center;
  box-shadow: var(--shadow-sm); margin-bottom: 8px;
  border: 1px solid var(--border);
}
.karyawan-card {
  background: white; border-radius: var(--radius-sm);
  padding: 14px; box-shadow: var(--shadow-sm);
  margin-bottom: 8px; border: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}

/* ==================== MODAL ==================== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(10,20,40,0.55); z-index: 200;
  backdrop-filter: blur(4px);
}
.modal {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: white; z-index: 201;
  border-radius: 26px 26px 0 0;
  max-height: 90vh; overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.modal::before {
  content: '';
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  width: 36px; height: 4px; border-radius: 2px;
  background: #e2e8f0;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 20px 14px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: white; z-index: 1;
}
.modal-header h3 { font-size: 16px; font-weight: 800; }
.modal-close {
  background: #f1f5f9; border: none; cursor: pointer;
  width: 30px; height: 30px; border-radius: 50%;
  font-size: 14px; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: background 0.15s;
}
.modal-close:hover { background: var(--border); }
.modal-body { padding: 16px 20px; }
.modal-footer {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
  position: sticky; bottom: 0; background: white;
}
.modal-footer .btn-primary { width: auto; padding: 11px 24px; }

/* ==================== SLIP GAJI ==================== */
.slip-header { text-align: center; margin-bottom: 16px; }
.slip-header h2 { font-size: 18px; font-weight: 800; color: var(--primary); }
.slip-header p { font-size: 12px; color: var(--text-muted); }
.slip-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.slip-table td { padding: 7px 4px; border-bottom: 1px solid var(--border); }
.slip-table td:last-child { text-align: right; font-weight: 700; }
.slip-table tr.total-row td { font-weight: 800; font-size: 15px; color: var(--success); border-top: 2px solid var(--text); }

/* ==================== TOAST & LOADING ==================== */
.toast {
  position: fixed; bottom: calc(var(--navbar-h) + 14px);
  left: 50%; transform: translateX(-50%);
  background: rgba(10,20,40,0.95); color: white;
  padding: 12px 24px; border-radius: 30px;
  font-size: 13px; font-weight: 700; z-index: 300;
  white-space: nowrap; box-shadow: 0 6px 24px rgba(0,0,0,0.3);
  animation: fadeIn 0.3s ease; font-family: var(--font);
}
.toast.success { background: rgba(5,150,105,0.97); }
.toast.error { background: rgba(220,38,38,0.97); }
.loading-overlay {
  position: fixed; inset: 0; background: rgba(255,255,255,0.92);
  z-index: 400; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  backdrop-filter: blur(6px);
}
.loading-spinner {
  width: 44px; height: 44px;
  border: 3px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
.loading-text { font-size: 14px; font-weight: 700; color: var(--text-muted); }

/* ==================== ADMIN TABS SCROLLABLE ==================== */
.admin-tabs-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-bottom: 16px;
}
.admin-tabs-wrap::-webkit-scrollbar { display: none; }
.admin-tabs-wrap .absensi-tabs {
  display: flex; gap: 0; flex-wrap: nowrap;
  min-width: max-content; margin-bottom: 0;
  border-radius: var(--radius-sm); padding: 5px;
  background: white; box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.admin-tabs-wrap .tab-btn {
  flex: none; white-space: nowrap;
  padding: 10px 14px; font-size: 12px;
}

/* ==================== IJIN REVIEW CARD ==================== */
.ijin-review-card {
  background: white; border-radius: var(--radius-sm);
  padding: 14px 16px; margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  transition: all 0.2s;
}
.ijin-review-card:last-child { margin-bottom: 0; }
.ijin-review-header {
  display: flex; justify-content: space-between;
  align-items: flex-start; margin-bottom: 10px;
}
.ijin-review-nama { font-size: 14px; font-weight: 800; color: var(--text); margin-bottom: 3px; }
.ijin-review-meta { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.ijin-review-ket {
  font-size: 12px; color: var(--text-muted);
  background: var(--bg); border-radius: 8px;
  padding: 8px 10px; margin-bottom: 10px;
  font-style: italic; line-height: 1.5;
}
.ijin-review-actions { display: flex; gap: 8px; }
.ijin-review-actions .btn-sm { flex: 1; text-align: center; }

/* ==================== IJIN RIWAYAT CARD ==================== */
.ijin-item-card {
  background: white; border-radius: var(--radius-sm);
  padding: 12px 14px; display: flex;
  justify-content: space-between; align-items: flex-start;
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  transition: all 0.2s;
}
.ijin-item-card.status-menunggu { border-left-color: var(--accent); }
.ijin-item-card.status-disetujui { border-left-color: var(--success); }
.ijin-item-card.status-ditolak { border-left-color: var(--danger); }
.ijin-item-left { flex: 1; }
.ijin-item-date { font-size: 13px; font-weight: 700; color: var(--text); }
.ijin-item-tipe { font-size: 11px; color: var(--text-muted); margin-top: 2px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.ijin-item-ket { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-style: italic; }
.ijin-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; margin-left: 10px; }
.ijin-item-actions { display: flex; gap: 6px; margin-top: 4px; }
.btn-xs {
  padding: 5px 10px; font-size: 11px; font-weight: 700;
  border-radius: 8px; border: none; cursor: pointer;
  font-family: var(--font); transition: all 0.15s;
}
.btn-xs-edit { background: var(--primary-light); color: var(--primary); }
.btn-xs-batal { background: var(--danger-light); color: var(--danger); }
.btn-xs-edit:hover { background: var(--primary); color: white; }
.btn-xs-batal:hover { background: var(--danger); color: white; }

#riwayatIjinList { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }

/* ==================== EMPTY STATE ==================== */
.empty-state {
  text-align: center; padding: 36px 16px;
  color: var(--text-muted); font-size: 14px; font-weight: 500;
}

/* ==================== UTILITIES ==================== */
.hidden { display: none !important; }
.admin-tab-content { animation: fadeIn 0.2s ease; }
.badge-notif {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--danger); color: white;
  border-radius: 50%; width: 18px; height: 18px;
  font-size: 10px; font-weight: 700; margin-left: 4px; vertical-align: middle;
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes lightboxZoom { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes checkpointPop { 0% { transform: scale(0.5); opacity: 0; } 70% { transform: scale(1.3); } 100% { transform: scale(1); opacity: 1; } }

/* ==================== STORY TRAY ==================== */
.story-tray-section { margin-bottom: 4px; }
.story-tray {
  display: flex; gap: 12px; overflow-x: auto;
  padding: 4px 0 12px; scrollbar-width: none; -ms-overflow-style: none;
}
.story-tray::-webkit-scrollbar { display: none; }
.story-item {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  cursor: pointer; flex-shrink: 0; width: 64px;
  animation: fadeIn 0.3s ease both;
}
.story-ring {
  width: 60px; height: 60px; border-radius: 50%;
  padding: 3px; position: relative; transition: transform 0.15s ease;
  flex-shrink: 0; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center;
}
.story-ring:active { transform: scale(0.92); }
.story-ring.status-hadir { background: linear-gradient(135deg, #059669, #34d399); }
.story-ring.status-ijin  { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.story-ring.status-alpha { background: linear-gradient(135deg, #dc2626, #f87171); }
.story-ring.status-belum { background: linear-gradient(135deg, #94a3b8, #cbd5e1); }
.story-ring-inner {
  width: 54px; height: 54px; border-radius: 50%;
  overflow: hidden; border: 2.5px solid #fff;
  background: #e2e8f0;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; box-sizing: border-box;
  align-self: center;
}
.story-ring-inner img {
  width: 54px; height: 54px; object-fit: cover;
  border-radius: 50%; display: block;
  flex-shrink: 0; min-width: 0; min-height: 0;
}
.story-avatar-init {
  font-size: 20px; font-weight: 800; color: var(--primary); line-height: 1;
  pointer-events: none;
}
.story-status-badge {
  position: absolute; bottom: 1px; right: 1px;
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff;
  font-size: 9px; display: flex; align-items: center; justify-content: center;
}
.story-status-badge.badge-hadir  { background: #059669; }
.story-status-badge.badge-ijin   { background: #f59e0b; }
.story-status-badge.badge-alpha  { background: #dc2626; }
.story-status-badge.badge-belum  { background: #94a3b8; }
.story-name {
  font-size: 10px; font-weight: 600; color: var(--text); text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 64px;
}
.story-status-lbl { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.story-status-lbl.lbl-hadir { color: #059669; }
.story-status-lbl.lbl-ijin  { color: #d97706; }
.story-status-lbl.lbl-alpha { color: #dc2626; }
.story-status-lbl.lbl-belum { color: #94a3b8; }

/* ==================== STORY LIGHTBOX ==================== */
.story-lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.88); display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 24px;
}
.story-lightbox.hidden { display: none; }
.story-lightbox-inner {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px;
  animation: lightboxZoom 0.25s cubic-bezier(0.34,1.56,0.64,1) both;
  max-width: 300px; width: 100%;
}
.story-lightbox-close {
  position: absolute; top: -14px; right: -14px;
  background: rgba(255,255,255,0.15); border: none; color: white;
  width: 34px; height: 34px; border-radius: 50%; font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.story-lightbox-avatar {
  width: 160px; height: 160px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.9);
  box-shadow: 0 10px 50px rgba(0,0,0,0.5);
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: #e2e8f0; font-size: 60px; font-weight: 800; color: var(--primary);
}
.story-lightbox-avatar img { width: 100%; height: 100%; object-fit: cover; }
.story-lightbox-name { color: #fff; font-size: 20px; font-weight: 800; text-align: center; }
.story-lightbox-status {
  font-size: 12px; font-weight: 700; padding: 5px 18px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.story-lightbox-status.lb-hadir { background: #059669; color: #fff; }
.story-lightbox-status.lb-ijin  { background: #f59e0b; color: #fff; }
.story-lightbox-status.lb-alpha { background: #dc2626; color: #fff; }
.story-lightbox-status.lb-belum { background: #64748b; color: #fff; }
.story-lightbox-time { font-size: 13px; color: rgba(255,255,255,0.75); text-align: center; }
.story-lightbox-profile-status {
  font-size: 12px; color: rgba(255,255,255,0.85); text-align: center;
  background: rgba(255,255,255,0.12); border-radius: 20px; padding: 5px 14px;
  margin: 6px 0 4px; font-style: italic; max-width: 200px;
}

/* ==================== REKAP ==================== */
.rekap-summary {
  display: flex; gap: 8px; margin-bottom: 12px; animation: fadeIn .3s ease;
}
.rekap-sum-item {
  flex: 1; border-radius: var(--radius-xs); padding: 10px 4px; text-align: center;
  background: white; box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.rekap-sum-item.hadir    { border-top: 3px solid #059669; }
.rekap-sum-item.ijin     { border-top: 3px solid #f59e0b; }
.rekap-sum-item.alpha    { border-top: 3px solid #dc2626; }
.rekap-sum-item.terlambat{ border-top: 3px solid #7c3aed; }
.rekap-sum-val  { font-size: 22px; font-weight: 800; color: var(--text); }
.rekap-sum-label{ font-size: 9px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-top: 2px; letter-spacing: 0.3px; }

.rekap-legend {
  display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 10px;
  font-size: 11px; color: var(--text-muted);
}
.legend-item { display: flex; align-items: center; gap: 5px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.ld-hadir    { background: #059669; }
.ld-terlambat{ background: #7c3aed; }
.ld-ijin     { background: #f59e0b; }
.ld-alpha    { background: #dc2626; }
.ld-libur    { background: #cbd5e1; }

.rekap-calendar { background: white; border-radius: var(--radius-sm); padding: 14px; margin-bottom: 12px; animation: fadeIn .3s ease; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.cal-header-row { display: grid; grid-template-columns: repeat(7,1fr); margin-bottom: 6px; }
.cal-day-name {
  text-align: center; font-size: 10px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; padding: 4px 0;
}
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 3px; }
.cal-cell {
  aspect-ratio: 1; border-radius: 50%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; cursor: pointer;
  transition: transform .12s ease; position: relative; min-width: 0;
}
.cal-cell:active { transform: scale(0.88); }
.cal-cell.empty { cursor: default; pointer-events: none; }
.cal-cell .cal-num { font-size: 12px; font-weight: 700; line-height: 1; color: var(--text); }
.cal-cell.st-hadir    { background: #d1fae5; }
.cal-cell.st-hadir .cal-num { color: #065f46; }
.cal-cell.st-terlambat{ background: #ede9fe; }
.cal-cell.st-terlambat .cal-num { color: #5b21b6; }
.cal-cell.st-ijin     { background: #fef3c7; }
.cal-cell.st-ijin .cal-num { color: #92400e; }
.cal-cell.st-alpha    { background: #fee2e2; }
.cal-cell.st-alpha .cal-num { color: #991b1b; }
.cal-cell.st-libur    { background: #f1f5f9; }
.cal-cell.st-libur .cal-num { color: #94a3b8; }
.cal-cell.st-today    { outline: 2px solid var(--primary); outline-offset: 1px; }
.cal-cell.st-minggu .cal-num { color: #dc2626; }
.cal-cell .cal-dot { width: 5px; height: 5px; border-radius: 50%; margin-top: 1px; }
.cal-cell.st-hadir    .cal-dot { background: #059669; }
.cal-cell.st-terlambat .cal-dot { background: #7c3aed; }
.cal-cell.st-ijin     .cal-dot { background: #f59e0b; }
.cal-cell.st-alpha    .cal-dot { background: #dc2626; }

.rekap-detail-panel {
  background: white; border-radius: 14px; padding: 14px 16px;
  margin-bottom: 12px; animation: fadeIn .2s ease;
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow-sm);
}
.rekap-detail-title { font-size: 13px; font-weight: 700; color: var(--primary); margin-bottom: 10px; }
.rekap-detail-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; }
.rekap-detail-row .rd-label { color: var(--text-muted); min-width: 110px; font-size: 12px; }
.rekap-detail-row .rd-val   { font-weight: 600; color: var(--text); }
.rd-time { font-family: monospace; font-size: 14px; font-weight: 700; color: var(--primary); }

/* ==================== SKELETON LOADING ==================== */
@keyframes shimmer {
  0%   { background-position: -300px 0; }
  100% { background-position: 300px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, #e8ecf0 50%, var(--border) 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 6px;
}
.story-ring-inner.skeleton { border-radius: 50%; }