/* =============================================================
   BEWARKOP design system
   Font: Montserrat (lokal) -> fallback sistem
   Warna: espresso, caramel, beige, cream
   ============================================================= */

@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/montserrat/montserrat-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/montserrat/montserrat-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/montserrat/montserrat-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/montserrat/montserrat-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/montserrat/montserrat-latin-800-normal.woff2") format("woff2"); }

:root {
  --espresso: #3b2416;
  --espresso-strong: #2a190f;
  --espresso-soft: #5a3a26;
  --caramel: #c68b59;
  --caramel-strong: #a86f3f;
  --beige: #e9d8c3;
  --cream: #fbf6ee;

  --bg: var(--cream);
  --surface: #ffffff;
  --surface-2: #f6eee3;
  --text: #2b1d14;
  --muted: #7a6555;
  --border: #eadfd2;
  --border-strong: #d9c7b3;
  --primary: var(--espresso);
  --primary-hover: var(--espresso-strong);
  --on-primary: #fffaf3;
  --accent: var(--caramel);
  --focus: #c68b59;

  --success: #2f7d4f; --success-bg: #e6f3eb;
  --warning: #9a6512; --warning-bg: #fbf0dc;
  --danger: #b3261e;  --danger-bg: #fbe7e5;
  --info: #2b6cb0;    --info-bg: #e5eef8;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(59, 36, 22, .06);
  --shadow: 0 4px 16px rgba(59, 36, 22, .08);
  --shadow-lg: 0 12px 36px rgba(59, 36, 22, .16);

  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sidebar-w: 248px;
  --topbar-h: 64px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #15100c;
  --surface: #1f1813;
  --surface-2: #2a211a;
  --text: #f3eae0;
  --muted: #b8a595;
  --border: #3a2c22;
  --border-strong: #4d3b2e;
  --primary: #d49a68;
  --primary-hover: #e2ae80;
  --on-primary: #1b120c;
  --focus: #e2ae80;
  --success: #6cc794; --success-bg: #183324;
  --warning: #e8b25c; --warning-bg: #3a2a12;
  --danger: #f08a82;  --danger-bg: #3d1714;
  --info: #8ab8ea;    --info-bg: #15283d;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 4px 16px rgba(0, 0, 0, .35);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55;
  color: var(--text); background: var(--bg); overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; font-weight: 700; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 1rem; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-variant-numeric: tabular-nums; }
.hidden, [hidden] { display: none !important; }
.mt { margin-top: 1rem; }
.meta-list { display: grid; grid-template-columns: max-content 1fr; gap: .6rem 1rem; margin: 0; font-size: .92rem; }
.meta-list dt { color: var(--muted); }
.meta-list dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.filter-bar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.filter-bar .field { margin: 0; min-width: 200px; flex: 1; }

.icon { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.icon-sm { width: 16px; height: 16px; flex: none; }
.icon-lg { width: 28px; height: 28px; flex: none; }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .6rem 1.1rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .95rem;
  cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, color .15s, transform .05s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.95); }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: .35rem .75rem; font-size: .85rem; }
.btn-icon { min-height: 44px; width: 44px; padding: 0; }
.btn[disabled], .btn.is-loading { opacity: .7; cursor: not-allowed; }
.btn .spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Form ---------- */
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.field label { font-weight: 600; font-size: .9rem; }
.field .hint { font-size: .8rem; color: var(--muted); }
.field .error { font-size: .82rem; color: var(--danger); font-weight: 500; }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: .6rem .8rem; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--caramel); box-shadow: 0 0 0 3px rgba(198, 139, 89, .25); }
.field.has-error .input, .field.has-error .select { border-color: var(--danger); }
.input-group { position: relative; display: flex; }
.input-group .input { padding-right: 3rem; }
.input-group .input-addon { position: absolute; right: 2px; top: 2px; bottom: 2px; width: 42px; display: grid; place-items: center; background: transparent; border: 0; color: var(--muted); cursor: pointer; border-radius: var(--radius-sm); }
.checkbox { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--espresso); }
.form-row { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: flex-end; margin-top: .5rem; }

