/* =====================================================================
   TRIJAYA ABSENSI — Design System
   Modern · Responsive · PWA-first · Precision spacing (4px scale)
   ===================================================================== */

:root {
  /* Brand */
  --brand-50:  #eef4ff;
  --brand-100: #dfe9ff;
  --brand-200: #c5d7ff;
  --brand-300: #a2bdfd;
  --brand-400: #7d9bf9;
  --brand-500: #5b78f0;
  --brand-600: #4557e0;
  --brand-700: #3944c4;
  --brand-800: #323c9e;
  --brand-900: #2e397c;
  --grad-brand: linear-gradient(135deg, #4557e0 0%, #6a5cf0 55%, #8b5cf6 100%);

  /* Semantic */
  --success-50:  #e8faf1; --success-500: #16a34a; --success-600: #15803d; --success-700: #166534;
  --warning-50:  #fef7e6; --warning-500: #d97706; --warning-600: #b45309; --warning-700: #92400e;
  --danger-50:   #fdeeee; --danger-500:  #dc2626; --danger-600:  #b91c1c;  --danger-700:  #991b1b;
  --info-50:     #e8f6fd; --info-500:    #0284c7;

  /* Neutral */
  --gray-50:  #f7f8fb;
  --gray-100: #eef0f5;
  --gray-200: #e3e7ef;
  --gray-300: #cdd3e0;
  --gray-400: #9aa4b8;
  --gray-500: #6b7690;
  --gray-600: #4f5a72;
  --gray-700: #3a4358;
  --gray-800: #262d3f;
  --gray-900: #161b28;

  /* Layout */
  --bg: #f4f6fa;
  --surface: #ffffff;
  --border: #e5e9f2;
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow-sm: 0 1px 2px rgba(22, 27, 40, .05);
  --shadow:    0 2px 8px rgba(22, 27, 40, .06), 0 1px 2px rgba(22, 27, 40, .04);
  --shadow-lg: 0 12px 32px rgba(22, 27, 40, .12);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* Spacing (4px scale) */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--gray-800);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; color: var(--gray-900); }

/* ---------- Utilities ---------- */
.text-muted { color: var(--gray-500); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-center { text-align: center; }
.mt-1 { margin-top: var(--sp-1); } .mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); } .mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); } .mt-8 { margin-top: var(--sp-8); }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: var(--radius);
  padding: 10px 18px; font-weight: 600; font-size: 14.5px; line-height: 1.2;
  cursor: pointer; user-select: none; white-space: nowrap;
  transition: background .18s ease, box-shadow .18s ease, transform .12s ease, border-color .18s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--brand-200); outline-offset: 1px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
/* Kondisi "menunggu" (belum bisa submit) — bukan disabled native agar klik tetap
   terdeteksi & pengguna mendapat penjelasan, bukan kegagalan senyap */
.btn[data-blocked] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn-primary { background: var(--grad-brand); color: #fff; box-shadow: 0 4px 14px rgba(69, 87, 224, .32); }
.btn-primary:hover { box-shadow: 0 6px 18px rgba(69, 87, 224, .42); filter: brightness(1.04); }

.btn-secondary { background: var(--surface); color: var(--gray-700); border-color: var(--gray-300); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-400); }

.btn-danger { background: var(--danger-500); color: #fff; box-shadow: 0 4px 12px rgba(220, 38, 38, .28); }
.btn-danger:hover { background: var(--danger-600); }

.btn-success { background: var(--success-500); color: #fff; box-shadow: 0 4px 14px rgba(22, 163, 74, .3); }
.btn-success:hover { background: var(--success-600); }

.btn-ghost { background: transparent; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); }

.btn-lg { padding: 14px 26px; font-size: 16px; border-radius: 14px; }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }

.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px; border: none;
  background: transparent; color: var(--gray-500); cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-icon:hover { background: var(--gray-100); color: var(--gray-800); }
.btn-icon svg { width: 19px; height: 19px; }

.btn-icon-danger { color: var(--danger-500); }
.btn-icon-danger:hover { background: var(--danger-50); color: var(--danger-600); }

/* ---------- Forms ---------- */
.form-group { margin-bottom: var(--sp-4); }
.label { display: block; font-size: 13.5px; font-weight: 600; color: var(--gray-700); margin-bottom: 7px; }
.label .req { color: var(--danger-500); }

.input {
  width: 100%; border: 1.5px solid var(--gray-300); border-radius: var(--radius);
  padding: 11px 14px; font-size: 15px; background: #fff; color: var(--gray-900);
  transition: border-color .16s, box-shadow .16s;
}
.input::placeholder { color: var(--gray-400); }
.input:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 4px rgba(91, 120, 240, .14); }
.input:disabled { background: var(--gray-100); color: var(--gray-500); }

/* Autofill Chrome/Edge — jaga latar tetap putih agar desain tidak "pecah" */
.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus,
.input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  -webkit-text-fill-color: var(--gray-900);
  caret-color: var(--gray-900);
  transition: background-color 9999s ease-in-out 0s;
}

