/* =========================================================================
   Finara — style.css
   Tema gelap (default) & terang, kartu kaca, chrome chart.
   ========================================================================= */

/* ---------------------------- token ---------------------------- */

:root {
  color-scheme: dark;
  --bg: #0d0e12;
  --surface-1: #17181d;        /* permukaan chart (tervalidasi) */
  --surface-2: #1f212a;
  --card-solid: #1a1c22;
  --card-border: rgba(255, 255, 255, 0.08);
  --glass: rgba(23, 25, 36, 0.52);
  --glass-strong: rgba(18, 20, 30, 0.8);
  --glass-border: rgba(255, 255, 255, 0.07);
  --glass-hi: rgba(255, 255, 255, 0.07);
  --fill-2: rgba(255, 255, 255, 0.07);
  --blur: 22px;
  --ink-1: #ffffff;
  --ink-2: #c5c9c2;
  --ink-3: #8d938a;
  --in: #2ee06a;               /* pemasukan — hijau terang */
  --out: #ff5a5a;              /* pengeluaran — merah terang */
  --chart-grid: #262933;
  --chart-axis: #3a3e4a;
  --accent: #1fb58c;
  --accent-2: #0d9488;
  --good-text: #0ca30c;
  --bad-text: #e66767;
  --warn: #fab219;
  --crit: #d03b3b;
  --good: #0ca30c;
  --track-ok: #142e4d;
  --track-warn: #3d2f10;
  --track-crit: #3f1717;
  --track-done: #113311;
  --tip-bg: rgba(15, 16, 24, 0.8);
  --grid-dot: 150, 240, 200;   /* rgb titik grid latar (mint lembut) */
  --shadow-card: 0 16px 40px rgba(0, 0, 0, 0.42);
  --shadow-pop: 0 24px 60px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #eef1f6;
  --surface-1: #fcfcfb;
  --surface-2: #f0efec;
  --card-solid: #fcfcfb;
  --card-border: rgba(11, 11, 11, 0.1);
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(30, 41, 59, 0.10);
  --glass-hi: rgba(255, 255, 255, 0.7);
  --fill-2: rgba(233, 255, 250, 0.06);
  --ink-1: #0b0b0b;
  --ink-2: #52514e;
  --ink-3: #898781;
  --in: #16a34a;               /* pemasukan — hijau terang */
  --out: #e5342e;              /* pengeluaran — merah terang */
  --chart-grid: #e1e0d9;
  --chart-axis: #c3c2b7;
  --accent: #0f9f6f;
  --accent-2: #0d9488;
  --good-text: #006300;
  --bad-text: #d03b3b;
  --track-ok: #cde2fb;
  --track-warn: #fdeecb;
  --track-crit: #f6d6d6;
  --track-done: #d2ecd2;
  --tip-bg: rgba(255, 255, 255, 0.85);
  --grid-dot: 15, 120, 84;     /* rgb titik grid latar (emerald pekat) */
  --shadow-card: 0 12px 32px rgba(40, 60, 110, 0.13);
  --shadow-pop: 0 24px 60px rgba(40, 60, 110, 0.22);
}

/* ---------------------------- dasar ---------------------------- */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }

body {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink-1);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* orbs warna di belakang segalanya — memberi "isi" pada blur kaca */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(38% 34% at -2% 8%, rgba(13, 148, 136, 0.24), transparent 66%),
    radial-gradient(38% 34% at 102% 8%, rgba(13, 148, 136, 0.24), transparent 66%),
    radial-gradient(52% 46% at 42% 116%, rgba(5, 122, 85, 0.22), transparent 68%);
}
[data-theme="light"] body::before {
  background:
    radial-gradient(38% 34% at -2% 8%, rgba(13, 148, 136, 0.14), transparent 66%),
    radial-gradient(38% 34% at 102% 8%, rgba(13, 148, 136, 0.14), transparent 66%),
    radial-gradient(52% 46% at 42% 116%, rgba(5, 150, 105, 0.14), transparent 68%);
}

/* Latar "Grid Klasik": kisi titik beranimasi di kanvas transparan, digambar
   oleh js/grid-bg.js. Warna titik mengikuti --grid-dot per tema; orb emerald
   dari body::before tetap tembus di belakangnya. */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.bg-grid canvas { display: block; width: 100%; height: 100%; }

