/* ==========================================================================
   Saung Tribun — mobile-first premium theme
   ========================================================================== */

:root {
  --bg:            #080B11;
  --bg-2:          #0C1119;
  --surface:       rgba(255, 255, 255, 0.045);
  --surface-2:     rgba(255, 255, 255, 0.07);
  --stroke:        rgba(255, 255, 255, 0.09);
  --stroke-strong: rgba(255, 255, 255, 0.16);

  --text:    #E9EEF5;
  --muted:   #8794A6;
  --faint:   #5C6879;

  --gold:    #E3B341;
  --gold-2:  #F5D272;
  --mint:    #34D399;
  --mint-2:  #10B981;
  --sky:     #38BDF8;
  --rose:    #FB7185;
  --amber:   #FBBF24;

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 30px;

  --shadow:    0 18px 44px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 8px 22px rgba(0, 0, 0, 0.36);

  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);

  --tabbar-h: 66px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* Selector class seperti .login-screen{display:grid} mengalahkan style bawaan
   [hidden]{display:none}, sehingga layar login tetap tampil menimpa aplikasi.
   Aturan ini mengembalikan perilaku hidden untuk semua elemen. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body {
  min-height: 100dvh;
  background-image:
    radial-gradient(1100px 620px at 78% -12%, rgba(52, 211, 153, 0.13), transparent 62%),
    radial-gradient(900px 560px at 8% 6%, rgba(227, 179, 65, 0.10), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 42%);
  background-attachment: fixed;
}

/* Angka uang harus rata lebarnya supaya kolom nominal tidak "goyang". */
.num, .money, input[inputmode="numeric"] {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--mint); }

/* ============================ LOGIN ============================ */
.login-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 26px 22px calc(26px + var(--sab));
  z-index: 60;
  overflow-y: auto;
  /* Aura lebih lebar dari viewport ponsel; tanpa ini ia menambah lebar scroll
     sehingga kotak login ikut tergeser dan terpotong. */
  overflow-x: hidden;
}

.login-aura {
  position: absolute;
  width: min(460px, 130vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.20), transparent 66%);
  filter: blur(46px);
  top: -120px;
  left: 50%;
  translate: -50% 0;
  pointer-events: none;
  animation: float 9s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(26px) scale(1.06); }
}

.login-box {
  position: relative;
  width: 100%;
  max-width: 400px;
  text-align: center;
  animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}

.brand-mark {
  width: 78px;
  height: 78px;
  margin: 0 auto 18px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(227, 179, 65, 0.20), rgba(52, 211, 153, 0.14));
  border: 1px solid var(--stroke-strong);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.brand-mark svg { width: 42px; height: 42px; fill: var(--gold); }

.brand-name {
  margin: 0;
  font-size: 30px;
  font-weight: 750;
  letter-spacing: -0.5px;
  background: linear-gradient(120deg, #FFFFFF, var(--gold-2) 62%, var(--mint));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-sub {
  margin: 7px 0 30px;
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.login-form {
  display: grid;
  gap: 15px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  padding: 22px 20px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.field { display: grid; gap: 7px; }

.field-label {
  font-size: 11.5px;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.field input, .field select, .field textarea,
.sheet-body input, .sheet-body select, .sheet-body textarea {
  width: 100%;
  padding: 13px 15px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--stroke);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 16px; /* 16px mencegah iOS auto-zoom saat fokus */
  transition: border-color 0.18s, box-shadow 0.18s;
}

.field input:focus, .field select:focus, .field textarea:focus,
.sheet-body input:focus, .sheet-body select:focus, .sheet-body textarea:focus {
  outline: none;
  border-color: rgba(52, 211, 153, 0.6);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.14);
}

.field-pw { position: relative; }
.field-pw input { padding-right: 48px; }

.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--muted);
  opacity: 0.75;
}

.pw-toggle svg { width: 19px; height: 19px; }

.login-err {
  background: rgba(251, 113, 133, 0.12);
  border: 1px solid rgba(251, 113, 133, 0.34);
  color: #FDA4B4;
  border-radius: var(--r-sm);
  padding: 10px 13px;
  font-size: 13.5px;
}

.login-foot {
  margin-top: 20px;
  color: var(--faint);
  font-size: 11.5px;
  letter-spacing: 0.6px;
}

