/**
 * PRESENSIABSEN — Tema Dashboard Karyawan (gaya mockup ponsel)
 * ------------------------------------------------------------
 * Dimuat KHAYUS di index.html (tidak mempengaruhi admin.html).
 * Membungkus seluruh aplikasi karyawan dalam bingkai ponsel (maks 440px),
 * berpola krem/kayu dengan font display serif, mengikuti desain mockup.
 */

/* ============================================ */
/* ============ FRAME & GLOBAL ================ */
/* ============================================ */

html body {
  /* !important agar backdrop hangat (#1c1613) mengalahkan body
     #0a1628 !important dari layout-fix (min-width:1024) — spesifisitas
     html body (0,0,2) + important tetap menang untuk file ini. */
  background: #1c1613 !important;
}

#app-container.shell {
  /* Bingkai ponsel: bingkainya sudah disediakan .shell (maks 440px, rounded di desktop) */
  background: var(--bg, #faf7f2);
  color: var(--ink, #241c14);

  /* Tokens tema krem/kayu — menggantikan the navy/indigo standar di dalam app karyawan */
  --bg: #faf7f2;
  --surface-0: #ffffff;
  --surface-1: #faf7f2;
  --surface-2: #f4eee5;
  --surface-dark: #5c4530;
  --border: #ece4d7;
  --border-mid: #ddd0bd;
  --border-dark: rgba(255, 255, 255, 0.08);
  --text-primary: #241c14;
  --text-secondary: #6b5d4f;
  --text-muted: #a89b8d;
  --navy: #5c4530;
  --navy-card: #533d2a;
  --navy-mid: #6b513a;
  --ink: #241c14;
  --ink-2: #6b5d4f;
  --ink-3: #a89b8d;
  --wood: #8b6b4a;
  --wood-dark: #5c4530;
  --sage: #7a8a6e;
  --honey: #c89648;
  --rust: #b85a3f;
  --indigo: #5c4530;
  --indigo-hover: #4a3626;
  --indigo-dim: rgba(92, 69, 48, 0.18);
  --indigo-soft: #efe6d9;
  --emerald: #7a8a6e;
  --emerald-soft: #eef2e8;
  --amber: #c89648;
  --amber-soft: #f9efd9;
  --rose: #b85a3f;
  --rose-soft: #f9e6df;
  --success-50: #eef2e8;
  --success-500: #7a8a6e;
  --success-600: #5f7354;
  --warning-50: #f9efd9;
  --warning-500: #c89648;
  --warning-600: #a8742f;
  --danger-50: #f9e6df;
  --danger-500: #b85a3f;
  --danger-600: #9c4430;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --shadow-sm: 0 2px 8px rgba(92, 69, 48, 0.06);
  --shadow-md: 0 4px 16px rgba(92, 69, 48, 0.08);
  --shadow-xl: 0 20px 60px rgba(92, 69, 48, 0.14);
}

#app-container.shell,
#app-container.shell button,
#app-container.shell input,
#app-container.shell select,
#app-container.shell textarea {
  font-family: 'Inter', -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Hapus header/sidebar lama — navigasi kini bar bawah */
#app-container.shell .app-header,
#app-container.shell .header-divider {
  display: none;
}

#app-container.shell .main {
  background: var(--bg, #faf7f2);
  padding-bottom: 100px;
}

#app-container.shell .page {
  animation: empFadeUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

/* ============================================ */
/* ============ NAV BAWAH (mockup) ============ */
/* ============================================ */

#app-container.shell .tab-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 76px;
  background: rgba(250, 247, 242, 0.94);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid var(--line, #ece4d7);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 10px 10px;
  z-index: 50;
}

#app-container.shell .tab-btn {
  flex: 0 1 72px;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 12px;
  background: transparent;
  border: none;
  color: var(--ink-3, #a89b8d);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.2px;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

#app-container.shell .tab-btn .tab-icon {
  font-size: 18px;
  line-height: 1;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#app-container.shell .tab-btn .tab-icon .icon-sm {
  width: 19px;
  height: 19px;
}

#app-container.shell .tab-btn.active {
  color: var(--wood-dark, #5c4530);
  font-weight: 600;
}

#app-container.shell .tab-btn.active .tab-icon {
  transform: scale(1.08);
}