svg { font-family: inherit; }
button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.num { font-variant-numeric: tabular-nums; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--ink-3); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------- layout ---------------------------- */

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 14px;
  border-right: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(calc(var(--blur) + 4px)) saturate(150%);
  -webkit-backdrop-filter: blur(calc(var(--blur) + 4px)) saturate(150%);
}

.sidebar nav { display: flex; flex-direction: column; gap: 6px; }

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 20px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #0e9d6e, #0a8f7e 55%, #34d399);
  box-shadow: 0 6px 16px rgba(14, 157, 110, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.brand-mark .icon i { font-size: 19px; }
.brand-name {
  font-size: 19px;
  font-weight: 750;
  letter-spacing: 0.2px;
  background: linear-gradient(100deg, var(--ink-1), var(--accent) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-sub { font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.6px; text-transform: uppercase; }

.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 550;
  transition: background 0.18s, color 0.18s, transform 0.18s;
}
.nav-btn:hover { background: var(--fill-2); color: var(--ink-1); transform: translateX(2px); }
.nav-btn.active {
  color: var(--ink-1);
  background: linear-gradient(95deg, rgba(31, 181, 140, 0.20), rgba(13, 148, 136, 0.12));
  box-shadow: inset 0 0 0 1px rgba(31, 181, 140, 0.35);
}
[data-theme="light"] .nav-btn.active {
  background: linear-gradient(95deg, rgba(15, 159, 111, 0.14), rgba(13, 148, 136, 0.08));
  box-shadow: inset 0 0 0 1px rgba(15, 159, 111, 0.3);
}
.nav-btn .icon i { font-size: 18px; }

.sidebar-foot { padding: 10px 8px 0; font-size: 11.5px; color: var(--ink-3); }

.sidebar-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding: 11px 13px;
  border-radius: 12px;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 550;
  transition: background 0.18s, color 0.18s;
}
.sidebar-toggle:hover { background: var(--fill-2); color: var(--ink-1); }
.sidebar-toggle .icon i { font-size: 15px; }

/* --- keadaan diciutkan (khusus layar lebar) --- */
@media (min-width: 881px) {
  .app { transition: grid-template-columns 0.28s cubic-bezier(0.2, 0.7, 0.3, 1); }
  html.nav-collapsed .app { grid-template-columns: 76px minmax(0, 1fr); }
  html.nav-collapsed .brand > span:last-child,
  html.nav-collapsed .nav-label,
  html.nav-collapsed .sidebar-foot { display: none; }
  html.nav-collapsed .brand { justify-content: center; padding: 4px 0 18px; gap: 0; }
  html.nav-collapsed .sidebar { padding-left: 10px; padding-right: 10px; }
  html.nav-collapsed .nav-btn,
  html.nav-collapsed .sidebar-toggle {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
    gap: 0;
  }
  html.nav-collapsed .nav-btn:hover { transform: none; }
}

main { padding: 26px 30px 48px; max-width: 1240px; width: 100%; margin: 0 auto; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.topbar h1 { font-size: 24px; font-weight: 750; letter-spacing: -0.2px; }
#page-subtitle { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }

/* ---------------------------- halaman & grid ---------------------------- */

.page { display: flex; flex-direction: column; gap: 18px; perspective: 1400px; }

/* fill-mode "backwards": jika animasi tidak berjalan, konten tetap terlihat */
.page > * {
  animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
  transform-origin: 50% 0;
}
.page > *:nth-child(2) { animation-delay: 0.05s; }
.page > *:nth-child(3) { animation-delay: 0.1s; }
.page > *:nth-child(4) { animation-delay: 0.15s; }
.page > *:nth-child(5) { animation-delay: 0.2s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(20px) rotateX(6deg); }
}

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }

/* konten lebar (tabel/chart) tidak boleh memaksa halaman melebar */
.page > *, .grid-2 > *, .grid-3 > *, .kpi-grid > *,
.budget-grid > *, .goal-grid > *, .toolbar > * { min-width: 0; }
.chart-body svg { max-width: 100%; height: auto; }

/* ---------------------------- kartu ---------------------------- */

