/* ELS Manager — kerangka & komponen. Token dasar ada di tokens.css (salinan Sales Kit; jangan diubah di sana).
   Spesifikasi: docs/DESIGN.md. Urutan (2.4): 1 tambahan token · 2 dasar & tipografi · 3 kerangka · 4 komponen ·
   5 lembar & toast · 6 masuk · 7 keyboard, mode fokus, kurangi gerak, fallback kaca, cetak.
   Titik patah (2.5): 380 · 560 · 720 (md) · 1024 (lg: sidebar, bar bawah hilang) · 1440 (sidebar 288).
   Gaya khusus satu halaman ada di css/views/<halaman>.css (ditautkan sesudah berkas ini). */

/* ==========================================================================
   1. Tambahan token Manager (3.2)
   ========================================================================== */
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url('../assets/fonts/JetBrainsMono-var.woff2') format('woff2'); }

:root {
  --mono: 'JetBrains Mono', 'Cascadia Code', Consolas, 'SFMono-Regular', Menlo, monospace; /* hanya untuk kode */
  --kb-inset: 0px;

  /* Alias nama lama Manager → token Sales Kit. Hapus setelah Tahap B tidak memakainya lagi. */
  --ink: var(--text); --line: var(--stroke); --r: var(--radius-lg); --r-sm: var(--radius-sm);
  --ok: var(--green); --ok-soft: var(--green-soft); --ok-ink: var(--green-ink);
  --warn: var(--amber); --warn-soft: var(--amber-soft); --warn-ink: var(--amber-ink);
  --bad: var(--red); --bad-soft: var(--red-soft); --bad-ink: var(--red-ink);
  --info: var(--blue); --info-soft: var(--blue-soft); --info-ink: var(--blue-ink);

  /* Ikon mask untuk .banner / .alert (bentuk saja; warnanya dari background-color). */
  --ic-warn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
  --ic-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
  --ic-bad: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' x2='12' y1='8' y2='12'/%3E%3Cline x1='12' x2='12.01' y1='16' y2='16'/%3E%3C/svg%3E");
  --ic-ok: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m16 9-5.5 5.5L8 12'/%3E%3C/svg%3E");
  --ic-flag: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528'/%3E%3C/svg%3E");

  /* Panah <select>: SVG data URI (CSP img-src mengizinkan data:). Warna = --muted per tema. */
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A7B1D6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2348527D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
}
:root[data-theme="light"] { --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2348527D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }

/* Titik patah Sales Kit (base.css) */
@media (min-width: 720px) { :root { --gutter: 24px; } }
@media (min-width: 1024px) { :root { --gutter: 36px; --topbar-h: 64px; } }
@media (min-width: 1440px) { :root { --sidebar-w: 288px; } }

/* ==========================================================================
   2. Dasar & tipografi (6.1)
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; background: var(--bg);
  scroll-padding-top: calc(var(--topbar-h) + var(--safe-top) + 12px); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: var(--fs-base); line-height: 1.55; font-weight: 450;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  overflow-x: hidden; transition: background-color .5s ease, color .3s ease;
}
h1, h2, h3, h4 { margin: 0; color: var(--text); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; text-wrap: balance; }
h3 { font-size: var(--fs-md); font-weight: 750; letter-spacing: -.01em; }
p { margin: 0; text-wrap: pretty; }
b, strong { font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); color: var(--text); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
.btn:focus-visible, .chip:focus-visible, .seg button:focus-visible { outline-offset: 3px; }
.ico { flex: none; display: inline-block; vertical-align: middle; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .82em; font-weight: 600; letter-spacing: 0; color: var(--muted); }
.m { color: var(--muted); font-size: var(--fs-sm); }
.is-good { color: var(--green-ink) !important; } .is-warn { color: var(--amber-ink) !important; } .is-bad { color: var(--red-ink) !important; }
.err { color: var(--red-ink); font-weight: 700; font-size: var(--fs-sm); }
.okmsg { color: var(--green-ink); font-weight: 700; font-size: var(--fs-sm); }
.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 719.98px) { .hide-mobile { display: none !important; } }
@media (min-width: 720px) { .hide-desktop { display: none !important; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   3. Kerangka (5.2–5.7)
   ========================================================================== */

/* ---------- Aurora, splash, dasar kerangka (5.2) ---------- */
.aurora { position: fixed; inset: -25%; z-index: var(--z-aurora); pointer-events: none; overflow: hidden; }
.aurora i {
  position: absolute; width: 64vmax; height: 64vmax; border-radius: 50%;
  background: radial-gradient(circle at center, currentColor 0%, transparent 62%);
  opacity: var(--aurora-opacity); transition: color 1.4s ease, opacity .6s ease;
  animation: auroraDrift 28s ease-in-out infinite alternate; will-change: transform;
}
.aurora i:nth-child(1) { color: var(--accent); left: -6%; top: -10%; }
.aurora i:nth-child(2) { color: var(--accent-2); right: -10%; top: 6%; animation-duration: 34s; animation-delay: -9s; opacity: calc(var(--aurora-opacity) * .8); }
.aurora i:nth-child(3) { color: var(--violet); left: 24%; bottom: -30%; animation-duration: 40s; animation-delay: -17s; opacity: calc(var(--aurora-opacity) * .6); }
.aurora::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--stroke) 1px, transparent 1px), linear-gradient(90deg, var(--stroke) 1px, transparent 1px);
  background-size: 64px 64px; opacity: .22;
  -webkit-mask-image: radial-gradient(ellipse at 50% 20%, #000 0%, transparent 55%);
  mask-image: radial-gradient(ellipse at 50% 20%, #000 0%, transparent 55%);
}
@keyframes auroraDrift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(7vw, 5vh, 0) scale(1.12); }
  100% { transform: translate3d(-5vw, 3vh, 0) scale(.94); }
}

#root { position: relative; z-index: var(--z-content); min-height: 100vh; min-height: 100dvh; }
.shell { min-height: 100dvh; }
.main-col { position: relative; min-width: 0; }