/* Perangkat sentuh: font 16px agar iOS Safari tidak auto-zoom saat fokus input */
@media (pointer: coarse) {
  .input, select.input, textarea.input { font-size: 16px; }
}
textarea.input { resize: vertical; min-height: 84px; }
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7690' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m19.5 8.25-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
  padding-right: 38px;
}
.input-plain { border: none; background: transparent; padding: 0; font-size: inherit; }
.input-plain:focus { outline: none; }

/* Input dengan aksi (toggle mata / captcha) */
.input-group { position: relative; }
.input-group .input { padding-right: 46px; }
.input-action {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; border-radius: 8px; cursor: pointer; color: var(--gray-400);
  transition: color .15s, background .15s;
}
.input-action:hover { color: var(--gray-600); background: var(--gray-100); }
.input-action svg { width: 20px; height: 20px; }
.input-captcha { padding-right: 158px; }
.captcha-thumb {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  height: 36px; width: 118px; border-radius: 8px; cursor: pointer; border: 1px solid var(--gray-200);
}
.captcha-hint { display: none; font-size: 12px; color: var(--gray-400); margin-top: 6px; }

/* Layar sempit: captcha ditumpuk di bawah input agar ruang ketik cukup luas */
@media (max-width: 480px) {
  .input-captcha { padding-right: 14px; }
  .captcha-thumb {
    position: static; transform: none;
    width: 100%; height: 48px; margin-top: 10px;
    object-fit: cover; border-radius: 10px;
  }
  .captcha-hint { display: block; }
}

.checkbox-row { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--gray-600); cursor: pointer; user-select: none; }
.checkbox-row input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--brand-600); cursor: pointer; }

.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; background: var(--gray-300); border-radius: 99px; cursor: pointer;
  transition: background .18s;
}
.switch .slider::before {
  content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform .18s;
}
.switch input:checked + .slider { background: var(--success-500); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* Validasi */
.field-error { font-size: 12.5px; color: var(--danger-500); margin-top: 6px; }
.form-group.has-error .input { border-color: var(--danger-500); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 99px; font-size: 12px; font-weight: 600; line-height: 1.4;
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-50); color: var(--success-700); }
.badge-warning { background: var(--warning-50); color: var(--warning-700); }
.badge-danger  { background: var(--danger-50);  color: var(--danger-700); }
.badge-info    { background: var(--info-50);    color: var(--info-500); }
.badge-muted   { background: var(--gray-100);   color: var(--gray-500); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-5); border-bottom: 1px solid var(--border);
}
.card-header h2 { font-size: 16px; }
.card-header h3 { font-size: 15px; }
.card-body { padding: var(--sp-5); }
.card-body-flush { padding: 0; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.table.table-compact { min-width: 480px; }
.table th {
  text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--gray-500); background: var(--gray-50);
  padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #fafbfe; }
.table .num { font-variant-numeric: tabular-nums; }

/* ---------- Toast ---------- */
.toast-stack {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 2000; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px);
  pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--gray-900); color: #fff; border-radius: var(--radius);
  padding: 12px 16px; font-size: 14px; box-shadow: var(--shadow-lg);
  animation: toast-in .28s cubic-bezier(.21, 1.02, .73, 1) both;
  pointer-events: auto;
}
.toast svg { width: 19px; height: 19px; flex: none; margin-top: 1px; }
.toast-success svg { color: #4ade80; }
.toast-error svg   { color: #f87171; }
.toast-info svg    { color: #7db4f8; }
.toast.is-leaving { animation: toast-out .25s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px) scale(.97); } }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1500; display: flex; align-items: center; justify-content: center;
  background: rgba(13, 18, 30, .55); backdrop-filter: blur(3px);
  padding: var(--sp-4); opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.modal-overlay.is-open { opacity: 1; pointer-events: auto; }
.modal {
  background: #fff; border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px; max-height: 90dvh; overflow: hidden;
  display: flex; flex-direction: column;
  transform: translateY(14px) scale(.98); transition: transform .22s ease;
}
.modal-overlay.is-open .modal { transform: none; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; }
.modal-body { padding: var(--sp-5); overflow-y: auto; }
.modal-lg { max-width: 680px; }
.modal-x {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--gray-100); color: var(--gray-500);
  display: grid; place-items: center; transition: background .15s, color .15s;
}
.modal-x:hover { background: var(--gray-200); color: var(--gray-700); }
.modal-x svg { width: 16px; height: 16px; }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; padding: var(--sp-4); flex-wrap: wrap; }
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 8px; border-radius: 9px;
  font-size: 13.5px; font-weight: 600; color: var(--gray-600);
  border: 1px solid transparent;
}
.pagination a:hover { background: var(--gray-100); }
.pagination .active span { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }
.pagination .disabled span { color: var(--gray-300); }
.pagination a svg { width: 15px; height: 15px; }

/* =====================================================================
   LANDING — Halaman depan (publik, tanpa login)
   ===================================================================== */
.landing { min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }

.landing-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .86); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.landing-header-inner {
  max-width: 960px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px;
}
.landing-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.landing-brand-mark {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  background: var(--grad-brand); color: #fff;
  display: grid; place-items: center; box-shadow: 0 6px 16px rgba(69, 87, 224, .35);
}
.landing-brand-mark svg { width: 20px; height: 20px; }
.landing-brand b { display: block; font-size: 15px; color: var(--gray-900); line-height: 1.2; }
.landing-brand span { display: block; font-size: 11.5px; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.landing-admin-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--gray-600);
  padding: 9px 14px; border-radius: 10px; transition: background .15s, color .15s;
}
.landing-admin-link svg { width: 16px; height: 16px; }
.landing-admin-link:hover { background: var(--gray-100); color: var(--gray-800); }

.landing-main { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: clamp(28px, 7vw, 56px) 20px clamp(36px, 7vw, 56px); }

.landing-hero { text-align: center; }
.landing-hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand-50); color: var(--brand-600); border: 1px solid var(--brand-100);
  padding: 7px 15px; border-radius: 99px; font-size: 12.5px; font-weight: 700;
}
.landing-hero-badge svg { width: 15px; height: 15px; }
.landing-hero h1 {
  margin-top: 18px;
  font-size: clamp(28px, 7.5vw, 42px); letter-spacing: -.02em; line-height: 1.15;
}
.landing-hero p { margin: 14px auto 0; max-width: 52ch; color: var(--gray-500); font-size: 15px; line-height: 1.7; }
.landing-hero-cta {
  margin-top: 26px; display: flex; flex-direction: column; gap: 12px;
  max-width: 360px; margin-left: auto; margin-right: auto;
}
@media (min-width: 640px) {
  .landing-hero-cta { flex-direction: row; justify-content: center; max-width: none; }
}
.landing-hero-note {
  margin-top: 18px; font-size: 12.5px; color: var(--gray-400);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  text-align: center;
}
.landing-hero-note svg { width: 14px; height: 14px; flex: none; }

.landing-steps { margin-top: clamp(36px, 8vw, 56px); display: grid; gap: 14px; }
@media (min-width: 720px) { .landing-steps { grid-template-columns: repeat(3, 1fr); } }
.landing-step {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.landing-step-num {
  width: 34px; height: 34px; border-radius: 12px;
  background: var(--grad-brand); color: #fff; font-weight: 800; font-size: 14px;
  display: grid; place-items: center; box-shadow: 0 6px 14px rgba(69, 87, 224, .3);
}
.landing-step b { display: block; margin-top: 12px; font-size: 15.5px; color: var(--gray-900); }
.landing-step p { margin-top: 5px; font-size: 13px; color: var(--gray-500); line-height: 1.65; }

.landing-features {
  margin-top: clamp(28px, 6vw, 40px);
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
}
.landing-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); color: var(--gray-600);
  font-size: 13px; font-weight: 600; padding: 9px 15px; border-radius: 99px;
  box-shadow: var(--shadow-sm);
}
.landing-chip svg { width: 16px; height: 16px; color: var(--brand-600); flex: none; }

.landing-footer {
  border-top: 1px solid var(--border); background: var(--surface);
  padding: 18px 20px calc(18px + env(safe-area-inset-bottom));
  text-align: center; font-size: 12.5px; color: var(--gray-400);
}

/* =====================================================================
   AUTH — Login (karyawan & admin) · Mobile-first responsive
   ===================================================================== */
.auth-page {
  min-height: 100dvh; display: grid; place-items: center;
  padding: clamp(16px, 4vw, 40px);
  background:
    radial-gradient(700px 380px at 8% -10%, rgba(91, 120, 240, .16), transparent 60%),
    radial-gradient(640px 400px at 105% 110%, rgba(139, 92, 246, .13), transparent 60%),
    var(--bg);
}
.auth-shell {
  width: 100%; max-width: 940px; display: grid; grid-template-columns: 1fr 1fr;
  background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  overflow: hidden; border: 1px solid rgba(255,255,255,.6);
}