/* ---------- Kartu, badge, alert ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-body { padding: 1.25rem; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.card-header h2, .card-header h3 { margin: 0; }
.stat { display: flex; gap: 1rem; align-items: center; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--primary); flex: none; }
.stat-label { font-size: .82rem; color: var(--muted); font-weight: 500; }
.stat-value { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-link { color: var(--text); transition: border-color .15s, box-shadow .15s; }
.stat-link:hover { text-decoration: none; border-color: var(--caramel); box-shadow: var(--shadow); }
.stat-value.money { font-size: 1.2rem; white-space: nowrap; }
.stat-value.small { font-size: 1rem; line-height: 1.35; padding-top: .2rem; }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--text); white-space: nowrap; }
.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(--info); }
.badge-brand { background: var(--espresso); color: #fffaf3; }

.alert { display: flex; gap: .75rem; align-items: flex-start; padding: .85rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .92rem; border: 1px solid transparent; }
.alert .icon { margin-top: 2px; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.alert-danger { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-info { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }

/* ---------- Tabel responsif ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: .75rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: .8rem 1rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
@media (max-width: 720px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tfoot, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { border-bottom: 1px solid var(--border); padding: .5rem 0; }
  .table-stack td { border: 0; padding: .3rem 1rem; display: flex; justify-content: space-between; gap: 1rem; }
  .table-stack td::before { content: attr(data-label); font-weight: 600; color: var(--muted); font-size: .8rem; }
}

.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem 1.25rem; border-top: 1px solid var(--border); }
.pagination-links { display: flex; gap: .4rem; }

.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .icon-lg { color: var(--caramel); margin-bottom: .5rem; }
.empty h3 { color: var(--text); }

/* ---------- Layout aplikasi ---------- */
.app { min-height: 100vh; display: flex; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--espresso); color: #f4e9dc;
  display: flex; flex-direction: column; z-index: 40; transform: translateX(-100%); transition: transform .2s ease;
}
[data-theme="dark"] .sidebar { background: #120d0a; border-right: 1px solid var(--border); }
.sidebar.is-open { transform: none; box-shadow: var(--shadow-lg); }
.sidebar-brand { display: flex; align-items: center; gap: .65rem; height: var(--topbar-h); padding: 0 1.25rem; font-weight: 800; letter-spacing: .04em; font-size: 1.15rem; color: #fff; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--caramel); color: var(--espresso); flex: none; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .75rem; }
.nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: rgba(244, 233, 220, .55); padding: .9rem .75rem .35rem; }
.nav-link { display: flex; align-items: center; gap: .75rem; min-height: 44px; padding: .55rem .75rem; border-radius: var(--radius-sm); color: rgba(244, 233, 220, .85); font-weight: 500; }
.nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.nav-link.is-active { background: var(--caramel); color: var(--espresso-strong); font-weight: 700; }
.nav-button { width: 100%; border: 0; background: transparent; font: inherit; cursor: pointer; text-align: left; }
.sidebar-foot {padding: .75rem; border-top: 1px solid rgba(255, 255, 255, .08); }
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(20, 12, 8, .45); z-index: 35; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: var(--topbar-h); display: flex; align-items: center; gap: .75rem; padding: 0 1rem; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.topbar-title { font-weight: 700; font-size: 1rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: .5rem; }
.branch-select { min-height: 40px; max-width: 200px; }
.user-chip { display: flex; align-items: center; gap: .5rem; padding: .25rem .5rem .25rem .25rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--beige); color: var(--espresso); font-weight: 700; font-size: .85rem; flex: none; }
[data-theme="dark"] .avatar { background: var(--surface-2); color: var(--primary); }
.user-chip-name { font-size: .85rem; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { padding: 1.25rem 1rem 6rem; width: 100%; max-width: 1280px; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-head p { margin: .25rem 0 0; color: var(--muted); }
.grid { display: grid; gap: 1rem; }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid-2 { grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 2fr 1fr; } .grid-halves { grid-template-columns: 1fr 1fr; } }

.offline-banner { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 60; display: flex; gap: .5rem; align-items: center; padding: .6rem 1rem; border-radius: 999px; background: var(--danger); color: #fff; font-weight: 600; font-size: .88rem; box-shadow: var(--shadow-lg); }

@media (min-width: 1024px) {
  .sidebar { transform: none; }
  .main { margin-left: var(--sidebar-w); }
  .menu-toggle, .sidebar-backdrop { display: none !important; }
  .content { padding: 1.75rem 2rem 3rem; }
  .topbar { padding: 0 2rem; }
}
@media (max-width: 560px) {
  .user-chip-name, .branch-label { display: none; }
  .branch-select { max-width: 130px; }
}

/* ---------- Toast & modal ---------- */
.toast-stack { position: fixed; top: 1rem; right: 1rem; left: 1rem; z-index: 80; display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: .65rem; align-items: flex-start; max-width: 420px; width: 100%; padding: .85rem 1rem; border-radius: var(--radius); background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-left: 4px solid var(--info); animation: toast-in .2s ease; font-size: .92rem; }
.toast-success { border-left-color: var(--success); } .toast-success .icon { color: var(--success); }
.toast-error { border-left-color: var(--danger); } .toast-error .icon { color: var(--danger); }
.toast-warning { border-left-color: var(--warning); } .toast-warning .icon { color: var(--warning); }
.toast-close { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 1rem; background: rgba(20, 12, 8, .5); }
.modal-dialog { width: 100%; max-width: 440px; max-height: calc(100vh - 2rem); overflow: auto; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 1.5rem; animation: toast-in .15s ease; }
.modal-actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: flex-end; margin-top: 1.25rem; }

/* ---------- Halaman auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.auth-brand { display: none; position: relative; overflow: hidden; background: var(--espresso); color: #f7ecdf; padding: 3rem; }
.auth-brand::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%; border: 48px solid rgba(198, 139, 89, .18); }
.auth-brand-logo { padding: 0; height: auto; }
.auth-brand h1 { font-size: 2.2rem; color: #fff; margin-top: 2.5rem; max-width: 18ch; }
.auth-brand p { color: rgba(247, 236, 223, .8); max-width: 42ch; }
.auth-points { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: .85rem; }
.auth-points li { display: flex; gap: .65rem; align-items: center; }
.auth-points .icon { color: var(--caramel); }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .brand-inline { display: flex; align-items: center; gap: .6rem; font-weight: 800; letter-spacing: .04em; font-size: 1.2rem; margin-bottom: 2rem; color: var(--text); }
.auth-card h2 { font-size: 1.5rem; }
.auth-foot { margin-top: 1.5rem; font-size: .88rem; color: var(--muted); text-align: center; }
@media (min-width: 960px) {
  .auth { grid-template-columns: 1.05fr 1fr; }
  .auth-brand { display: flex; flex-direction: column; }
  .auth-card .brand-inline { display: none; }
}

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.demo-roles { display: grid; gap: .75rem; margin-top: 1rem; }
.demo-role { width: 100%; display: flex; align-items: center; gap: 1rem; text-align: left; padding: 1rem; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); font: inherit; color: var(--text); cursor: pointer; min-height: 72px; }
.demo-role:hover { border-color: var(--caramel); box-shadow: var(--shadow); }
.demo-arrow { margin-left: auto; color: var(--caramel-strong); }

/* ---------- Banner langganan & demo ---------- */
.notice-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .7rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .9rem; border: 1px solid transparent; }
.notice-bar .notice-text { flex: 1; min-width: 200px; display: flex; gap: .5rem; align-items: flex-start; }
.notice-bar .btn { min-height: 36px; }
.notice-info { background: var(--info-bg); color: var(--info); }
.notice-warning { background: var(--warning-bg); color: var(--warning); }
.notice-danger { background: var(--danger-bg); color: var(--danger); }
.notice-brand { background: var(--beige); color: var(--espresso); }
[data-theme="dark"] .notice-brand { background: var(--surface-2); color: var(--primary); }