.card {
  position: relative;
  min-width: 0;
  border-radius: 20px;
  padding: 18px 20px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-card), inset 0 1px 0 var(--glass-hi);
  backdrop-filter: blur(var(--blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(150%);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.card-head h3 { font-size: 15px; font-weight: 650; }
.card-sub { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.card-tools { display: flex; align-items: center; gap: 12px; }

.link-btn { color: var(--accent); font-size: 12.5px; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }

/* ---------------------------- stat tile ---------------------------- */

.stat-tile { overflow: hidden; }
.stat-label { font-size: 12px; color: var(--ink-3); font-weight: 550; }
.stat-value { font-size: 21px; font-weight: 720; letter-spacing: -0.3px; margin: 5px 0 8px; white-space: nowrap; }
.stat-value.sm { font-size: 18px; }
.stat-meta { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; min-height: 30px; }

.stat-hero .stat-value { font-size: 26px; }
.stat-hero .stat-value.sm { font-size: 21px; }

.delta { font-size: 12px; font-weight: 650; white-space: nowrap; }
.delta.good { color: var(--good-text); }
.delta.bad { color: var(--bad-text); }
.delta.muted { color: var(--ink-3); font-weight: 500; }
.delta-ctx { color: var(--ink-3); font-weight: 450; }

.spark-line { stroke: var(--ink-3); stroke-width: 1.5; opacity: 0.65; }
.spark-dot { stroke: var(--surface-1); stroke-width: 1.5; }
.spark { flex-shrink: 0; }

/* koin dekoratif pada kartu saldo */
.coin {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
  color: #6b4a06;
  background: radial-gradient(circle at 30% 28%, #ffe9a0, #f5c332 48%, #c78d0a 82%, #8f6103);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.22), inset 0 -6px 10px rgba(120, 70, 0, 0.35),
    0 10px 20px rgba(0, 0, 0, 0.35);
  transform: rotateX(14deg) rotateZ(-10deg);
  animation: coinFloat 4.5s ease-in-out infinite alternate;
}
.coin::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.5) 48%, transparent 62%);
  background-size: 220% 100%;
  animation: coinShine 3.4s linear infinite;
}
@keyframes coinFloat {
  from { transform: translateY(0) rotateX(14deg) rotateZ(-10deg); }
  to { transform: translateY(-7px) rotateX(20deg) rotateZ(-4deg); }
}
@keyframes coinShine {
  from { background-position: 130% 0; }
  to { background-position: -130% 0; }
}

/* ---------------------------- filter & pill ---------------------------- */

.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.18s;
}
.pill:hover { color: var(--ink-1); transform: translateY(-1px); }
.pill.active {
  color: #fff;
  background: linear-gradient(135deg, #0e9d6e, #0a8f7e);
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(14, 157, 110, 0.35);
}

/* ---------------------------- tombol & input ---------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 650;
  border: 1px solid transparent;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn .icon i { font-size: 14px; }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #0e9d6e, #0a8f7e);
  box-shadow: 0 6px 18px rgba(14, 157, 110, 0.35);
}
.btn-primary:hover { box-shadow: 0 10px 24px rgba(14, 157, 110, 0.45); }
.btn-ghost { background: var(--fill-2); color: var(--ink-1); border-color: var(--glass-border); }
.btn-danger { color: var(--bad-text); border-color: color-mix(in srgb, var(--bad-text) 40%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--bad-text) 12%, transparent); }
.btn-danger-solid {
  color: #fff;
  background: linear-gradient(135deg, #e5484d, #c73838);
  box-shadow: 0 6px 16px rgba(229, 72, 77, 0.32);
}
.btn-danger-solid:hover { box-shadow: 0 10px 24px rgba(229, 72, 77, 0.42); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 10px; }

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  color: var(--ink-3);
  transition: all 0.18s;
}
.icon-btn:hover { background: var(--fill-2); color: var(--ink-1); }
.icon-btn.danger:hover { color: var(--bad-text); background: color-mix(in srgb, var(--bad-text) 12%, transparent); }
.icon-btn .icon i { font-size: 15px; }
.icon { display: inline-flex; align-items: center; justify-content: center; }
.icon i { font-size: 16px; line-height: 1; }

.input {
  background: var(--fill-2);
  border: 1px solid var(--glass-border);
  border-radius: 11px;
  padding: 9px 12px;
  color: var(--ink-1);
  font-size: 13.5px;
  font-family: inherit;
  transition: border-color 0.18s, box-shadow 0.18s;
  min-width: 0;
}
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.input::placeholder { color: var(--ink-3); }
.input-emoji { width: 64px; text-align: center; font-size: 17px; }

/* ---- modernisasi kontrol bawaan browser ---- */

/* Select: buang tampilan bawaan, pakai chevron kustom */
select.input {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238d938a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 15px;
}
select.input:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231fb58c' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}
select.input option {
  background: var(--card-solid);
  color: var(--ink-1);
}
select.input optgroup {
  background: var(--card-solid);
  color: var(--ink-3);
  font-style: normal;
  font-weight: 700;
}

/* Date: ganti ikon kalender bawaan dengan versi bertema */
input[type="date"].input { position: relative; cursor: pointer; }
input[type="date"]::-webkit-calendar-picker-indicator {
  width: 17px;
  height: 17px;
  cursor: pointer;
  opacity: 0.7;
  padding: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17' viewBox='0 0 24 24' fill='none' stroke='%238d938a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4.5' width='18' height='17' rx='3'/%3E%3Cpath d='M3 9.5h18M8 2.5v4M16 2.5v4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transition: opacity 0.15s;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }
input[type="date"]::-webkit-datetime-edit { color: var(--ink-1); }
input[type="date"]:invalid::-webkit-datetime-edit { color: var(--ink-3); }

/* Search: tombol hapus (×) kustom */
input[type="search"] { -webkit-appearance: none; appearance: none; }
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  cursor: pointer;
  opacity: 0.6;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238d938a' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
input[type="search"]::-webkit-search-cancel-button:hover { opacity: 1; }

/* ---- dropdown & date picker kustom (pengganti <select> / date bawaan) ---- */

.cselect, .cdate {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  position: relative;
}
.cselect { padding-right: 34px; }
.cselect-value, .cdate-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cselect-value.is-placeholder, .cdate-label.is-placeholder { color: var(--ink-3); }
.cselect-chev {
  position: absolute; right: 11px; top: 50%;
  transform: translateY(-50%);
  display: flex; color: var(--ink-3);
  transition: transform 0.2s, color 0.2s;
}
.cselect.open .cselect-chev { transform: translateY(-50%) rotate(180deg); color: var(--accent); }
.cdate-ico { display: flex; color: var(--ink-3); transition: color 0.18s; }
.cdate.open .cdate-ico { color: var(--accent); }
.cselect.open, .cdate.open {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.cselect-panel, .cdate-panel {
  position: fixed;
  z-index: 90;
  padding: 6px;
  border-radius: 14px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-pop), inset 0 1px 0 var(--glass-hi);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  animation: popIn 0.16s cubic-bezier(0.2, 0.9, 0.3, 1.05);
}
@keyframes popIn { from { opacity: 0; transform: translateY(-6px); } }

.cselect-panel { min-width: 180px; max-height: 288px; overflow-y: auto; }
.cselect-group {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-3); font-weight: 700; padding: 9px 10px 4px;
}
.cselect-opt {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 9px; cursor: pointer;
  font-size: 13.5px; color: var(--ink-1);
}
.cselect-ico { font-size: 15px; flex-shrink: 0; }
.cselect-opt-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cselect-check { display: none; color: var(--accent); flex-shrink: 0; }
.cselect-opt.selected { color: var(--accent); font-weight: 600; }
.cselect-opt.selected .cselect-check { display: flex; }
.cselect-opt.active { background: var(--fill-2); }