.splash { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; }
.splash-logo { --els-h: 46px; margin-bottom: 6px; animation: splashBreath 1.8s var(--ease) infinite alternate; }
.splash-name { font-weight: 800; letter-spacing: -.01em; font-size: var(--fs-lg); line-height: 1.2; }
.splash-tag { margin-top: -14px; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
@keyframes splashBreath { from { opacity: .82; transform: scale(.985); } to { opacity: 1; transform: scale(1); } }

.skip-link { position: fixed; left: 12px; top: calc(var(--safe-top) + 8px); z-index: var(--z-float); padding: 10px 16px; border-radius: 999px;
  background: var(--surface-raised); color: var(--text); border: 1px solid var(--stroke-strong); font-weight: 700; transform: translateY(-200%); }
.skip-link:focus-visible { transform: none; }
.noscript { padding: 16px; }

/* ---------- Logo yang ikut tema (4.6) — gambar tidak pernah diwarnai ulang ---------- */
.els-art { display: inline-flex; align-items: center; flex: none; height: var(--els-h, 32px); line-height: 0; vertical-align: middle; }
.els-art-img { display: block; height: 100%; width: auto; max-width: none; user-select: none; pointer-events: none; }
.els-mark { width: var(--els-h, 32px); }
.els-mark .els-art-img { width: 100%; }
.els-auto .els-art-light { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .els-auto .els-art-light { display: block; }
  :root:not([data-theme="dark"]) .els-auto .els-art-dark { display: none; }
}
:root[data-theme="light"] .els-auto .els-art-light { display: block; }
:root[data-theme="light"] .els-auto .els-art-dark { display: none; }

/* ---------- Topbar (5.3) ---------- */
.topbar {
  position: sticky; top: 0; z-index: var(--z-topbar); display: flex; align-items: center; gap: 6px;
  height: calc(var(--topbar-h) + var(--safe-top));
  padding: var(--safe-top) calc(10px + var(--safe-right)) 0 calc(10px + var(--safe-left));
  background: transparent; border-bottom: 1px solid transparent;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.is-scrolled .topbar, .topbar.is-solid {
  background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  border-bottom-color: var(--stroke);
}
.topbar-back { display: none; }
.topbar.has-back .topbar-back { display: inline-grid; }
.topbar.has-back .topbar-brand { display: none; }
.topbar-brand { display: inline-flex; align-items: center; padding: 7px; border-radius: 12px; }
.topbar-brand .els-mark { --els-h: 30px; }
.topbar-title { flex: 1; min-width: 0; display: grid; padding: 0 6px; }
.topbar-title > span {
  grid-area: 1 / 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--fs-md); letter-spacing: -.01em; line-height: 1.3;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.tt-brand { font-weight: 800; }
.tt-page { font-weight: 750; opacity: 0; transform: translateY(6px); }
.is-scrolled .tt-page, .topbar.title-always .tt-page { opacity: 1; transform: none; }
.is-scrolled .tt-brand, .topbar.title-always .tt-brand, .topbar.has-back .tt-brand { opacity: 0; transform: translateY(-6px); }
.topbar.has-back .tt-page { opacity: 1; transform: none; }
.topbar-actions { display: flex; align-items: center; gap: 4px; }
.topbar-avatar { display: inline-flex; padding: 4px; border-radius: 50%; text-decoration: none; }
.topbar-avatar .avatar { transition: transform var(--dur) var(--ease); }
.topbar-avatar:hover .avatar { transform: scale(1.06); }
.theme-toggle .ico { transition: transform .5s var(--ease-spring); }
.theme-toggle:active .ico { transform: rotate(-40deg) scale(.9); }
.net-pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px;
  background: var(--amber-soft); color: var(--amber-ink); font-size: var(--fs-xs); font-weight: 750; white-space: nowrap; }
.btn.icon.is-busy .ico { animation: spin .9s linear infinite; }
.grad-text { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Sidebar ≥1024 px (5.4) ---------- */
.sidebar { display: none; }
.brand { display: flex; align-items: center; gap: 12px; padding: 10px 10px 22px; color: var(--text); text-decoration: none; border-radius: 14px; }
.brand:hover { text-decoration: none; }
.brand-logo { --els-h: 28px; }
.brand-rule { flex: none; align-self: stretch; width: 1px; margin: 4px 0; background: var(--stroke-strong); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-weight: 800; font-size: var(--fs-md); letter-spacing: -.015em; line-height: 1.2; white-space: nowrap; }
.brand-tag { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; white-space: nowrap; }

.side-nav { flex: 1; overflow-y: auto; padding: 4px 2px 12px; margin: 0 -4px; scrollbar-width: thin; }
.nav-group + .nav-group { margin-top: 18px; }
.nav-group-label { padding: 0 12px 6px; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 6px 10px; margin: 2px 4px;
  border-radius: 14px; color: var(--muted); font-weight: 650; font-size: var(--fs-base); text-decoration: none;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}
.nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-item:active { transform: scale(.98); }
.nav-item .ic { width: 34px; height: 34px; border-radius: 11px; transition: transform var(--dur) var(--ease-spring); }
.nav-item:hover .ic { transform: scale(1.06); }
.nav-item-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item.active { background: var(--surface-3); color: var(--text); }
.nav-item.active::before { content: ""; position: absolute; left: -4px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: linear-gradient(var(--accent), var(--accent-2)); }
.nav-item.active .ic { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent); box-shadow: 0 8px 20px -8px var(--accent-glow); }

.side-foot { padding-top: 12px; border-top: 1px solid var(--stroke); }
.side-me {
  display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 18px; border: 1px solid var(--stroke);
  background: linear-gradient(135deg, var(--violet-soft), var(--cyan-soft)); color: var(--text); text-decoration: none;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.side-me:hover { transform: translateY(-1px); box-shadow: var(--shadow); text-decoration: none; }
.side-me-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.side-me-name { font-weight: 750; font-size: var(--fs-sm); line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-me-sub { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-me-chev { color: var(--dim); }

.notif-badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--red); color: var(--on-red); font-size: 10.5px; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none;
}

@media (min-width: 1024px) {
  .sidebar {
    display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0; z-index: var(--z-nav);
    width: var(--sidebar-w); padding: calc(20px + var(--safe-top)) 14px calc(16px + var(--safe-bottom));
    background: var(--glass); -webkit-backdrop-filter: blur(22px) saturate(1.4); backdrop-filter: blur(22px) saturate(1.4);
    border-right: 1px solid var(--stroke);
  }
  .main-col { margin-left: var(--sidebar-w); }
  .topbar { padding-left: var(--gutter); padding-right: var(--gutter); gap: 8px; }
  .topbar .topbar-brand, .topbar .topbar-avatar, .tt-brand { display: none; }
  /* Di desktop tombol kembali hanya untuk rute detail (selektor kedua mengalahkan .topbar.has-back .topbar-back di atas). */
  .topbar .topbar-back, .topbar.has-back:not(.has-back-detail) .topbar-back { display: none; }
  .topbar.has-back.has-back-detail .topbar-back { display: inline-grid; }
  .topbar.has-back:not(.has-back-detail) .tt-page { opacity: 0; transform: translateY(6px); }
  .is-scrolled .topbar.has-back .tt-page, .topbar.title-always .tt-page, .topbar.title-always.has-back .tt-page { opacity: 1; transform: none; }
}

/* ---------- Navigasi bawah <1024 px, tombol [+], FAB (5.5) ---------- */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-nav);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: stretch;
  height: calc(var(--bottomnav-h) + var(--safe-bottom));
  padding: 0 calc(6px + var(--safe-right)) var(--safe-bottom) calc(6px + var(--safe-left));
  background: var(--glass); -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5);
  border-top: 1px solid var(--stroke); box-shadow: var(--shadow-up);
}
.bn-item {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 0; min-height: 44px; padding: 6px 2px; color: var(--dim); font-size: 11px; font-weight: 700; letter-spacing: .01em;
  text-decoration: none; background: none; border: 0; cursor: pointer; transition: color var(--dur) var(--ease);
}
.bn-item:hover { text-decoration: none; color: var(--muted); }
.bn-icon { position: relative; display: grid; place-items: center; width: 48px; height: 30px; border-radius: 999px;
  transition: background-color var(--dur) var(--ease), transform var(--dur) var(--ease-spring); }
.bn-item:active .bn-icon { transform: scale(.9); }
.bn-item.active { color: var(--accent-ink); }
.bn-item.active .bn-icon { background: var(--accent-soft); }
.bn-icon .notif-badge { position: absolute; top: -4px; left: 28px; box-shadow: 0 0 0 2px var(--bg); }
.bn-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bn-plus-wrap { display: flex; justify-content: center; align-items: flex-start; }
.bn-plus {
  display: grid; place-items: center; width: 58px; height: 58px; margin-top: -20px; border-radius: 50%;
  color: var(--on-brand); background: linear-gradient(135deg, var(--cyan), var(--violet)); border: 4px solid var(--bg);
  box-shadow: 0 12px 28px -8px var(--violet-glow), 0 4px 12px -4px var(--cyan-glow); cursor: pointer;
  transition: transform var(--dur) var(--ease-spring), box-shadow var(--dur) var(--ease);
}
.bn-plus:hover { transform: translateY(-2px); }
.bn-plus:active { transform: scale(.92); }
.bn-plus .ico, .fab .ico { transition: transform var(--dur-slow) var(--ease-spring); }
.qa-open .bn-plus .ico, .qa-open .fab .ico { transform: rotate(135deg); }

.fab { display: none; }
@media (min-width: 1024px) {
  .bottomnav { display: none; }   /* lg: sidebar menggantikan bar bawah */
  .fab:not([hidden]) {
    position: fixed; right: 32px; bottom: 32px; z-index: var(--z-fab); display: inline-flex; align-items: center; gap: 10px;
    height: 56px; padding: 0 22px 0 18px; border: 0; border-radius: 999px; cursor: pointer;
    color: var(--on-brand); font-weight: 750; font-size: var(--fs-base);
    background: linear-gradient(135deg, var(--cyan), var(--violet));
    box-shadow: 0 16px 36px -12px var(--violet-glow), 0 6px 14px -6px var(--cyan-glow);
    transition: transform var(--dur) var(--ease-spring), box-shadow var(--dur) var(--ease);
  }
  .fab:hover { transform: translateY(-2px); box-shadow: 0 22px 44px -12px var(--violet-glow), 0 6px 14px -6px var(--cyan-glow); }
  .fab:active { transform: scale(.96); }
}

/* ---------- Area isi (5.6) ---------- */
.view {
  display: flex; flex-direction: column; gap: var(--space-5); width: 100%; max-width: var(--content-max); margin: 0 auto;
  padding: 4px calc(var(--gutter) + var(--safe-right)) calc(var(--bottomnav-h) + var(--safe-bottom) + 36px) calc(var(--gutter) + var(--safe-left));
}
.view:focus { outline: none; }
@media (min-width: 1024px) { .view { padding-bottom: 96px; } }
.page-enter > * { animation: pageIn var(--dur-slow) var(--ease-out) both; }
.page-enter > :nth-child(2) { animation-delay: 40ms; }
.page-enter > :nth-child(3) { animation-delay: 80ms; }
.page-enter > :nth-child(4) { animation-delay: 120ms; }
.page-enter > :nth-child(5) { animation-delay: 160ms; }
.page-enter > :nth-child(n+6) { animation-delay: 200ms; }
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Kepala halaman .ph (5.7) ---------- */
.ph {
  position: relative; overflow: hidden; isolation: isolate; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4);
  margin-top: 4px; padding: var(--space-6) var(--space-5); border-radius: var(--radius-xl); border: 1px solid var(--stroke);
  background: radial-gradient(130% 160% at 0% 0%, var(--accent-soft) 0%, transparent 50%), var(--surface);
  box-shadow: var(--shadow), inset 0 1px 0 var(--highlight);
}
.ph::before { content: ""; position: absolute; z-index: -1; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 68%); opacity: .55; pointer-events: none; }
.ph::after { content: ""; position: absolute; z-index: -1; left: 0; right: 0; top: 0; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent); opacity: .7; }
.ph > :first-child:not(.ph-ic), .ph-text { flex: 1 1 260px; min-width: 0; }
.ph > :where(:not(:first-child):not(.ph-text)) { flex: 0 1 auto; }   /* :where = spesifisitas rendah, aturan HP di bawah menang */
.ph:not(:has(h1)) { display: none; }   /* Tahap A: kepala yang tinggal berisi tombol kembali/eyebrow (Profil) */
/* .ph > .ph-ic (bukan .ph-ic saja): .ic di bagian komponen datang sesudahnya dan akan menimpa ukuran. */
.ph > .ph-ic { width: 56px; height: 56px; border-radius: 18px; }
.ph-ic .ico { width: 28px; height: 28px; }
.ph h1 { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.025em; line-height: 1.12; overflow-wrap: anywhere; }
.ph .eyebrow { margin-bottom: 8px; }
.ph .sub { margin-top: 6px; color: var(--muted); max-width: 62ch; }
.ph-extra { flex: 1 1 100%; display: flex; flex-direction: column; gap: 8px; }
.ph .how { margin-top: 8px; }
@media (min-width: 720px) { .ph { padding: var(--space-7); gap: var(--space-5); } .ph > .ph-ic { width: 64px; height: 64px; border-radius: 20px; } }
@media (max-width: 559.98px) { .ph > .btn, .ph-act > .btn { flex: 1 1 100%; } }