#app-container.shell .tab-btn:not(.active):hover {
  color: var(--ink-2, #6b5d4f);
}

#app-container.shell .tab-btn.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 20px;
  height: 2px;
  background: var(--wood-dark, #5c4530);
  border-radius: 0 0 2px 2px;
  transform: translateX(-50%);
}

#app-container.shell .tab-badge {
  background: var(--rust, #b85a3f);
}

/* ============================================ */
/* ============ BERANDA (mockup) ============== */
/* ============================================ */

#page-beranda {
  padding: 28px 24px 130px;
}

/* --- Header --- */
#page-beranda .hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

#page-beranda .hd-l small {
  display: block;
  font-size: 10.5px;
  color: var(--ink-3);
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

#page-beranda .hd-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

#page-beranda .hd-name-box {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

#page-beranda .hd-name-row strong {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 26px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.5px;
  line-height: 1.1;
}

#page-beranda .hd-role {
  font-size: 10.5px;
  color: var(--ink-3);
  font-weight: 500;
  letter-spacing: 0.3px;
}

#page-beranda .beranda-avatar,
#page-beranda .hd-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--wood-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  flex-shrink: 0;
}

#page-beranda .beranda-avatar img,
#page-beranda .hd-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#page-beranda .icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.2s, background 0.2s;
  padding: 0;
}

#page-beranda .icon-btn:hover { background: var(--surface-2); }
#page-beranda .icon-btn:active { transform: scale(0.9); }
#page-beranda .icon-btn svg { width: 16px; height: 16px; }

#page-beranda .icon-btn .dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rust);
  animation: empPulseDot 1.8s ease-in-out infinite;
}

/* --- Jam besar --- */
#page-beranda .clock-block { margin-bottom: 32px; }

#page-beranda .clock {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 78px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -2.5px;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  margin-bottom: 16px;
  padding-left: 2px;
}

#page-beranda .clock small {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 32px;
  font-style: italic;
  color: var(--ink-3);
  letter-spacing: -1px;
  margin-left: 2px;
  transform: translateY(-5px);
}

#page-beranda .clock-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

#page-beranda .clock-date {
  font-size: 12.5px;
  color: var(--ink-2);
  font-weight: 500;
}

#page-beranda .clock-zone {
  font-size: 9.5px;
  color: var(--ink-3);
  font-weight: 600;
  letter-spacing: 1.5px;
}

/* --- Baris shift --- */
#page-beranda .shift-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

#page-beranda .shift-name {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 21px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.3px;
  line-height: 1;
}

#page-beranda .shift-dot {
  color: var(--ink-3);
  font-size: 12px;
  transform: translateY(-2px);
}

#page-beranda .shift-place {
  font-size: 10.5px;
  color: var(--ink-3);
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* --- Kartu jadwal Masuk/Pulang --- */
#page-beranda .schedule {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-0);
}

#page-beranda .sch-cell {
  padding: 18px 20px;
  position: relative;
  transition: background 0.25s;
}

#page-beranda .sch-cell:first-child { border-right: 1px solid var(--line); }

#page-beranda .sch-cell .lbl {
  font-size: 9.5px;
  color: var(--ink-3);
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

#page-beranda .sch-cell .val {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 32px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.5px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

#page-beranda .sch-cell .val small,
#page-beranda .sch-cell .val .extra {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-size: 15px;
  color: var(--wood);
  font-weight: 400;
  margin-left: 6px;
}

/* --- Tombol utama absen --- */
#page-beranda .main-btn {
  width: 100%;
  padding: 19px;
  background: var(--wood-dark);
  color: #faf7f2;
  border: none;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.1px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 38px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 24px -12px rgba(92, 69, 48, 0.5);
  transition: background 0.25s, transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

#page-beranda .main-btn:active { transform: scale(0.985); }
#page-beranda .main-btn svg { width: 17px; height: 17px; }

#page-beranda .main-btn.out {
  background: transparent;
  color: var(--wood-dark);
  border: 1.5px solid var(--wood-dark);
  box-shadow: none;
}

#page-beranda .main-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* --- Statistik bulan ini --- */
#page-beranda .sect-label {
  font-size: 9.5px;
  color: var(--ink-3);
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

#page-beranda .stats {
  display: flex;
  margin-bottom: 34px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