.auth-aside {
  position: relative; color: #fff; padding: var(--sp-10) var(--sp-8);
  background: var(--grad-brand); display: flex; flex-direction: column; overflow: hidden;
}
.auth-aside::before, .auth-aside::after {
  content: ""; position: absolute; border-radius: 50%;
}
.auth-aside::before { width: 300px; height: 300px; background: rgba(255,255,255,.09); top: -110px; right: -110px; }
.auth-aside::after { width: 220px; height: 220px; background: rgba(255,255,255,.07); bottom: -80px; left: -70px; }
.auth-aside > * { position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand-mark {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  background: rgba(255,255,255,.16); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
}
.auth-brand-mark svg { width: 24px; height: 24px; color: #fff; }
.auth-brand b { font-size: 17px; letter-spacing: .01em; }
.auth-brand span { display: block; font-size: 12px; opacity: .82; font-weight: 500; }
.auth-hero { margin-top: auto; padding-top: var(--sp-12); }
.auth-hero h2 { color: #fff; font-size: 27px; line-height: 1.28; letter-spacing: -.01em; }
.auth-hero p { margin-top: var(--sp-3); font-size: 14.5px; line-height: 1.7; opacity: .88; max-width: 34ch; }
.auth-feats { margin-top: var(--sp-6); display: grid; gap: 12px; }
.auth-feat { display: flex; align-items: center; gap: 11px; font-size: 13.5px; opacity: .95; }
.auth-feat svg { width: 20px; height: 20px; opacity: .95; flex: none; }

.auth-main {
  padding: var(--sp-10) var(--sp-8); display: flex; flex-direction: column; justify-content: center;
  min-width: 0;
}
.auth-main-mobile-brand { display: none; }
.auth-title { font-size: clamp(21px, 4.5vw, 23px); letter-spacing: -.01em; }
.auth-sub { color: var(--gray-500); font-size: 14px; margin-top: 6px; }
.auth-form { margin-top: var(--sp-6); }
.auth-form .btn-block { margin-top: var(--sp-5); }
.auth-form .checkbox-row { margin: 2px 0 0; }
.auth-foot { margin-top: var(--sp-6); text-align: center; font-size: 13.5px; color: var(--gray-500); }
.auth-foot a { color: var(--brand-600); font-weight: 600; }
.auth-foot a:hover { text-decoration: underline; }
.auth-admin-link { display: inline-flex; align-items: center; gap: 6px; }
.auth-admin-link svg { width: 15px; height: 15px; }
.auth-home-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 10px; font-size: 12.5px; font-weight: 500; color: var(--gray-400);
  transition: color .15s;
}
.auth-home-link:hover { color: var(--gray-600); }
.auth-home-link svg { width: 14px; height: 14px; }

@media (max-width: 860px) {
  .auth-page {
    align-items: start;
    padding-top: max(clamp(16px, 6vw, 32px), env(safe-area-inset-top));
  }
  .auth-shell {
    grid-template-columns: 1fr; max-width: 460px;
    margin-bottom: env(safe-area-inset-bottom);
  }
  .auth-aside { display: none; }
  .auth-main { padding: clamp(28px, 7vw, 40px) clamp(20px, 6vw, 32px) clamp(32px, 8vw, 44px); }
  .auth-main-mobile-brand {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    margin-bottom: var(--sp-6);
  }
  .auth-main-mobile-brand .auth-brand-mark {
    width: 60px; height: 60px; border-radius: 18px;
    background: var(--grad-brand); color: #fff; box-shadow: 0 10px 24px rgba(69, 87, 224, .35);
  }
  .auth-main-mobile-brand .auth-brand-mark svg { width: 30px; height: 30px; }
  .auth-main-mobile-brand b { margin-top: 12px; font-size: 19px; color: var(--gray-900); }
  .auth-main-mobile-brand span { font-size: 13px; color: var(--gray-500); }
  .auth-foot { margin-top: var(--sp-5); }
}

/* Ponsel kecil (iPhone SE dkk.) */
@media (max-width: 380px) {
  .auth-page { padding-left: 14px; padding-right: 14px; }
  .auth-main { padding-left: 18px; padding-right: 18px; }
  .auth-main-mobile-brand b { font-size: 18px; }
  .auth-title { font-size: 20px; }
  .auth-hero h2 { font-size: 24px; }
}

/* Ponsel diputar (landscape, layar pendek) — konten mulai dari atas agar tidak terpotong */
@media (max-height: 640px) and (max-width: 900px) {
  .auth-page { align-items: start; }
  .auth-main { padding-top: 24px; padding-bottom: 28px; }
  .auth-main-mobile-brand { margin-bottom: var(--sp-4); }
  .auth-form { margin-top: var(--sp-4); }
  .auth-foot { margin-top: var(--sp-4); }
}

/* =====================================================================
   EMPLOYEE APP — PWA layout
   ===================================================================== */
.app-shell { min-height: 100dvh; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; }

.app-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .86); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.app-header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: 12px 20px;
}
.app-user { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; object-fit: cover;
  background: var(--grad-brand); color: #fff; font-weight: 700; font-size: 15px;
  display: grid; place-items: center; flex: none; box-shadow: var(--shadow-sm);
}
.avatar-lg { width: 76px; height: 76px; font-size: 26px; border-radius: 50%; }
.app-user-name { font-weight: 700; font-size: 15px; color: var(--gray-900); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-user-sub { font-size: 12.5px; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.app-main { flex: 1; padding: var(--sp-5) 20px calc(96px + env(safe-area-inset-bottom)); }

/* Bottom navigation */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav-inner {
  max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr);
  padding: 6px 12px 8px;
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 4px; border-radius: 12px; font-size: 11.5px; font-weight: 600; color: var(--gray-400);
  transition: color .15s, background .15s;
}
.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a.active { color: var(--brand-600); }
.bottom-nav a:not(.active):hover { color: var(--gray-600); }

/* Kartu absensi utama */
.clock-card {
  background: var(--grad-brand); color: #fff; text-align: center;
  border-radius: var(--radius-xl); padding: var(--sp-8) var(--sp-6) var(--sp-6);
  box-shadow: 0 16px 40px rgba(69, 87, 224, .35);
  position: relative; overflow: hidden;
}
.clock-card::before {
  content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%;
  background: rgba(255,255,255,.08); top: -130px; right: -80px;
}
.clock-card > * { position: relative; z-index: 1; }
.clock-card-label { font-size: 12.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .85; }
.clock-time { font-size: 44px; font-weight: 800; letter-spacing: .02em; line-height: 1.15; margin-top: 8px; font-variant-numeric: tabular-nums; }
.clock-date { font-size: 14px; opacity: .88; margin-top: 2px; }
.clock-divider { height: 1px; background: rgba(255,255,255,.22); margin: var(--sp-5) auto; width: 72%; }

.clock-btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  width: 168px; height: 168px; border-radius: 50%;
  background: #fff; color: var(--brand-700); border: none; cursor: pointer;
  font-weight: 800; font-size: 19px; letter-spacing: .05em;
  box-shadow: 0 10px 28px rgba(9, 14, 40, .3), inset 0 0 0 8px rgba(255,255,255,.5);
  transition: transform .15s ease, box-shadow .2s ease;
  margin: 0 auto;
}
.clock-btn svg { width: 34px; height: 34px; }
.clock-btn span:last-child { font-size: 12px; font-weight: 600; opacity: .7; letter-spacing: .01em; }
.clock-btn:hover { transform: scale(1.03); }
.clock-btn:active { transform: scale(.97); }
.clock-btn.out { color: var(--danger-600); }
.clock-btn.done { pointer-events: none; color: var(--gray-400); box-shadow: 0 6px 18px rgba(9, 14, 40, .16), inset 0 0 0 8px rgba(255,255,255,.45); }