.eyebrow { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: var(--fs-xs); font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }

/* "Cara kerja": penjelasan panjang dilipat (Tahap B), tanpa JS */
.how > summary { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; cursor: pointer; list-style: none;
  color: var(--accent-ink); font-size: var(--fs-sm); font-weight: 700; }
.how > summary::-webkit-details-marker { display: none; }
.how > summary .chev { transition: transform var(--dur) var(--ease); }
.how[open] > summary .chev { transform: rotate(180deg); }
.how > p, .how > ul { margin-top: 6px; color: var(--muted); font-size: var(--fs-sm); max-width: 62ch; }

/* Tahap A: tombol kembali di dalam halaman disembunyikan (topbar sudah punya); dihapus dari markup di Tahap B. */
.ph button.link[data-back], #allTl, .ph #back { display: none; }
.view > p:has(> #allTl:only-child) { display: none; }   /* pembungkus <p> kosong agar tidak memakan jarak */

/* ==========================================================================
   4. Komponen (6.2–6.20)
   ========================================================================== */

/* ---------- Seksi (6.2) ---------- */
section { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
h2 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: var(--fs-lg); font-weight: 800; letter-spacing: -.015em; padding: 0 2px; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 8px; border-radius: 999px;
  background: var(--surface-3); color: var(--muted); font-size: 11.5px; font-weight: 800; letter-spacing: 0; font-variant-numeric: tabular-nums; }
/* Tahap B: kepala seksi dengan aksi di kanan */
.section-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.section-h > h2 { flex: 1; min-width: 0; }
.stamp { display: flex; align-items: center; gap: 6px; color: var(--dim); font-size: var(--fs-xs); font-weight: 650; }

/* ---------- Kartu (6.3) ---------- */
.card { position: relative; min-width: 0; padding: var(--space-5); border-radius: var(--radius-lg); background: var(--surface);
  border: 1px solid var(--stroke); box-shadow: var(--shadow-sm), inset 0 1px 0 var(--highlight); }
.card > h2 { font-size: var(--fs-md); font-weight: 750; letter-spacing: -.01em; padding: 0; }
.card[role="button"], .card.click { cursor: pointer; transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.card[role="button"]:hover, .card.click:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--stroke-strong); }
.card[role="button"]:active, .card.click:active { transform: scale(.99); }

/* "Sekarang" & proyek di Hari Ini: kartu hero */
.now {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); border-color: var(--accent-glow);
  background: radial-gradient(120% 120% at 0% 0%, var(--accent-soft) 0%, transparent 55%), radial-gradient(90% 120% at 100% 100%, var(--accent-soft) 0%, transparent 60%), var(--surface);
  box-shadow: var(--shadow), inset 0 1px 0 var(--highlight);
}
.now > div { flex: 1 1 240px; min-width: 0; }
.now h3 { margin-top: 4px; font-size: var(--fs-lg); font-weight: 800; letter-spacing: -.015em; }
.now > .ic { width: 52px; height: 52px; border-radius: 16px; }
@media (max-width: 559.98px) { .now > .btn { flex: 1 1 100%; min-height: 52px; } }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-3); }

/* ---------- Kartu KPI .tiles / .tile (6.4) ---------- */
.tiles { display: grid; gap: var(--space-3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .tiles { gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } }
@media (max-width: 719.98px) {
  .tiles { grid-auto-flow: row dense; }                              /* kartu .col sesudah kartu bercincin tetap berpasangan */
  .tiles > .tile:not(.col) { grid-column: 1 / -1; }                 /* kartu bercincin selebar layar di HP */
  /* Kartu ganjil terakhir tidak sendirian. Paritas dihitung dari kartu .col saja: bila ada satu kartu bercincin
     (Hari Ini: cincin + 2 KPI), jumlah .col = n − 1, jadi yang "ganjil" adalah anak terakhir genap. */
  .tiles:not(:has(> .tile:not(.col))) > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .tiles:has(> .tile:not(.col)) > .tile.col:last-child:nth-child(even) { grid-column: 1 / -1; }
}
.tile { position: relative; overflow: hidden; display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4); }
.tile.col { flex-direction: column; align-items: stretch; gap: 6px; }
.tile::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%); pointer-events: none; }
.tile > div { min-width: 0; }
.tile .k { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); font-weight: 750; color: var(--muted); letter-spacing: .02em; line-height: 1.3; }
.tile .k .ic { width: 30px; height: 30px; border-radius: 10px; }
.tile .v { font-size: clamp(1.25rem, 1rem + 1vw, var(--fs-xl)); font-weight: 800; letter-spacing: -.02em; line-height: 1.15;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile .v small { font-size: var(--fs-xs); font-weight: 650; color: var(--muted); letter-spacing: 0; }
.tile .v small.up { color: var(--green-ink); }
.tile .m { font-size: var(--fs-xs); color: var(--dim); font-weight: 600; }
.tile .count-big { margin: 2px 0; }
/* Seluruh kartu bisa diketuk tanpa tombol bersarang (Tahap B, Menara) */
.tile-link { position: absolute; inset: 0; z-index: 1; border: 0; background: none; border-radius: inherit; cursor: pointer; }
.tile:has(.tile-link) { transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.tile:has(.tile-link):hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--stroke-strong); }
.tile-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Kotak ikon .ic (6.5) ---------- */
.ic { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 13px;
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.ic-sm { width: 32px; height: 32px; border-radius: 10px; }
.ic-lg { width: 52px; height: 52px; border-radius: 16px; }
.ic-xl { width: 68px; height: 68px; border-radius: 22px; }
.ic-solid { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent); box-shadow: 0 10px 24px -10px var(--accent-glow); }
.ic.score { font-size: var(--fs-sm); letter-spacing: -.02em; }   /* angka skor di dalam kotak (Audit) */

/* ---------- Cincin & bar kemajuan (6.6) ---------- */
.ring { flex: none; overflow: visible; }
.ring:not([width]) { width: 64px; height: 64px; }   /* ring() lama tanpa atribut ukuran; ring(…, { size }) memakai atribut width/height */
.ring circle { fill: none; stroke-width: 7; }
.ring .bg { stroke: var(--surface-3); }
.ring .fg { stroke-linecap: round; transition: stroke-dashoffset 1.1s var(--ease-out); }
.ring .fg:not([stroke]) { stroke: var(--accent); }
.ring .rs1 { stop-color: var(--accent); }
.ring .rs2 { stop-color: var(--accent-2); }
.ring text { fill: var(--text); font-family: var(--font); font-size: 15px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.bar { position: relative; height: 8px; border-radius: 999px; background: var(--surface-3); }
.bar > i { position: absolute; inset: 0 auto 0 0; overflow: hidden; border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .9s var(--ease-out); }
.bar > i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--shimmer), transparent);
  transform: translateX(-100%); animation: shimmer 2.4s ease-in-out 1s infinite; }
.bar > i.ok { background: linear-gradient(90deg, var(--green), var(--cyan)); }
.bar > b { position: absolute; top: -4px; width: 2px; height: 16px; margin-left: -1px; border-radius: 2px; background: var(--text); opacity: .55; }
@keyframes shimmer { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }

/* ---------- Pil, sel nilai, kode (6.7) ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 750; letter-spacing: .01em; line-height: 1.25; white-space: nowrap;
  background: var(--surface-3); color: var(--muted); }
.pill .ico { width: 13px; height: 13px; }
.pill.ok { background: var(--green-soft); color: var(--green-ink); }
.pill.warn { background: var(--amber-soft); color: var(--amber-ink); }
.pill.bad { background: var(--red-soft); color: var(--red-ink); }
.pill.info { background: var(--blue-soft); color: var(--blue-ink); }
.pill.acc { background: var(--accent-soft); color: var(--accent-ink); }
.pill.dot::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.acc.dot::before, .pill.ok.dot::before { animation: livePulse 2.4s ease-in-out infinite; }
@keyframes livePulse { 0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); } 50% { box-shadow: 0 0 0 5px transparent; } }
.row .st .pill, .gate .pill { white-space: normal; text-align: left; }

/* Sel nilai berwarna di tabel Menara */
.c { display: inline-flex; justify-content: center; min-width: 52px; padding: 3px 8px; border-radius: 8px; font-weight: 800; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.c.ok { background: var(--green-soft); color: var(--green-ink); }
.c.warn { background: var(--amber-soft); color: var(--amber-ink); }
.c.bad { background: var(--red-soft); color: var(--red-ink); }

/* Kode butir/SOP (Tahap B menggantikan .mono di label butir) */
.code { display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 6px; margin-right: 6px; border-radius: 7px;
  background: var(--accent-soft); color: var(--accent-ink); font-family: var(--mono); font-size: 11px; font-weight: 700; vertical-align: 1px; }

/* ---------- Tombol (6.8) ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: var(--radius-pill); border: 1px solid var(--stroke); background: var(--surface-3); color: var(--text);
  font-weight: 700; font-size: var(--fs-base); line-height: 1.1; white-space: nowrap; text-decoration: none; cursor: pointer;
  user-select: none; -webkit-user-select: none;
  transition: transform var(--dur-fast) var(--ease), background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease), color var(--dur) var(--ease), opacity var(--dur) var(--ease), filter var(--dur) var(--ease);
}
.btn:hover { background: var(--surface-2); border-color: var(--stroke-strong); text-decoration: none; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled, .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn.is-busy { pointer-events: none; opacity: .75; }
.btn .ico { width: 18px; height: 18px; }
.btn.primary { color: var(--on-accent); border-color: transparent; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 24px -10px var(--accent-glow), inset 0 1px 0 var(--inset-hi); }
.btn.primary:hover { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent;
  box-shadow: 0 14px 30px -10px var(--accent-glow), inset 0 1px 0 var(--inset-hi); filter: brightness(1.04); }
.btn.soft { color: var(--accent-ink); background: var(--accent-soft); border-color: transparent; }
.btn.soft:hover { background: var(--accent-soft); border-color: var(--accent-glow); }
.btn.ghost { color: var(--accent-ink); background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn.danger { color: var(--on-red); background: var(--red); border-color: transparent; box-shadow: 0 10px 22px -12px var(--red-glow); }
.btn.danger:hover { background: var(--red); filter: brightness(1.06); }
.btn.danger-soft { color: var(--red-ink); background: var(--red-soft); border-color: transparent; }
.btn.danger-soft:hover { background: var(--red-soft); border-color: var(--red-glow); }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: var(--fs-sm); gap: 6px; }
.btn.sm .ico { width: 16px; height: 16px; }
.btn.lg { min-height: 52px; padding: 0 24px; font-size: var(--fs-md); }
.btn.block { display: flex; width: 100%; }
.btn.icon { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; min-height: 0; padding: 0; border-radius: 50%;
  color: var(--muted); background: transparent; border-color: transparent; }
.btn.icon:hover { background: var(--surface-3); color: var(--text); }
.btn.icon:active { transform: scale(.92); }
.btn.icon .ico { width: 20px; height: 20px; }
.btn.icon.sm { width: 36px; height: 36px; }
.btn.icon.primary { color: var(--on-accent); background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
/* Area sentuh 44 px untuk kontrol kecil */
.btn.sm::after, .chip::after, .seg button::after, .wa::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%); }
.btn.icon.sm::after { left: 50%; right: auto; width: 44px; transform: translate(-50%, -50%); }
.btns { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.link { position: relative; display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none;
  color: var(--accent-ink); font-weight: 700; font-size: inherit; cursor: pointer; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Chip & saringan (6.9) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--stroke); background: var(--surface-2); color: var(--muted); font-size: var(--fs-sm); font-weight: 650;
  line-height: 1.2; white-space: nowrap; cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur-fast) var(--ease); }