#page-beranda .stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
  position: relative;
  cursor: pointer;
}

#page-beranda .stat:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--line);
}

#page-beranda .stat .n {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 40px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -1.5px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

#page-beranda .stat .n small {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-size: 18px;
  color: var(--ink-3);
  font-weight: 400;
  margin-left: 2px;
}

#page-beranda .stat .l {
  font-size: 10px;
  color: var(--ink-3);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

#page-beranda .stat.ok .n  { color: var(--sage); }
#page-beranda .stat.warn .n { color: var(--honey); }
#page-beranda .stat.err .n { color: var(--rust); }

/* --- Grafik jam kerja --- */
#page-beranda .chart-card {
  background: var(--surface-0);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 34px;
}

#page-beranda .chart-card .beranda-chart-bars { display: flex; }

/* --- Menu aksi (mockup) --- */
#page-beranda .menu {
  display: flex;
  flex-direction: column;
}

#page-beranda .menu-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 17px 4px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  text-align: left;
  width: 100%;
  position: relative;
  font-family: inherit;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#page-beranda .menu-item:first-child { border-top: 1px solid var(--line); }
#page-beranda .menu-item:active { transform: scale(0.99); }

#page-beranda .menu-item::before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 1px;
  width: 0;
  background: var(--ink);
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#page-beranda .menu-item:hover::before { width: 100%; }

#page-beranda .mn-ic {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  flex-shrink: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.25s, color 0.25s;
}

#page-beranda .mn-ic svg { width: 17px; height: 17px; }

#page-beranda .menu-item:hover .mn-ic {
  background: var(--wood-dark);
  color: #faf7f2;
}

#page-beranda .mn-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

#page-beranda .mn-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 19px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.3px;
  line-height: 1.1;
}

#page-beranda .mn-sub {
  font-size: 10.5px;
  color: var(--ink-3);
  font-weight: 500;
}

#page-beranda .mn-arrow {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 21px;
  color: var(--ink-3);
  line-height: 1;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), color 0.25s;
}

#page-beranda .menu-item:hover .mn-arrow {
  transform: translateX(5px);
  color: var(--ink);
}

/* ============================================ */
/* ============ KOMPONEN DIPAKAI BERSAMA ====== */
/* ============================================ */

#app-container.shell .card {
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(92, 69, 48, 0.04);
  padding: 16px;
  margin-bottom: 16px;
}

#app-container.shell .card-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

#app-container.shell .card-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 19px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.2px;
}

#app-container.shell .card-link {
  color: var(--wood);
  font-weight: 600;
  font-size: 12px;
}

/* Chips / filter */
#app-container.shell .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

#app-container.shell .chip {
  border: 1px solid var(--line);
  background: var(--surface-0);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s;
}

#app-container.shell .chip:hover { background: var(--surface-2); }

#app-container.shell .chip.active {
  background: var(--wood-dark);
  border-color: var(--wood-dark);
  color: #faf7f2;
}

/* Form */
#app-container.shell .field-label {
  color: var(--ink-2);
  font-size: 11px;
}

#app-container.shell .input,
#app-container.shell .select,
#app-container.shell .textarea {
  background: var(--surface-0);
  border: 1.5px solid var(--border);
  color: var(--ink);
  border-radius: 10px;
}

#app-container.shell .input:focus,
#app-container.shell .select:focus,
#app-container.shell .textarea:focus {
  border-color: var(--wood);
  box-shadow: 0 0 0 3.5px rgba(139, 107, 74, 0.18);
}

/* Tombol */
#app-container.shell .btn-primary {
  background: var(--wood-dark);
  color: #faf7f2;
}

#app-container.shell .btn-primary:hover { background: #4a3626; }

#app-container.shell .btn-secondary {
  background: var(--surface-1);
  color: var(--ink-2);
  border: 1.5px solid var(--border);
}

#app-container.shell .btn-danger {
  background: var(--danger-50);
  color: var(--danger-600);
  border-color: #edd2c8;
}

/* Tabel */
#app-container.shell .table th {
  color: var(--ink-3);
  font-weight: 600;
}

#app-container.shell .table td {
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

/* Daftar / kosong */
#app-container.shell .list,
#app-container.shell .approval-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#app-container.shell .list-item,
#app-container.shell .approval {
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