.clock-status {
  display: inline-flex; align-items: center; gap: 7px; margin-top: var(--sp-5);
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22);
  padding: 7px 16px; border-radius: 99px; font-size: 13px; font-weight: 600;
}
.clock-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .25); }
.clock-status.status-work::before { background: #fbbf24; box-shadow: 0 0 0 3px rgba(251, 191, 36, .25); animation: pulse 1.6s infinite; }
.clock-status.status-idle::before { background: #93c5fd; box-shadow: 0 0 0 3px rgba(147, 197, 253, .25); }
@keyframes pulse { 50% { opacity: .45; } }

/* Info jam kerja & lokasi */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); margin-top: var(--sp-5); }
.info-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--sp-4); display: flex; gap: 12px; align-items: center; box-shadow: var(--shadow-sm);
}
.info-tile-icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--brand-50); color: var(--brand-600);
}
.info-tile-icon svg { width: 20px; height: 20px; }
.info-tile b { display: block; font-size: 14.5px; color: var(--gray-900); line-height: 1.3; }
.info-tile span { font-size: 12px; color: var(--gray-500); }

/* Riwayat list */
.history-group { margin-top: var(--sp-4); }
.history-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow-sm);
}
.history-date { min-width: 44px; text-align: center; flex: none; }
.history-date b { display: block; font-size: 19px; line-height: 1.2; color: var(--gray-900); }
.history-date span { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; color: var(--gray-400); text-transform: uppercase; }
.history-detail { flex: 1; min-width: 0; }
.history-detail b { display: block; font-size: 14px; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-detail span { font-size: 12.5px; color: var(--gray-500); }
.history-status { flex: none; }

.empty-state { text-align: center; padding: var(--sp-12) var(--sp-6); color: var(--gray-500); }
.empty-state svg { width: 40px; height: 40px; margin: 0 auto var(--sp-3); color: var(--gray-300); }
.empty-state b { display: block; color: var(--gray-700); font-size: 15.5px; margin-bottom: 4px; }
.empty-state p { font-size: 13.5px; }

/* Success page */
.success-wrap { text-align: center; padding-top: var(--sp-8); }
.success-check {
  width: 108px; height: 108px; margin: 0 auto; border-radius: 50%;
  background: var(--success-50); color: var(--success-500);
  display: grid; place-items: center;
  animation: pop-in .5s cubic-bezier(.2, 1.4, .5, 1) both;
}
.success-check svg { width: 52px; height: 52px; }
@keyframes pop-in { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.success-title { margin-top: var(--sp-5); font-size: 22px; }
.success-sub { color: var(--gray-500); font-size: 14px; margin-top: 6px; }
.success-meta {
  margin-top: var(--sp-6); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--sp-2) var(--sp-5); text-align: left; box-shadow: var(--shadow-sm);
}
.success-meta-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: 13px 0; border-bottom: 1px solid var(--gray-100); }
.success-meta-row:last-child { border-bottom: none; }
.success-meta-row span { font-size: 13.5px; color: var(--gray-500); }
.success-meta-row b { font-size: 14px; color: var(--gray-900); text-align: right; }

/* Camera page */
.camera-frame {
  position: relative; width: 100%; aspect-ratio: 3 / 4; max-height: 62dvh;
  border-radius: var(--radius-xl); overflow: hidden; background: #0d1220;
  box-shadow: var(--shadow-lg);
}
.camera-frame video, .camera-frame canvas { width: 100%; height: 100%; object-fit: cover; }
.camera-frame.hidden-video video, .camera-frame.hidden-video canvas { position: absolute; inset: 0; }
.camera-guide {
  position: absolute; left: 50%; top: 14%; transform: translateX(-50%);
  width: min(58%, 240px); aspect-ratio: 1; border-radius: 50%;
  border: 2.5px dashed rgba(255,255,255,.75); pointer-events: none;
}
.camera-guide::after {
  content: "Posisikan wajah di dalam lingkaran";
  position: absolute; top: calc(100% + 12px); left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.9); font-size: 12.5px; white-space: nowrap;
  background: rgba(13, 18, 32, .55); padding: 5px 12px; border-radius: 99px; backdrop-filter: blur(4px);
}
.camera-fallback {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  color: #cbd5e1; padding: var(--sp-6);
}
.camera-fallback svg { width: 54px; height: 54px; margin: 0 auto var(--sp-3); color: var(--gray-400); }