.chip:hover { color: var(--text); border-color: var(--stroke-strong); }
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent-soft); border-color: var(--accent-glow); }
.chip .count { min-width: 20px; height: 18px; padding: 0 5px; margin-left: 2px; background: var(--surface-3); color: inherit; font-size: 10.5px; }
.chip[aria-pressed="true"] .count { background: var(--accent-soft); }
.chip[data-alert] .count { background: var(--red-soft); color: var(--red-ink); }
/* Di HP baris chip di luar kepala halaman digulir menyamping dengan tepi memudar, tidak menumpuk berbaris-baris. */
@media (max-width: 719.98px) {
  .view > .chips, section > .chips {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 2px var(--gutter);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 16px), transparent);
    mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 16px), transparent);
  }
  .view > .chips::-webkit-scrollbar, section > .chips::-webkit-scrollbar { display: none; }
  .view > .chips > .chip, section > .chips > .chip { flex: none; }
}

/* ---------- Segmen .seg, termasuk Ya/Tidak dan S/P/M (6.10) ---------- */
.seg { display: inline-flex; flex-wrap: nowrap; gap: 2px; padding: 4px; max-width: 100%; overflow-x: auto; scrollbar-width: none;
  border-radius: 999px; background: var(--surface-3); border: 1px solid var(--stroke); }
.seg button { position: relative; flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; min-width: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent;
  color: var(--muted); font-weight: 700; font-size: var(--fs-sm); white-space: nowrap; cursor: pointer;
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur-fast) var(--ease); }
.seg button:hover { color: var(--text); }
.seg button:active { transform: scale(.97); }
.seg button[aria-pressed="true"] { color: var(--on-accent); background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 16px -8px var(--accent-glow); }
.seg.yn button, .seg.spm button { min-width: 56px; min-height: 40px; }
/* Warna jawaban: menimpa token aksen di tombol aktif */
.seg button[aria-pressed="true"][data-v="Ya"], .seg button[aria-pressed="true"][data-v="S"] {
  --accent: var(--green); --accent-2: var(--cyan); --on-accent: var(--on-green); --accent-glow: var(--green-glow); }
.seg button[aria-pressed="true"][data-v="P"] {
  --accent: var(--amber); --accent-2: var(--amber); --on-accent: var(--on-amber); --accent-glow: var(--amber-glow); }
.seg button[aria-pressed="true"][data-v="M"], .seg.yn button[aria-pressed="true"][data-v="Tidak"] {
  --accent: var(--red); --accent-2: var(--pink); --on-accent: var(--on-red); --accent-glow: var(--red-glow); }
.seg-long { display: none; }
@media (min-width: 560px) { .seg-long { display: inline; } }
@media (max-width: 559.98px) {
  .f > .seg { display: flex; width: 100%; }
  .f > .seg button { flex: 1 1 0; min-height: 44px; }
}

/* ---------- Baris & detail (6.11) ---------- */
.rows { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius-lg); background: var(--surface);
  border: 1px solid var(--stroke); box-shadow: var(--shadow-sm), inset 0 1px 0 var(--highlight); }
.row { position: relative; display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 2px 14px; align-items: center;
  min-height: 64px; padding: 12px var(--space-4); border-top: 1px solid var(--stroke); transition: background-color var(--dur) var(--ease); }
.rows > .row:first-child, .rows > :first-child > .row { border-top: 0; }
.row[role="button"] { cursor: pointer; }
.row[role="button"]:hover { background: var(--surface-2); }
.row[role="button"]:active { background: var(--surface-3); }
.row .id { grid-row: 1 / span 2; font-size: var(--fs-xs); font-weight: 750; color: var(--dim); line-height: 1.3; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.row .ti { font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.row .meta { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: var(--fs-sm); color: var(--muted); }
.row .st { grid-column: 3; grid-row: 1 / span 2; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.row .st .m { font-size: var(--fs-xs); color: var(--dim); font-weight: 650; }
.rows > .empty, .rows .empty { padding: var(--space-6) var(--space-4); }

/* Tahap B: baris dengan kotak ikon status di kiri dan panah di kanan */
.row.has-ic { grid-template-columns: 40px minmax(0, 1fr) auto 16px; grid-template-areas: "ic id st ch" "ic ti st ch" "ic meta st ch"; row-gap: 1px; }
/* grid-area saja (tanpa grid-column/grid-row sesudahnya, yang akan membatalkan penempatan area) */
.row.has-ic > .ic { grid-area: ic; }
.row.has-ic .id { grid-area: id; font-size: 11px; letter-spacing: .02em; }
.row.has-ic .ti { grid-area: ti; }
.row.has-ic .meta { grid-area: meta; }
.row.has-ic .st { grid-area: st; }
.row > .chev { grid-area: ch; color: var(--dim); transition: transform var(--dur) var(--ease), color var(--dur) var(--ease); }
.row[role="button"]:hover > .chev { transform: translateX(2px); color: var(--muted); }

@media (max-width: 559.98px) {
  .row { grid-template-columns: 64px minmax(0, 1fr); }
  .row .id { grid-row: 1 / span 3; align-self: start; padding-top: 3px; }
  .row .st { grid-column: 2; grid-row: auto; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; text-align: left; }
  .row.has-ic { grid-template-columns: 40px minmax(0, 1fr) 16px; grid-template-areas: "ic id ch" "ic ti ch" "ic meta ch" "ic st ch"; }
  .row.has-ic .id { padding-top: 0; }
}

/* Detail yang membuka di bawah baris (TL Tahap A; Tahap B pindah ke lembar) */
.detail { display: grid; gap: var(--space-3); padding: var(--space-3) var(--space-4) var(--space-4) calc(72px + 14px + var(--space-4));
  border-top: 1px dashed var(--stroke); background: var(--surface-2); }
@media (max-width: 559.98px) { .detail { padding: var(--space-3) var(--space-4) var(--space-4); } }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--space-3) var(--space-4); margin: 0; }
.kv > div { min-width: 0; }
.kv dt { font-size: var(--fs-xs); font-weight: 750; color: var(--dim); letter-spacing: .02em; }
.kv dd { margin: 2px 0 0; font-weight: 650; overflow-wrap: anywhere; }

/* Log TL sebagai garis waktu */
.log { list-style: none; margin: 0; padding: 0 0 0 2px; display: flex; flex-direction: column; gap: var(--space-3); font-size: var(--fs-sm); }
.log li { position: relative; display: flex; flex-wrap: wrap; gap: 2px 10px; padding-left: 26px; }
.log li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.log li:not(:last-child)::after { content: ""; position: absolute; left: 8px; top: 20px; bottom: calc(var(--space-3) * -1); width: 2px; background: var(--stroke); }
.log .mono { font-family: var(--font); font-size: var(--fs-xs); color: var(--dim); font-weight: 650; min-width: 0; font-variant-numeric: tabular-nums; }
/* Tahap B: titik berikon per jenis log */
.log li.has-dot { padding-left: 38px; }
.log li.has-dot::before { display: none; }
.log-dot { position: absolute; left: 0; top: 0; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-ink); }
.log li.has-dot:not(:last-child)::after { left: 13px; top: 30px; }

/* ---------- Formulir (6.12) ---------- */
.form { display: flex; flex-direction: column; gap: var(--space-4); }
fieldset { min-width: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; padding: var(--space-5);
  border-radius: var(--radius-lg); border: 1px solid var(--stroke); background: var(--surface);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--highlight); }
/* legend di-float agar tampil di dalam kartu (bukan memotong garis tepi) */
legend { float: left; width: 100%; display: flex; align-items: center; gap: 10px; margin: 0; padding: 0 0 var(--space-3);
  border-bottom: 1px solid var(--stroke); font-size: var(--fs-md); font-weight: 800; letter-spacing: -.01em; }