/* ============================ BUTTONS ============================ */
.btn-primary {
  background: linear-gradient(135deg, var(--mint), var(--mint-2));
  color: #04140D;
  font-weight: 720;
  border-radius: var(--r-sm);
  padding: 12px 18px;
  box-shadow: 0 10px 26px rgba(16, 185, 129, 0.28);
  transition: transform 0.14s, filter 0.14s, opacity 0.14s;
}

.btn-primary:active { transform: scale(0.975); filter: brightness(1.08); }
.btn-primary:disabled { opacity: 0.55; box-shadow: none; }
.btn-lg { padding: 15px 18px; font-size: 16px; }

.btn-ghost {
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  color: var(--text);
  border-radius: var(--r-sm);
  padding: 11px 16px;
  font-weight: 620;
  transition: background 0.16s, transform 0.14s;
}

.btn-ghost:active { transform: scale(0.975); background: rgba(255, 255, 255, 0.11); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  color: #251A03;
  font-weight: 720;
  border-radius: var(--r-sm);
  padding: 12px 18px;
  box-shadow: 0 10px 26px rgba(227, 179, 65, 0.26);
}

.btn-danger {
  background: rgba(251, 113, 133, 0.14);
  border: 1px solid rgba(251, 113, 133, 0.36);
  color: #FDA4B4;
  border-radius: var(--r-sm);
  padding: 11px 16px;
  font-weight: 640;
}

.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }

/* ============================ TOPBAR ============================ */
.app { padding-bottom: calc(var(--tabbar-h) + var(--sab) + 14px); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(var(--sat) + 12px) 16px 12px;
  background: rgba(8, 11, 17, 0.78);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--stroke);
}

.topbar-left { display: flex; align-items: center; gap: 11px; min-width: 0; }

.topbar-logo {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(227, 179, 65, 0.22), rgba(52, 211, 153, 0.14));
  border: 1px solid var(--stroke-strong);
}

.topbar-logo svg { width: 22px; height: 22px; fill: var(--gold); }

.topbar-title {
  font-weight: 730;
  font-size: 16.5px;
  letter-spacing: -0.2px;
  line-height: 1.2;
}

.topbar-sub {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.period-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: none;
  padding: 9px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  font-size: 13px;
  font-weight: 640;
}

.period-chip .chev {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2.2;
  stroke-linecap: round;
}

/* ============================ VIEW / CARDS ============================ */
.view { padding: 16px 16px 8px; display: grid; gap: 14px; animation: fade 0.26s ease; }

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

.card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  padding: 16px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--muted);
}

.section-title {
  margin: 4px 2px -2px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
}

/* Hero saldo */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  padding: 22px 20px;
  background:
    linear-gradient(150deg, rgba(52, 211, 153, 0.20), rgba(56, 189, 248, 0.08) 48%, rgba(227, 179, 65, 0.16)),
    rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke-strong);
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  right: -80px;
  top: -110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.14), transparent 68%);
  pointer-events: none;
}

.hero-label {
  font-size: 11.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(233, 238, 245, 0.72);
  font-weight: 640;
}

.hero-amount {
  margin: 7px 0 2px;
  font-size: 33px;
  font-weight: 780;
  letter-spacing: -1.1px;
  line-height: 1.1;
}

.hero-meta {
  display: flex;
  gap: 16px;
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
}

.hero-meta div { flex: 1; min-width: 0; }

.hero-meta .k {
  font-size: 10.5px;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: rgba(233, 238, 245, 0.62);
}

.hero-meta .v { font-size: 15px; font-weight: 700; margin-top: 2px; }
.up { color: var(--mint); }
.down { color: var(--rose); }

/* Stat grid */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

.stat {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.stat-k {
  font-size: 10.5px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-v {
  font-size: 19px;
  font-weight: 750;
  margin-top: 6px;
  letter-spacing: -0.4px;
}

.stat-sub { font-size: 11.5px; color: var(--faint); margin-top: 3px; }

.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot.mint { background: var(--mint); box-shadow: 0 0 9px var(--mint); }
.dot.gold { background: var(--gold); box-shadow: 0 0 9px var(--gold); }
.dot.rose { background: var(--rose); box-shadow: 0 0 9px var(--rose); }
.dot.sky  { background: var(--sky);  box-shadow: 0 0 9px var(--sky); }

/* Progress */
.bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
  margin-top: 10px;
}

.bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mint), var(--sky));
  transition: width 0.65s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.bar.gold > i { background: linear-gradient(90deg, var(--gold), var(--gold-2)); }