.gps-panel {
  margin-top: var(--sp-4); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--sp-4); box-shadow: var(--shadow-sm);
  display: flex; gap: 12px; align-items: flex-start;
}
.gps-icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--success-50); color: var(--success-600);
}
.gps-icon.pending { background: var(--warning-50); color: var(--warning-600); }
.gps-icon.ok { background: var(--success-50); color: var(--success-600); }
.gps-icon.off { background: var(--danger-50); color: var(--danger-500); }
.gps-icon.denied { background: var(--warning-50); color: var(--warning-600); }
.gps-icon svg { width: 20px; height: 20px; }
.gps-panel.is-error { border-color: #f3c6c6; background: #fffaf9; }
.gps-info b { display: block; font-size: 14px; color: var(--gray-800); }
.gps-info span { font-size: 12.5px; color: var(--gray-500); word-break: break-all; }
.gps-retry { margin-top: 10px; }

/* Tombol clock besar — status "memeriksa GPS" */
.clock-btn.is-checking { pointer-events: none; animation: pulse 1.2s ease infinite; }
.clock-btn .spinner {
  margin: 0; width: 32px; height: 32px; border-width: 3px;
  border-color: rgba(69, 87, 224, .22); border-top-color: var(--brand-600);
}

/* ---------- Modal notifikasi GPS ---------- */
.gps-modal { max-width: 410px; position: relative; }
.gps-modal .modal-body { text-align: center; padding-top: var(--sp-8); }
.gps-modal-icon {
  width: 78px; height: 78px; margin: 0 auto var(--sp-4); border-radius: 50%;
  display: grid; place-items: center; background: var(--danger-50); color: var(--danger-500);
}
.gps-modal-icon svg { width: 38px; height: 38px; }
.gps-modal-icon.denied { background: var(--warning-50); color: var(--warning-600); }
.gps-modal-icon.timeout { background: var(--info-50); color: var(--info-500); }
.gps-modal-icon.unsupported { background: var(--gray-100); color: var(--gray-500); }
.gps-modal h3 { font-size: 17.5px; }
.gps-modal-msg { margin-top: 8px; font-size: 13.5px; color: var(--gray-500); line-height: 1.65; }
.gps-steps { text-align: left; margin: var(--sp-4) 0 0; display: grid; gap: 10px; }
.gps-steps li { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--gray-600); line-height: 1.55; }
.gps-steps li b { color: var(--gray-800); font-weight: 600; }
.gps-step-num {
  width: 22px; height: 22px; border-radius: 50%; flex: none; margin-top: 1px;
  background: var(--brand-50); color: var(--brand-600);
  font-size: 12px; font-weight: 700; display: grid; place-items: center;
}
.gps-modal-actions { display: grid; gap: 10px; margin-top: var(--sp-5); }

.camera-actions { display: grid; gap: 10px; margin-top: var(--sp-5); }

/* =====================================================================
   ADMIN — Dashboard layout
   ===================================================================== */
.admin-shell { display: flex; min-height: 100dvh; }

/* Navigasi bawah admin (mobile saja — 4 ikon cepat) */
.admin-bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  display: none; /* hanya mobile */
}
.admin-bottom-nav-inner {
  max-width: 560px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 10px 8px;
}
.admin-bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 2px; border-radius: 12px;
  font-size: 11px; font-weight: 600; color: var(--gray-400);
  transition: color .15s;
  white-space: nowrap;
}
.admin-bottom-nav a svg { width: 21px; height: 21px; }
.admin-bottom-nav a.active { color: var(--brand-600); }
.admin-bottom-nav a:not(.active):hover { color: var(--gray-600); }

.sidebar {
  position: fixed; inset-block: 0; left: 0; z-index: 300;
  width: 264px; background: #10152a; color: #cdd4e6;
  display: flex; flex-direction: column;
  transform: translateX(-100%); transition: transform .25s ease;
  box-shadow: none;
}
.sidebar.is-open { transform: none; box-shadow: 0 0 60px rgba(10, 14, 30, .5); }
@media (min-width: 1024px) {
  .sidebar { transform: none; box-shadow: 1px 0 0 rgba(255,255,255,.06); }
}