legend .ic { width: 32px; height: 32px; border-radius: 10px; }
legend .lg-n { margin-left: auto; font-size: var(--fs-xs); font-weight: 750; color: var(--dim); font-variant-numeric: tabular-nums; }

.f { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; }
.f + .f { padding-top: 14px; border-top: 1px solid var(--stroke); }
.f > label, .f > .lab { font-weight: 650; line-height: 1.4; }
/* Tandai yang opsional, bukan yang wajib (sebagian besar butir wajib) */
.f .req::after { content: none; }
.f > label:not(.req)::after { content: "Opsional"; display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px;
  background: var(--surface-3); color: var(--dim); font-size: 10.5px; font-weight: 750; vertical-align: 1px; }
.f .hint { grid-column: 1 / -1; font-size: var(--fs-xs); color: var(--dim); font-weight: 550; }
.f .alert { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px;
  background: var(--amber-soft); border: 1px solid var(--amber-glow); color: var(--amber-ink); font-size: var(--fs-sm); font-weight: 700; }
.f .alert::before { content: ""; flex: none; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: var(--ic-flag) center / contain no-repeat; mask: var(--ic-flag) center / contain no-repeat; }
.f.stack { grid-template-columns: minmax(0, 1fr); }
.f > .f.stack, .f > textarea { grid-column: 1 / -1; }
.f .val { justify-self: end; text-align: right; }
.f.is-missing { border-radius: 12px; box-shadow: 0 0 0 2px var(--red-glow); animation: shakeX .32s var(--ease); }
@media (max-width: 559.98px) { .f { grid-template-columns: minmax(0, 1fr); } .f .val { justify-self: start; text-align: left; } }

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; font-size: var(--fs-sm); font-weight: 700; color: var(--text); }
.field input, .field select, .field textarea { font-weight: 500; }

:where(input:not([type]), input[type="text"], input[type="number"], input[type="tel"], input[type="email"], input[type="password"],
  input[type="date"], input[type="time"], input[type="search"], select, textarea) {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--stroke-strong);
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 16px; line-height: 1.4; appearance: none; -webkit-appearance: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea):hover { border-color: var(--accent-glow); }
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea):focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background-color: var(--surface-solid); }
:where(input, textarea)::placeholder { color: var(--dim); opacity: 1; }
:where(input, select, textarea):disabled { opacity: .6; cursor: not-allowed; }
input[type="number"] { width: 180px; text-align: right; font-weight: 750; font-variant-numeric: tabular-nums; }
.field input[type="number"] { width: 100%; text-align: left; }
@media (max-width: 559.98px) { input[type="number"] { width: 100%; text-align: left; } }
input[type="date"], input[type="time"] { min-width: 0; }
input::-webkit-date-and-time-value { text-align: left; }
textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
select { width: auto; max-width: 100%; padding-right: 42px; cursor: pointer;
  background-image: var(--chev); background-repeat: no-repeat; background-position: right 14px center; background-size: 18px; }
.field select, .form select { width: 100%; }
select option { background: var(--surface-solid); color: var(--text); }

/* Kotak centang bulat bergradien (semua checkbox, kecuali sakelar .toggle-input) */
input[type="checkbox"]:not(.toggle-input) {
  appearance: none; -webkit-appearance: none; flex: none; position: relative; display: inline-grid; place-content: center;
  width: 24px; height: 24px; margin: 0; border-radius: 50%; border: 2px solid var(--stroke-strong); background: var(--surface-2);
  cursor: pointer; vertical-align: middle; transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
input[type="checkbox"]:not(.toggle-input)::before { content: ""; width: 12px; height: 12px; background: var(--on-accent);
  clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 22%, 86% 8%, 38% 72%); transform: scale(0); transition: transform var(--dur) var(--ease-spring); }
input[type="checkbox"]:not(.toggle-input):checked { border-color: transparent; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 16px -6px var(--accent-glow); }
input[type="checkbox"]:not(.toggle-input):checked::before { transform: scale(1); }
input[type="checkbox"]:not(.toggle-input):hover:not(:disabled) { border-color: var(--accent); }
input[type="checkbox"]:disabled { opacity: .5; cursor: not-allowed; }
/* Dua aturan terpisah: browser tanpa :has() tetap menata label.inline. */
label.inline { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 650; cursor: pointer; }
.field > span:has(> input[type="checkbox"]) { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 650; cursor: pointer; }

/* Sakelar (Tahap B: profil "WhatsApp sama", irama "Wajib dari toko"/"Aktif", Tampilan "Animasi") */
.toggle { position: relative; display: flex; align-items: center; gap: 14px; min-height: 44px; cursor: pointer; }
.toggle-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.toggle-track { position: relative; flex: none; width: 48px; height: 28px; border-radius: 999px; background: var(--surface-3);
  border: 1px solid var(--stroke-strong); transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.toggle-thumb { position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--knob);
  box-shadow: var(--knob-shadow); transition: transform var(--dur) var(--ease-spring); }
.toggle-input:checked + .toggle-track { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }
.toggle-input:checked + .toggle-track .toggle-thumb { transform: translateX(20px); }
.toggle-input:focus-visible + .toggle-track { outline: 2px solid var(--accent); outline-offset: 3px; }
.toggle-input:disabled + .toggle-track { opacity: .5; }
.toggle-label { font-weight: 650; }
.toggle-sub { display: block; font-size: var(--fs-sm); color: var(--muted); font-weight: 500; }

/* Pilih cabang dengan ikon (Tahap B: Hari Ini, Rutinitas) */
.br-sel { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.br-sel select { min-height: 44px; padding-top: 8px; padding-bottom: 8px; font-size: var(--fs-base); font-weight: 650; }

/* ---------- Foto bukti (6.13) ---------- */
.photo-btn { position: relative; overflow: hidden; }
.photo-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.photo-btn.is-busy .ico { animation: spin .9s linear infinite; }
.shot { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.shot figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--muted); max-width: 36ch; }
.thumb { display: block; width: 96px; height: 72px; object-fit: cover; border-radius: 14px; border: 1px solid var(--stroke);
  background: var(--surface-2); cursor: zoom-in; }
.fq-ev { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; }
@media (max-width: 559.98px) { .fq-ev { grid-template-columns: minmax(0, 1fr); } }
.ans { font-weight: 700; }
.ans.ok { color: var(--green-ink); } .ans.warn { color: var(--amber-ink); } .ans.bad { color: var(--red-ink); }

/* ---------- Bar kemajuan & kirim (6.14) ---------- */
/* Tahap A: .runbar lama tetap di atas (lengket di bawah topbar), berkaca. */
.runbar { position: sticky; top: calc(var(--topbar-h) + var(--safe-top) + 8px); z-index: 5; display: flex; flex-wrap: wrap; align-items: center;
  gap: 8px var(--space-4); padding: 10px var(--space-4); border-color: var(--stroke-strong); box-shadow: var(--shadow);
  background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); }
.runbar .bar { flex: 1 1 120px; }
.runbar span { font-size: var(--fs-sm); font-weight: 750; font-variant-numeric: tabular-nums; }
.submit-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
#runMsg, #msg { color: var(--red-ink); font-weight: 700; font-size: var(--fs-sm); }

/* Tahap B: satu bar kirim di bawah (anak terakhir <form>), juga Profil (.when-dirty). */
.savebar { position: sticky; bottom: calc(var(--bottomnav-h) + var(--safe-bottom) + 12px); z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 8px 8px 16px; border-radius: var(--radius-lg);
  background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--stroke-strong); box-shadow: var(--shadow-lg); }
html.focus-mode .savebar { bottom: calc(var(--safe-bottom) + 12px); }
@media (min-width: 1024px) { .savebar { bottom: 16px; } }
.savebar-info { flex: 1 1 0; min-width: 96px; display: flex; flex-direction: column; gap: 6px; }
.savebar-prog { font-size: var(--fs-sm); font-weight: 750; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.savebar-msg { flex: 1 0 100%; order: 3; padding: 0 2px 2px 0; font-size: var(--fs-xs); font-weight: 700; color: var(--red-ink); line-height: 1.4; }
.savebar-msg:empty { display: none; }
.savebar.is-ready .savebar-prog { color: var(--green-ink); }
.savebar.is-ready .btn.primary { animation: readyGlow 2.4s ease-in-out infinite; }
.form:not(.is-dirty) > .savebar.when-dirty { display: none; }
@keyframes readyGlow {
  0%, 100% { box-shadow: 0 10px 24px -10px var(--accent-glow), inset 0 1px 0 var(--inset-hi); }
  50% { box-shadow: 0 12px 32px -6px var(--accent-glow), inset 0 1px 0 var(--inset-hi); }
}

/* ---------- Riwayat 7 hari & legenda (6.15) ---------- */
.hist-wrap { overflow-x: auto; }
.hist { display: grid; grid-template-columns: minmax(120px, 1.2fr) repeat(7, minmax(32px, 1fr)); gap: 6px; align-items: center; min-width: 440px; font-size: var(--fs-sm); }
.hist > span:not(.sq):not(.h) { font-weight: 650; line-height: 1.3; }
.hist .h { font-size: 10.5px; font-weight: 750; color: var(--dim); text-align: center; text-transform: uppercase; letter-spacing: .04em; line-height: 1.25; }
.sq { display: grid; place-items: center; height: 32px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--stroke);
  font-size: 12px; font-weight: 800; color: var(--dim); }