#app-container.shell .list-item-title,
#app-container.shell .approval-name {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 17px;
  font-weight: 400;
  color: var(--ink);
}

#app-container.shell .list-item-meta,
#app-container.shell .approval-detail {
  color: var(--ink-2);
  font-size: 12px;
}

#app-container.shell .empty {
  color: var(--ink-3);
  font-size: 13px;
  text-align: center;
  padding: 28px 12px;
}

/* Atur posisi overlay modal & toast & banner PWA ke dalam bingkai ponsel */
#app-container.shell .modal-overlay {
  position: absolute;
  inset: 0;
}

#app-container.shell .toast-container {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 380px;
}

#app-container.shell #pwa-install-banner {
  position: absolute;
  top: 14px;
  bottom: auto;
  left: 12px;
  right: 12px;
  transform: none;
  width: auto;
  max-width: none;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-0);
  box-shadow: 0 12px 30px rgba(46, 32, 16, 0.18);
  z-index: calc(var(--z-toast) + 10);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out), visibility 0.3s;
}

#app-container.shell #pwa-install-banner.show {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#app-container.shell #pwa-install-banner .pwa-banner-text strong {
  color: var(--ink);
  font-size: 12.5px;
}

#app-container.shell #pwa-install-banner .pwa-banner-text span {
  color: var(--ink-3);
  font-size: 11px;
}

#app-container.shell #pwa-install-banner .pwa-install-btn,
#app-container.shell #pwa-install-banner .pwa-dismiss-btn {
  position: relative;
  z-index: 1;
  pointer-events: auto;
  touch-action: manipulation;
}

#app-container.shell #pwa-install-banner .pwa-install-btn {
  background: var(--wood);
  color: #fffaf3;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 11.5px;
}

#app-container.shell #pwa-install-banner .pwa-dismiss-btn {
  color: var(--ink-3);
  padding: 8px 10px;
  margin-right: -6px;
  font-size: 20px;
}

/* ============================================ */
/* ============ LAYAR KAMERA / GPS ============ */
/* ============================================ */

#page-absen-kamera {
  background: #14110d;
}

#gps-verify-screen.gps-verify-screen {
  background: #eee5d8;
  justify-content: flex-start;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

/* Peta dekoratif */
#gps-verify-screen .gps-map {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

#gps-verify-screen .road { position: absolute; background: #fff; }
#gps-verify-screen .road-1 { width: 200%; height: 30px; top: 28%; left: -50%; transform: rotate(8deg); }
#gps-verify-screen .road-2 { width: 24px; height: 200%; left: 68%; top: -50%; transform: rotate(-6deg); }
#gps-verify-screen .road-3 { width: 200%; height: 20px; bottom: 22%; left: -50%; transform: rotate(-3deg); }
#gps-verify-screen .road-4 { width: 16px; height: 200%; left: 22%; top: -50%; }

#gps-verify-screen .blk { position: absolute; border-radius: 6px; background: rgba(180, 150, 120, 0.28); }
#gps-verify-screen .blk-1 { width: 100px; height: 70px; top: 8%; left: 6%; }
#gps-verify-screen .blk-2 { width: 90px; height: 110px; top: 50%; left: 5%; }
#gps-verify-screen .blk-3 { width: 80px; height: 100px; top: 6%; right: 8%; }
#gps-verify-screen .blk-4 { width: 120px; height: 80px; bottom: 8%; right: 10%; }
#gps-verify-screen .blk-5 { width: 70px; height: 60px; top: 42%; left: 40%; }

#gps-verify-screen .gps-me {
  position: absolute;
  top: 48%;
  left: 52%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--wood);
  border: 3px solid #fff;
  transform: translate(-50%, -50%);
  z-index: 5;
  box-shadow: 0 3px 10px rgba(92, 69, 48, 0.35);
}

#gps-verify-screen .gps-me::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--wood);
  transform: translate(-50%, -50%);
  animation: empRadar 2.4s ease-out infinite;
}

#gps-verify-screen .office-marker {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -100%);
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

#gps-verify-screen .office-pin {
  width: 32px;
  height: 32px;
  border-radius: 50% 50% 50% 4px;
  background: var(--wood-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #faf7f2;
  transform: rotate(-45deg);
  box-shadow: 0 6px 16px rgba(92, 69, 48, 0.3);
}