.sidebar-brand {
  display: flex; align-items: center; gap: 12px; padding: 20px 22px;
  border-bottom: 1px solid rgba(255,255,255,.07); flex: none;
}
.sidebar-brand .mark {
  width: 40px; height: 40px; border-radius: 12px; background: var(--grad-brand);
  display: grid; place-items: center; color: #fff; flex: none;
  box-shadow: 0 6px 16px rgba(69, 87, 224, .4);
}
.sidebar-brand .mark svg { width: 21px; height: 21px; }
.sidebar-brand b { color: #fff; font-size: 15.5px; display: block; line-height: 1.3; }
.sidebar-brand span { font-size: 11.5px; color: #8b93ad; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 12px 20px; }
.sidebar-nav-label {
  font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: #5c6580; padding: 14px 12px 7px;
}
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin-bottom: 2px; border-radius: 11px;
  font-size: 14px; font-weight: 500; color: #aeb6cd;
  transition: background .15s, color .15s;
}
.sidebar-nav a svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.sidebar-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav a.active { background: var(--grad-brand); color: #fff; box-shadow: 0 6px 16px rgba(69, 87, 224, .35); }
.sidebar-nav a.active svg { opacity: 1; }
.sidebar-foot { padding: 14px 12px; border-top: 1px solid rgba(255,255,255,.07); flex: none; }
.sidebar-foot a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px;
  font-size: 14px; color: #f1a4a4; transition: background .15s;
}
.sidebar-foot a:hover { background: rgba(220, 38, 38, .14); color: #ffb3b3; }
.sidebar-foot a svg { width: 19px; height: 19px; }

.sidebar-backdrop {
  position: fixed; inset: 0; z-index: 250; background: rgba(13, 18, 30, .5);
  backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .22s;
}
.sidebar-backdrop.is-open { opacity: 1; pointer-events: auto; }

.admin-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
@media (min-width: 1024px) { .admin-content { margin-left: 264px; } }

.topbar {
  position: sticky; top: 0; z-index: 200;
  background: rgba(255,255,255,.86); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top); /* notch / status bar iPhone */
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  padding: 12px 20px;
}
.topbar-title { font-size: 17px; font-weight: 700; color: var(--gray-900); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-sub { font-size: 12.5px; color: var(--gray-500); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.topbar-user .avatar { width: 36px; height: 36px; font-size: 13px; }
.topbar-user-name { display: none; line-height: 1.25; }
.topbar-user-name b { font-size: 13.5px; display: block; }
.topbar-user-name span { font-size: 11.5px; color: var(--gray-500); }
@media (min-width: 640px) { .topbar-user-name { display: block; } }
.topbar-user .btn-icon-danger { color: var(--danger-500); }

.admin-body { flex: 1; padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
@media (min-width: 1024px) {
  .admin-body { padding: 28px 32px 40px; }
  .admin-bottom-nav { display: none !important; }
}
@media (max-width: 1023.98px) {
  .admin-bottom-nav { display: block; }
}
.page-header { margin-bottom: 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }
.page-header h1 { font-size: 21px; letter-spacing: -.01em; }
.page-header p { color: var(--gray-500); font-size: 13.5px; margin-top: 3px; }
.page-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Pagination di dalam card — beri pemisah halus */
.card > .pagination { border-top: 1px solid var(--gray-100); }

/* Ringkasan header halaman di ponsel */
@media (max-width: 640px) {
  .page-header { margin-bottom: 14px; }
  .page-header h1 { font-size: 18px; }
  .page-header p { font-size: 12.5px; }
  .page-header-actions { width: 100%; }
  .page-header-actions .btn { flex: 1 1 auto; }
  .card-header h2 { font-size: 15px; }
}

/* Stats cards */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 18px; }
@media (min-width: 768px) { .stat-grid { grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 20px; } }
/* Kartu ke-5 (ganjil) melebar penuh di ponsel agar grid rapi */
@media (max-width: 767.98px) {
  .stat-grid .stat-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .stat-card-value { font-size: 22px; }
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat-card::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 4px 0 0 4px;
  background: var(--stat-color, var(--brand-500));
}
.stat-card-label { font-size: 12px; font-weight: 600; color: var(--gray-500); }
.stat-card-value { font-size: 26px; font-weight: 800; color: var(--gray-900); line-height: 1.2; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-card-icon {
  position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; background: color-mix(in srgb, var(--stat-color, var(--brand-500)) 12%, #fff);
  color: var(--stat-color, var(--brand-500));
}
.stat-card-icon svg { width: 17px; height: 17px; }

/* Toolbar / filter */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.filter-bar .form-group { margin-bottom: 0; }
.filter-bar .label { margin-bottom: 5px; font-size: 12.5px; }
.filter-bar .input { padding: 9px 12px; font-size: 14px; }
.filter-spacer { flex: 1; }

/* Ponsel: field filter & tombol ditumpuk penuh (target sentuh besar) */
@media (max-width: 640px) {
  .filter-bar { padding: 14px; }
  .filter-bar .form-group { flex: 1 1 100% !important; min-width: 0 !important; }
  .filter-bar .btn { flex: 1 1 100%; }
}

/* Karyawan grid */
.emp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(255px, 100%), 1fr)); gap: 14px; }
.emp-card-actions { flex-wrap: wrap; }
.emp-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 12px;
  transition: box-shadow .18s, transform .18s;
}
.emp-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.emp-card-top { display: flex; align-items: center; gap: 12px; }
.emp-card-top .avatar { width: 46px; height: 46px; font-size: 16px; border-radius: 14px; }
.emp-card-name { font-weight: 700; font-size: 15px; color: var(--gray-900); line-height: 1.3; }
.emp-card-role { font-size: 12.5px; color: var(--gray-500); }
.emp-card-meta { display: grid; gap: 7px; font-size: 13px; color: var(--gray-600); flex: 1; }
.emp-card-meta div { display: flex; align-items: center; gap: 8px; }
.emp-card-meta svg { width: 15px; height: 15px; color: var(--gray-400); flex: none; }
.emp-card-actions {
  display: flex; gap: 8px; align-items: center; justify-content: flex-end;
  border-top: 1px solid var(--gray-100); padding-top: 12px;
}

/* Absensi detail modal */
.detail-grid { display: grid; gap: var(--sp-4); }
.detail-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.detail-photo { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--gray-100); }
.detail-photo img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.detail-photo figcaption { padding: 8px 12px; font-size: 12px; color: var(--gray-600); display: flex; justify-content: space-between; align-items: center; }
.detail-photo figcaption b { color: var(--gray-900); }
.detail-map { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); height: 260px; }
.detail-map iframe { width: 100%; height: 100%; border: 0; }
.detail-rows { display: grid; gap: 8px; }
.detail-row { display: flex; justify-content: space-between; gap: var(--sp-4); padding: 9px 12px; background: var(--gray-50); border-radius: 10px; font-size: 13.5px; }
.detail-row span { color: var(--gray-500); }
.detail-row b { color: var(--gray-800); text-align: right; word-break: break-all; }