.cdate-panel { width: 272px; }
.cdate-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 8px; }
.cdate-title { font-weight: 650; font-size: 13.5px; }
.cdate-nav {
  width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 9px; color: var(--ink-2); transition: background 0.15s, color 0.15s;
}
.cdate-nav:hover { background: var(--fill-2); color: var(--ink-1); }
.cdate-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cdate-dow { text-align: center; font-size: 10px; font-weight: 700; color: var(--ink-3); padding: 4px 0 6px; text-transform: uppercase; }
.cdate-cell {
  height: 34px; border-radius: 9px; font-size: 13px; color: var(--ink-1);
  display: grid; place-items: center; cursor: pointer;
  font-variant-numeric: tabular-nums; transition: background 0.12s;
}
.cdate-cell.empty { visibility: hidden; cursor: default; }
.cdate-cell:not(.disabled):not(.empty):not(.selected):hover { background: var(--fill-2); }
.cdate-cell.today { box-shadow: inset 0 0 0 1px var(--chart-axis); font-weight: 700; }
.cdate-cell.selected {
  background: linear-gradient(135deg, #0e9d6e, #0a8f7e);
  color: #fff; font-weight: 700;
  box-shadow: 0 4px 12px rgba(14, 157, 110, 0.35);
}
.cdate-cell.selected:hover { filter: brightness(1.08); }
.cdate-cell.disabled { color: var(--ink-3); opacity: 0.38; cursor: default; }
.cdate-foot { display: flex; justify-content: space-between; gap: 8px; padding-top: 9px; margin-top: 6px; border-top: 1px solid var(--glass-border); }
.cdate-today, .cdate-clear {
  font-size: 12.5px; font-weight: 600; padding: 6px 10px; border-radius: 8px;
  color: var(--accent); transition: background 0.15s;
}
.cdate-clear { color: var(--ink-3); }
.cdate-today:hover, .cdate-clear:hover { background: var(--fill-2); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar-plain { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--chart-grid); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------------------- chart chrome ---------------------------- */

.chart-card { min-width: 0; }
.chart-body { min-height: 264px; }
.chart-grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart-axis { stroke: var(--chart-axis); stroke-width: 1; }
.chart-ylabel, .chart-xlabel { fill: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-endlabel { fill: var(--ink-1); font-size: 11px; font-weight: 600; }

.band-wash { fill: var(--ink-1); opacity: 0; transition: opacity 0.15s; }
.band:hover .band-wash, .band:focus-within .band-wash { opacity: 0.05; }
.band:hover .bar, .band:focus-within .bar { filter: brightness(1.16); }
.band rect:focus { outline: none; }

.crosshair { stroke: var(--ink-3); stroke-width: 1; opacity: 0.65; }
.dot-ring { stroke: var(--surface-1); stroke-width: 2; }

.donut-flex { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.donut-wrap { flex-shrink: 0; margin-inline: auto; }
.slice { transition: transform 0.16s, filter 0.16s; outline: none; }
.slice:hover, .slice:focus { transform: translate(var(--dx, 0), var(--dy, 0)); filter: brightness(1.12); }
.donut-title { fill: var(--ink-3); font-size: 11px; }
.donut-value { fill: var(--ink-1); font-size: 19px; font-weight: 650; }

.donut-legend { flex: 1; min-width: 210px; }
.dl-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto 34px;
  gap: 9px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--chart-grid);
  font-size: 12.5px;
}
.dl-row:last-child { border-bottom: none; }
.dl-name { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-val { color: var(--ink-1); font-weight: 600; }
.dl-pct { color: var(--ink-3); text-align: right; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex-shrink: 0; }

/* ---------------------------- tooltip ---------------------------- */

.tip {
  position: fixed;
  z-index: 80;
  min-width: 170px;
  max-width: 260px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--tip-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-pop), inset 0 1px 0 var(--glass-hi);
  pointer-events: none;
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}
.tip-title { font-size: 12px; font-weight: 650; color: var(--ink-2); margin-bottom: 6px; }
.tip-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 2px 0; }
.tip-key { width: 12px; height: 3px; border-radius: 2px; flex-shrink: 0; }
.tip-row:not(:has(.tip-key)) { padding-left: 20px; }
.tip-label { color: var(--ink-3); flex: 1; }
.tip-val { color: var(--ink-1); font-variant-numeric: tabular-nums; font-weight: 650; }

/* ---------------------------- tabel ---------------------------- */

.table-card { padding: 12px 16px 16px; }
.table-scroll { overflow: auto; max-height: 300px; }
.table-scroll-lg { max-height: min(62vh, 640px); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table thead { position: sticky; top: 0; z-index: 1; }
.table th {
  text-align: left;
  color: var(--ink-3);
  font-weight: 700;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 12px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass-strong);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}
.table th:first-child { border-top-left-radius: 10px; }
.table th:last-child { border-top-right-radius: 10px; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--chart-grid); vertical-align: middle; }
.table tbody tr { transition: background 0.12s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--ink-1) 4%, transparent); }
.table th.num, .table td.num { text-align: right; }
.td-date { white-space: nowrap; color: var(--ink-2); }
.td-note { color: var(--ink-2); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-actions { white-space: nowrap; text-align: right; }
.amt-in { color: var(--in); font-weight: 650; white-space: nowrap; }
.amt-out { color: var(--out); font-weight: 650; white-space: nowrap; }
.table-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 12px;
  font-size: 12.5px;
  color: var(--ink-3);
}
.cat-badge { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.cat-ico { font-size: 15px; }

/* ---------------------------- daftar mini (dashboard) ---------------------------- */

.mini-list { display: flex; flex-direction: column; }
.mini-budget { padding: 9px 0; border-bottom: 1px solid var(--chart-grid); }
.mini-budget:last-child { border-bottom: none; }
.mb-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; font-size: 12.5px; }
.mb-name { color: var(--ink-2); font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-val { color: var(--ink-3); white-space: nowrap; }

.tx-mini { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--chart-grid); }
.tx-mini:last-child { border-bottom: none; }
.tx-ico {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 16px;
  border-radius: 11px;
  background: var(--fill-2);
  border: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.tx-mid { flex: 1; min-width: 0; }
.tx-name { font-size: 13px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-sub { font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-amt { font-size: 12.5px; }

/* ---------------------------- meter & status ---------------------------- */

.meter { height: 10px; border-radius: 999px; overflow: hidden; background: var(--track-ok); }
.meter-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.meter-warn { background: var(--track-warn); }
.meter-warn .meter-fill { background: var(--warn); }
.meter-crit { background: var(--track-crit); }
.meter-crit .meter-fill { background: var(--crit); }
.meter-done { background: var(--track-done); }
.meter-done .meter-fill { background: var(--good); }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-ok .status-dot { background: var(--good); }
.status-warn .status-dot { background: var(--warn); }
.status-crit .status-dot { background: var(--crit); }
.status-done { color: var(--good-text); font-weight: 650; }

/* ---------------------------- anggaran ---------------------------- */

.budget-head .meter { margin-top: 4px; }
.budget-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.budget-card { display: flex; flex-direction: column; gap: 10px; }
.bc-top { display: flex; align-items: center; gap: 12px; }
.field-inline { display: flex; flex-direction: row !important; align-items: center; gap: 10px; margin-top: 2px; }
.field-inline span { flex-shrink: 0; }
.field-inline .input { width: 150px; margin-left: auto; }

/* ---------------------------- target ---------------------------- */

.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.goal-card { display: flex; flex-direction: column; gap: 10px; }
.goal-top { display: flex; align-items: center; gap: 12px; }
.goal-top h3 { font-size: 15px; font-weight: 650; }
.goal-ico {
  width: 46px;
  height: 46px;
  font-size: 26px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--fill-2);
  border: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.goal-pct { font-size: 17px; font-weight: 750; color: var(--ink-1); }
.goal-actions { display: flex; gap: 8px; align-items: center; margin-top: 2px; }
.goal-done { border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.goal-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 170px;
  border-style: dashed;
  border-width: 1.5px;
  color: var(--ink-3);
  font-size: 13.5px;
  font-weight: 600;
  transition: all 0.2s;
}
.goal-add:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.goal-add-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--fill-2); }

/* ---------------------------- pengaturan ---------------------------- */

.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--fill-2); }
.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
  transition: all 0.18s;
}
.seg-btn .icon i { font-size: 13px; }
.seg-btn.active {
  color: #fff;
  background: linear-gradient(135deg, #0e9d6e, #0a8f7e);
  box-shadow: 0 4px 12px rgba(14, 157, 110, 0.3);
}
.seg-theme { margin-top: 2px; }

.cat-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 28px; }
.cat-h { font-size: 12px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; padding: 6px 0; }
.cat-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--chart-grid); font-size: 13px; }
.cat-row:last-child { border-bottom: none; }