#gps-verify-screen .office-pin svg { transform: rotate(45deg); width: 13px; height: 13px; }

#gps-verify-screen .office-label {
  background: #fff;
  padding: 5px 10px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 600;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(92, 69, 48, 0.1);
  white-space: nowrap;
}

/* Sheet bawah layar GPS */
#gps-verify-screen .gps-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface-0);
  border-radius: 24px 24px 0 0;
  padding: 20px 24px 28px;
  z-index: 20;
  box-shadow: 0 -8px 24px rgba(92, 69, 48, 0.08);
}

#gps-verify-screen .gps-sheet .handle {
  width: 32px;
  height: 3px;
  background: var(--line-2, #ddd0bd);
  border-radius: 2px;
  margin: 0 auto 18px;
}

#gps-verify-screen .gps-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

#gps-verify-screen .gps-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 23px;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 3px;
  line-height: 1.1;
}

#gps-verify-screen .gps-desc {
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 500;
}

#gps-verify-screen .gps-dist {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-size: 21px;
  font-weight: 400;
  color: var(--sage);
  white-space: nowrap;
  line-height: 1;
  padding-top: 4px;
}

#gps-verify-screen .gps-sub {
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 6px;
}

#gps-verify-screen .gps-addr {
  font-size: 11.5px;
  color: var(--ink-2);
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 16px;
}

#gps-verify-screen .confirm {
  width: 100%;
  padding: 16px;
  background: var(--wood-dark);
  color: #faf7f2;
  border: none;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: -0.1px;
  transition: transform 0.15s, background 0.2s;
}

#gps-verify-screen .confirm:hover { background: #4a3626; }
#gps-verify-screen .confirm:active { transform: scale(0.98); }
#gps-verify-screen .confirm:disabled { opacity: 0.5; cursor: wait; }

#gps-verify-screen .sat-bar {
  width: 6px;
  border-radius: 4px;
  background: var(--honey);
}

/* ============================================ */
/* ============ LAYAR SUKSES (mockup) ========= */
/* ============================================ */

#successOverlay {
  position: absolute;
  inset: 0;
  z-index: 300;
  background: var(--bg, #faf7f2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s;
}

#successOverlay.on {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#successOverlay .success-icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--sage);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  animation: empPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}

#successOverlay .success-icon svg {
  width: 34px;
  height: 34px;
  color: #faf7f2;
  stroke-width: 2.5;
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: empCheck 0.55s 0.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#successOverlay .success-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 34px;
  font-weight: 400;
  color: var(--ink);
  text-align: center;
  margin-bottom: 10px;
  letter-spacing: -0.8px;
  line-height: 1.05;
}

#successOverlay .success-desc {
  font-size: 12.5px;
  color: var(--ink-3);
  text-align: center;
  margin-bottom: 30px;
  line-height: 1.5;
  font-weight: 400;
  max-width: 280px;
}

#successOverlay .success-card {
  width: 100%;
  margin-bottom: 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

#successOverlay .success-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 2px;
  border-bottom: 1px solid var(--line);
}

#successOverlay .success-row:last-child { border-bottom: none; }

#successOverlay .success-label {
  font-size: 11.5px;
  color: var(--ink-3);
  font-weight: 500;
}

#successOverlay .success-value {
  font-size: 13px;
  color: var(--ink);
  font-weight: 600;
  text-align: right;
  letter-spacing: -0.15px;
}

#successOverlay .success-value.green { color: var(--sage); }
#successOverlay .success-value.amber { color: var(--honey); }

#successOverlay .success-done {
  width: 100%;
  padding: 16px;
  background: var(--wood-dark);
  color: #faf7f2;
  border: none;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: -0.1px;
  transition: transform 0.15s, background 0.2s;
}

#successOverlay .success-done:active { transform: scale(0.98); }

#successOverlay .confetti-piece {
  position: absolute;
  width: 6px;
  height: 6px;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  animation: empConfetti 1.8s ease-out forwards;
}

/* ============================================ */
/* ============ ANIMASI BANTUAN =============== */
/* ============================================ */