.sq .ico { width: 14px; height: 14px; }
.sq.ok { background: var(--green-soft); border-color: transparent; color: var(--green-ink); }
.sq.late { background: var(--amber-soft); border-color: transparent; color: var(--amber-ink); }
.sq.miss { background: var(--red-soft); border-color: transparent; color: var(--red-ink); }
.sq.now { border: 2px dashed var(--accent); }
.sq[role="button"] { cursor: pointer; transition: transform var(--dur-fast) var(--ease); }
.sq[role="button"]:hover { transform: scale(1.06); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--fs-xs); color: var(--muted); font-weight: 650; }
.hist + .legend, .card > .legend { margin-top: var(--space-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i, .legend .sq { display: inline-block; width: 12px; height: 12px; border-radius: 4px; border: 0; }

/* ---------- Kosong, memuat, galat (6.16) ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: var(--space-7) var(--space-5); color: var(--text); }
.card.empty { color: var(--muted); }           /* markup lama: teks saja */
.empty-art { position: relative; margin-bottom: 10px; }
.empty-art::before { content: ""; position: absolute; inset: -16px; border-radius: 50%; background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%); }
.empty-art .ic { position: relative; animation: floaty 4s ease-in-out infinite; }
.empty-title { font-size: var(--fs-md); font-weight: 750; }
.empty-text { color: var(--muted); font-size: var(--fs-sm); max-width: 38ch; }
.empty .btn { margin-top: 12px; }
.card > .empty { padding: var(--space-6) 0; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.error-card { text-align: center; }
.error-card + .btns { justify-content: center; }

.skel-page { display: flex; flex-direction: column; gap: var(--space-4); }
.skel-grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .skel-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.skel { position: relative; overflow: hidden; border-radius: var(--radius-lg); background: var(--surface-2); border: 1px solid var(--stroke); }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, var(--highlight), transparent);
  animation: skelShimmer 1.4s ease-in-out infinite; }
.skel-hero { height: 150px; border-radius: var(--radius-xl); }
.skel-kpi { height: 104px; }
.skel-line { height: 64px; border-radius: var(--radius); }
@keyframes skelShimmer { 100% { transform: translateX(100%); } }
.loading { padding: 40px 0; text-align: center; color: var(--muted); }
.spin { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--stroke-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -4px; }

/* ---------- Tabel (6.17) ---------- */
.scroll { position: relative; overflow: auto; border-radius: var(--radius-lg); border: 1px solid var(--stroke); box-shadow: var(--shadow-sm);
  background: linear-gradient(270deg, var(--surface-solid) 40%, transparent) right center / 36px 100% no-repeat local,
              radial-gradient(farthest-side at 100% 50%, var(--stroke-strong), transparent) right center / 16px 100% no-repeat scroll,
              var(--surface-solid);
  -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
@media (min-width: 720px) { .scroll { max-height: max(420px, calc(100dvh - 160px)); } }
table.data, table.plain, table.week { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
table.data { min-width: 860px; font-size: var(--fs-sm); }
table.plain { min-width: 620px; font-size: var(--fs-sm); }
:is(table.data, table.plain, table.week) th { position: sticky; top: 0; z-index: 2; padding: 10px 12px; text-align: left; white-space: nowrap;
  background: var(--surface-raised); border-bottom: 1px solid var(--stroke); font-size: var(--fs-xs); font-weight: 800; color: var(--muted); letter-spacing: .02em; }
:is(table.data, table.plain) td { padding: 10px 12px; border-bottom: 1px solid var(--stroke); vertical-align: middle; }
table.data td { white-space: nowrap; }
:is(table.data, table.plain) tbody tr:last-child > td { border-bottom: 0; }
table.data td.r, table.data th.r { text-align: right; }
table.data th:first-child, table.data td:first-child { position: sticky; left: 0; z-index: 1; min-width: 200px; white-space: normal;
  background: var(--surface-solid); box-shadow: 1px 0 0 var(--stroke); }
table.data thead th:first-child { z-index: 3; background: var(--surface-raised); }
table.data tbody tr[role="button"] { cursor: pointer; }
table.data tbody tr[role="button"]:hover > td { background-color: var(--surface-3); }
table.data tbody tr[role="button"]:hover > td:first-child { background: linear-gradient(var(--surface-3), var(--surface-3)), var(--surface-solid); }
table.data td .m, table.plain td .m { font-size: var(--fs-xs); }

/* Tahap B: tabel menjadi kartu di HP (setiap td diberi data-label) */
@media (max-width: 719.98px) {
  .scroll.cards { overflow: visible; max-height: none; background: var(--surface); }
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; min-width: 0; width: 100%; }
  table.cards thead { display: none; }
  table.cards tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 14px var(--space-4); border-top: 1px solid var(--stroke); }
  table.cards tbody tr:first-child { border-top: 0; }
  table.cards td { padding: 0 !important; border: 0 !important; white-space: normal; text-align: left !important; position: static !important;
    box-shadow: none !important; background: none !important; min-width: 0 !important; }
  table.cards td:first-child, table.cards td.wide { grid-column: 1 / -1; }
  table.cards td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 10px; font-weight: 750;
    color: var(--dim); text-transform: uppercase; letter-spacing: .04em; }
}

/* Kalender minggu (irama, ≥720 px) */
table.week { min-width: 860px; font-size: var(--fs-sm); }
table.week td { vertical-align: top; padding: 8px; border-bottom: 1px solid var(--stroke); border-left: 1px solid var(--stroke); }
table.week td:first-child { position: sticky; left: 0; z-index: 1; border-left: 0; font-weight: 750; white-space: nowrap; background: var(--surface-solid); }
.ev { display: block; margin-bottom: 6px; padding: 6px 8px; border-radius: 10px; border-left: 3px solid var(--slate); background: var(--surface-2);
  font-weight: 650; font-size: var(--fs-xs); line-height: 1.35; }
.ev small { display: block; margin-top: 1px; font-size: 11px; font-weight: 600; color: var(--muted); }
.ev.mgr { background: var(--cyan-soft); border-left-color: var(--cyan); }
.ev.ptr { background: var(--blue-soft); border-left-color: var(--blue); }
.ev.gm { background: var(--green-soft); border-left-color: var(--green); }

/* ---------- Proyek & Irama (6.18) ---------- */
.count-big { font-size: var(--fs-4xl); font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.gates { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.gate { position: relative; display: flex; flex-direction: column; gap: 6px; padding: var(--space-4); border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--stroke); box-shadow: var(--shadow-sm), inset 0 1px 0 var(--highlight); font-size: var(--fs-sm); }
.gate b { font-size: var(--fs-sm); font-weight: 800; }
.gate .pill, .gate .btns { align-self: flex-start; }
/* Kelas (Tahap B) dan :has() (Tahap A) dipisah: browser tanpa :has() tetap membaca kelasnya. */
.gate.is-pass { border-color: var(--green-glow); background: radial-gradient(120% 120% at 0% 0%, var(--green-soft) 0%, transparent 60%), var(--surface); }
.gate:has(> .pill.ok) { border-color: var(--green-glow); background: radial-gradient(120% 120% at 0% 0%, var(--green-soft) 0%, transparent 60%), var(--surface); }
.gate.is-next { border-color: var(--amber-glow); box-shadow: 0 0 0 3px var(--amber-soft), var(--shadow-sm); }
.gate:has(> .pill.warn) { border-color: var(--amber-glow); box-shadow: 0 0 0 3px var(--amber-soft), var(--shadow-sm); }
.gate.is-held { border-color: var(--red-glow); background: radial-gradient(120% 120% at 0% 0%, var(--red-soft) 0%, transparent 60%), var(--surface); }
.gate:has(> .pill.bad) { border-color: var(--red-glow); background: radial-gradient(120% 120% at 0% 0%, var(--red-soft) 0%, transparent 60%), var(--surface); }

.phase { border-top: 1px solid var(--stroke); }
.phase:first-child { border-top: 0; }
.phase > button { all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: 32px minmax(0, 1fr) 150px auto;
  gap: 12px; align-items: center; min-height: 64px; padding: 12px var(--space-4); cursor: pointer; transition: background-color var(--dur) var(--ease); }
.phase > button:hover { background: var(--surface-2); }
.phase > button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.phase .no { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft);
  color: var(--accent-ink); font-family: var(--font); font-weight: 800; font-size: var(--fs-sm); }
.phase > button[aria-expanded="true"] .no { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent); }
.phase .chev { color: var(--dim); transition: transform var(--dur) var(--ease); }
.phase > button[aria-expanded="true"] .chev { transform: rotate(180deg); }
.phase .nm { min-width: 0; }
.phase .nm b { display: block; font-weight: 700; }
.phase .nm span { font-size: var(--fs-xs); color: var(--dim); font-weight: 600; }
@media (max-width: 559.98px) { .phase > button { grid-template-columns: 32px minmax(0, 1fr) auto; } .phase > button .bar { grid-column: 2 / -1; grid-row: 2; } }
.tasks { list-style: none; margin: 0; padding: 4px var(--space-4) var(--space-3) calc(var(--space-4) + 44px); display: flex; flex-direction: column;
  background: var(--surface-2); border-top: 1px dashed var(--stroke); }
@media (max-width: 559.98px) { .tasks { padding-left: var(--space-4); } }
.tasks li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 52px; padding: 8px 0;
  border-top: 1px solid var(--stroke); font-size: var(--fs-sm); }
.tasks li:first-child { border-top: 0; }
.tasks input[type="checkbox"] { width: 28px; height: 28px; }
.tasks input[type="checkbox"]:checked { background: linear-gradient(135deg, var(--green), var(--cyan)); box-shadow: 0 6px 16px -6px var(--green-glow); }
.tasks label { font-weight: 600; line-height: 1.4; cursor: pointer; }
.tasks .done { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--muted); }
.tasks .gate-row { grid-template-columns: minmax(0, 1fr); display: flex; align-items: center; gap: 8px; font-weight: 750; color: var(--amber-ink); }