.page-note { color: var(--ink-3); font-size: 12.5px; }

/* ---------------------------- form & modal ---------------------------- */

.form { display: flex; flex-direction: column; gap: 14px; }
.form .seg { width: 100%; }
.form .seg-btn { flex: 1; justify-content: center; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; font-weight: 550; color: var(--ink-3); }
.field-row { display: flex; gap: 10px; }
.field-emoji { flex-shrink: 0; }
.form-err { color: var(--bad-text); font-size: 12.5px; font-weight: 550; }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 6, 10, 0.55);
  backdrop-filter: blur(6px);
  perspective: 1200px;
  animation: fadeIn 0.2s ease;
}
.modal {
  width: min(460px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 22px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-pop), inset 0 1px 0 var(--glass-hi);
  backdrop-filter: blur(28px) saturate(150%);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  animation: modalIn 0.38s cubic-bezier(0.2, 0.9, 0.3, 1.08);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 4px;
}
.modal-head h3 { font-size: 16.5px; font-weight: 700; }
.modal-body { padding: 14px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 2px 20px 20px; }
.modal-confirm { width: min(420px, 100%); }
.confirm-msg { color: var(--ink-2); font-size: 14px; line-height: 1.6; }

@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(26px) rotateX(10deg) scale(0.97); }
  to { opacity: 1; transform: none; }
}