@keyframes empPulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@keyframes empRadar {
  0%   { transform: translate(-50%, -50%) scale(0.4); opacity: 0.9; }
  100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

@keyframes empPop {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes empCheck {
  to { stroke-dashoffset: 0; }
}

@keyframes empConfetti {
  0%   { transform: translate3d(0, -20px, 0) rotate(0); opacity: 0; }
  15%  { opacity: 1; }
  100% { transform: translate3d(var(--dx, 0), var(--dy, 420px), 0) rotate(540deg); opacity: 0; }
}

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

/* =============================================================
   OVERRIDE LAYOUT-FIX / MAIN.CSS — agar tema mockup menang
   (layout-fix memaksa shell full-width di PC & nav putih di HP)
   ============================================================= */

/* Desktop: batalkan grid full-width layout-fix, kembalikan bingkai ponsel */
@media (min-width: 1024px) {
  #app-container.shell,
  #app-container.shell:not(.hidden) {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
    width: 100% !important;
    max-width: 440px !important;
    margin: 0 auto !important;
    height: min(900px, calc(100vh - 48px)) !important;
    height: min(900px, calc(100dvh - 48px)) !important;
    max-height: 920px !important;
    border-radius: 28px !important;
    overflow: hidden !important;
    box-shadow: 0 24px 80px rgba(28, 22, 19, 0.4);
  }

  #app-container.shell .app-header,
  #app-container.shell .header-divider {
    display: none !important;
  }

  #app-container.shell .main {
    grid-column: unset !important;
    grid-row: unset !important;
    width: 100% !important;
    height: auto !important;
    flex: 1 1 auto !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding-bottom: 140px !important;
  }

  body {
    padding: 24px !important;
  }
}

/* Mobile/HP & desktop: nav bawah selalu memakai tema mockup */
#app-container.shell .main {
  padding-bottom: 100px !important;
}

#page-beranda {
  padding: 28px 24px 130px !important;
  background: transparent !important;
}

/* Halaman profil: beri jarak bawah agar tombol Keluar tidak tertutup tab-nav bawah */
#page-profile {
  padding-bottom: 130px !important;
  /* Netralkan background #f4f7fb dari layout-fix (HP) → ikut tema krem shell,
     konsisten dengan desktop. admin.html tidak memuat file ini → tetap biru. */
  background: transparent !important;
}

#app-container.shell .tab-nav {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  top: auto !important;
  z-index: 50 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-around !important;
  gap: 0 !important;
  height: 76px !important;
  padding: 0 10px 10px !important;
  background: rgba(250, 247, 242, 0.94) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  border-top: 1px solid var(--line, #ece4d7) !important;
  box-shadow: none !important;
  overflow-x: auto !important;
  scrollbar-width: none !important;
}

#app-container.shell .tab-nav::-webkit-scrollbar {
  display: none !important;
}

#app-container.shell .tab-btn {
  flex: 0 1 72px !important;
  min-width: 0 !important;
  max-width: none !important;
  width: auto !important;
  padding: 8px 10px !important;
  border-radius: 12px !important;
  color: var(--ink-3, #a89b8d) !important;
  font-size: 9.5px !important;
  font-weight: 500 !important;
  letter-spacing: 0.2px !important;
}

#app-container.shell .tab-btn.active {
  color: var(--wood-dark, #5c4530) !important;
  background: transparent !important;
  font-weight: 600 !important;
}

#app-container.shell .tab-btn.active .tab-icon {
  transform: scale(1.08) !important;
  background: transparent !important;
  padding: 0 !important;
}

#app-container.shell .tab-btn.active .tab-icon,
#app-container.shell .tab-btn.active .tab-icon svg {
  color: var(--wood-dark, #5c4530) !important;
  stroke: var(--wood-dark, #5c4530) !important;
}

#app-container.shell .tab-btn .tab-icon {
  font-size: 18px !important;
}

/* Profil: ikut tema krem/kayu walau layout-fix memaksa gradien navy */
#page-profile .profile-hero {
  background: linear-gradient(160deg, #6b513a 0%, #4a3626 100%) !important;
  margin: 20px 20px 0 !important;
  border-radius: 20px !important;
  padding: 30px 18px 26px !important;
  box-shadow: none !important;
}

#page-profile .profile-name,
#page-profile .profile-email {
  color: #faf7f2 !important;
}