.cols { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.cols ul { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: var(--fs-sm); }
.cols li { position: relative; padding-left: 18px; line-height: 1.45; }
.cols li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.sched { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; min-height: 64px; padding: 12px var(--space-4); border-top: 1px solid var(--stroke); }
.rows > .sched:first-child { border-top: 0; }
.sched b { font-weight: 700; }
.sched .edit { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; padding: 12px; margin-top: 4px;
  border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--stroke); }
.sched .edit .field { flex: 1 1 140px; }

/* Tahap B: agenda irama di HP (pengganti tabel minggu) */
.dstrip { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.dchip { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 48px; min-height: 58px; padding: 0;
  border-radius: 14px; border: 1px solid var(--stroke); background: var(--surface-2); color: var(--muted); cursor: pointer; }
.dchip-wd { font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.dchip-dn { font-size: var(--fs-md); font-weight: 800; color: var(--text); }
.dchip.is-today { border-color: var(--accent-glow); }
.dchip[aria-pressed="true"] { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: var(--on-accent);
  box-shadow: 0 8px 18px -10px var(--accent-glow); }
.dchip[aria-pressed="true"] .dchip-dn { color: var(--on-accent); }

/* ---------- Menara: matriks, masalah sistem, banner (6.19) ---------- */
.matrix svg { display: block; width: 100%; height: auto; }
.matrix text { font-family: var(--font); fill: var(--text); font-size: 12px; font-weight: 650; }
.matrix .ax { fill: var(--dim); font-size: 10.5px; font-weight: 650; }
.matrix .ql { fill: var(--muted); font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.matrix .grid { stroke: var(--stroke); stroke-width: 1; stroke-dasharray: 3 4; }
.matrix .thr { stroke: var(--amber); stroke-width: 1.5; stroke-dasharray: 5 4; }
.matrix .halo { fill: var(--surface-solid); }
.matrix .dot-ok { fill: var(--green); } .matrix .dot-warn { fill: var(--amber); } .matrix .dot-bad { fill: var(--red); } .matrix .dot-info { fill: var(--blue); }
.matrix .q-ok { fill: var(--green-soft); } .matrix .q-info { fill: var(--blue-soft); } .matrix .q-warn { fill: var(--amber-soft); } .matrix .q-bad { fill: var(--red-soft); }
.matrix circle[data-go-to] { cursor: pointer; }
.matrix > .m, .matrix > .legend { margin-top: var(--space-3); }

.sys { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-4); overflow: hidden;
  padding-left: calc(var(--space-5) + 4px); border-color: var(--amber-glow); background: linear-gradient(135deg, var(--amber-soft), transparent 60%), var(--surface); }
.sys::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--amber); }
.sys .eyebrow { color: var(--amber-ink) !important; }
.sys > div { flex: 1 1 260px; min-width: 0; }

/* .banner: blok + ikon absolut (bukan flex), agar tautan/tombol .link di tengah kalimat tetap mengalir sebaris dengan teksnya. */
.banner { position: relative; display: block; padding: 12px var(--space-4) 12px calc(var(--space-4) + 18px + 10px); border-radius: var(--radius);
  border: 1px solid var(--accent-glow); background: var(--accent-soft); color: var(--text); font-size: var(--fs-sm); font-weight: 600; line-height: 1.45; }
.banner::before { content: ""; position: absolute; left: var(--space-4); top: 13px; width: 18px; height: 18px; background: var(--accent-ink);
  -webkit-mask: var(--ic-info) center / contain no-repeat; mask: var(--ic-info) center / contain no-repeat; }
.banner.warn { background: var(--amber-soft); border-color: var(--amber-glow); }
.banner.warn::before { background: var(--amber-ink); -webkit-mask-image: var(--ic-warn); mask-image: var(--ic-warn); }
.banner.bad { background: var(--red-soft); border-color: var(--red-glow); }
.banner.bad::before { background: var(--red-ink); -webkit-mask-image: var(--ic-bad); mask-image: var(--ic-bad); }
.banner.info { background: var(--blue-soft); border-color: var(--blue-glow); }
.banner.info::before { background: var(--blue-ink); }
.banner.ok { background: var(--green-soft); border-color: var(--green-glow); }
.banner.ok::before { background: var(--green-ink); -webkit-mask-image: var(--ic-ok); mask-image: var(--ic-ok); }
.banner .link { font-size: inherit; }

/* ---------- Orang: avatar, nama, WhatsApp, profil (6.20) ---------- */
.avatar { flex: none; display: inline-grid; place-items: center; overflow: hidden; border-radius: 50%; vertical-align: middle;
  color: var(--on-accent); font-weight: 800; letter-spacing: .01em; line-height: 1; user-select: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)) center / cover no-repeat;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--accent-glow); }
.person { display: inline-flex; align-items: center; gap: 6px; margin-right: 10px; font-weight: 600; }
.wa { position: relative; display: inline-flex; align-items: center; gap: 4px; min-height: 26px; padding: 0 10px; border-radius: 999px;
  border: 1px solid transparent; background: var(--green-soft); color: var(--green-ink); font-size: 11.5px; font-weight: 750; text-decoration: none; }
.wa:hover { border-color: var(--green-glow); text-decoration: none; }

.profile-head { position: relative; overflow: hidden; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-5);
  padding: var(--space-5); border-radius: var(--radius-xl); border: 1px solid var(--stroke);
  background: radial-gradient(110% 140px at 0% 0%, var(--accent-soft), transparent 72%), var(--surface);
  box-shadow: var(--shadow), inset 0 1px 0 var(--highlight); }
.profile-head > div { flex: 1 1 220px; min-width: 0; }
.profile-head h1 { font-size: var(--fs-xl) !important; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; }
.profile-head .avatar { box-shadow: 0 0 0 3px var(--surface-solid), 0 0 0 5px var(--accent-glow), 0 16px 32px -14px var(--accent-glow); }
.pf-av { position: relative; display: inline-flex; }
.pf-cam { position: absolute; right: -4px; bottom: -2px; width: 36px; height: 36px; border: 3px solid var(--surface-solid); overflow: hidden; }
.pf-cam input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ==========================================================================
   5. Lembar (5.8) & toast (5.9)
   ========================================================================== */
html.sheet-open { overflow: hidden; }
.sheet-layer { position: fixed; inset: 0; z-index: var(--z-sheet); display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: var(--backdrop); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity var(--dur-slow) var(--ease); }
.sheet {
  position: relative; display: flex; flex-direction: column; width: 100%; max-height: calc(100dvh - var(--safe-top) - 24px);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0; background: var(--surface-solid); color: var(--text);
  border: 1px solid var(--stroke); border-bottom: 0; box-shadow: var(--shadow-lg);
  transform: translateY(100%); transition: transform .34s var(--ease-out); outline: none; overflow: hidden;
}
.sheet::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 120px; pointer-events: none;
  background: radial-gradient(80% 120px at 20% 0%, var(--accent-soft), transparent 70%); }
.sheet-layer.is-open .sheet-backdrop { opacity: 1; }
.sheet-layer.is-open .sheet { transform: none; }
.sheet-layer.is-closing .sheet { transform: translateY(100%); transition-duration: .24s; transition-timing-function: var(--ease); }
.sheet.is-dragging { transition: none; }
.sheet-handle { position: relative; display: flex; justify-content: center; padding: 10px 0 2px; touch-action: none; cursor: grab; }
.sheet-handle::before { content: ""; width: 42px; height: 5px; border-radius: 999px; background: var(--stroke-strong); }
.sheet-head { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px var(--space-5) 12px; touch-action: none; }
.sheet-head .ic { width: 40px; height: 40px; }
.sheet-head-text { flex: 1; min-width: 0; }
.sheet-title { font-size: var(--fs-lg); font-weight: 800; letter-spacing: -.015em; line-height: 1.25; }
.sheet-sub { margin-top: 2px; font-size: var(--fs-sm); color: var(--muted); }
.sheet-close { margin-right: -8px; }
.sheet-body { position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 4px var(--space-5) calc(var(--space-5) + var(--safe-bottom)); }
/* Kaki lengket: margin negatif menutup padding bawah .sheet-body. Posisi sticky dihitung dari tepi dalam padding area
   gulir, jadi offset bawahnya harus sama dengan margin negatif itu; dengan bottom: 0 kaki naik dan menutup teks terakhir. */
.sheet-body > .form > .btns:last-child, .sheet-actions {
  position: sticky; bottom: calc((var(--space-5) + var(--safe-bottom)) * -1); z-index: 2; flex-direction: row-reverse;
  margin: 4px calc(var(--space-5) * -1) calc((var(--space-5) + var(--safe-bottom)) * -1);
  padding: 12px var(--space-5) calc(14px + var(--safe-bottom)); background: var(--surface-solid); border-top: 1px solid var(--stroke);
}
.sheet-body > .form > .btns:last-child .btn, .sheet-actions .btn { flex: 1 1 0; min-width: 120px; }
.sheet-actions .btn.icon { flex: none; min-width: 0; }
.sheet-ver { margin-top: var(--space-4); text-align: center; font-size: var(--fs-xs); color: var(--dim); font-weight: 650; }
@media (min-width: 720px) {
  .sheet-layer { align-items: center; padding: 24px; }
  .sheet { width: min(560px, 100%); max-height: min(86vh, 860px); border-radius: var(--radius-xl); border-bottom: 1px solid var(--stroke);
    transform: translateY(16px) scale(.97); opacity: 0; transition: transform .3s var(--ease-out), opacity .22s ease; }
  .sheet-layer.is-open .sheet { transform: none; opacity: 1; }
  .sheet-layer.is-closing .sheet { transform: translateY(10px) scale(.98); opacity: 0; }
  .sheet-handle { display: none; }
  .sheet-head { padding-top: var(--space-5); }
  .sheet-body > .form > .btns:last-child, .sheet-actions { justify-content: flex-start; padding-bottom: 16px; }
  .sheet-body > .form > .btns:last-child .btn, .sheet-actions .btn { flex: 0 0 auto; }
  .sheet-sm { width: min(420px, 100%); }
  .sheet-lg { width: min(780px, 100%); }
  .sheet-full { width: min(1000px, 100%); height: min(92vh, 980px); }
}