/* ---------------------------- notice, empty, toast ---------------------------- */

.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 13px;
  color: var(--ink-2);
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.notice-actions { display: flex; gap: 8px; }

.empty { text-align: center; padding: 26px 12px; color: var(--ink-3); font-size: 13px; }
.empty-ico { font-size: 30px; margin-bottom: 8px; }
.empty .btn { margin-top: 12px; }

#toast-root {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 11px 20px;
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 550;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-pop), inset 0 1px 0 var(--glass-hi);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  animation: toastIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.1);
  transition: opacity 0.35s, transform 0.35s;
}
.toast.out { opacity: 0; transform: translateY(10px); }
.toast-err { border-color: color-mix(in srgb, var(--bad-text) 45%, transparent); color: var(--bad-text); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(0.96); } }

/* ---------------------------- responsif ---------------------------- */

@media (max-width: 1080px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .cat-cols { grid-template-columns: 1fr; }
}

@media (max-width: 880px) {
  :root { --blur: 14px; }             /* blur lebih ringan untuk GPU ponsel */
  .app { grid-template-columns: 1fr; }
  main { padding: 18px 14px calc(86px + env(safe-area-inset-bottom)); }
  /* header: judul & aksi tetap satu baris — judul yang mengalah (elipsis),
     bukan tombol yang turun baris secara janggal */
  .topbar { margin-bottom: 14px; flex-wrap: nowrap; align-items: center; gap: 10px; }
  .topbar > div:first-child { flex: 1 1 auto; min-width: 0; }
  .topbar h1 { font-size: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #page-subtitle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar-actions { flex: 0 0 auto; gap: 8px; }

  /* sidebar menjadi bar navigasi bawah */
  .sidebar {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
    flex-direction: row;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-right: none;
    border-top: 1px solid var(--glass-border);
    z-index: 40;
    background: var(--glass-strong);
  }
  .brand, .sidebar-foot, .sidebar-toggle { display: none; }
  .sidebar nav { flex-direction: row; flex: 1; justify-content: space-around; gap: 0; }
  .nav-btn { flex: 1; flex-direction: column; gap: 3px; padding: 6px 4px; font-size: 10px; border-radius: 10px; }
  .nav-btn:hover { transform: none; }
  .nav-btn .icon i { font-size: 19px; }

  /* filter jadi satu baris yang bisa digulir. overflow-x:auto memaksa KEDUA
     sumbu terpotong (spec), jadi beri padding di semua sisi sebagai ruang untuk
     bayangan pil aktif; margin negatif menetralkan padding itu supaya tata letak
     tak bergeser & pil tetap sejajar tepi kartu. Batas margin kiri/kanan -13px
     (< padding main 14px) agar halaman tak menggulir horizontal. */
  .filter-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 12px 13px 18px;
    margin: -12px -13px -14px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .filter-row::-webkit-scrollbar { display: none; }
  .pill { flex-shrink: 0; }
  /* glow dirapatkan (blur 12 < buffer 13px) agar muat dalam scroll-container,
     termasuk sisi kiri pil pertama yang menempel tepi. */
  .pill.active { box-shadow: 0 4px 12px rgba(14, 157, 110, 0.34); }

  /* toolbar transaksi: cari selebar penuh, sisanya dua kolom */
  .toolbar .input { flex: 1 1 40%; }
  .toolbar input[type="search"] { flex-basis: 100%; }
  .toolbar .btn { flex: 1 1 auto; justify-content: center; }

  .card { padding: 16px; border-radius: 18px; }
  .grid-3 { grid-template-columns: 1fr; }
  .donut-flex { justify-content: center; }
  .cat-cols { grid-template-columns: 1fr; }
  .field-inline .input { width: 130px; }
  .td-note { max-width: 150px; }
  .table-card .table { min-width: 620px; }  /* digulir horizontal di dalam kartu */
  .modal-foot .btn { flex: 1; justify-content: center; }
}

@media (max-width: 520px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .topbar h1 { font-size: 20px; }
  /* tombol tambah cukup ikon "+" — label disembunyikan agar tak berdesakan */
  #btn-add-tx { padding: 10px 12px; }
  #btn-add-tx .btn-label { display: none; }
  .stat-hero .stat-value { font-size: 23px; }
}

/* ---------------------------- gerbang login ---------------------------- */

/* Sembunyikan isi aplikasi selama terkunci (anti-flash data). */
html.locked .app { visibility: hidden; }
html.locked, html.locked body { overflow: hidden; }
/* Tombol kunci hanya relevan saat aplikasi terbuka. */
html.locked #btn-logout { display: none; }

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;                 /* di atas modal (50) & popup kontrol (90) */
  display: grid;
  place-items: center;
  padding: 24px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: authFade 0.28s ease both;
}
.auth-overlay.auth-leaving { animation: authFade 0.24s ease both reverse; }
@keyframes authFade { from { opacity: 0; } to { opacity: 1; } }