/* ---------- Langganan ---------- */
.usage { display: grid; gap: .9rem; }
.usage-row { display: grid; gap: .35rem; }
.usage-head { display: flex; justify-content: space-between; font-size: .88rem; }
.meter { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border: 0; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
.meter::-webkit-progress-value { background: var(--caramel); border-radius: 999px; }
.meter::-moz-progress-bar { background: var(--caramel); border-radius: 999px; }
.meter.is-full::-webkit-progress-value { background: var(--danger); }
.meter.is-full::-moz-progress-bar { background: var(--danger); }
.plan-options { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.plan-option { display: flex; flex-direction: column; gap: .5rem; padding: 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.plan-option.is-current { border: 2px solid var(--caramel); }
.plan-option .price-line { font-size: 1.3rem; font-weight: 800; }
.plan-option ul { list-style: none; padding: 0; margin: 0; font-size: .86rem; color: var(--muted); display: grid; gap: .25rem; flex: 1; align-content: start; }
.plan-option form { display: grid; gap: .5rem; }
.inline-form { display: inline; }
.admin-action { display: inline-block; margin: 0 .35rem .35rem 0; vertical-align: top; }
.admin-action summary { list-style: none; }
.admin-action summary::-webkit-details-marker { display: none; }
.admin-action[open] { display: block; max-width: 320px; }
.invoice-total { font-size: 1.6rem; font-weight: 800; white-space: nowrap; }
.svg-chart { width: 100%; height: auto; display: block; }
.svg-chart .bar { fill: var(--caramel); }
.svg-chart .grid { stroke: var(--border); }
.svg-chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.svg-chart .value { fill: var(--text); font-weight: 600; }

/* ---------- Installer & halaman error ---------- */
.installer { max-width: 760px; margin: 0 auto; padding: 2rem 1rem 4rem; }
.auth-card-brand { display: flex; align-items: center; gap: .6rem; font-size: 1.15rem; margin-bottom: 1.5rem; letter-spacing: .03em; }
code { font-size: .88em; background: var(--surface-2); padding: .1rem .35rem; border-radius: 4px; }
.steps {display: flex; gap: .5rem; flex-wrap: wrap; margin: 1rem 0 1.5rem; padding: 0; list-style: none; }
.steps li { display: flex; align-items: center; gap: .4rem; font-size: .82rem; font-weight: 600; padding: .35rem .75rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.steps li.is-done { background: var(--success-bg); color: var(--success); }
.steps li.is-current { background: var(--espresso); color: #fffaf3; }
.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li { display: flex; gap: .75rem; align-items: flex-start; padding: .65rem 0; border-bottom: 1px solid var(--border); }
.check-list li:last-child { border-bottom: 0; }
.check-ok { color: var(--success); } .check-fail { color: var(--danger); } .check-warn { color: var(--warning); }
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; text-align: center; }
.error-code { font-size: 4.5rem; font-weight: 800; color: var(--caramel); line-height: 1; }

/* =============================================================
   FASE 4: operasional (form, daftar, POS, pesanan, shift)
   ============================================================= */
.req { color: var(--danger); }
.hint.block, .block { display: block; }
.field .hint.block { margin-top: .1rem; }
.form-narrow { max-width: 760px; }
.align-start { align-items: start; }
.recipe-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.stack { display: grid; gap: 1rem; align-content: start; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.split { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .split { grid-template-columns: 320px 1fr; } }
.check-grid { display: grid; gap: .6rem 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: .5rem; }
.check-grid .checkbox, .checkbox-top { align-items: flex-start; }
.checkbox input { margin-top: 2px; }
fieldset { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
fieldset[disabled] .btn { display: none; }
legend { padding: 0; margin-bottom: .5rem; }
.h3 { font-size: 1.05rem; } .h4 { font-size: .95rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.table th.num { text-align: right; }
.table td.actions { white-space: nowrap; text-align: right; }
.text-danger { color: var(--danger); } .text-warning { color: var(--warning); } .text-success { color: var(--success); }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain > li { padding: .55rem 0; border-bottom: 1px solid var(--border); }
.list-plain > li:last-child { border-bottom: 0; }
.row-between { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.row-end { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; white-space: nowrap; }
.list-plain.card-body { padding: .25rem 1.25rem .75rem; }
.timeline.card-body { margin: 1.25rem 1.25rem 1.25rem 1.75rem; padding: 0 0 0 1rem; }
.rank.card-body { padding: 1rem 1.25rem 1rem 2.5rem; }
.input-sm { min-height: 36px; padding: .35rem .6rem; max-width: 140px; margin-left: auto; }
.input-lg { min-height: 54px; font-size: 1.25rem; font-weight: 700; }
.btn-lg { min-height: 52px; font-size: 1.02rem; padding: .7rem 1.4rem; }
.total-line { text-align: right; font-size: 1.05rem; }
.badge-btn { border: 0; cursor: pointer; font: inherit; font-size: .78rem; font-weight: 600; padding: .2rem .7rem; border-radius: 999px; min-height: 30px; }
.badge-btn.is-on { background: var(--success-bg); color: var(--success); }
.badge-btn.is-off { background: var(--warning-bg); color: var(--warning); }
.badge-btn:hover { filter: brightness(.96); }

/* Repeater baris */
.repeater-row { display: grid; gap: .5rem .75rem; grid-template-columns: 1fr 1fr auto; align-items: end; padding: .6rem 0; border-bottom: 1px dashed var(--border); }
.repeater-row .field { margin: 0; }
.repeater-row-4 { grid-template-columns: 2fr 1fr 1fr 1fr auto; }
.repeater-row:has(> .field:nth-of-type(3)):not(.repeater-row-4) { grid-template-columns: 2fr 1fr 1fr auto; }
[data-repeater-add] { margin-top: .75rem; }
@media (max-width: 640px) {
  .repeater-row, .repeater-row-4, .repeater-row:has(> .field:nth-of-type(3)):not(.repeater-row-4) { grid-template-columns: 1fr 1fr; }
  .repeater-row > .field:first-of-type { grid-column: 1 / -1; }
}

/* Role & izin */
.list-nav { display: grid; padding: .5rem; border-bottom: 1px solid var(--border); }
.list-nav-item { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .6rem .75rem; border-radius: var(--radius-sm); color: var(--text); font-weight: 500; }
.list-nav-item:hover { background: var(--surface-2); text-decoration: none; }
.list-nav-item.is-active { background: var(--beige); color: var(--espresso-strong); font-weight: 700; }
[data-theme="dark"] .list-nav-item.is-active { background: var(--surface-2); color: var(--primary); }
.perm-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.perm-group { border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; display: grid; gap: .5rem; align-content: start; }
.perm-group legend { font-weight: 700; padding: 0 .35rem; }

/* Daftar ringkas & totals */
.totals { display: grid; grid-template-columns: 1fr auto; gap: .4rem 1rem; margin: 0; font-size: .92rem; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.totals .grand { color: var(--text); font-weight: 800; font-size: 1.1rem; padding-top: .4rem; border-top: 1px solid var(--border); }
.rank { margin: 0; padding-left: 1.4rem; display: grid; gap: .5rem; }
.rank li { padding-left: .25rem; }
.rank li span:first-child { font-weight: 600; margin-right: .5rem; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 2px solid var(--border); display: grid; gap: .9rem; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: calc(-1rem - 6px); top: .35rem; width: 10px; height: 10px; border-radius: 50%; background: var(--caramel); }
.status-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }

/* Meja */
.table-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); padding: 1rem; }
.table-tile { display: grid; gap: .15rem; padding: .9rem; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); }
.table-tile strong { font-size: 1.1rem; }
.table-tile.is-busy { border-color: var(--caramel); background: color-mix(in srgb, var(--caramel) 12%, var(--surface)); }
.table-tile.is-off { opacity: .55; }
.tile-actions { display: flex; gap: .25rem; margin-top: .35rem; }

/* ---------- POS ---------- */
.pos { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1100px) { .pos { grid-template-columns: minmax(0, 1fr) 380px; } }
.pos-toolbar { display: grid; gap: .75rem; margin-bottom: 1rem; }
.pos-search .icon { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.pos-search .input { padding-left: 2.6rem; padding-right: .8rem; }
.chips { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: thin; }
.chip { flex: none; min-height: 40px; padding: .4rem 1rem; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: .88rem; cursor: pointer; }
.chip.is-active, .chip:hover { background: var(--espresso); color: #fffaf3; border-color: var(--espresso); }
[data-theme="dark"] .chip.is-active { background: var(--primary); color: var(--on-primary); }
.pos-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pos-item { position: relative; display: grid; gap: .35rem; align-content: start; text-align: left; padding: .75rem; min-height: 150px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); font: inherit; color: var(--text); cursor: pointer; transition: border-color .12s, transform .06s, box-shadow .12s; }
.pos-item:hover { border-color: var(--caramel); box-shadow: var(--shadow); }
.pos-item:active { transform: scale(.98); }
.pos-item-art { display: grid; place-items: center; height: 64px; border-radius: var(--radius-sm); font-weight: 800; font-size: 1.3rem; letter-spacing: .04em; color: var(--espresso); }
.tone-0 { background: #f1dfc9; } .tone-1 { background: #e8d2b8; } .tone-2 { background: #dfe7d4; } .tone-3 { background: #f3d9cf; } .tone-4 { background: #e5dcef; } .tone-5 { background: #d9e8ec; }
[data-theme="dark"] .pos-item-art { filter: brightness(.55) saturate(1.2); color: #fff; }
.pos-item-name { font-weight: 700; font-size: .92rem; line-height: 1.3; }
.pos-item-price { font-weight: 600; color: var(--caramel-strong); font-size: .88rem; }
[data-theme="dark"] .pos-item-price { color: var(--primary); }
.pos-item.is-soldout { opacity: .55; cursor: not-allowed; }
.pos-item-flag { position: absolute; top: .55rem; right: .55rem; background: var(--danger); color: #fff; font-size: .7rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; }
.pos-loading { grid-column: 1 / -1; display: flex; gap: .5rem; align-items: center; justify-content: center; padding: 3rem; color: var(--muted); }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: middle; }
.pos-cart { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 1rem; display: grid; gap: .75rem; }
@media (min-width: 1100px) { .pos-cart { position: sticky; top: calc(var(--topbar-h) + 1rem); max-height: calc(100vh - var(--topbar-h) - 2rem); overflow: auto; } }
.pos-cart-head { display: flex; align-items: center; gap: .5rem; }
.pos-cart-head h2 { margin: 0; flex: 1; }
.pos-cart-close { display: none; }
.segmented { display: flex; gap: .25rem; padding: .25rem; border-radius: var(--radius-sm); background: var(--surface-2); flex-wrap: wrap; }
.seg, .seg-radio span { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 40px; padding: .35rem .6rem; border: 0; border-radius: 6px; background: transparent; font: inherit; font-weight: 600; font-size: .86rem; color: var(--muted); cursor: pointer; }
.seg-radio { flex: 1; display: flex; }
.seg-radio input { position: absolute; opacity: 0; pointer-events: none; }
.seg.is-active, .seg-radio input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg-radio input:focus-visible + span { outline: 3px solid var(--focus); }
.pos-meta .field { margin-bottom: 0; }
.pos-lines { list-style: none; margin: 0; padding: 0; display: grid; }
.pos-line { display: grid; grid-template-columns: 1fr auto; gap: .25rem .75rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.pos-line-main { display: grid; min-width: 0; grid-column: 1 / -1; }
.pos-line-total { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.pos-empty { text-align: center; color: var(--muted); padding: 1.5rem 0; }
.pos-empty .icon-lg { color: var(--caramel); }
.qty-stepper { display: inline-flex; align-items: center; gap: .25rem; }
.qty-stepper .input { width: 80px; text-align: center; }
.qty-sm .btn-icon { min-height: 36px; width: 36px; }
.qty-val { min-width: 2ch; text-align: center; font-weight: 700; }
.pos-totals { display: grid; gap: .3rem; }
.pos-total-row { display: flex; justify-content: space-between; font-size: .92rem; font-variant-numeric: tabular-nums; }
.pos-total-row.is-grand { font-size: 1.25rem; font-weight: 800; padding-top: .4rem; border-top: 1px solid var(--border); }
.pos-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.pos-actions .pos-pay { grid-column: 1 / -1; }
.pos-actions .is-on { border-color: var(--caramel); background: color-mix(in srgb, var(--caramel) 15%, var(--surface)); }
.pos-cart-bar { display: none; }
.pos-gate { max-width: 520px; margin: 2rem auto; text-align: center; display: grid; justify-items: center; gap: .5rem; }
.pos-gate .icon-lg { color: var(--caramel); width: 40px; height: 40px; }
@media (max-width: 1099px) {
  .pos-cart { position: fixed; inset: auto 0 0 0; z-index: 70; max-height: 88vh; overflow: auto; border-radius: var(--radius-lg) var(--radius-lg) 0 0; transform: translateY(105%); transition: transform .2s ease; }
  .pos-cart-open .pos-cart { transform: none; }
  .pos-cart-close { display: inline-flex; }
  .pos-cart-bar:not([hidden]) { position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 65; display: flex; justify-content: space-between; align-items: center; min-height: 56px; padding: .75rem 1.1rem; border: 0; border-radius: var(--radius); background: var(--espresso); color: #fffaf3; font: inherit; font-weight: 700; box-shadow: var(--shadow-lg); cursor: pointer; }
  [data-theme="dark"] .pos-cart-bar { background: var(--primary); color: var(--on-primary); }
  .pos-cart-bar span { display: inline-flex; align-items: center; gap: .5rem; }
}
.modal-wide { max-width: 560px; }
.option-grid { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.option-card { position: relative; display: flex; cursor: pointer; }
.option-card input { position: absolute; opacity: 0; pointer-events: none; }
.option-card span { flex: 1; display: grid; gap: .1rem; min-height: 48px; padding: .55rem .75rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-weight: 600; font-size: .9rem; }
.option-card small { font-weight: 500; color: var(--muted); }
.option-card input:checked + span { border-color: var(--espresso); background: color-mix(in srgb, var(--caramel) 18%, var(--surface)); box-shadow: inset 0 0 0 1px var(--espresso); }
[data-theme="dark"] .option-card input:checked + span { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.option-card input:focus-visible + span { outline: 3px solid var(--focus); }
.pay-total { font-size: 2rem; font-weight: 800; margin: .25rem 0 1rem; font-variant-numeric: tabular-nums; }
.pay-change { font-size: 1.05rem; margin: .75rem 0 0; }
.pos-success { text-align: center; display: grid; justify-items: center; gap: .25rem; }
.pos-success > .icon { width: 48px; height: 48px; color: var(--success); }
.queue-no { font-size: 3.2rem; font-weight: 800; letter-spacing: .04em; margin: 0; line-height: 1.1; }
.modal .error { color: var(--danger); font-weight: 500; font-size: .9rem; }

/* ---------- FASE 5: layar produksi & pengelolaan layar ---------- */
a.seg { text-decoration: none; }
.kds { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .kds { grid-template-columns: repeat(3, 1fr); } }
.kds-col { background: var(--surface-2); border-radius: var(--radius-lg); padding: .9rem; min-height: 50vh; }
.kds-col h2 { display: flex; align-items: center; gap: .5rem; font-size: 1.05rem; margin: 0 0 .75rem; }
.kds-col h2 .badge { margin-left: auto; }
.kds-list { display: grid; gap: .75rem; }
.kds-card { background: var(--surface); border: 1px solid var(--border); border-left: 6px solid var(--caramel); border-radius: var(--radius); padding: .85rem; display: grid; gap: .5rem; box-shadow: var(--shadow-sm); }
.kds-card.is-late { border-left-color: var(--danger); }
.kds-card header { display: flex; justify-content: space-between; align-items: center; }
.kds-no { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.kds-age { display: inline-flex; gap: .25rem; align-items: center; color: var(--muted); font-size: .85rem; }
.kds-card.is-late .kds-age { color: var(--danger); font-weight: 700; }
.kds-meta { margin: 0; font-size: .85rem; color: var(--muted); }
.kds-items { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; font-size: 1rem; }
.kds-items small { display: block; color: var(--muted); font-size: .82rem; padding-left: 1.6rem; }
.kds-items em { color: var(--caramel-strong); font-style: normal; font-weight: 600; }
.kds-note { color: var(--warning) !important; font-weight: 600; margin: 0; }
.kds-empty { text-align: center; color: var(--muted); padding: 2rem 0; margin: 0; }
.kds-conn { display: flex; gap: .4rem; align-items: center; color: var(--danger); font-weight: 600; }
.display-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.display-card.is-off { opacity: .7; }
.qr-box { width: 96px; height: 96px; flex: none; background: #fff; border-radius: 8px; padding: 2px; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.form-inline-card { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.form-inline-card .field { margin: 0; flex: 1; min-width: 220px; }
details > summary { list-style: none; cursor: pointer; display: inline-flex; }
details > summary::-webkit-details-marker { display: none; }
.receipt-qr { width: 120px; height: 120px; margin: 4px auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .sidebar, .topbar, .toast-stack, .offline-banner, .form-actions, .btn, .notice-bar, .no-print, .alert-dismiss { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0 !important; max-width: none !important; }
  body { background: #fff !important; color: #000 !important; font-size: 11px; }
  .card { box-shadow: none !important; border: 1px solid #ccc !important; break-inside: avoid; }
  .report-table th, .report-table td { padding: .25rem .4rem !important; font-size: 10px; }
  .table-stack thead { display: table-header-group !important; }
  .table-stack tr { display: table-row !important; }
  .table-stack td { display: table-cell !important; }
  .table-stack td::before { display: none !important; }
  .print-only { display: block !important; }
  .report-chart svg { max-height: 180px; }
  details.report-definition > summary { display: none; }
  a[href]::after { content: none !important; }
}
.print-only { display: none; }

/* ===== FASE 6: unggahan, QRIS, verifikasi pembayaran ===== */
.upload-preview { display: flex; justify-content: center; padding: .75rem; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); }
.upload-preview img { max-width: 100%; max-height: 260px; object-fit: contain; border-radius: 6px; background: #fff; }
.upload-preview-sm img { max-height: 96px; }
.upload-inline { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.upload-inline .upload-preview { flex: none; width: 120px; height: 120px; padding: .4rem; }
.upload-inline .upload-preview img { max-height: 100%; }
.copy-row { display: flex; gap: .5rem; }
.copy-row .input { flex: 1; min-width: 0; font-size: .82rem; }
.qris-pay { display: grid; gap: .75rem; justify-items: center; text-align: center; padding: 1rem; border-radius: var(--radius-sm); background: var(--surface-2); }
.qris-img { width: 100%; max-width: 260px; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); background: #fff; padding: .5rem; }
.qris-amount { margin: 0; font-size: 1.5rem; font-weight: 800; color: var(--espresso); }
[data-theme="dark"] .qris-amount { color: var(--text); }
.qris-pay p { margin: 0; max-width: 46ch; }
.proof-list { display: grid; }
.proof-item { display: grid; grid-template-columns: 1fr; gap: 1rem; padding: 1rem 1.25rem; border-top: 1px solid var(--border); }
.proof-thumb { display: block; justify-self: start; width: 140px; height: 180px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.proof-thumb img { width: 100%; height: 100%; object-fit: cover; }
.proof-head { display: flex; gap: .75rem; align-items: baseline; flex-wrap: wrap; margin-bottom: .5rem; }
.proof-actions { display: grid; gap: .6rem; margin-top: .9rem; }
.proof-actions form { display: flex; gap: .5rem; flex-wrap: wrap; }
.proof-actions .input { flex: 1; min-width: 200px; }
@media (min-width: 760px) { .proof-item { grid-template-columns: 140px 1fr; } }
.product-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--surface-2); flex: none; }
.pos-qris { display: flex; justify-content: center; margin: .5rem 0; }
.pos-qris img { max-width: 240px; width: 100%; border-radius: 8px; background: #fff; padding: .4rem; border: 1px solid var(--border); }
.brand-logo-img { max-height: 48px; max-width: 160px; object-fit: contain; }
.pos-item-photo { overflow: hidden; padding: 0; background: var(--surface-2); }
.pos-item-photo img { width: 100%; height: 100%; object-fit: cover; }
[data-theme="dark"] .pos-item-photo { filter: none; }
.center { text-align: center; }

/* ===== FASE 7: laporan ===== */
.report-card { display: flex; gap: 1rem; align-items: flex-start; }
.report-card p { margin: .25rem 0 0; }
.report-card.is-locked { opacity: .78; }
.report-ranges { padding: .75rem 1.25rem 1rem; }
.report-table tfoot td { font-weight: 700; border-top: 2px solid var(--border-strong); background: var(--surface-2); }
.report-chart svg { width: 100%; height: auto; max-height: 260px; }
.btn.is-disabled { opacity: .55; cursor: not-allowed; }
.report-definition summary { gap: .4rem; align-items: center; }
.report-table td.num, .report-table th.num { white-space: nowrap; }
/* ===== FASE 7: notifikasi ===== */
.notif-bell { position: relative; }
.notif-badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center; }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-item { display: flex; gap: 1rem; align-items: center; padding: .9rem 1.25rem; border-top: 1px solid var(--border); }
.notif-item:first-child { border-top: 0; }
.notif-item.is-unread { background: color-mix(in srgb, var(--caramel) 9%, transparent); }
.notif-item.is-unread strong::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: .45rem; border-radius: 50%; background: var(--danger); vertical-align: middle; }
.notif-text { display: grid; gap: .15rem; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.notif-actions { flex: none; }
@media (max-width: 560px) { .notif-item { align-items: flex-start; } .notif-item .stat-icon { display: none; } }
/* ===== FASE 7: QR meja ===== */
.qr-sheet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; }
.qr-card { display: grid; justify-items: center; gap: .4rem; padding: 1rem; background: #fff; color: #1f140c; border: 2px dashed var(--border-strong); border-radius: var(--radius); text-align: center; break-inside: avoid; }
.qr-card .qr-box { width: 170px; height: 170px; }
.qr-card .qr-box svg { width: 100%; height: 100%; }
.qr-card-brand { font-size: .95rem; }
.qr-card-table { font-size: 1.5rem; font-weight: 800; }
@media print { .qr-sheet-grid { grid-template-columns: repeat(3, 1fr); } .qr-card { border-color: #999; } }
/* ===== FASE 8: PWA ===== */
.install-bar, .update-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(1rem + env(safe-area-inset-bottom)); z-index: 60; display: flex; align-items: center; gap: .6rem; width: min(560px, calc(100% - 2rem)); padding: .65rem .75rem; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg, var(--shadow)); }
.install-bar[hidden] { display: none !important; }
.install-bar img { border-radius: 10px; flex: none; }
.install-bar span, .update-bar span { flex: 1; font-size: .88rem; line-height: 1.35; }
.update-bar { bottom: auto; top: calc(.75rem + env(safe-area-inset-top)); }
.install-guide ol, .install-guide ul { line-height: 1.7; padding-left: 1.25rem; }
.install-guide h2 { margin-top: 1.75rem; font-size: 1.15rem; }
@media print { .install-bar, .update-bar { display: none !important; } }
@media (max-width: 480px) { .install-bar img, .install-bar a.btn { display: none; } .install-bar { gap: .4rem; } }
/* ===== FASE 9: kesehatan sistem ===== */
.health-list { list-style: none; margin: 0; padding: 0; }
.health-item { display: flex; gap: .75rem; align-items: flex-start; padding: .8rem 1.25rem; border-top: 1px solid var(--border); }
.health-item:first-child { border-top: 0; }
.health-item > span { flex: none; margin-top: .1rem; }
.health-item > div { min-width: 0; overflow-wrap: anywhere; }

/* ---------- Panel superadmin: daftar paket (kartu) ---------- */
.plan-admin-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); align-items: stretch; }
.plan-admin-card { display: flex; flex-direction: column; gap: 1rem; padding: 1.25rem; min-width: 0; transition: box-shadow .2s ease, border-color .2s ease; }
.plan-admin-card:hover { box-shadow: var(--shadow); }
.plan-admin-card.is-featured { border-color: var(--caramel); box-shadow: 0 0 0 1px var(--caramel), var(--shadow-sm); }
.plan-admin-card.is-archived { opacity: .7; }
.pac-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.pac-title { min-width: 0; }
.pac-title h2 { font-size: 1.15rem; margin: 0; line-height: 1.3; overflow-wrap: anywhere; }
.pac-slug { display: block; font-size: .78rem; color: var(--muted); margin-top: .15rem; overflow-wrap: anywhere; }
.pac-tags { display: flex; flex-wrap: wrap; gap: .4rem; min-height: 24px; }
.pac-tags .icon-sm { width: 13px; height: 13px; }
.pac-price { padding: .85rem 1rem; border-radius: var(--radius-sm); background: var(--surface-2); }
.pac-price strong { font-size: 1.45rem; font-weight: 800; letter-spacing: -.01em; }
.pac-price span { color: var(--muted); font-size: .9rem; margin-left: .2rem; }
.pac-price-alt { font-size: .85rem; color: var(--muted); margin-top: .1rem; }
.pac-limits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: 0; }
.pac-limits div { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .55rem .6rem; text-align: center; min-width: 0; }
.pac-limits dt { display: flex; align-items: center; justify-content: center; gap: .3rem; font-size: .74rem; color: var(--muted); font-weight: 500; }
.pac-limits dt .icon-sm { width: 13px; height: 13px; flex: none; }
.pac-limits dd { margin: .15rem 0 0; font-size: 1.1rem; font-weight: 700; }
.pac-features { flex: 1; }
.pac-features-head { display: flex; align-items: center; justify-content: space-between; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .5rem; }
.pac-count { font-variant-numeric: tabular-nums; background: var(--surface-2); padding: .1rem .5rem; border-radius: 999px; letter-spacing: 0; }
.feature-chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.feature-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .6rem .25rem .45rem; border-radius: 999px; font-size: .8rem; font-weight: 500; line-height: 1.35;
  background: color-mix(in srgb, var(--caramel) 14%, var(--surface)); color: var(--text); border: 1px solid color-mix(in srgb, var(--caramel) 28%, transparent); }
.feature-chip .icon-sm { width: 13px; height: 13px; flex: none; color: var(--success); }
.feature-chip.is-off { background: transparent; border-color: var(--border); color: var(--muted); }
.feature-chip.is-off .icon-sm { color: var(--muted); }
.pac-missing { margin-top: .6rem; }
.pac-missing summary { display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem; color: var(--muted); cursor: pointer; list-style: none; min-height: 32px; }
.pac-missing summary::-webkit-details-marker { display: none; }
.pac-missing summary .icon-sm { transition: transform .2s ease; }
.pac-missing[open] summary .icon-sm { transform: rotate(180deg); }
.pac-missing .feature-chips { margin-top: .35rem; }
.pac-foot { display: flex; flex-direction: column; gap: .6rem; padding-top: .9rem; border-top: 1px solid var(--border); }
.pac-subs { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; color: var(--muted); }
.pac-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35rem; }
.pac-actions .btn { width: 100%; justify-content: center; padding-left: .4rem; padding-right: .4rem; white-space: nowrap; }
.pac-actions .btn-ghost { border: 1px solid var(--border); }
.pac-actions .inline-form { margin: 0; }
@media (max-width: 480px) {
  .plan-admin-card { padding: 1rem; }
  .pac-price strong { font-size: 1.3rem; }
}

/* ---------- Panel superadmin: notifikasi & pesan ---------- */
.nowrap { white-space: nowrap; }
.msg-nav { position: sticky; top: calc(var(--topbar-h, 64px) + .5rem); z-index: 5; box-shadow: var(--shadow-sm); }
.msg-nav .seg { text-decoration: none; }
.msg-nav .seg:hover { background: var(--surface); color: var(--text); }
.msg-section { display: flex; align-items: center; gap: .5rem; font-size: 1.2rem; margin: 2rem 0 .85rem; scroll-margin-top: calc(var(--topbar-h, 64px) + 4.5rem); }
.msg-section .icon { color: var(--caramel-strong); }
.msg-section-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin: 2rem 0 .85rem; scroll-margin-top: calc(var(--topbar-h, 64px) + 4.5rem); }
.msg-section-row .msg-section { margin: 0; }
.msg-tips { margin: .25rem 0 0; padding-left: 1.1rem; color: var(--muted); display: grid; gap: .35rem; }
.msg-groups { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); margin: .5rem 0 1rem; }
.msg-group { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem .5rem; margin: 0; min-width: 0; display: grid; gap: .6rem; align-content: start; }
.msg-group legend { display: inline-flex; align-items: center; gap: .4rem; padding: 0 .4rem; font-weight: 700; font-size: .92rem; }
.msg-group legend .icon-sm { color: var(--caramel-strong); }
.msg-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; align-items: center; }
.msg-filters .chip { min-height: 34px; padding: .3rem .85rem; font-size: .82rem; text-decoration: none; }
.msg-filter-sep { width: 1px; height: 22px; background: var(--border-strong); margin: 0 .25rem; }
.msg-error { max-width: 340px; overflow-wrap: anywhere; color: var(--muted); }
.wa-preview-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); align-items: start; }
.wa-preview { overflow: hidden; display: flex; flex-direction: column; }
.wa-preview-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem .9rem; border-bottom: 1px solid var(--border); font-size: .9rem; }
.wa-chat { padding: 1rem .9rem 1.1rem; background: #efe7dd radial-gradient(circle at 1px 1px, rgba(59, 36, 22, .06) 1px, transparent 0) 0 0 / 14px 14px; }
[data-theme="dark"] .wa-chat { background-color: #1b1511; }
.wa-bubble { position: relative; background: #fff; color: #1f1a17; border-radius: 0 10px 10px 10px; padding: .6rem .7rem 1.2rem; font-size: .84rem; line-height: 1.5; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); overflow-wrap: anywhere; max-width: 100%; }
[data-theme="dark"] .wa-bubble { background: #2a211a; color: #f4e9dc; }
.wa-bubble::before { content: ""; position: absolute; left: -7px; top: 0; border-width: 0 8px 8px 0; border-style: solid; border-color: transparent #fff transparent transparent; }
[data-theme="dark"] .wa-bubble::before { border-right-color: #2a211a; }
.wa-time { position: absolute; right: .55rem; bottom: .3rem; font-size: .68rem; color: #8a7f76; }
.email-preview iframe { display: block; width: 100%; height: 680px; border: 0; background: #f4ece2; border-radius: 0 0 var(--radius) var(--radius); }
@media (max-width: 640px) {
  .msg-nav { position: static; }
  .msg-nav .seg { flex: 1 1 30%; font-size: .8rem; }
  .email-preview iframe { height: 560px; }
}
.msg-stats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
@media (max-width: 480px) { .msg-stats .stat { flex-direction: column; align-items: flex-start; gap: .5rem; } .msg-stats .stat-icon { width: 36px; height: 36px; } }