/* Daftar aksi & kisi aksi cepat (Lainnya, Catat cepat, menu ⋮) */
.action-list { display: flex; flex-direction: column; gap: 4px; margin-top: var(--space-4); }
.action-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 10px; border: 0; border-radius: 14px;
  background: none; color: var(--text); font-weight: 650; text-align: left; cursor: pointer; text-decoration: none;
  transition: background-color var(--dur) var(--ease); }
.action-item:hover { background: var(--surface-2); text-decoration: none; }
.action-item:active { background: var(--surface-3); }
.action-item.is-danger { color: var(--red-ink); }
.action-item:disabled { opacity: .5; cursor: not-allowed; }
.action-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.action-item-sub { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; }
.action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; min-height: 52px; padding: 8px 10px; }
.qa-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .qa-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.qa-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px; min-height: 104px; padding: 14px;
  border-radius: 18px; border: 1px solid var(--stroke); background: var(--surface-2); color: var(--text);
  font-weight: 700; font-size: var(--fs-sm); line-height: 1.3; text-align: left; text-decoration: none; cursor: pointer;
  transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  animation: qaIn .36s var(--ease-out) both;
}
.qa-item:hover { transform: translateY(-2px); border-color: var(--accent-glow); background: var(--accent-soft); box-shadow: var(--shadow); text-decoration: none; }
.qa-item:active { transform: scale(.97); }
.qa-item[aria-current="page"] { border-color: var(--accent-glow); }
.qa-item:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.qa-sub { display: block; margin-top: 2px; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
@keyframes qaIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Toast (5.9) ---------- */
.toasts {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: var(--z-toast);
  bottom: calc(var(--bottomnav-h) + var(--safe-bottom) + 14px); width: min(460px, calc(100vw - 24px));
  display: flex; flex-direction: column-reverse; gap: 8px; pointer-events: none;
}
@media (min-width: 1024px) { .toasts { bottom: 104px; left: calc(50% + var(--sidebar-w) / 2); } }
html.sheet-open .toasts { top: calc(var(--safe-top) + 12px); bottom: auto; flex-direction: column; }
html.focus-mode .toasts { bottom: calc(var(--safe-bottom) + 104px); }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-radius: 18px;
  background: var(--surface-raised); color: var(--text); border: 1px solid var(--stroke-strong); box-shadow: var(--shadow-lg);
  font-size: var(--fs-sm); font-weight: 600; line-height: 1.4;
  opacity: 0; transform: translateY(14px) scale(.97); transition: opacity var(--dur) var(--ease), transform var(--dur-slow) var(--ease-spring);
}
.toast.show { opacity: 1; transform: none; }
.toast.hide { opacity: 0; transform: translateY(8px) scale(.97); transition-duration: .2s; }
.toast-icon { width: 32px; height: 32px; border-radius: 10px; }
.toast-msg { flex: 1; min-width: 0; padding: 4px 0; }
.toast .btn.icon.toast-close { width: 32px; height: 32px; }   /* mengalahkan .btn.icon.sm (36) */

/* ==========================================================================
   6. Masuk, ganti PIN, splash (5.10)
   ========================================================================== */
.login {
  position: relative; min-height: 100dvh; display: grid; place-items: center;
  padding: calc(var(--safe-top) + 24px) calc(var(--gutter) + var(--safe-right)) calc(var(--safe-bottom) + 24px) calc(var(--gutter) + var(--safe-left));
}
.login .card {
  position: relative; overflow: hidden; isolation: isolate; width: min(420px, 100%); display: flex; flex-direction: column; gap: var(--space-4);
  padding: var(--space-7) var(--space-6); border-radius: var(--radius-xl);
  -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--highlight); animation: authIn .5s var(--ease-out) both;
}
.login .card::before { content: ""; position: absolute; z-index: -1; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--violet), transparent); }
.login .card::after { content: ""; position: absolute; z-index: -1; right: -90px; top: -110px; width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 68%); opacity: .45; }
.login .els-logo { --els-h: 40px; align-self: flex-start; margin-bottom: 4px; }
.login h1 { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.025em; }
.login label { display: flex; flex-direction: column; gap: 7px; font-size: var(--fs-sm); font-weight: 700; }
.login input { min-height: 56px; font-size: 17px; }
.login .btn.primary { min-height: 56px; font-size: var(--fs-md); }
.login .m { line-height: 1.5; }
.login .eyebrow + h1 { margin-top: 4px; }
.login h1 + .m { margin-top: 8px; }
@media (max-width: 379.98px) { .login .card { padding: var(--space-6) var(--space-4); border-radius: var(--radius-lg); } }
@keyframes authIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }

/* Tahap B: markup masuk baru (kartu masuk Sales Kit) */
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand .els-logo { --els-h: 30px; margin: 0; }
.input-wrap { display: flex; align-items: center; gap: 2px; width: 100%; min-height: 48px; padding: 0 4px 0 14px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--stroke-strong); transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--surface-solid); }
.input-wrap > input { flex: 1; min-width: 0; min-height: 46px; padding-left: 8px; border: 0 !important; background: transparent !important; box-shadow: none !important; }
.login .input-wrap { min-height: 56px; }
.login .input-wrap > input { min-height: 54px; }
.input-wrap .btn.icon[aria-pressed="true"] { color: var(--accent-ink); }
.input-icon { color: var(--dim); }
.input-prefix { color: var(--muted); font-weight: 750; font-size: var(--fs-sm); }
.auth-alert { display: flex; gap: 8px; padding: 10px 12px; border-radius: 14px; background: var(--red-soft); border: 1px solid var(--red-glow);
  color: var(--red-ink); font-size: var(--fs-sm); font-weight: 700; animation: authAlert .25s var(--ease-out); }
.auth-card.is-shake { animation: shakeX .32s var(--ease); }
.auth-spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
.auth-help { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: var(--fs-sm); }
.auth-foot { margin-top: var(--space-4); text-align: center; color: var(--dim); font-size: var(--fs-xs); font-weight: 650; }
/* Buat PIN baru: aturan yang tercentang saat mengetik (ul.auth-rules > li.auth-rule.is-ok, ikon circle-dot → circle-check) */
.auth-rules { list-style: none; margin: 0; display: grid; gap: 6px; padding: 12px 14px; border-radius: 16px;
  background: var(--surface-2); border: 1px solid var(--stroke); font-size: var(--fs-sm); color: var(--muted); }
.auth-rule { display: flex; align-items: center; gap: 8px; font-weight: 650; transition: color var(--dur) var(--ease); }
.auth-rule .ico { color: var(--dim); transition: color var(--dur) var(--ease); }
.auth-rule.is-ok { color: var(--text); }
.auth-rule.is-ok .ico { color: var(--green); }
@keyframes authAlert { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes shakeX { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* ==========================================================================
   7. Keyboard, mode fokus, kurangi gerak, fallback kaca, cetak (5.11)
   ========================================================================== */
/* Keyboard di HP: app.js memasang html.kb-open saat input/textarea/select fokus di perangkat (pointer: coarse). */
html.kb-open .bottomnav, html.kb-open .fab { display: none; }
html.kb-open .toasts { bottom: calc(var(--kb-inset, 0px) + 12px); }
/* Bar kirim/simpan tepat di atas keyboard. iOS: --kb-inset > 0 (bar terikat ke viewport tata letak di balik keyboard).
   Android: --kb-inset tetap 0, jadi tetap safe-bottom + 12px seperti mode fokus. Berlaku juga untuk Isi Tugas & Profil. */
html.kb-open .savebar { bottom: calc(max(var(--kb-inset, 0px), var(--safe-bottom)) + 12px); }
.sheet-layer { bottom: var(--kb-inset, 0px); }
@supports (bottom: max(0px, env(keyboard-inset-height, 0px))) {
  .sheet-layer { bottom: max(var(--kb-inset, 0px), env(keyboard-inset-height, 0px)); }
}
html.kb-open .sheet { max-height: calc(100% - var(--safe-top) - 12px); }

/* Mode fokus (Isi Tugas): tanpa bar bawah; bar kirim di zona jempol. */
html.focus-mode .bottomnav, html.focus-mode .fab { display: none; }
html.focus-mode .view { padding-bottom: calc(var(--safe-bottom) + 32px); }

/* Kurangi gerak: pilihan OS atau sakelar "Animasi" (html.reduce-motion, dipasang boot-theme.js sebelum cat). */
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after {
  animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important;
  transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important;
}
.reduce-motion .aurora i { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important;
    transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important;
  }
  .aurora i { animation: none !important; }
}

/* Browser tanpa backdrop-filter: bingkai jadi pekat agar teks tetap terbaca. */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .is-scrolled .topbar, .topbar.is-solid, .sidebar, .bottomnav, .savebar, .runbar { background: var(--surface-solid); }
}

/* Cetak: hasil audit / Menara bisa disimpan sebagai PDF. */
@media print {
  .sidebar, .bottomnav, .fab, .topbar, .aurora, .toasts, .skip-link, .savebar, .btn { display: none !important; }
  .main-col { margin: 0 !important; }
  .view { padding: 0 !important; max-width: none; }
  body { background: #fff; color: #000; }
  .card, .rows, .ph, fieldset, .scroll { box-shadow: none !important; background: #fff !important; border-color: #ccc !important; break-inside: avoid; }
}
@media (forced-colors: active) { .btn.primary, .seg button[aria-pressed="true"], .chip[aria-pressed="true"] { border: 1px solid ButtonText; } }