/* Chart */
.chart { display: flex; align-items: flex-end; gap: 10px; padding-top: 6px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }

/* Tinggi eksplisit — batang memakai height dalam persen, dan persen tidak bisa
   dihitung terhadap induk yang tingginya berasal dari flex-grow. */
.chart-bars { height: 108px; display: flex; align-items: flex-end; gap: 3px; width: 100%; justify-content: center; }

.chart-bar {
  width: 44%;
  border-radius: 5px 5px 2px 2px;
  min-height: 3px;
  transition: height 0.6s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.chart-bar.masuk  { background: linear-gradient(180deg, var(--mint), rgba(52, 211, 153, 0.3)); }
.chart-bar.keluar { background: linear-gradient(180deg, var(--rose), rgba(251, 113, 133, 0.3)); }
.chart-x { font-size: 10px; color: var(--faint); white-space: nowrap; }

.legend { display: flex; gap: 14px; justify-content: center; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 6px; }

/* ============================ LIST ============================ */
.list { display: grid; gap: 9px; }

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  transition: transform 0.14s, background 0.16s;
  width: 100%;
  text-align: left;
}

.row:active { transform: scale(0.988); background: var(--surface-2); }

.avatar {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-weight: 730;
  font-size: 14px;
  letter-spacing: -0.3px;
  background: linear-gradient(145deg, rgba(52, 211, 153, 0.24), rgba(227, 179, 65, 0.16));
  border: 1px solid var(--stroke);
  color: #F3F7FA;
}

.row-main { flex: 1; min-width: 0; }
.row-name { font-weight: 660; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-right { text-align: right; flex: none; }
.row-amount { font-weight: 730; font-size: 14.5px; letter-spacing: -0.2px; }

.pill {
  display: inline-block;
  margin-top: 4px;
  padding: 2.5px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 680;
  letter-spacing: 0.3px;
}

.pill.lunas    { background: rgba(52, 211, 153, 0.15); color: var(--mint); border: 1px solid rgba(52, 211, 153, 0.32); }
.pill.belum    { background: rgba(251, 113, 133, 0.13); color: var(--rose); border: 1px solid rgba(251, 113, 133, 0.3); }
.pill.sebagian { background: rgba(251, 191, 36, 0.14); color: var(--amber); border: 1px solid rgba(251, 191, 36, 0.32); }
.pill.info     { background: rgba(56, 189, 248, 0.13); color: var(--sky); border: 1px solid rgba(56, 189, 248, 0.3); }
.pill.mute     { background: rgba(255, 255, 255, 0.07); color: var(--muted); border: 1px solid var(--stroke); }

.empty { text-align: center; padding: 30px 16px; color: var(--faint); font-size: 13.5px; }
.empty .ico { font-size: 34px; display: block; margin-bottom: 8px; opacity: 0.55; }

/* Summary strip */
.strip {
  display: flex;
  gap: 10px;
  padding: 13px 15px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.12), rgba(227, 179, 65, 0.09));
  border: 1px solid var(--stroke);
}

.strip div { flex: 1; min-width: 0; }
.strip .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.7px; color: var(--muted); font-weight: 640; }
.strip .v { font-size: 15.5px; font-weight: 740; margin-top: 3px; letter-spacing: -0.3px; }

/* Menu list */
.menu-list { display: grid; gap: 8px; }

.menu-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 15px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  width: 100%;
  text-align: left;
  transition: transform 0.14s, background 0.16s;
}

.menu-item:active { transform: scale(0.988); background: var(--surface-2); }

.menu-ico {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--mint);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
}

.menu-ico svg { width: 20px; height: 20px; }

.profile-card { display: flex; align-items: center; gap: 13px; }
.profile-card .pill { margin-top: 6px; }

.menu-label { flex: 1; font-weight: 630; font-size: 14.5px; }
.menu-arrow { color: var(--faint); font-size: 17px; }

