/* ---------- warna & tema (krem + coklat espresso, aksen pink) ---------- */
:root {
  color-scheme: light;
  --bg: #f6f0ea;
  --surface: #fffcf9;
  --surface-2: #f2e9e1;
  --text: #2b1e18;
  --muted: #8d786b;
  --border: #ebdfd4;
  --accent: #e0607e;
  --accent-strong: #c94566;
  --accent-soft: #fbe5ea;
  --on-accent: #ffffff;
  --caramel: #c27c3a;
  --danger: #cf4b4b;
  --espresso: #2e211b;
  --on-espresso: #f6ece4;
  --on-espresso-muted: rgba(246, 236, 228, .62);
  --hero: linear-gradient(140deg, #2f211b 0%, #553a2d 55%, #7a5443 100%);
  --shadow: 0 1px 2px rgba(74, 51, 40, .05), 0 12px 32px -14px rgba(74, 51, 40, .22);
  --radius: 22px;
  --sidebar: 252px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #15100d;
    --surface: #1f1814;
    --surface-2: #2a211c;
    --text: #f5ece5;
    --muted: #ae998c;
    --border: #34291f;
    --accent: #f07c97;
    --accent-strong: #f597ac;
    --accent-soft: #3d2228;
    --on-accent: #ffffff;
    --caramel: #e3a362;
    --danger: #f07070;
    --espresso: #1d1511;
    --hero: linear-gradient(140deg, #2a1d17 0%, #4a3227 60%, #65463a 100%);
    --shadow: 0 1px 0 rgba(255, 255, 255, .02);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #15100d;
  --surface: #1f1814;
  --surface-2: #2a211c;
  --text: #f5ece5;
  --muted: #ae998c;
  --border: #34291f;
  --accent: #f07c97;
  --accent-strong: #f597ac;
  --accent-soft: #3d2228;
  --on-accent: #ffffff;
  --caramel: #e3a362;
  --danger: #f07070;
  --espresso: #1d1511;
  --hero: linear-gradient(140deg, #2a1d17 0%, #4a3227 60%, #65463a 100%);
  --shadow: 0 1px 0 rgba(255, 255, 255, .02);
}

@property --p { syntax: "<number>"; inherits: true; initial-value: 0; }

/* ---------- dasar ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.015em; }
p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }

.icon { display: block; flex: none; }
.muted { color: var(--muted); }
.print-only { display: none; }

/* ---------- tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); font-size: 15px; font-weight: 600; text-decoration: none;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 10px 20px -12px var(--accent); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .6; cursor: default; }

.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 12px; background: transparent; color: var(--muted);
  text-decoration: none; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap;
}

.segmented { display: flex; padding: 4px; border-radius: 14px; background: var(--surface-2); }
.segmented button {
  flex: 1; height: 38px; border: 0; border-radius: 10px; background: transparent;
  font-size: 14px; font-weight: 600; color: var(--muted);
}
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(43, 30, 24, .12); }

/* ---------- kerangka: header (HP), menu, konten ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; text-decoration: none; white-space: nowrap; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px;
  background: var(--accent); color: #fff; box-shadow: 0 8px 16px -8px var(--accent);
}

.avatar {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: var(--hero); color: #fff; font-weight: 700; font-size: 15px;
}
.avatar-btn { padding: 0; border: 0; background: none; border-radius: 50%; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 720px; margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 20px 6px;
}

/* HP: menu pil coklat melayang di bawah */
.nav {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom));
  width: min(440px, calc(100% - 24px));
  padding: 6px; border-radius: 24px;
  background: rgba(46, 33, 27, .94);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 16px 36px -14px rgba(30, 20, 15, .65);
}
.nav-brand, .nav-foot { display: none; }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 0 7px; border-radius: 18px;
  color: var(--on-espresso-muted); font-size: 11px; font-weight: 700; text-decoration: none;
  transition: background .2s, color .2s;
}
.nav-links a.active { background: var(--accent); color: #fff; }

main { max-width: 720px; margin: 0 auto; padding: 10px 16px calc(112px + env(safe-area-inset-bottom)); }

/* Laptop: sidebar coklat di kiri */
@media (min-width: 960px) {
  .topbar { display: none; }
  .nav {
    left: 0; top: 0; bottom: 0; transform: none;
    width: var(--sidebar); padding: 28px 16px 20px; border-radius: 0;
    display: flex; flex-direction: column;
    background: var(--espresso); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none;
    border-right: 1px solid rgba(255, 255, 255, .04);
  }
  .nav-brand { display: flex; color: var(--on-espresso); margin: 0 10px 32px; font-size: 17px; }
  .nav-links { flex-direction: column; }
  .nav-links a { flex: none; flex-direction: row; gap: 12px; padding: 12px 14px; border-radius: 14px; font-size: 15px; font-weight: 600; }
  .nav-links a:hover:not(.active) { background: rgba(255, 255, 255, .06); color: var(--on-espresso); }
  .nav-foot {
    display: flex; align-items: center; gap: 10px; margin-top: auto;
    padding: 14px 6px 0 8px; border-top: 1px solid rgba(255, 255, 255, .08); color: var(--on-espresso);
  }
  .nav-foot .nav-user { flex: 1; min-width: 0; }
  .nav-foot .nav-user b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-foot .nav-user small { display: block; color: var(--on-espresso-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav-foot .icon-btn { color: var(--on-espresso-muted); }
  .nav-foot .icon-btn:hover { background: rgba(255, 255, 255, .08); color: var(--on-espresso); }
  main { max-width: none; margin-left: var(--sidebar); padding: 40px 48px 64px; }
  #view > * { max-width: 760px; margin-left: auto; margin-right: auto; }
}

/* ---------- elemen umum ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 0 18px; }
.page-head h1 { font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
.page-head .sub { margin-top: 2px; color: var(--muted); font-size: 14px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2 { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; }
.card-head h2 .icon { color: var(--accent); }

.loading { padding: 64px 0; text-align: center; color: var(--muted); }
.empty { padding: 6px 2px; font-size: 14px; color: var(--muted); }
.empty-state { padding: 48px 16px; text-align: center; color: var(--muted); }
.empty-state .big { font-size: 44px; margin-bottom: 8px; }
.empty-state .btn { margin-top: 16px; }

.save-status { font-size: 12px; font-weight: 600; color: var(--muted); }
.save-status.error { color: var(--danger); }

/* ---------- Hari Ini: kartu hero ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  margin-bottom: 16px; padding: 20px 20px 18px; border-radius: 28px;
  background: var(--hero); color: #fff8f3;
  box-shadow: 0 22px 44px -24px rgba(47, 33, 27, .75);
}
.hero::before, .hero::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; pointer-events: none; }
.hero::before { width: 240px; height: 240px; right: -80px; top: -110px; background: radial-gradient(circle, rgba(240, 124, 151, .45), transparent 68%); }
.hero::after { width: 200px; height: 200px; left: -70px; bottom: -120px; background: radial-gradient(circle, rgba(214, 160, 110, .28), transparent 70%); }

.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.hero-kicker { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #ffb3c4; min-height: 18px; }
.hero h1 { margin-top: 4px; font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.hero-year { font-size: 14px; color: rgba(255, 248, 243, .6); }
.hero-arrows { display: flex; gap: 6px; }
.hero-arrows a {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 13px;
  background: rgba(255, 255, 255, .1); color: #fff; text-decoration: none; transition: background .15s;
}
.hero-arrows a:hover { background: rgba(255, 255, 255, .2); }

.hero-body { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.hero-msg {
  flex: 1; min-width: 0; padding: 12px 14px; border-radius: 18px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .1);
  font-size: 14px; line-height: 1.45;
}
.hero-msg b { display: block; margin-bottom: 2px; font-size: 14px; }
.hero-back {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 14px;
  background: rgba(255, 255, 255, .12); font-size: 14px; font-weight: 700; text-decoration: none;
}
.hero-spacer { flex: 1; }

.ring { position: relative; display: grid; place-content: center; flex: none; width: 80px; height: 80px; text-align: center; transition: --p .6s ease; }
.ring::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p) * 1turn), rgba(255, 255, 255, .16) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px));
}
.ring b { font-size: 19px; font-weight: 800; line-height: 1; }
.ring small { display: block; margin-top: 3px; font-size: 10px; font-weight: 700; letter-spacing: .04em; color: rgba(255, 248, 243, .65); }

/* ---------- to-do ---------- */
.add-bar { display: flex; gap: 8px; margin-bottom: 8px; }
.add-field {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px;
  height: 50px; padding: 0 7px 0 15px; border-radius: 16px;
  background: var(--surface-2); border: 1px solid transparent;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.add-field:focus-within { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.add-field > input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: transparent; outline: none; }
.add-field > input::placeholder { color: var(--muted); }

.date-chip {
  position: relative; display: inline-flex; align-items: center; gap: 5px; flex: none;
  height: 36px; padding: 0 10px; border-radius: 11px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer;
}
.date-chip.set { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.date-chip input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0;
  opacity: 0; cursor: pointer; -webkit-appearance: none; appearance: none;
}

.add-btn {
  display: grid; place-items: center; flex: none; width: 50px; height: 50px;
  border: 0; border-radius: 16px; background: var(--accent); color: #fff;
  box-shadow: 0 10px 20px -10px var(--accent); transition: background .15s, transform .1s;
}
.add-btn:hover { background: var(--accent-strong); }
.add-btn:active { transform: scale(.95); }

.todo-list { list-style: none; margin: 0; padding: 0; }
.todo { display: flex; align-items: flex-start; gap: 2px; border-top: 1px solid var(--border); }
.todo:first-child { border-top: 0; }

.check { display: grid; place-items: center; flex: none; width: 40px; height: 46px; cursor: pointer; }
.check input {
  appearance: none; -webkit-appearance: none; margin: 0;
  display: grid; place-content: center;
  width: 23px; height: 23px; border: 2px solid var(--muted); border-radius: 50%; cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}
.check input:hover { border-color: var(--accent); }
.check input:checked { background: var(--accent); border-color: var(--accent); transform: scale(1.05); }
.check input:checked::after {
  content: ""; width: 10px; height: 5px; margin-top: -2px;
  border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: rotate(-45deg);
}

.todo-body { flex: 1; min-width: 0; padding: 5px 0; }
.todo-title {
  display: block; width: 100%; padding: 6px 0; line-height: 1.45;
  border: 0; background: transparent; outline: none; resize: none; overflow: hidden;
  field-sizing: content; /* judul panjang turun ke baris berikutnya */
}
.todo.important .todo-title { font-weight: 700; }
.todo.done .todo-title { color: var(--muted); font-weight: 400; text-decoration: line-through; }
.todo-meta { display: block; margin-top: -4px; padding-bottom: 5px; font-size: 12px; font-weight: 600; color: var(--caramel); }

.todo .icon-btn { width: 34px; height: 34px; margin-top: 6px; border-radius: 10px; }
.star-btn { opacity: .45; }
.star-btn:hover { opacity: 1; color: var(--caramel); }
.todo.important .star-btn { opacity: 1; color: var(--caramel); }
.todo.done .star-btn { visibility: hidden; }
.del-btn { opacity: .45; }
.del-btn:hover { opacity: 1; color: var(--danger); }

.all-done {
  margin-top: 12px; padding: 12px; border-radius: 14px;
  background: var(--accent-soft); color: var(--accent-strong);
  font-size: 14px; font-weight: 700; text-align: center;
}

/* Mendatang */
.upcoming { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.up-item { display: flex; align-items: center; gap: 12px; }
.up-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-decoration: none; }
.up-date {
  display: grid; place-content: center; flex: none; width: 46px; height: 50px; border-radius: 14px;
  background: var(--surface-2); text-align: center; line-height: 1.1;
}
.up-date b { font-size: 17px; font-weight: 800; }
.up-date small { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.up-title { min-width: 0; overflow-wrap: anywhere; }
.up-title small { display: block; font-size: 12px; font-weight: 600; color: var(--caramel); }

/* catatan otomatis tinggi */
.autosize {
  display: block; width: 100%; min-height: 150px; padding: 0;
  border: 0; background: transparent; resize: none; outline: none; overflow: hidden;
  field-sizing: content; /* browser lama pakai JS di app.js */
}
.autosize::placeholder, .note-title::placeholder { color: var(--muted); opacity: .8; }

/* ---------- Riwayat ---------- */
.search { position: relative; margin-bottom: 16px; }
.search .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 52px; padding: 0 16px 0 46px;
  border: 1px solid var(--border); border-radius: 18px; background: var(--surface);
  box-shadow: var(--shadow); -webkit-appearance: none; appearance: none;
}
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head h2 { font-size: 17px; font-weight: 700; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wd { padding: 4px 0 6px; font-size: 12px; font-weight: 700; text-align: center; color: var(--muted); }
.cal-day {
  position: relative; display: grid; place-items: center; aspect-ratio: 1;
  border-radius: 14px; font-size: 15px; font-weight: 600; text-decoration: none; transition: background .15s;
}
.cal-day:hover { background: var(--surface-2); }
.cal-day.future { color: var(--muted); font-weight: 500; }
.cal-day.today { background: var(--accent); color: #fff; font-weight: 800; box-shadow: 0 8px 16px -8px var(--accent); }
.cal-day .dot { position: absolute; bottom: 14%; width: 5px; height: 5px; border-radius: 50%; background: var(--caramel); }
.cal-day.today .dot { background: #fff; }
.cal-note { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.cal-note .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--caramel); }

.results h3 { margin: 16px 0 6px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.results h3:first-child { margin-top: 0; }
.result { display: block; padding: 10px 0; border-top: 1px solid var(--border); text-decoration: none; }
.results h3 + .result { border-top: 0; }
.result small { display: block; font-size: 12px; font-weight: 700; color: var(--accent); }
.result span { display: block; overflow-wrap: anywhere; }
.result mark { background: var(--accent-soft); color: inherit; border-radius: 4px; padding: 0 2px; }

/* ---------- Rekap ---------- */
.period-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 0; }
.period-label { flex: 1; text-align: center; }
.period-label h2 { font-size: 18px; font-weight: 800; }
.period-label p { font-size: 13px; color: var(--muted); }
.period-nav .icon-btn { background: var(--surface); border: 1px solid var(--border); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.stat { padding: 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.stat b { display: block; font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stat span { font-size: 12px; font-weight: 600; color: var(--muted); }
.stat.primary { background: var(--hero); border-color: transparent; color: #fff; }
.stat.primary span { color: rgba(255, 248, 243, .7); }

.report-actions { display: flex; gap: 8px; margin-bottom: 16px; }
.report-actions .btn { flex: 1; }

.timeline { position: relative; }
.tl-day { position: relative; padding: 0 0 18px 22px; }
.tl-day::before { content: ""; position: absolute; left: 4px; top: 8px; bottom: -8px; width: 2px; background: var(--border); }
.tl-day:last-child { padding-bottom: 0; }
.tl-day:last-child::before { display: none; }
.tl-day::after { content: ""; position: absolute; left: 0; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tl-day h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.tl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.tl-list li { display: flex; gap: 8px; align-items: flex-start; font-size: 15px; }
.tl-list .icon { margin-top: 3px; color: var(--accent); }
.tl-note {
  margin-top: 8px; padding: 10px 12px; border-radius: 14px;
  background: var(--surface-2); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere;
}

.pending-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pending-list li { display: flex; gap: 10px; align-items: flex-start; }
.pending-list .icon { margin-top: 3px; color: var(--muted); }
.pending-list .imp .icon { color: var(--caramel); }
.pending-list small { display: block; font-size: 12px; color: var(--muted); }

/* ---------- Catatan ---------- */
.note-list { display: grid; gap: 12px; }
@media (min-width: 560px) { .note-list { grid-template-columns: 1fr 1fr; } }
.note-card { display: flex; flex-direction: column; margin: 0; text-decoration: none; transition: border-color .15s, transform .15s; }
.note-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.note-card h3 { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.note-card p {
  margin: 6px 0 12px; font-size: 14px; color: var(--muted); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.note-card time { margin-top: auto; font-size: 12px; font-weight: 600; color: var(--caramel); }

.editor-bar { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; }
.editor-bar .save-status { margin-left: auto; }
.back-link { display: inline-flex; align-items: center; gap: 4px; padding-right: 8px; font-weight: 700; text-decoration: none; color: var(--muted); }
.back-link:hover { color: var(--text); }
.note-title {
  display: block; width: 100%; padding: 0; margin-bottom: 12px;
  border: 0; background: transparent; outline: none; font-size: 24px; font-weight: 800; letter-spacing: -.02em;
}
.note-editor { min-height: 50vh; }

/* ---------- Login ---------- */
.auth {
  display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 24px 16px;
  background: radial-gradient(900px 420px at 50% -8%, rgba(122, 84, 67, .35), transparent 70%), var(--bg);
}
.auth-card {
  width: 100%; max-width: 400px; padding: 32px 24px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 28px; box-shadow: var(--shadow);
}
.auth-card .brand-mark { width: 60px; height: 60px; border-radius: 19px; margin: 0 auto 16px; }
.auth-card h1 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.auth-card > p { margin: 6px 0 24px; }
.auth form { display: grid; gap: 14px; text-align: left; }

.field { display: grid; gap: 6px; }
.field span { font-size: 13px; font-weight: 700; }
.field input {
  height: 50px; padding: 0 15px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2);
}
.field input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }

/* ---------- Pengaturan ---------- */
dialog {
  width: min(420px, calc(100vw - 32px)); padding: 0;
  border: 1px solid var(--border); border-radius: 24px; background: var(--surface); color: var(--text);
  box-shadow: 0 24px 60px rgba(20, 12, 8, .3);
}
dialog::backdrop { background: rgba(30, 20, 15, .45); }
.dialog-body { padding: 22px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.dialog-head h2 { font-size: 19px; font-weight: 800; }
.profile { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding: 12px; border-radius: 18px; background: var(--surface-2); }
.profile b { display: block; }
.profile small { color: var(--muted); font-size: 13px; }
.setting { margin-bottom: 20px; }
.setting > b { display: block; margin-bottom: 8px; font-size: 13px; }
details summary { cursor: pointer; font-size: 14px; font-weight: 700; }
details form { display: grid; gap: 10px; margin-top: 12px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 50;
  display: flex; align-items: center; gap: 16px;
  max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: 16px;
  background: var(--espresso); color: var(--on-espresso); font-size: 14px; font-weight: 600;
  box-shadow: 0 16px 32px -12px rgba(20, 12, 8, .5);
  opacity: 0; transform: translate(-50%, 12px); pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { padding: 0; border: 0; background: none; color: #ff9fb5; font-weight: 800; }
@media (min-width: 960px) { .toast { left: calc(50% + var(--sidebar) / 2); bottom: 28px; } }

/* ---------- cetak (Rekap -> PDF) ---------- */
@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #f4f4f4; --text: #000; --muted: #555; --border: #ddd; --shadow: none; }
  body { background: #fff; color: #000; }
  .topbar, .nav, .toast, .no-print { display: none !important; }
  .print-only { display: block; }
  main { margin: 0 !important; padding: 0 !important; max-width: none !important; }
  .card, .stat { box-shadow: none; break-inside: avoid; }
  .stat.primary { background: #fff; color: #000; border: 1px solid #ddd; }
  .stat.primary span { color: #555; }
}
