/* Etalase — stylesheet aplikasi.
   Sumber: docs/reference/preview.html + design system admin Chameleon Cloth (design.md, admin.css).
   Tema putih saja: tidak ada dark mode. Radius ≤ 6px, tanpa bayangan dekoratif.

   Isi:
   1. Token
   2. Dasar
   3. Layout (shell, sidebar, topbar, konten)
   4. Komponen (tombol, input, range, notice, alert, menu pengguna)
   5. Ringkasan & panel
   6. Tabel & daftar muat otomatis
   7. Drawer & dialog
   8. Form
   9. Badge
   10. Toast
   11. Gambar: thumb, galeri, pratinjau postingan, lightbox
   12. Halaman masuk (login / undangan)
   13. Utilitas
   14. Responsif */

/* ============ 1. Token ============ */
:root {
  --bg: #f3f3f4; --canvas: #fafafa; --surface: #ffffff; --surface-subtle: #f7f7f8;
  --text: #18181b; --muted: #61616a; --muted-strong: #3f3f46; --placeholder: #9ca3af;
  --line: #ebebee; --line-strong: #dcdce1;
  --primary: #c2410c; --primary-hover: #9a3412; --accent: #c2410c; --accent-bg: #fff4ed; --accent-text: #9a3412; --on-primary: #ffffff;
  --blue: #2563eb;
  --success: #16803b; --success-bg: #ecfdf3;
  --warning: #9a6700; --warning-bg: #fff8c5; --warning-mark: #e08700;
  --danger: #cf222e; --danger-bg: #fff1f2;
  --info-bg: #eef5ff; --accent-soft: #fff7f2; --focus-ring: rgba(37, 99, 235, .12);
  --sidebar-bg: var(--bg); --topbar-bg: transparent; --nav-label: #71717a; --count-bg: #e6e6ea;
  --row-hover: rgba(0, 0, 0, .045); --row-hover-faint: rgba(0, 0, 0, .03); --hover-soft: #ececef;
  --selected-soft: #e8e8eb; --checked-line: #73777f; --checked-bg: #f5f6f7; --track-bg: #eceef1;
  --backdrop: rgba(17, 24, 39, .36); --overlay-strong: rgba(24, 24, 27, .88);
  --bar: #d3d6db; --bar-strong: #c2410c; --skeleton: #eceef1;
  --icon-invert: 0;
  --radius: 10px; --radius-sm: 8px; --radius-lg: 14px; --sidebar: 244px; --topbar: 64px;
  --brand: #f97316; --shadow-card: 0 1px 2px rgba(24, 24, 27, .04);
  /* Skala huruf (design.md, ringkas): halaman 16 > seksi/panel 14 > isi 13 > sekunder/tabel 12 > keterangan 11 > label kapital 10.
     Ketebalan: 600 untuk judul, label, dan angka penting; 500 untuk nama/menu; 400 untuk teks pendukung. */
  --fs-micro: 11px; --fs-caption: 12px; --fs-small: 13px; --fs-body: 14px; --fs-title: 15px; --fs-heading: 15px; --fs-page: 22px; --fs-stat: 26px;
  --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600;
  --lh-tight: 1.3; --lh-body: 1.45; --lh-text: 1.55; --ls-eyebrow: .05em;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-family: var(--font);
  font-feature-settings: "cv11", "ss01"; /* Inter: angka 1 & a lebih mudah dibaca */
  color-scheme: light;
}