/* FAB */
.fab {
  position: fixed;
  right: 18px;
  bottom: calc(var(--tabbar-h) + var(--sab) + 18px);
  width: 56px;
  height: 56px;
  border-radius: 19px;
  display: grid;
  place-items: center;
  font-size: 27px;
  font-weight: 400;
  color: #04140D;
  background: linear-gradient(135deg, var(--mint), var(--mint-2));
  box-shadow: 0 14px 32px rgba(16, 185, 129, 0.42);
  z-index: 25;
  transition: transform 0.16s;
}

.fab:active { transform: scale(0.92); }

/* ============================ TABBAR ============================ */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 8px 6px calc(8px + var(--sab));
  background: rgba(8, 11, 17, 0.9);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  border-top: 1px solid var(--stroke);
}

.tab {
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 6px 2px;
  border-radius: 13px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 620;
  transition: color 0.18s, background 0.18s;
}

.tab svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab.active { color: var(--mint); background: rgba(52, 211, 153, 0.10); }
.tab:active { background: rgba(255, 255, 255, 0.07); }

/* ============================ SHEET ============================ */
.sheet-wrap { position: fixed; inset: 0; z-index: 70; }

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.22s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 90dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(180deg, #131A24, #0C1119);
  border-top: 1px solid var(--stroke-strong);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 10px 18px calc(22px + var(--sab));
  box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.6);
  animation: slideUp 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }

.sheet-grip {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 auto 12px;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.sheet-head h3 { margin: 0; font-size: 18px; font-weight: 730; letter-spacing: -0.3px; }

.sheet-x {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  color: var(--muted);
  font-size: 14px;
  flex: none;
}

.sheet-body { display: grid; gap: 14px; }
.sheet-body .field { display: grid; gap: 7px; }
.sheet-body label.check { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.sheet-body label.check input { width: 20px; height: 20px; accent-color: var(--mint-2); flex: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.hint { font-size: 12px; color: var(--faint); line-height: 1.45; }

.quick-amounts { display: flex; gap: 8px; flex-wrap: wrap; }

.quick-amounts button {
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  font-size: 12.5px;
  font-weight: 640;
  color: var(--muted);
}

.quick-amounts button:active { background: rgba(52, 211, 153, 0.16); color: var(--mint); }

/* ============================ TOAST ============================ */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--sab) + 26px);
  transform: translateX(-50%);
  z-index: 90;
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(20, 27, 37, 0.97);
  border: 1px solid var(--stroke-strong);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  font-weight: 620;
  max-width: 88vw;
  text-align: center;
  animation: toastIn 0.26s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.toast.ok  { border-color: rgba(52, 211, 153, 0.45); color: var(--mint); }
.toast.err { border-color: rgba(251, 113, 133, 0.45); color: #FDA4B4; }

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 14px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ============================ MISC ============================ */
.skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.05));
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  border-radius: var(--r-md);
  height: 74px;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

.tools { display: flex; gap: 8px; flex-wrap: wrap; }
.tools > button { flex: 1; min-width: 120px; }

.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { padding: 9px 6px; text-align: left; border-bottom: 1px solid var(--stroke); }
.tbl th { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 650; }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl tfoot td { font-weight: 730; border-bottom: none; padding-top: 12px; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (min-width: 620px) {
  .view { max-width: 620px; margin: 0 auto; }
  .topbar, .tabbar { max-width: 620px; margin: 0 auto; }
  .tabbar { border-radius: 22px 22px 0 0; border-left: 1px solid var(--stroke); border-right: 1px solid var(--stroke); }
  .sheet { max-width: 620px; margin: 0 auto; border-radius: var(--r-xl) var(--r-xl) 0 0; }
}

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

/* ==========================================================================
   TAMBAHAN v5 — login wajah, kunjungan, bukti bayar, akun anggota
   ========================================================================== */

/* Checkbox baris penuh (dipakai di form anggota, bukti, kunjungan). */
.check {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  accent-color: var(--mint-2);
  margin: 0;
  padding: 0;
}

/* ------------------------- Login wajah ------------------------- */
.or-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: var(--faint);
  font-size: 11.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.or-line::before, .or-line::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--stroke);
}

.btn-face {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--r-sm);
  background: rgba(56, 189, 248, 0.10);
  border: 1px solid rgba(56, 189, 248, 0.34);
  color: #7DD3FC;
  font-size: 15px;
  font-weight: 680;
  transition: transform 0.14s, background 0.16s;
}
.btn-face svg { width: 22px; height: 22px; }
.btn-face:active { transform: scale(0.98); background: rgba(56, 189, 248, 0.18); }
.btn-face:disabled { opacity: 0.6; }