.auth-card {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 30px 28px 26px;
  border-radius: 20px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-pop), inset 0 1px 0 var(--glass-hi);
  -webkit-backdrop-filter: blur(var(--blur));
  backdrop-filter: blur(var(--blur));
  animation: authRise 0.34s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes authRise { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.auth-card.auth-shake { animation: authShake 0.4s ease; }
@keyframes authShake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-7px)} 40%,80%{transform:translateX(7px)} }

.auth-mark {
  width: 52px; height: 52px;
  margin: 0 auto 6px;
  display: grid; place-items: center;
  border-radius: 15px;
  font-size: 22px; color: #fff;
  background: linear-gradient(135deg, #0e9d6e, #0a8f7e);
  box-shadow: 0 8px 20px rgba(14, 157, 110, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.auth-title { font-size: 21px; font-weight: 800; text-align: center; color: var(--ink-1); }
.auth-sub { font-size: 13px; text-align: center; color: var(--ink-3); margin-bottom: 10px; line-height: 1.5; }

.auth-field { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin: 8px 0 5px; }
.auth-input-wrap { position: relative; display: flex; align-items: center; }
.auth-input {
  width: 100%;
  padding: 12px 44px 12px 14px;
  font-size: 15px; font-family: inherit;
  color: var(--ink-1);
  background: var(--fill-2);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-input::placeholder { color: var(--ink-3); }
.auth-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31, 181, 140, 0.2); }
.auth-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px;
  display: grid; place-items: center;
  color: var(--ink-3); border-radius: 9px;
}
.auth-eye:hover { color: var(--ink-1); background: var(--fill-2); }

.auth-error { font-size: 12.5px; font-weight: 600; color: var(--out); margin: 8px 0 0; }

.auth-submit {
  margin-top: 16px;
  padding: 12px 16px;
  font-size: 15px; font-weight: 700; font-family: inherit;
  color: #fff;
  border-radius: 12px;
  background: linear-gradient(135deg, #0e9d6e, #0a8f7e);
  box-shadow: 0 8px 20px rgba(14, 157, 110, 0.4);
  transition: transform 0.14s, box-shadow 0.2s, opacity 0.2s;
}
.auth-submit:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(14, 157, 110, 0.5); }
.auth-submit:active { transform: translateY(0); }
.auth-submit.is-busy { opacity: 0.65; pointer-events: none; }

.auth-note {
  margin-top: 14px;
  font-size: 11.5px; line-height: 1.55;
  color: var(--ink-3);
}
.auth-note i { color: var(--accent); margin-right: 3px; }

.auth-forgot {
  margin: 14px auto 0;
  font-size: 12.5px; font-weight: 600; font-family: inherit;
  color: var(--ink-3);
}
.auth-forgot:hover { color: var(--accent); text-decoration: underline; }

.auth-reset-confirm { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--track-crit); border: 1px solid rgba(208, 59, 59, 0.4); }
.auth-reset-confirm p { font-size: 12.5px; line-height: 1.55; color: var(--ink-2); }
.auth-reset-actions { display: flex; gap: 8px; margin-top: 10px; }
.auth-reset-actions button { flex: 1; padding: 9px 12px; font-size: 13px; font-weight: 700; font-family: inherit; border-radius: 10px; }
.auth-reset-cancel { color: var(--ink-1); background: var(--fill-2); border: 1px solid var(--glass-border); }
.auth-reset-go { color: #fff; background: var(--crit); }
.auth-reset-go:hover { filter: brightness(1.08); }

@media (max-width: 520px) {
  .auth-card { padding: 26px 20px 22px; border-radius: 16px; }
}

/* Kode tautan WhatsApp (modal Pengaturan). */
.wa-code {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 8px;
  text-align: center;
  padding: 14px 8px;
  border-radius: 14px;
  background: var(--fill-2);
  border: 1px dashed var(--glass-border);
  color: var(--accent);
  user-select: all;
}

/* ---------------------------- gerak & cetak ---------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important; /* delay tanpa durasi = konten "hilang" sesaat */
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .bg-grid, .sidebar, .topbar-actions, .filter-row, .td-actions, #toast-root { display: none !important; }
  body::before { display: none; }
  .app { grid-template-columns: 1fr; }
  .card { box-shadow: none; backdrop-filter: none; }
}