/* ============ 2. Dasar ============ */
html { box-sizing: border-box; height: 100%; -webkit-text-size-adjust: 100%; }
*, *::before, *::after { box-sizing: inherit; }
body { height: 100%; margin: 0; background: var(--bg); color: var(--text); font-size: var(--fs-body); line-height: var(--lh-body); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: var(--lh-tight); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.ico { width: 15px; height: 15px; display: block; flex: none; filter: invert(var(--icon-invert)); opacity: .72; }
.mono { font-family: var(--mono); }
.skip-link { position: absolute; left: 8px; top: -40px; z-index: 200; padding: 8px 12px; border-radius: 5px; background: var(--primary); color: var(--on-primary); font-size: var(--fs-small); font-weight: var(--fw-semibold); }
.skip-link:focus { top: 8px; }

/* ============ 3. Layout ============ */
.app-shell { height: 100%; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); overflow: hidden; }
.sidebar { height: 100%; min-height: 0; display: grid; grid-template-rows: auto 1fr; background: var(--sidebar-bg); border-right: 1px solid var(--line); }
.sidebar__brand { height: var(--topbar); display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 20px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: var(--fw-semibold); letter-spacing: -.01em; }
/* Nama aplikasi: tanpa logo, cukup tulisan dengan huruf serif miring agar beda dari teks antarmuka. */
.wordmark { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; font-size: 20px; font-style: italic; font-weight: 700; letter-spacing: -.02em; line-height: 1; color: var(--text); }
.brand__mark { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; background: var(--accent); color: #fff; font-size: var(--fs-body); font-weight: var(--fw-semibold); }
.brand__name { font-size: var(--fs-heading); font-weight: var(--fw-semibold); }
.sidebar__nav { min-height: 0; padding: 12px; overflow-y: auto; }
.nav-group { display: grid; gap: 2px; }
.nav-group + .nav-group { margin-top: 14px; }
.nav-label { margin: 0 10px 6px; color: var(--nav-label); font-size: var(--fs-micro); font-weight: var(--fw-semibold); letter-spacing: var(--ls-eyebrow); text-transform: uppercase; }
.nav-item { min-height: 32px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border-radius: 6px; color: var(--muted-strong); font-size: var(--fs-body); }
.nav-item .ico { width: 16px; height: 16px; }
.nav-item:hover { background: var(--row-hover); color: var(--text); }
.nav-item.is-active { background: var(--hover-soft); color: var(--text); font-weight: var(--fw-semibold); }
.nav-item.is-active .ico { opacity: 1; }
.nav-item__count { min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; margin-left: auto; padding: 0 5px; border-radius: 5px; background: var(--count-bg); color: var(--muted-strong); font-size: var(--fs-micro); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.nav-item__count:empty { display: none; }
.nav-item.is-active .nav-item__count { background: var(--primary); color: var(--surface); }
.sidebar__footer { padding: 9px 8px; border-top: 1px solid var(--line); }
.profile { display: flex; align-items: center; gap: 9px; padding: 3px 8px; min-width: 0; }
.profile > span:last-child { min-width: 0; }
.profile strong { display: block; font-size: var(--fs-small); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile small { display: block; color: var(--muted-strong); font-size: var(--fs-caption); } /* 4.5:1 di atas --sidebar-bg [UI-4] */
.avatar { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 5px; background: var(--selected-soft); color: var(--muted-strong); font-size: var(--fs-small); font-weight: var(--fw-semibold); }
.avatar--sm { width: 24px; height: 24px; font-size: var(--fs-caption); }
.sidebar__brand .sidebar__close { display: none; }
.sidebar-backdrop { display: none; }

.app-content { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
.app-topbar { min-height: var(--topbar); display: flex; align-items: center; gap: 10px; padding: 4px 32px; background: var(--topbar-bg); border-bottom: 1px solid var(--line); }
.app-topbar__title { min-width: 0; display: flex; align-items: baseline; gap: 6px; }
.app-topbar__title h1:focus { outline: none; } /* menerima fokus program saat pindah halaman (bukan kontrol) [A11Y-1] */
.breadcrumb { margin: 0; flex: none; color: var(--muted); font-size: var(--fs-body); }
.breadcrumb:not(:empty)::after { content: "/"; margin-left: 6px; color: var(--line-strong); }
.app-topbar h1 { margin: 0; font-size: var(--fs-page); font-weight: var(--fw-semibold); letter-spacing: -.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.menu-toggle { display: none; width: 32px; height: 32px; flex: none; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); cursor: pointer; }
.dashboard-main { position: relative; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 20px 28px 32px; }
.dashboard-main:focus { outline: none; }
.content-section + .content-section { margin-top: 20px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; min-height: 32px; margin-bottom: 12px; flex-wrap: wrap; }
.section-heading h2 { margin: 0; font-size: var(--fs-heading); font-weight: var(--fw-semibold); letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.section-heading p { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-small); }
.section-heading > div > p:only-child { margin: 0; color: var(--muted-strong); } /* baris ringkas di bawah judul halaman (topbar) */
.section-heading__actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.view-loading { padding: 40px 0; color: var(--muted); font-size: var(--fs-small); text-align: center; }

/* ============ 4. Komponen ============ */
/* Tombol */
.button { height: 32px; padding: 0 12px; border: 1px solid transparent; border-radius: 6px; cursor: pointer; font-size: var(--fs-body); font-weight: var(--fw-semibold); display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; background: transparent; }
.button--primary { background: var(--primary); color: var(--on-primary); }
.button--primary:hover { background: var(--primary-hover); }
.button--primary .ico { filter: invert(1); opacity: 1; }
/* Tombol netral (pola admin chameleoncloth): putih, bingkai tipis, ikon + teks. */
.button--secondary { border-color: var(--line-strong); background: var(--surface); color: var(--muted-strong); }
.button--secondary:hover { background: var(--surface-subtle); color: var(--text); }
.button--secondary:hover .ico { opacity: 1; }
.button--danger { border-color: var(--line-strong); background: var(--surface); color: var(--danger); }
.button--danger:hover { background: var(--danger-bg); }
.button--danger-solid { background: var(--danger); color: #fff; }
.button--danger-solid:hover { background: #b31d28; }
.button--text { background: transparent; color: var(--muted-strong); }
.button--text:hover { background: var(--hover-soft); }
.button--sm { height: 28px; padding: 0 8px; font-size: var(--fs-small); gap: 6px; }
/* Tombol ikon saja (aksi baris/kartu): persegi, keterangan lewat title/aria-label. */
.button--icon { width: 32px; padding: 0; }
.button--icon.button--sm { width: 28px; }
.button--icon .ico { width: 16px; height: 16px; }
.button--danger .ico { filter: invert(19%) sepia(89%) saturate(2400%) hue-rotate(345deg); opacity: .9; }
.button-row { display: inline-flex; align-items: center; gap: 6px; }
.button--block { width: 100%; }
.button:disabled { opacity: .42; cursor: not-allowed; }
.button[aria-busy="true"] { opacity: .7; cursor: progress; }
.button .spin, .spin { width: 10px; height: 10px; flex: none; display: inline-block; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.icon-button { width: 28px; height: 28px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 4px; background: transparent; cursor: pointer; }
.icon-button:hover { background: var(--hover-soft); }
.icon-button:disabled { opacity: .35; cursor: not-allowed; }
.table-link { color: var(--accent); font-size: var(--fs-small); font-weight: var(--fw-semibold); white-space: nowrap; background: none; border: 0; padding: 0; cursor: pointer; }
.table-link:hover { text-decoration: underline; }

/* Input */
input[type="text"], input[type="search"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="time"],
input[type="email"], input[type="password"], input[type="url"], select, textarea {
  height: 34px; width: 100%; min-width: 0; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 6px; outline: none;
  background: var(--surface); color: var(--text); font-size: var(--fs-body); transition: border-color 120ms ease, box-shadow 120ms ease;
}
input::placeholder, textarea::placeholder { color: var(--muted); } /* 4.8:1 di atas putih; --placeholder hanya untuk garis [UI-4] */
input:hover, select:hover, textarea:hover { border-color: var(--placeholder); }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 2px var(--focus-ring); }
input[readonly] { background: var(--surface-subtle); color: var(--muted-strong); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
input[aria-invalid="true"]:focus { border-color: var(--danger); box-shadow: 0 0 0 2px rgba(207, 34, 46, .12); }
textarea { height: auto; min-height: 118px; padding: 8px 10px; resize: vertical; font-size: var(--fs-body); line-height: var(--lh-text); }
input[type="checkbox"], input[type="radio"] { width: 15px; height: 15px; margin: 0; accent-color: var(--primary); cursor: pointer; vertical-align: middle; }

/* Pemilih periode (ui/js/period.mjs): tombol + popover preset & rentang tanggal */
.period { position: relative; flex: none; max-width: 100%; }
.period__button { max-width: 100%; gap: 7px; color: var(--text); font-weight: var(--fw-semibold); }
.period__button .ico { width: 14px; height: 14px; }
.period__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.period__caret { width: 0; height: 0; flex: none; margin-left: 2px; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--muted); }
.period__button[aria-expanded="true"] { background: var(--surface-subtle); border-color: var(--placeholder); }
.period__pop { position: absolute; top: calc(100% + 4px); left: 0; z-index: 40; width: 292px; max-width: calc(100vw - 32px); display: grid; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: 0 6px 16px rgba(17, 24, 39, .08); }
.period__pop[hidden] { display: none; }
.period__presets { display: grid; padding: 4px; }
.period__preset { min-height: 34px; display: flex; align-items: center; padding: 0 10px; border: 0; border-radius: 4px; background: none; color: var(--muted-strong); font-size: var(--fs-body); text-align: left; cursor: pointer; }
.period__preset:hover { background: var(--hover-soft); color: var(--text); }
.period__preset[aria-pressed="true"] { background: var(--selected-soft); color: var(--text); font-weight: var(--fw-semibold); }
.period__custom { display: grid; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.period__heading { color: var(--muted); font-size: var(--fs-micro); font-weight: var(--fw-semibold); letter-spacing: var(--ls-eyebrow); text-transform: uppercase; }
.period__fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.period__field { display: grid; gap: 4px; min-width: 0; font-size: var(--fs-small); font-weight: var(--fw-semibold); color: var(--muted-strong); }
.period__field input { padding: 0 6px; font-size: var(--fs-small); }
.period__error { margin: 0; color: var(--danger); font-size: var(--fs-small); }
.period__error:empty { display: none; }
.period__actions { display: flex; justify-content: flex-end; }

/* Range: grup tombol segmented (filter, pilihan cepat) */
.range { display: inline-flex; align-items: center; gap: 6px; padding: 0; border-radius: 6px; background: transparent; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.range::-webkit-scrollbar { display: none; }
.range button { height: 30px; padding: 0 10px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--muted-strong); font-size: var(--fs-small); font-weight: var(--fw-medium); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.range button:hover { background: var(--hover-soft); color: var(--text); }
.range button[aria-pressed="true"] { background: var(--selected-soft); color: var(--text); font-weight: var(--fw-semibold); }
.range button[aria-pressed="true"] .n { color: var(--muted-strong); }
.range button:disabled { opacity: .4; cursor: not-allowed; }
.range .n { font-size: var(--fs-caption); color: var(--muted-strong); font-variant-numeric: tabular-nums; }

/* Notice & alert */
.notice { display: flex; gap: 9px; align-items: flex-start; padding: 9px 12px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--info-bg); color: var(--muted-strong); font-size: var(--fs-small); }
.notice .ico { margin-top: 1px; width: 14px; height: 14px; }
.alert { margin: 0; padding: 10px 12px; border-radius: 6px; font-size: var(--fs-small); background: var(--surface-subtle); color: var(--muted-strong); }
.alert--info { background: var(--info-bg); color: var(--blue); }
.alert--success { background: var(--success-bg); color: var(--success); }
.alert--warning { background: var(--warning-bg); color: var(--warning); }
.alert--danger { background: var(--danger-bg); color: var(--danger); }
.alert b { font-weight: var(--fw-semibold); }

/* Menu pengguna (topbar) */
.user-menu { position: relative; }
.user-menu__button { height: 34px; display: inline-flex; align-items: center; gap: 8px; padding: 0 8px 0 4px; border: 1px solid transparent; border-radius: 5px; background: transparent; cursor: pointer; font-size: var(--fs-body); font-weight: var(--fw-medium); color: var(--muted-strong); }
.user-menu__button:hover, .user-menu__button[aria-expanded="true"] { background: var(--hover-soft); }
.user-menu__name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu__caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--muted); }
.menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 200px; padding: 4px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.menu__head { padding: 8px 10px 9px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.menu__head strong { display: block; font-size: var(--fs-small); }
.menu__head small { display: block; color: var(--muted); font-size: var(--fs-small); overflow-wrap: anywhere; }
.menu__item { width: 100%; min-height: 36px; display: flex; align-items: center; gap: 9px; padding: 0 10px; border: 0; border-radius: 4px; background: none; color: var(--muted-strong); font-size: var(--fs-body); text-align: left; cursor: pointer; }
.menu__item:hover { background: var(--hover-soft); color: var(--text); }
/* Fokus keyboard memakai outline biru seperti kontrol lain (latar abu saja hanya 1,14:1) [A11Y-6]. */
.menu__item:focus-visible { background: var(--hover-soft); color: var(--text); outline: 2px solid var(--blue); outline-offset: -2px; }
.menu__item--danger { color: var(--danger); }

/* Pemilih anggota (topbar, admin) */
.owner-pick { position: relative; display: flex; align-items: center; min-width: 0; }
.owner-pick__label { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: var(--fs-small); font-weight: var(--fw-semibold); pointer-events: none; }
.owner-pick__label .ico { width: 14px; height: 14px; }
.owner-pick__select { width: auto; max-width: 240px; height: 30px; padding: 0 26px 0 86px; font-size: var(--fs-small); font-weight: var(--fw-semibold); color: var(--text); text-overflow: ellipsis; }

/* Avatar pemilik di tabel (admin, "Semua anggota") */
.avatar--xs { width: 20px; height: 20px; border-radius: 4px; font-size: var(--fs-micro); }
.owner-tag { display: inline-grid; vertical-align: middle; cursor: default; font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.product-cell > .owner-tag { margin-left: auto; }
.owner-inline { display: inline-flex; align-items: center; gap: 8px; }

/* Drawer Akun Meta */
.acc-sec { display: grid; gap: 6px; }
.acc-sec__head { margin: 0; display: flex; align-items: center; gap: 7px; font-size: var(--fs-small); font-weight: var(--fw-semibold); }
.acc-sec__head .ico { width: 14px; height: 14px; }
.acc-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.acc-row { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 6px 8px 6px 12px; }
.acc-row + .acc-row { border-top: 1px solid var(--line); }
.acc-row.is-default { background: var(--checked-bg); }
.acc-row__main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; cursor: pointer; }
.acc-row input:disabled + .acc-row__main { cursor: default; }
.acc-row__text { min-width: 0; display: grid; }
.acc-row__text strong { font-size: var(--fs-small); font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-row__text small { color: var(--muted); font-size: var(--fs-small); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-row__status { flex: none; }
.acc-off { flex: none; color: var(--muted-strong); }
.acc-off:hover { color: var(--danger); }
.acc-none { margin: 0; padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: 6px; color: var(--muted); font-size: var(--fs-small); }

/* ============ 5. Ringkasan & panel ============ */
.summary-grid { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 10px; }
.summary-item { min-width: 0; display: grid; gap: 2px; align-content: start; padding: 10px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.summary-item__label { color: var(--muted); font-size: var(--fs-small); font-weight: var(--fw-medium); }
.summary-item strong { font-size: var(--fs-stat); line-height: 26px; font-weight: var(--fw-semibold); letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary-item small { color: var(--muted); font-size: var(--fs-small); font-variant-numeric: tabular-nums; }
.dashboard-detail-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 16px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); overflow: hidden; }
.panel__head { min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.panel__head h3 { margin: 0; font-size: var(--fs-title); font-weight: var(--fw-semibold); display: flex; align-items: center; gap: 8px; }
.panel__head small { color: var(--muted); font-size: var(--fs-small); }
.panel__body { padding: 10px 14px; }
.panel__sub { padding: 12px 16px 4px; color: var(--muted); border-top: 1px solid var(--line); font-size: var(--fs-micro); font-weight: var(--fw-semibold); letter-spacing: var(--ls-eyebrow); text-transform: uppercase; }
.chart-wrap { position: relative; padding: 12px 14px 8px; }
.chart-wrap canvas { display: block; width: 100%; height: 210px; }
.chart-tip { position: absolute; pointer-events: none; background: var(--overlay-strong); color: #fff; font-size: var(--fs-caption); font-weight: var(--fw-semibold); padding: 4px 7px; border-radius: 4px; white-space: nowrap; transform: translate(-50%, -100%); }
/* Grafik batang horizontal (Sumber klik, Analisis iklan): nama · batang · angka dalam satu baris. */
.bar-chart { padding: 8px 0; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 30%) minmax(0, 1fr) auto; grid-template-areas: "name track val"; align-items: center; gap: 12px; padding: 6px 16px; }
.bar-row__name { grid-area: name; display: flex; align-items: center; gap: 7px; min-width: 0; font-size: var(--fs-small); font-weight: var(--fw-medium); color: var(--text); }
.bar-row__val { grid-area: val; display: inline-flex; align-items: baseline; justify-content: flex-end; gap: 6px; min-width: 64px; font-size: var(--fs-small); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-row__val b { color: var(--text); font-weight: var(--fw-semibold); }
.bar-row__val small { font-size: var(--fs-caption); }
.bar-row__val > b, .bar-row__val > small { display: inline-block; text-align: right; }
.bar-row__val > b { min-width: 36px; }
.bar-row__val > small { min-width: 44px; }
.bar-row__val > small:first-of-type { min-width: 58px; }
.track { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--track-bg); overflow: hidden; }
.track i { display: block; height: 100%; border-radius: 2px; background: var(--bar-strong); }
.bar-row .track { grid-column: auto; grid-area: track; height: 14px; border-radius: 3px; }
.bar-row .track i { border-radius: 3px; }
.bar-row.is-best .track i { background: var(--success); }
.bar-row + .bar-row { border-top: 0; }
/* Tombol ⓘ + popover penjelasan (ui.mjs info()) */
.info-tip { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; padding: 0; margin: 0 2px; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--muted); font: italic 600 11px/1 Georgia, serif; cursor: pointer; vertical-align: middle; flex: none; position: relative; }
.info-tip::after { content: ""; position: absolute; inset: -12px; } /* area sentuh 42px */
.info-tip:hover, .info-tip[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.info-tip:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.info-pop { position: fixed; z-index: 80; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 13px; line-height: 1.5; box-shadow: 0 6px 20px rgba(16, 24, 40, .12); white-space: pre-line; }
.info-pop--rich { display: grid; gap: 10px; white-space: normal; padding: 12px 14px; }
.info-pop .ip-sec { display: grid; gap: 3px; }
.info-pop .ip-sec + .ip-sec { padding-top: 10px; border-top: 1px solid var(--line); }
.info-pop .ip-k { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.info-pop .ip-v { font-size: 13px; font-weight: 400; color: var(--text); line-height: 1.5; }
.info-pop .ip-v b { font-weight: 600; }
.info-pop .ip-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.info-pop .ip-chip { padding: 1px 7px; border-radius: 4px; background: var(--surface-subtle); border: 1px solid var(--line); font-size: 12px; color: var(--muted-strong); }
.info-tip__body { display: none; }
.bar-legend { display: inline-flex; align-items: center; gap: 10px; }
.bar-legend__best { display: inline-flex; align-items: center; gap: 5px; color: var(--success); }
.bar-legend__best::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--success); }
.attention { list-style: none; margin: 0; padding: 0; }
.attention li { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; }
.attention li + li { border-top: 1px solid var(--line); }
.attention strong { display: block; font-size: var(--fs-body); font-weight: var(--fw-semibold); }
.attention small { display: block; color: var(--muted); font-size: var(--fs-small); }
.attention .table-link { margin-left: auto; padding-left: 8px; flex: none; }
.attention li > span:not(.dot) { flex: 1 1 auto; min-width: 0; } /* teks mengalah, link aksi tidak terpotong */
.dot { width: 6px; height: 6px; flex: none; border-radius: 3px; margin-top: 5px; background: var(--warning-mark); }
.dot--danger { background: var(--danger); }
.dot--info { background: var(--blue); }
.dot--success { background: var(--success); }

/* ============ 6. Tabel & daftar muat otomatis ============ */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.search { position: relative; flex: 1 1 260px; max-width: 360px; min-width: 0; }
.search .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; opacity: .5; pointer-events: none; }
.search input { padding-left: 31px; }
.sort-select { width: auto; min-width: 200px; flex: 0 0 auto; }
.bulkbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 5px 6px 5px 12px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--accent-soft); }
.bulkbar strong { font-size: var(--fs-body); margin-right: auto; }
.data-table-wrap { position: relative; container-type: inline-size; overflow-x: auto; scroll-padding-inline: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.data-table-wrap--flush { border: 0; border-radius: 0; }
.data-table { width: 100%; border-collapse: collapse; min-width: var(--minw, 860px); }
.data-table th { padding: 7px 10px; background: var(--surface-subtle); color: var(--muted); font-size: var(--fs-caption); font-weight: var(--fw-medium); text-align: left; white-space: nowrap; }
.data-table td { height: 44px; padding: 6px 10px; border-top: 1px solid var(--line); color: var(--muted-strong); font-size: var(--fs-small); vertical-align: middle; }
.data-table thead + tbody tr:first-child td { border-top: 1px solid var(--line); }
.data-table .numeric { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table tbody tr.row { cursor: pointer; }
.data-table tbody tr.row:hover td { background: var(--row-hover-faint); }
.data-table tbody tr.is-selected td { background: var(--accent-soft); }
.data-table tr.group td { height: auto; padding: 8px 12px; background: var(--surface-subtle); color: var(--muted); font-size: var(--fs-small); font-weight: var(--fw-semibold); }
.data-table .empty td { height: auto; padding: 24px 16px; text-align: center; color: var(--muted); }
/* Tabel lebih lebar dari layar HP: pesan kosong/error menempel di area yang terlihat, bukan di tengah tabel [UI-2]. */
.data-table tr.empty td { padding-left: 0; padding-right: 0; }
.data-table tr.empty .empty-state { position: sticky; left: 0; width: min(100%, calc(100vw - 34px)); width: min(100%, 100cqi); }
.data-table__actions { width: 44px; text-align: right !important; white-space: nowrap; }
.col-check { width: 36px; padding-right: 0 !important; }
.sort { border: 0; background: none; padding: 0; color: inherit; font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.sort:hover { color: var(--text); }
.sort .ar { font-size: var(--fs-micro); opacity: .6; }
.product-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.product-cell .pc { min-width: 0; display: grid; }
.product-cell strong { color: var(--text); font-size: var(--fs-body); font-weight: var(--fw-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 360px; }
.product-cell small { color: var(--muted); font-size: var(--fs-small); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 360px; }
.product-cell small.err { color: var(--danger); }
.sku-code { font-family: var(--mono); font-size: var(--fs-caption); color: var(--muted-strong); white-space: nowrap; }
.channels { display: inline-flex; gap: 6px; align-items: center; }
.channels .ico { width: 14px; height: 14px; opacity: .8; }
.ref { display: inline-flex; align-items: center; gap: 6px; }
.ref .ico { width: 13px; height: 13px; }
.feed-end { min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: var(--fs-small); text-align: center; }
.feed-end--error { color: var(--danger); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 2px 0; color: var(--muted); font-size: var(--fs-small); }

/* Skeleton (memuat) */
.skeleton-row td { height: 48px; }
.sk { display: block; height: 10px; border-radius: 3px; background: var(--skeleton); animation: pulse 1.4s ease-in-out infinite; }
.sk--w40 { width: 40%; } .sk--w60 { width: 60%; } .sk--w80 { width: 80%; }
@keyframes pulse { 50% { opacity: .55; } }

/* Status kosong & error */
.empty-state { display: grid; justify-items: center; gap: 4px; padding: 24px 16px; text-align: center; color: var(--muted); }
.empty-state .ico { width: 22px; height: 22px; opacity: .45; }
.empty-state strong { color: var(--text); font-size: var(--fs-body); font-weight: var(--fw-semibold); }
.empty-state p { margin: 0; max-width: 46ch; font-size: var(--fs-small); line-height: var(--lh-text); }
.empty-state .button { margin-top: 6px; }
.error-state strong { color: var(--danger); }

/* ============ 7. Drawer & dialog ============ */
.drawer-wrap { position: fixed; inset: 0; z-index: 50; }
.drawer-backdrop { position: absolute; inset: 0; background: var(--backdrop); animation: fade .16s ease; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(460px, 100%); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--surface); border-left: 1px solid var(--line); animation: slide .2s cubic-bezier(.2, .8, .2, 1); }
.drawer--wide { width: min(640px, 100%); }
.drawer__head { min-height: var(--topbar); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px 8px 18px; padding-top: calc(8px + env(safe-area-inset-top, 0px)); border-bottom: 1px solid var(--line); }
.drawer__head > div { min-width: 0; }
.drawer__head > .icon-button, .drawer__head [data-close] { flex: none; } /* × tidak menyusut oleh judul panjang [A11Y-5] */
.drawer__head h2 { margin: 0; font-size: var(--fs-heading); font-weight: var(--fw-semibold); line-height: var(--lh-tight); overflow-wrap: anywhere; }
.drawer__body { overflow-y: auto; overscroll-behavior: contain; padding: 16px 18px; display: grid; grid-auto-rows: max-content; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; }
.drawer__foot { display: flex; gap: 6px; justify-content: flex-end; align-items: center; flex-wrap: wrap; padding: 10px 18px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }
.drawer__foot:empty { display: none; }
.drawer__foot .hint { margin-right: auto; color: var(--muted); font-size: var(--fs-small); }
.dialog-wrap { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; }
.dialog-wrap .drawer-backdrop { z-index: 0; }
.dialog { position: relative; z-index: 1; width: min(400px, 100%); display: grid; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); animation: fade .16s ease; }
.dialog h2 { margin: 0; font-size: var(--fs-heading); font-weight: var(--fw-semibold); }
.dialog p { margin: 0; color: var(--muted-strong); font-size: var(--fs-small); line-height: 1.5; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
@keyframes slide { from { transform: translateX(16px); opacity: .5; } }
@keyframes sheet { from { transform: translateY(24px); opacity: .5; } }
@keyframes fade { from { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ 8. Form ============ */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field .label { font-size: var(--fs-small); font-weight: var(--fw-semibold); color: var(--muted-strong); }
.field__hint { color: var(--muted); font-size: var(--fs-caption); }
.field__error { margin: 0; color: var(--danger); font-size: var(--fs-small); }
.field__error:empty { display: none; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.input-group { position: relative; display: flex; }
.input-group input { padding-right: 40px; }
.input-group .icon-button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.choices { display: grid; gap: 6px; }
.choices--row { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.choice { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 5px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--checked-line); background: var(--checked-bg); }
.choice:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.choice .ico { width: 16px; height: 16px; }
.choice strong { display: block; font-size: var(--fs-small); font-weight: var(--fw-semibold); }
.choice small { display: block; color: var(--muted); font-size: var(--fs-caption); }
.choice:has(input:checked) small { color: var(--muted-strong); } /* 4,47:1 → ≥ 6,9:1 di --checked-bg [A11Y-7] */
.vars { display: flex; gap: 4px; flex-wrap: wrap; }
.var { height: 24px; padding: 0 7px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-subtle); font-family: var(--mono); font-size: var(--fs-caption); color: var(--muted-strong); cursor: pointer; }
.var:hover { border-color: var(--line-strong); color: var(--text); }
.preview-box { white-space: pre-wrap; overflow-wrap: anywhere; padding: 10px 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-subtle); font-size: var(--fs-small); line-height: 1.5; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.facts > div { min-width: 0; display: grid; gap: 2px; padding: 8px 10px; background: var(--surface); }
.facts span { font-size: var(--fs-caption); color: var(--muted); font-weight: var(--fw-medium); }
.facts b { font-size: var(--fs-small); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.facts .wide { grid-column: 1 / -1; }
.facts > div:last-child:nth-child(odd) { grid-column: 1 / -1; } /* fakta ganjil: yang terakhir selebar kotak, tanpa sel kosong */
.plan { border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.plan > div { display: flex; gap: 10px; align-items: center; padding: 7px 10px; font-size: var(--fs-small); }
.plan > div + div { border-top: 1px solid var(--line); }
.plan .when { color: var(--muted); width: 124px; flex: none; font-size: var(--fs-small); font-variant-numeric: tabular-nums; white-space: nowrap; }
.plan .what { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.media-grid > * { aspect-ratio: 1; max-width: 100%; border-radius: 4px; border: 1px solid var(--line); background: var(--surface-subtle); display: grid; place-items: center; align-content: center; gap: 4px; font-size: var(--fs-caption); color: var(--muted); text-align: center; }
.media-grid > .has { background: var(--info-bg); border-color: transparent; }
.media-grid label { border-style: dashed; cursor: pointer; }
.media-grid label:hover { border-color: var(--line-strong); color: var(--text); }
.inline { display: flex; gap: 6px; align-items: center; }
.dropzone { display: grid; justify-items: center; gap: 6px; padding: 28px 16px; border: 1px dashed var(--line-strong); border-radius: 6px; text-align: center; cursor: pointer; color: var(--muted); font-size: var(--fs-small); }
.dropzone strong { color: var(--text); font-size: var(--fs-small); }
.dropzone .ico { width: 20px; height: 20px; }
.dropzone.is-over { border-color: var(--blue); background: var(--accent-soft); }
.steps { display: flex; gap: 4px; }
.steps i { height: 3px; flex: 1; border-radius: 2px; background: var(--track-bg); }
.steps i.on { background: var(--primary); }
.map-table { width: 100%; border-collapse: collapse; border: 1px solid var(--line); border-radius: 6px; }
.map-table td, .map-table th { padding: 6px 8px; border-top: 1px solid var(--line); font-size: var(--fs-small); text-align: left; }
.map-table th { border-top: 0; background: var(--surface-subtle); color: var(--muted); font-size: var(--fs-small); font-weight: var(--fw-medium); }
.map-table select { height: 30px; font-size: var(--fs-small); }
.map-table .ex { color: var(--muted); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checklist label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; cursor: pointer; }
.checklist label + label { border-top: 1px solid var(--line); }
.checklist input { margin-top: 1px; }
.checklist strong { display: block; font-size: var(--fs-small); font-weight: var(--fw-semibold); }
.checklist small { display: block; color: var(--muted); font-size: var(--fs-small); }
.checklist label:has(input:checked) strong { color: var(--muted); text-decoration: line-through; }

/* ============ 9. Badge ============ */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 4px; font-size: var(--fs-caption); font-weight: var(--fw-medium); line-height: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; background: var(--surface-subtle); color: var(--muted-strong); }
.badge--neutral { background: var(--track-bg); color: var(--muted-strong); }
.badge--success { background: var(--success-bg); color: var(--success); }
.badge--warning { background: var(--warning-bg); color: var(--warning); }
.badge--danger { background: var(--danger-bg); color: var(--danger); }
.badge--info { background: var(--info-bg); color: var(--blue); }
.badge--spin::before { content: ""; width: 7px; height: 7px; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }

/* ============ 10. Toast ============ */
.toast-stack { position: fixed; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); right: 18px; z-index: 100; width: min(calc(100% - 36px), 340px); display: grid; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: 11px; align-items: center; padding: 10px 6px 10px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); animation: fade .16s ease; }
.toast__indicator { align-self: stretch; border-radius: 0 3px 3px 0; background: var(--success); }
.toast--info .toast__indicator { background: var(--blue); }
.toast--warning .toast__indicator { background: var(--warning-mark); }
.toast--danger .toast__indicator { background: var(--danger); }
.toast--neutral .toast__indicator { background: var(--muted); }
.toast__text { min-width: 0; font-size: var(--fs-small); font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.toast__text small { display: block; color: var(--muted); font-weight: var(--fw-regular); font-size: var(--fs-small); }
.toast__actions { display: flex; align-items: center; gap: 2px; }
.toast__close { width: 26px; height: 26px; font-size: var(--fs-heading); line-height: 1; color: var(--muted); }

/* ============ 11. Gambar ============ */
.thumb, .thumb-ph { width: 34px; height: 34px; flex: none; overflow: hidden; border-radius: 4px; background: var(--surface-subtle); border: 1px solid var(--line); display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; padding: 0; }
.thumb .ico, .thumb-ph .ico { width: 14px; height: 14px; opacity: .4; }
.thumb img, .thumb-ph img { width: 100%; height: 100%; display: block; object-fit: cover; }
.thumb.has-img, .thumb-ph.has-img { background: var(--surface); }
.thumb.has-media, .thumb-ph.has-media { background: var(--info-bg); border-color: transparent; }
button.thumb, button.thumb-ph { cursor: zoom-in; }
.data-table .thumb, .data-table .thumb-ph, .thumb--md { width: 36px; height: 36px; border-radius: 5px; }
.thumb--lg, .data-table .thumb--lg { width: 56px; height: 56px; border-radius: 6px; }
.thumb.sm, .thumb-ph.sm, .data-table .thumb.sm, .data-table .thumb-ph.sm { width: 32px; height: 32px; }
.img-pop { position: fixed; z-index: 60; width: 260px; height: 260px; padding: 4px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); pointer-events: none; }
.img-pop img { width: 100%; height: 100%; display: block; object-fit: contain; border-radius: 4px; }
.gallery { display: grid; gap: 8px; }
.gallery__main { position: relative; width: 100%; max-width: 100%; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-subtle); cursor: zoom-in; padding: 0; }
.gallery__main.is-empty { cursor: default; }
.gallery__main.is-over { border-color: var(--blue); background: var(--accent-soft); }
.gallery__main img { width: 100%; height: 100%; display: block; object-fit: contain; }
.gallery__empty { display: grid; justify-items: center; gap: 6px; max-width: 260px; padding: 16px; color: var(--muted); font-size: var(--fs-small); text-align: center; }
.gallery__empty .ico { width: 22px; height: 22px; opacity: .45; }
.gallery__badge { position: absolute; left: 8px; top: 8px; padding: 2px 6px; border-radius: 4px; background: var(--overlay-strong); color: #fff; font-size: var(--fs-caption); font-weight: var(--fw-semibold); }
.gallery__strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.gallery__strip > * { width: 60px; height: 60px; flex: none; padding: 0; overflow: hidden; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-subtle); cursor: pointer; }
.gallery__strip > button { grid-template: minmax(0, 1fr) / minmax(0, 1fr); } /* foto 4:5 utuh, tidak terpotong [UI-5] */
.gallery__strip button[aria-pressed="true"] { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.gallery__strip img { width: 100%; height: 100%; display: block; object-fit: cover; }
.gallery__strip label { border-style: dashed; color: var(--muted); font-size: var(--fs-caption); gap: 2px; align-content: center; }
.gallery__strip label:hover { border-color: var(--line-strong); color: var(--text); }
.gallery__meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: var(--fs-caption); }
.post-mock { overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.post-mock__head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: var(--fs-small); font-weight: var(--fw-semibold); }
.post-mock__head .avatar { width: 24px; height: 24px; font-size: var(--fs-caption); }
.post-mock__img { width: 100%; max-width: 100%; aspect-ratio: 4 / 5; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); overflow: hidden; place-items: center; background: var(--surface-subtle); border-block: 1px solid var(--line); }
.post-mock__img.fb { aspect-ratio: 1; }
.post-mock__img img { width: 100%; height: 100%; display: block; object-fit: cover; }
.post-mock__cap { padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-small); line-height: 1.5; }
/* Lightbox sengaja gelap (latar foto), bukan tema gelap. */
.lightbox { position: fixed; inset: 0; z-index: 90; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: #0b0c0e; color: #fff; animation: fade .16s ease; }
.lightbox__bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); font-size: var(--fs-small); }
.lightbox__bar strong { min-width: 0; font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox__stage { min-height: 0; display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: center; }
.lightbox__img { min-height: 0; min-width: 0; height: 100%; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; overflow: hidden; padding: 8px 0; box-sizing: border-box; } /* foto selalu muat di layar [UI-1] */
.lightbox__stage img { max-width: 100%; max-height: 100%; margin: auto; display: block; object-fit: contain; }
.lightbox button { width: 40px; height: 40px; flex: none; display: grid; place-items: center; margin: auto; padding: 0; border: 1px solid rgba(255, 255, 255, .18); border-radius: 5px; background: rgba(255, 255, 255, .06); color: #fff; font-size: var(--fs-page); cursor: pointer; }
.lightbox__bar button { margin: 0 0 0 auto; } /* tombol Tutup di pojok kanan [UI-1] */
.lightbox button:hover { background: rgba(255, 255, 255, .14); }
.lightbox button:disabled { opacity: .3; cursor: not-allowed; }
.lightbox__foot { padding: 10px 14px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); text-align: center; color: rgba(255, 255, 255, .7); font-size: var(--fs-small); }

/* ============ 12. Halaman masuk ============ */
.auth-page { min-height: 100%; display: grid; grid-template-rows: 1fr auto; }
.auth-main { display: grid; place-items: center; padding: 32px 20px; }
.login-panel { width: min(100%, 376px); padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.login-panel__brand { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-weight: var(--fw-semibold); }
.login-panel__title { margin: 0 0 18px; font-size: var(--fs-heading); font-weight: var(--fw-semibold); line-height: 1.3; letter-spacing: -.015em; }
.login-panel__lead { margin: -10px 0 16px; color: var(--muted); font-size: var(--fs-small); }
.login-form { display: grid; gap: 15px; }
.login-form .field > label { font-size: var(--fs-small); }
.auth-footer { padding: 14px 20px 18px; color: var(--muted); font-size: var(--fs-small); text-align: center; }

/* ============ 13. Utilitas ============ */
.muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.stack { display: grid; gap: 8px; }
.row-flex { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ============ 14. Responsif ============ */
@media (max-width: 1100px) {
  .summary-grid { --cols: 3 !important; }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 40; width: min(260px, 85vw); transform: translateX(-100%); transition: transform .2s ease; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .sidebar.is-open { transform: none; }
  .sidebar-backdrop.is-open { display: block; position: fixed; inset: 0; z-index: 35; background: var(--backdrop); }
  .menu-toggle, .sidebar__brand .sidebar__close { display: inline-grid; }
  .sidebar__brand .sidebar__close { width: 36px; height: 36px; }
  .nav-item { min-height: 40px; }
  .dashboard-detail-grid { grid-template-columns: minmax(0, 1fr); }
  .summary-grid { --cols: 2 !important; }
  .summary-item:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .bar-row { gap: 4px 8px; padding: 6px 12px; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name val" "track track"; }
  .data-table .thumb, .data-table .thumb-ph, .thumb--md { width: 48px; height: 48px; }
  .thumb--lg, .data-table .thumb--lg { width: 64px; height: 64px; }
  .app-topbar h1 { font-size: var(--fs-heading); }
  .app-topbar { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .dashboard-main { padding: 16px max(16px, env(safe-area-inset-right, 0px)) 32px max(16px, env(safe-area-inset-left, 0px)); }
  .user-menu__name { display: none; }
  .owner-pick__text { display: none; }
  .owner-pick__select { max-width: 132px; height: 36px; padding-left: 28px; }
  .acc-row { flex-wrap: wrap; row-gap: 4px; }
  .acc-row__main { flex-basis: calc(100% - 30px); }
  .acc-row__status { margin-left: 25px; }
  .acc-off { margin-left: auto; }
  .user-menu__button { height: 36px; padding: 0 6px 0 4px; }
  .section-heading__actions { width: 100%; }
  .section-heading__actions .button { flex: 1; }
  .search { max-width: none; flex-basis: 100%; }
  .sort-select { flex: 1 1 auto; min-width: 0; }
  .field-row { grid-template-columns: 1fr; }
  .button { min-height: 36px; }
  .button--sm { height: 36px; }
  input[type="text"], input[type="search"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="time"],
  input[type="email"], input[type="password"], input[type="url"], select { height: 36px; }
  .app-topbar__title { display: block; }
  .breadcrumb { display: none; }
  .icon-button { width: 36px; height: 36px; }
  /* Target sentuh ≥ 36px [UX-4][UI-3] */
  .menu-toggle { width: 36px; height: 36px; }
  .range button { height: 36px; }
  .period__preset { min-height: 36px; }
  .var { height: 36px; padding: 0 10px; }
  .table-link { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; min-width: 36px; } /* [A11Y-5] */
  .col-check input[type="checkbox"] { width: 18px; height: 18px; }
  .data-table--sticky .col-check { position: sticky; left: 0; z-index: 1; background: var(--surface); }
  .data-table--sticky .col-product { position: sticky; left: 36px; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--line); }
  .data-table--sticky th.col-check, .data-table--sticky th.col-product { background: var(--surface-subtle); }
  .data-table--sticky tr.is-selected .col-check, .data-table--sticky tr.is-selected .col-product { background: var(--accent-soft); }
  .product-cell strong, .product-cell small { max-width: 170px; }
  /* Drawer menjadi sheet bawah */
  .drawer, .drawer--wide { top: auto; left: 0; width: 100%; max-height: calc(100% - 24px - env(safe-area-inset-top, 0px)); border-left: 0; border-top: 1px solid var(--line); border-radius: 6px 6px 0 0; animation: sheet .2s cubic-bezier(.2, .8, .2, 1); }
  .drawer__head { padding-top: 8px; }
  .toast-stack { top: auto; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); right: 16px; width: calc(100% - 32px); }
  /* Saat sheet bawah terbuka, posisi toast dihitung ui.mjs (positionToasts) agar tidak menutupi kepala/kaki sheet. */
  .lightbox__stage { grid-template-columns: 36px minmax(0, 1fr) 36px; }
  .lightbox button { width: 36px; height: 36px; }
  .auth-main { align-items: start; padding: 42px 16px 24px; }
}
@media (max-width: 480px) {
  .summary-item strong { font-size: 20px; line-height: 28px; }
  .summary-item { padding: 12px; }
  .media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (hover: none) {
  .img-pop { display: none !important; }
  .button { min-height: 36px; }
  input[type="text"], input[type="search"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="time"],
  input[type="email"], input[type="password"], input[type="url"], select { height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Tombol contoh/pilihan cepat (redesign minimalis): bingkai tipis, bukan tombol aksi. */
.button--chip { border-color: var(--line); background: var(--surface); color: var(--muted-strong); font-weight: var(--fw-medium); }
.button--chip:hover { border-color: var(--line-strong); color: var(--text); }

/* Tanda format (Feed / Story / Reels / Carousel): ikon kecil seperti ikon kanal, nama opsional. */
.fmt { display: inline-flex; align-items: center; gap: 5px; color: var(--muted-strong); font-size: var(--fs-small); }
.fmt .ico { width: 14px; height: 14px; }
.jd-chfmt { display: inline-flex; align-items: center; gap: 8px; }
.jd-chfmt .fmt { padding-left: 8px; border-left: 1px solid var(--line); }
.ss-fmt { display: inline-flex; align-items: center; gap: 5px; }
.ss-fmt .ico { width: 13px; height: 13px; }
.range button .ico { width: 14px; height: 14px; }

/* ============ 15. Tampilan aplikasi native ============
   Kanvas abu muda + sidebar menyatu dengan kanvas; konten di panel terang bersudut membulat; kartu putih
   bersudut 14px; judul & angka memakai Plus Jakarta Sans, teks antarmuka memakai Inter. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/inter.woff2) format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/fonts/jakarta.woff2) format("woff2"); }

body { background: var(--bg); }
h1, h2, h3, .brand__name, .summary-item strong, .gr-card__num, .ia-tgt__nums b, .stat, .stat__value, .login-panel__title, .set-profile strong {
  font-family: var(--display); letter-spacing: -.02em;
}

/* Shell */
.sidebar { grid-template-rows: auto auto minmax(0, 1fr) auto; border-right: 0; background: var(--sidebar-bg); }
.sidebar__brand { height: 64px; border-bottom: 0; padding: 0 12px 0 18px; }
.brand { gap: 10px; }
.brand__mark { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); }
.brand__mark img { width: 17px; height: 17px; filter: invert(1); }
.brand__name { font-size: 19px; font-weight: 700; }
.sidebar__owner:empty { display: none; }
.sidebar__owner { padding: 0 12px 6px; }
.sidebar__nav { padding: 6px 12px 12px; }
.nav-group + .nav-group { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.nav-label { margin: 0 10px 6px; font-size: var(--fs-caption); font-weight: var(--fw-medium); letter-spacing: 0; text-transform: none; color: var(--nav-label); }
.nav-item { min-height: 38px; gap: 12px; padding: 0 12px; border: 1px solid transparent; border-radius: 10px; font-size: var(--fs-body); font-weight: var(--fw-medium); color: var(--muted-strong); }
.nav-item .ico { width: 18px; height: 18px; opacity: .78; }
.nav-item:hover { background: rgba(0, 0, 0, .04); }
.nav-item.is-active { background: var(--surface); border-color: var(--line); color: var(--text); font-weight: var(--fw-semibold); box-shadow: var(--shadow-card); }
.nav-item--button { width: 100%; background: none; cursor: pointer; text-align: left; font-family: inherit; }
.sidebar__footer { display: grid; gap: 2px; padding: 10px 12px 14px; border-top: 0; }
.side-user { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-card); }
.side-user:hover { border-color: var(--line-strong); }
.side-user .avatar { width: 34px; height: 34px; border-radius: 50%; background: #ffedd5; color: #9a3412; font-size: var(--fs-small); }
.side-user__text { flex: 1; min-width: 0; display: grid; }
.side-user__text strong { font-size: var(--fs-small); font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user__text small { color: var(--muted); font-size: var(--fs-caption); }
.side-user > .ico { width: 14px; height: 14px; opacity: .5; }

/* Pemilih data anggota (admin): kartu seperti pemilih toko */
.owner-pick { width: 100%; }
.owner-pick__select { width: 100%; max-width: none; height: 40px; padding: 0 30px 0 36px; border-radius: 10px; border-color: var(--line); background: var(--selected-soft); font-size: var(--fs-small); appearance: none; -webkit-appearance: none; cursor: pointer; }
.owner-pick__select:hover { border-color: var(--line-strong); }
.owner-pick__label { left: 12px; }
.owner-pick__label .ico { width: 16px; height: 16px; }
.owner-pick__text { display: none; }
.owner-pick__caret { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; pointer-events: none; opacity: .55; }

/* Panel konten */
.app-content { margin: 10px 10px 10px 0; background: var(--canvas); border: 1px solid var(--line); border-radius: 18px; }
.app-topbar { min-height: 72px; padding: 14px 32px 6px; background: transparent; border-bottom: 0; }
.app-topbar__title { flex-direction: column; align-items: flex-start; gap: 2px; }
.breadcrumb { font-size: var(--fs-caption); }
.breadcrumb:not(:empty)::after { content: none; }
.app-topbar h1 { font-size: var(--fs-page); font-weight: 700; letter-spacing: -.025em; }
.dashboard-main { padding: 12px 32px 40px; }
.section-heading h2 { font-size: 17px; font-weight: 700; }
.content-section + .content-section { margin-top: 28px; }

/* Kartu, tabel, panel */
.panel, .summary-item, .data-table-wrap, .post-mock, .facts, .plan, .acc-list, .map-table { border-radius: var(--radius-lg); }
.panel, .summary-item, .data-table-wrap { box-shadow: var(--shadow-card); }
.summary-grid { gap: 14px; }
.summary-item { padding: 16px 18px; gap: 6px; }
.summary-item strong { line-height: 1.15; font-weight: 700; }
.panel__head { min-height: 52px; padding: 0 18px; }
.panel__head h3 { font-size: var(--fs-title); font-weight: 700; }
.panel__body { padding: 14px 18px; }
.data-table th { padding: 10px 12px; background: var(--surface); color: var(--muted); font-size: var(--fs-caption); font-weight: var(--fw-medium); border-bottom: 1px solid var(--line); }
.data-table td { height: 52px; padding: 8px 12px; font-size: var(--fs-small); }
.data-table thead + tbody tr:first-child td { border-top: 0; }

/* Tombol & input */
.button { height: 36px; padding: 0 14px; border-radius: var(--radius-sm); }
.button--sm { height: 30px; padding: 0 10px; border-radius: 8px; }
.button--icon { width: 36px; }
.button--icon.button--sm { width: 30px; }
.button--icon, .button--icon.button--sm { padding: 0; }
.button--secondary, .button--danger { box-shadow: var(--shadow-card); }
input[type="text"], input[type="search"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="time"],
input[type="email"], input[type="password"], input[type="url"], select, textarea { height: 38px; border-radius: var(--radius-sm); }
textarea { height: auto; }
.range { gap: 4px; padding: 3px; border-radius: 10px; background: var(--selected-soft); }
.range button { height: 30px; border-radius: 8px; }
.range button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 2px rgba(24, 24, 27, .08); }
.badge { border-radius: 6px; }
.notice, .alert, .bulkbar, .dropzone, .choice, .preview-box, .acc-none { border-radius: var(--radius); }
.menu, .period__pop, .info-pop, .img-pop { border-radius: 12px; }
.period__preset, .menu__item { border-radius: 8px; }
.thumb, .thumb-ph, .data-table .thumb, .data-table .thumb-ph, .thumb--md { border-radius: 8px; }
.gallery__main { border-radius: var(--radius-lg); }
.toast { border-radius: 12px; box-shadow: 0 8px 24px rgba(24, 24, 27, .08); }

/* Drawer & dialog */
.drawer { top: 10px; right: 10px; bottom: 10px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.drawer__head { min-height: 64px; padding-left: 22px; }
.drawer__head h2 { font-size: 17px; font-weight: 700; }
.drawer__body { padding: 18px 22px; }
.drawer__foot { padding: 12px 22px; }
.dialog { border-radius: 16px; padding: 22px; }
.dialog h2 { font-size: 17px; font-weight: 700; }

/* Halaman masuk */
.login-panel { border-radius: 18px; padding: 28px; box-shadow: var(--shadow-card); }
.login-panel__title { font-size: 22px; font-weight: 700; }

/* Pengaturan */
.settings { max-width: 680px; display: grid; gap: 22px; }
.set-profile { display: flex; align-items: center; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-card); }
.set-profile > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.set-profile strong { font-size: 17px; font-weight: 700; }
.set-profile small { color: var(--muted); font-size: var(--fs-small); overflow-wrap: anywhere; }
.avatar--lg { width: 48px; height: 48px; border-radius: 50%; background: #ffedd5; color: #9a3412; font-size: 16px; }
.set-group { display: grid; gap: 8px; }
.set-group__title { margin: 0 4px; color: var(--muted); font-family: var(--font); font-size: var(--fs-small); font-weight: var(--fw-semibold); letter-spacing: 0; }
.set-card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-card); overflow: hidden; }
.set-row { width: 100%; min-height: 60px; display: flex; align-items: center; gap: 14px; padding: 10px 16px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.set-row + .set-row { border-top: 1px solid var(--line); }
button.set-row:hover { background: var(--surface-subtle); }
.set-row--static { cursor: default; flex-wrap: wrap; }
.set-row__ico { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--selected-soft); }
.set-row__ico .ico { width: 17px; height: 17px; opacity: .8; }
.set-row__text { flex: 1; min-width: 160px; display: grid; gap: 2px; }
.set-row__text strong { font-size: var(--fs-body); font-weight: var(--fw-semibold); }
.set-row__text small { color: var(--muted); font-size: var(--fs-small); }
.set-row__chev { width: 14px; height: 14px; opacity: .45; }
.set-row[data-act="logout"] strong { color: var(--danger); }
.segmented { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--selected-soft); }
.segmented button { height: 32px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--muted-strong); font-size: var(--fs-small); font-weight: var(--fw-medium); cursor: pointer; }
.segmented button[aria-checked="true"] { background: var(--surface); color: var(--text); font-weight: var(--fw-semibold); box-shadow: 0 1px 2px rgba(24, 24, 27, .1); }

@media (max-width: 900px) {
  .app-content { margin: 0; border: 0; border-radius: 0; }
  .sidebar { border-radius: 0 18px 18px 0; }
  .app-topbar { flex-direction: row; align-items: center; min-height: 60px; padding: 10px 16px 4px; }
  .drawer { top: 0; right: 0; bottom: 0; border-radius: 0; }
}
@media (max-width: 720px) {
  .app-topbar h1 { font-size: 19px; }
  .dashboard-main { padding-top: 8px; }
  .drawer, .drawer--wide { top: auto; right: 0; border-radius: 18px 18px 0 0; }
  .set-row--static .segmented { width: 100%; }
  .set-row--static .segmented button { flex: 1; }
}

/* ============ 16. Grafik garis lengkung (ui/js/charts.mjs) ============
   Wadah canvas berukuran tetap; Chart.js mengisi wadah. Ukuran: penuh 170px, kecil 120px, mini 48px, baris tabel 34px. */
.crv { position: relative; min-width: 0; height: 170px; }
.crv--sm { height: 120px; }
.crv--xs { height: 48px; }
.crv--row { height: 34px; width: 120px; flex: none; }
.crv > canvas { display: block; max-width: 100%; }
.crv-big { font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.crv-big .unit { margin-left: 4px; font: 600 14px var(--font); color: var(--muted); letter-spacing: 0; }
.crv-delta { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.crv-delta.up { color: var(--success); } .crv-delta.down { color: var(--danger); } .crv-delta.same { color: var(--muted); }
.crv-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
/* Kartu kecil per sumber di bawah grafik total */
.crv-src-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.crv-src { min-width: 0; display: grid; gap: 2px; padding: 10px 12px 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.crv-src__name { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-small); font-weight: var(--fw-semibold); color: var(--muted-strong); min-width: 0; }
.crv-src__n { font-family: var(--display); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.crv-src__n small { margin-left: 4px; font: 500 12px var(--font); color: var(--muted); }
@media (max-width: 520px) { .crv-big { font-size: 22px; } .crv--row { display: none; } }
.crv-src.is-best { border-color: #bfe3cb; background: #f6fcf8; }
.crv-src__name .truncate { min-width: 0; }

/* ============ 17. Gaya B · Daftar bersih (disetujui pemilik 24 Nov 2026) ============
   Acuan: preview "Ads Semua Halaman". Menu kiri ikon saja (nama muncul saat diarahkan), huruf 15px, lapang,
   tombol ikon 44/36px, filter kapsul, kotak angka (b-kpi), kotak isi (b-box), daftar rapi (b-list/b-row). */
:root { --fs-body: 15px; --fs-small: 13px; --fs-caption: 12px; --fs-page: 24px; --rail: 76px; --ink: #17171a; }
body { font-size: var(--fs-body); }

/* Menu kiri: rel ikon */
@media (min-width: 901px) {
  .app-shell { grid-template-columns: var(--rail) minmax(0, 1fr); }
  .sidebar { width: var(--rail); overflow: visible; background: #fbfbfc; border-right: 1px solid var(--line); z-index: 20; }
  .sidebar__brand { height: 72px; padding: 0; justify-content: center; }
  .brand__name { display: none; }
  .brand__mark { width: 36px; height: 36px; border-radius: 11px; }
  .sidebar__owner { display: none; }
  .sidebar__nav { padding: 4px 0 12px; overflow: visible; }
  .nav-group { justify-items: center; gap: 4px; }
  .nav-group + .nav-group { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); width: 32px; margin-left: auto; margin-right: auto; justify-items: center; }
  .nav-group + .nav-group .nav-item { margin-left: -6px; }
  .nav-label { display: none; }
  .nav-item { position: relative; width: 44px; height: 44px; min-height: 44px; padding: 0; justify-content: center; border-radius: 12px; border: 0; box-shadow: none; color: #6b6b74; }
  .nav-item > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nav-item .ico { width: 20px; height: 20px; opacity: .85; }
  .nav-item:hover { background: #f2f2f4; color: var(--text); }
  .nav-item.is-active { background: var(--ink); color: #fff; border: 0; box-shadow: none; }
  .nav-item.is-active .ico { filter: invert(1); opacity: 1; }
  .nav-item[data-tip]:hover::after, .nav-item[data-tip]:focus-visible::after {
    content: attr(data-tip); position: absolute; left: 54px; top: 50%; transform: translateY(-50%); z-index: 60;
    padding: 5px 9px; border-radius: 7px; background: var(--ink); color: #fff; font: 500 12px var(--font); white-space: nowrap; pointer-events: none;
  }
  .sidebar__footer { padding: 10px 0 16px; justify-items: center; gap: 4px; }
  .side-user { width: 40px; height: 40px; padding: 0; margin: 0 0 6px; border: 0; border-radius: 50%; background: none; box-shadow: none; justify-content: center; }
  .side-user .avatar { width: 36px; height: 36px; }
  .side-user__text, .side-user > .ico { display: none; }
  .app-content { margin: 0; border: 0; border-radius: 0; background: var(--surface); }
  .app-topbar { min-height: 76px; padding: 18px 32px 6px; }
  .dashboard-main { padding: 14px 32px 48px; }
  .owner-pick { width: auto; }
  .owner-pick__select { width: 220px; height: 44px; border-radius: 12px; background: var(--surface); border-color: var(--line-2, #e2e2e6); }
}
.app-topbar h1 { font-size: var(--fs-page); }

/* Tombol: utama gelap, ikon 44/36 */
.button { height: 44px; padding: 0 18px; border-radius: 12px; font-size: 14px; }
.button--sm { height: 36px; padding: 0 12px; border-radius: 10px; font-size: 13px; }
.button--icon { width: 44px; padding: 0; }
.button--icon.button--sm { width: 36px; padding: 0; }
.button--icon .ico { width: 20px; height: 20px; }
.button--icon.button--sm .ico { width: 18px; height: 18px; }
.button--primary { background: var(--ink); color: #fff; }
.button--primary:hover { background: #2d2d33; }
.button--secondary { border-color: #e2e2e6; box-shadow: none; }
input[type="text"], input[type="search"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="time"],
input[type="email"], input[type="password"], input[type="url"], select { height: 44px; border-radius: 12px; font-size: 15px; }
textarea { border-radius: 12px; font-size: 15px; }
/* Filter: kapsul terpisah, yang aktif gelap */
.range { gap: 6px; padding: 0; background: none; border-radius: 0; }
.range button { height: 36px; padding: 0 14px; border: 1px solid #e2e2e6; border-radius: 999px; background: var(--surface); color: var(--muted-strong); font-size: 14px; box-shadow: none; }
.range button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: none; }
.range button[aria-pressed="true"] .n { color: #d4d4d8; }
.range button .n { font-size: 13px; }

/* Kotak angka */
.b-kpis { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 14px; }
.b-kpi { min-width: 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); display: grid; gap: 6px; align-content: start; }
.b-kpi__label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.b-kpi__label .ico { width: 18px; height: 18px; opacity: .7; }
.b-kpi__value { font-family: var(--display); font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.b-kpi__sub { color: var(--muted); font-size: 13px; }
.b-kpi__sub.up { color: var(--success); font-weight: 600; } .b-kpi__sub.down { color: var(--danger); font-weight: 600; }
/* Kotak isi */
.b-box { min-width: 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; }
.b-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.b-head h2, .b-head h3 { margin: 0; font-family: var(--font); font-size: 16px; font-weight: 600; letter-spacing: 0; display: flex; align-items: center; gap: 8px; }
.b-head .b-meta { color: var(--muted); font-size: 14px; }
.b-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* Daftar rapi: kolom diatur per halaman lewat --b-cols */
.b-list { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); }
.b-lhead, .b-row { display: grid; grid-template-columns: var(--b-cols, 52px minmax(0, 1fr) auto); align-items: center; gap: 16px; padding: 12px 18px; }
.b-lhead { padding-block: 10px; background: #fbfbfc; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 500; }
.b-row { border-top: 1px solid var(--line); }
.b-lhead + .b-row, .b-row:first-child { border-top: 0; }
.b-row.is-link { cursor: pointer; }
.b-row.is-link:hover { background: #fafafb; }
.b-row .b-r, .b-lhead .b-r { text-align: right; font-variant-numeric: tabular-nums; }
.b-t { min-width: 0; display: grid; gap: 2px; }
.b-t strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-t small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-acts { display: flex; gap: 6px; justify-content: flex-end; }
.b-when { display: inline-flex; align-items: center; gap: 6px; color: var(--muted-strong); font-size: 14px; font-variant-numeric: tabular-nums; }
.b-when .ico { width: 16px; height: 16px; }
.b-thumb { width: 52px; height: 52px; border-radius: 10px; overflow: hidden; flex: none; }
.b-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.b-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.b-grid21 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; }
.badge { border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 600; }
@media (max-width: 1100px) { .b-kpis { --cols: 2 !important; } }
@media (max-width: 900px) { .b-grid2, .b-grid21 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .b-lhead .b-hm, .b-row .b-hm { display: none !important; }
  .b-lhead, .b-row { display: flex; gap: 12px; }
  .b-lhead > *, .b-row > * { min-width: 0; }
  .b-row > .b-t, .b-lhead > :nth-child(2) { flex: 1 1 auto; }
  .b-row > .b-acts, .b-row > .button, .b-row > .badge, .b-row > .b-thumb { flex: none; }
  .b-t strong { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; }
  .b-kpi__value { font-size: 22px; }
  .b-kpi { padding: 14px 16px; }
}

/* ---- 17b. Perbaikan QC UI gaya B ---- */
:root { --primary: var(--ink); --primary-hover: #2d2d33; --accent: var(--ink); --accent-soft: #f4f4f5; --bar-strong: var(--ink); }
@media (min-width: 901px) {
  .sidebar { grid-template-rows: 72px minmax(0, 1fr) auto; }
  .sidebar__footer { align-content: end; }
  .breadcrumb { display: none; }
}
@media (max-width: 900px) {
  .nav-item.is-active { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: none; }
  .nav-item.is-active .ico { filter: invert(1); opacity: 1; }
}
@media (max-width: 720px) {
  .dashboard-main { padding: 8px max(16px, env(safe-area-inset-right, 0px)) 32px max(16px, env(safe-area-inset-left, 0px)); }
  .app-topbar__title { flex: 1 1 auto; min-width: 0; }
  .owner-pick { width: auto; flex: 0 1 150px; }
  .owner-pick__select { width: 100%; max-width: 150px; height: 44px; border-radius: 12px; background: var(--surface); border-color: #e2e2e6; }
}
.drawer__head .icon-button, .sidebar__close { width: 36px; height: 36px; border: 1px solid #e2e2e6; border-radius: 10px; background: var(--surface); }
.drawer__head .icon-button .ico { width: 18px; height: 18px; }
.menu-toggle { width: 44px; height: 44px; border-radius: 12px; border-color: #e2e2e6; }
.search .ico { left: 14px; width: 18px; height: 18px; opacity: .6; }
.search input { padding-left: 42px; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23, 23, 26, .14); }
:focus-visible { outline-color: var(--ink); }
.drawer .label { font-size: 13px; font-weight: 600; color: var(--muted-strong); }
/* Saklar seragam (pakai di semua halaman): <label class="b-switch"><input type="checkbox"> Teks</label> */
.b-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--muted-strong); }
.b-switch input { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; margin: 0; border-radius: 999px; background: #d4d4d8; position: relative; cursor: pointer; transition: background .15s; flex: none; }
.b-switch input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .15s; }
.b-switch input:checked { background: var(--success); }
.b-switch input:checked::after { left: 21px; }
.b-switch input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* Pemilih anggota di HP: ikon saja (pilihan tetap lewat <select>) */
@media (max-width: 640px) {
  .owner-pick { flex: none; width: 44px; }
  .owner-pick__select { width: 44px; max-width: 44px; padding: 0; color: transparent; text-indent: -999px; }
  .owner-pick__label { left: 13px; }
  .owner-pick__caret { display: none; }
}
/* Tombol ⓘ: area sentuh 36px tanpa mengubah ukuran tampilan */
.info-tip::after { inset: -9px; }