/* ------------------------- Layar kamera ------------------------- */
.kamera {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #05070B;
  padding: calc(var(--sat) + 6px) 16px calc(var(--sab) + 18px);
}

.kamera-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.kamera-head h3 { margin: 0; font-size: 16px; font-weight: 700; }

.kamera-panggung {
  position: relative;
  width: min(78vw, 320px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: #0C1119;
  border: 1px solid var(--stroke-strong);
  box-shadow: var(--shadow);
  margin-top: auto;
}
.kamera-panggung video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Dicerminkan supaya terasa seperti bercermin; kanvas tangkapan TIDAK
     dicerminkan karena pengenalan wajah memakai gambar apa adanya. */
  transform: scaleX(-1);
}
.kamera-oval {
  position: absolute;
  inset: 7%;
  border-radius: 50%;
  border: 2px dashed rgba(52, 211, 153, 0.55);
  pointer-events: none;
}
.kamera.sibuk .kamera-oval {
  border-style: solid;
  border-color: var(--mint);
  animation: pulseOval 1.1s ease-in-out infinite;
}
@keyframes pulseOval {
  0%, 100% { opacity: 0.35; transform: scale(0.98); }
  50%      { opacity: 1;    transform: scale(1.02); }
}

.kamera-petunjuk {
  margin: 18px 0 0;
  max-width: 340px;
  text-align: center;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
  min-height: 42px;
}
.kamera-petunjuk.err { color: var(--rose); }

.kamera-aksi { margin: 14px 0 auto; }

.btn-shutter {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.10);
  border: 2px solid rgba(255, 255, 255, 0.5);
  transition: transform 0.14s;
}
.btn-shutter i {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mint), var(--mint-2));
  display: block;
}
.btn-shutter:active { transform: scale(0.93); }
.btn-shutter:disabled { opacity: 0.5; }

.kamera-berkas {
  margin-top: 6px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 620;
  color: var(--sky);
  cursor: pointer;
}

/* ------------------------- Tabbar dengan lencana ------------------------- */
.tab { position: relative; }

.tab-badge {
  position: absolute;
  top: 1px;
  right: calc(50% - 20px);
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--rose);
  color: #2A0710;
  font-size: 10px;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
}

/* ------------------------- Pilih sesi kunjungan ------------------------- */
.sesi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.sesi-opsi {
  padding: 14px 12px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--stroke);
  text-align: left;
  transition: background 0.16s, border-color 0.16s, transform 0.14s;
}
.sesi-opsi:active { transform: scale(0.98); }
.sesi-opsi .s-nama { font-size: 15px; font-weight: 720; }
.sesi-opsi .s-jam  { margin-top: 3px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sesi-opsi.pilih {
  background: rgba(52, 211, 153, 0.13);
  border-color: rgba(52, 211, 153, 0.45);
}
.sesi-opsi.pilih .s-nama { color: var(--mint); }

/* ------------------------- Bukti pembayaran ------------------------- */
.bukti-thumb {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 12px;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
}

.bukti-besar {
  width: 100%;
  border-radius: var(--r-md);
  border: 1px solid var(--stroke);
  background: #05070B;
  display: block;
}

.drop-foto {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 26px 16px;
  border-radius: var(--r-md);
  border: 1.5px dashed var(--stroke-strong);
  background: var(--surface);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 620;
  text-align: center;
  cursor: pointer;
}
.drop-foto svg { width: 30px; height: 30px; opacity: 0.7; }
.drop-foto img { max-height: 190px; border-radius: var(--r-sm); }

/* ------------------------- Kredensial akun ------------------------- */
.kredensial {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: var(--r-md);
  background: rgba(227, 179, 65, 0.09);
  border: 1px solid rgba(227, 179, 65, 0.32);
}
.kredensial .baris {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}
.kredensial .nilai {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--gold-2);
  letter-spacing: 0.6px;
  user-select: all;
}

.info-box {
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.26);
  font-size: 12.5px;
  line-height: 1.6;
  color: #A5D8F3;
}
.info-box.warn {
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.28);
  color: #F3D89A;
}