/* Location cards */
.loc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); gap: 14px; }
.loc-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.loc-map { height: 150px; background: var(--gray-100); position: relative; }
.loc-map iframe { width: 100%; height: 100%; border: 0; filter: saturate(.85); }
.loc-body { padding: 16px; }
.loc-body h3 { font-size: 15.5px; display: flex; align-items: center; gap: 8px; }
.loc-body p { font-size: 13px; color: var(--gray-500); margin-top: 4px; }
.loc-coords { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.loc-chip { font-size: 12px; background: var(--gray-100); color: var(--gray-600); border-radius: 8px; padding: 4px 9px; font-variant-numeric: tabular-nums; }
.loc-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 0 16px 14px; }

/* Laporan */
.report-summary { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 16px; }
@media (min-width: 1024px) { .report-summary { grid-template-columns: 5fr 3fr; } }
/* Item grid boleh menyusut agar .table-wrap scroll di dalam, bukan memperlebar halaman */
.report-summary > .card { min-width: 0; }
.dur-num { font-variant-numeric: tabular-nums; }
.print-note { display: none; }

/* Pengaturan */
.setting-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 900px) { .setting-grid { grid-template-columns: 1fr 1fr; } }
.setting-grid > .card { min-width: 0; }

/* Pengaturan — logo & favicon */
.branding-preview { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; }
.branding-preview-item { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.branding-preview-item > img {
    width: 56px; height: 56px; object-fit: contain; border-radius: 14px;
    background: #fff; border: 1px solid var(--gray-200); padding: 6px;
}
.branding-preview-empty {
    width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center;
    background: var(--gray-100); color: var(--gray-400);
}
.branding-preview-empty svg { width: 24px; height: 24px; }
.branding-preview-label { font-weight: 700; font-size: 13px; margin-top: 4px; }
.branding-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.input-file { padding: 8px; }
.input-file::file-selector-button {
    font: inherit; font-weight: 600; color: var(--brand-700);
    background: var(--brand-50); border: 0; border-radius: 10px;
    padding: 8px 14px; margin-right: 10px; cursor: pointer;
}
.input-file::file-selector-button:hover { background: var(--brand-100); }

/* Pengaturan — SMTP */
.check-row {
    display: flex; align-items: center; gap: 10px; cursor: pointer;
    font-weight: 600; font-size: 14.5px; color: var(--gray-800);
}
.check-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand-600); cursor: pointer; }
.smtp-test-row {
    display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
    margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--gray-200);
}

/* Logo kustom di dalam brand mark */
.sidebar-brand .mark img,
.auth-brand-mark img,
.landing-brand-mark img {
    width: 100%; height: 100%; object-fit: contain; border-radius: inherit; display: block;
    padding: 5px; background: #fff;
}

/* =====================================================================
   Misc
   ===================================================================== */
.page-loading { display: grid; place-items: center; min-height: 40vh; color: var(--gray-400); }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--gray-200); border-top-color: var(--brand-600);
  animation: spin .8s linear infinite; margin: 0 auto;
}
.spinner-light { border-color: rgba(255,255,255,.4) !important; border-top-color: #fff !important; }
.btn.is-loading { pointer-events: none; opacity: .8; }
@keyframes spin { to { transform: rotate(360deg); } }

::selection { background: rgba(91, 120, 240, .25); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 99px; border: 2.5px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Print (laporan) */
@media print {
  .sidebar, .topbar, .filter-bar, .page-header-actions, .btn, .bottom-nav, .admin-bottom-nav, .toast-stack, .pagination { display: none !important; }
  body { background: #fff; }
  .admin-content { margin: 0 !important; }
  .admin-body { padding: 0 !important; }
  .card { box-shadow: none; border-color: #ddd; }
}
