/* =========================================================
   Panel (dashboard pelanggan + admin) — satu tampilan untuk semua.
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
:root {
  --bg: #f5f4f0;
  --card: #ffffff;
  --ink: #16181d;
  --muted: #646a73;
  --line: #e6e4de;
  --line-2: #d6d3cb;
  --soft: #f0efea;
  --primary: #1a3d2f;
  --primary-ink: #ffffff;
  --accent: #c8f169;
  --accent-ink: #1a2e05;
  --danger: #c2410c;
  --danger-soft: #fdeee6;
  --ok: #15803d;
  --ok-soft: #e8f6ec;
  --warn: #a16207;
  --warn-soft: #fdf6dd;
  --r: 14px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgb(20 20 20 / .04), 0 6px 18px -10px rgb(20 20 20 / .14);
  --side: 264px;
  --top: 64px;
  -webkit-text-size-adjust: 100%;
}
html { overflow-x: clip; }
body.pn {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
:where(h1, h2, h3, p, td, th, a, span, li, label) { overflow-wrap: break-word; }
:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; border-radius: 6px; }
.ic { width: 18px; height: 18px; flex: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.nowrap { white-space: nowrap; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.stack { display: grid; gap: 16px; }
.stack-sm { display: grid; gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

/* ---------- Layout ---------- */
.pn-side {
  position: fixed; inset: 0 auto 0 0; z-index: 50; width: var(--side);
  display: flex; flex-direction: column; background: #121513; color: #e8eae6;
  transform: translateX(-100%); transition: transform .25s ease;
}
.pn-side.is-open { transform: none; box-shadow: 20px 0 60px rgb(0 0 0 / .3); }
.pn-scrim { position: fixed; inset: 0; z-index: 45; background: rgb(0 0 0 / .45); }
.pn-scrim[hidden] { display: none; }
@media (min-width: 1024px) {
  .pn-side { transform: none; }
  .pn-scrim { display: none !important; }
  .pn-main { margin-left: var(--side); }
  .pn-menu { display: none !important; }
}
.pn-brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px 14px; font-weight: 800; font-size: 1.08rem; letter-spacing: -.02em; }
.pn-logo { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.pn-site { margin: 0 12px 10px; padding: 12px; border-radius: 12px; background: #1c201d; border: 1px solid #262b27; }
.pn-site__n { font-weight: 700; line-height: 1.3; }
.pn-site__u { font-size: .8rem; color: #9ca39d; overflow-wrap: anywhere; }
.pn-site select { width: 100%; margin-top: 8px; min-height: 38px; border-radius: 8px; border: 1px solid #333a35; background: #121513; color: #e8eae6; padding: 0 8px; font-size: .86rem; }
.pn-nav { flex: 1; overflow-y: auto; padding: 4px 12px 16px; }
.pn-nav__h { margin: 14px 10px 6px; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #7f877f; }
.pn-nav a { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 0 10px; border-radius: 10px; color: #cfd4cf; font-weight: 500; font-size: .94rem; }
.pn-nav a:hover { background: #1e231f; color: #fff; }
.pn-nav a.is-active { background: #24302a; color: #fff; }
.pn-nav a.is-active .ic { color: var(--accent); }
.pn-side__foot { padding: 12px; border-top: 1px solid #232824; display: flex; align-items: center; gap: 10px; }
.pn-side__foot .avatar { width: 34px; height: 34px; border-radius: 99px; display: grid; place-items: center; background: #2a312c; font-weight: 700; flex: none; }
.pn-side__foot form { margin-left: auto; }
.pn-side__foot button { border: 0; background: transparent; color: #9ca39d; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; }
.pn-side__foot button:hover { background: #1e231f; color: #fff; }

.pn-top {
  position: sticky; top: 0; z-index: 30; min-height: var(--top);
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  background: rgb(245 244 240 / .9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.pn-top h1 { font-size: 1.12rem; font-weight: 750; letter-spacing: -.015em; line-height: 1.25; min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-menu { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); flex: none; }
.pn-content { padding: 20px 16px 64px; max-width: 1180px; }
@media (min-width: 768px) { .pn-top { padding: 12px 28px; } .pn-content { padding: 28px 28px 80px; } }
.pn-top .btn span { display: none; }
@media (min-width: 640px) { .pn-top .btn span { display: inline; } }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; }
.card__b { padding: 18px; }
@media (min-width: 768px) { .card__b { padding: 22px; } }
.card__h { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 18px; border-bottom: 1px solid var(--line); }
@media (min-width: 768px) { .card__h { padding: 16px 22px; } }
.card__h h2, .h2 { font-size: 1.02rem; font-weight: 750; letter-spacing: -.01em; }
.card__f { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid var(--line); background: #fbfaf8; border-radius: 0 0 var(--r) var(--r); }
.grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid--side { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; } }
.grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { color: var(--muted); max-width: 64ch; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--card); color: var(--ink); font-weight: 600; font-size: .92rem; line-height: 1.2; text-align: center;
  transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
}
.btn:hover { border-color: #bdb9ae; background: #fbfaf7; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn--primary:hover { background: #24503e; border-color: #24503e; }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { background: #bde552; border-color: #bde552; }
.btn--danger { color: var(--danger); }
.btn--danger:hover { background: var(--danger-soft); border-color: #f3c3a8; }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: var(--soft); border-color: transparent; }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: .86rem; border-radius: 9px; }
.btn--icon { width: 40px; padding: 0; }
.btn--sm.btn--icon { width: 36px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field > span:first-child, .label { font-size: .86rem; font-weight: 650; }
.hint { font-size: .8rem; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px;
  background: #fff; font-size: 16px; line-height: 1.4; transition: border-color .15s ease, box-shadow .15s ease;
}
@media (min-width: 768px) { .input, .select, .textarea { font-size: .95rem; } }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgb(26 61 47 / .14); }
.textarea { min-height: 100px; resize: vertical; }
.select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23646a73' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input-group { display: flex; align-items: stretch; min-width: 0; }
.input-group .input { border-radius: 10px 0 0 10px; min-width: 0; }
.input-group > span { display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--line-2); border-left: 0; border-radius: 0 10px 10px 0; background: var(--soft); color: var(--muted); font-weight: 600; white-space: nowrap; }
.input-group--pre .input { border-radius: 0 10px 10px 0; }
.input-group--pre > span { border-left: 1px solid var(--line-2); border-right: 0; border-radius: 10px 0 0 10px; }
.fields { display: grid; gap: 14px; }
@media (min-width: 640px) { .fields--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fields--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.err { color: var(--danger); font-size: .82rem; font-weight: 600; }
.input.is-err, .select.is-err, .textarea.is-err { border-color: var(--danger); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: .92rem; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--primary); flex: none; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .9rem; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__t { position: relative; width: 42px; height: 24px; border-radius: 99px; background: #cfccc3; transition: background-color .2s ease; flex: none; }
.switch__t::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 99px; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .2); transition: transform .2s ease; }
.switch input:checked + .switch__t { background: var(--ok); }
.switch input:checked + .switch__t::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__t { outline: 2px solid #3b82f6; outline-offset: 2px; }

/* image upload */
.upl { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 14px; align-items: center; }
.upl__img { width: 88px; height: 88px; border-radius: 12px; overflow: hidden; background: var(--soft) repeating-linear-gradient(45deg, transparent 0 8px, rgb(0 0 0 / .03) 8px 16px); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); }
.upl__img img { width: 100%; height: 100%; object-fit: cover; }
.upl__img--logo img { object-fit: contain; padding: 6px; background: #fff; }
.upl input[type=file], .file { width: 100%; font-size: .86rem; color: var(--muted); }
.upl input[type=file]::file-selector-button, .file::file-selector-button {
  margin-right: 10px; min-height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; font-weight: 600; cursor: pointer; color: var(--ink);
}
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.thumb { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--soft); aspect-ratio: 1; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb__bar { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; gap: 4px; padding: 6px; background: linear-gradient(transparent, rgb(0 0 0 / .65)); color: #fff; font-size: .72rem; font-weight: 600; }
.thumb__bar label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.thumb__bar input { accent-color: var(--accent); width: 14px; height: 14px; margin: 0; }
.thumb.is-off img { opacity: .3; }
.tag-demo { position: absolute; top: 6px; left: 6px; padding: 2px 7px; border-radius: 99px; background: rgb(0 0 0 / .65); color: #fff; font-size: .66rem; font-weight: 700; }

/* repeater */
.rep { display: grid; gap: 10px; }
.rep__row { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fcfbf9; position: relative; }
.rep__row .rep__del { position: absolute; top: 8px; right: 8px; }
.rep__row .fields { padding-right: 40px; }
@media (min-width: 640px) { .rep__row--inline { grid-template-columns: minmax(0, 1fr) auto; align-items: end; } .rep__row--inline .fields { padding-right: 0; } .rep__row--inline .rep__del { position: static; } }

/* icon picker */
.iconpick { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; align-items: center; }
.iconpick__prev { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--soft); border: 1px solid var(--line); }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: .92rem; margin-bottom: 16px; border: 1px solid transparent; }
.alert .ic { margin-top: 2px; }
.alert--ok { background: var(--ok-soft); color: #14532d; border-color: #c6e9d0; }
.alert--err { background: var(--danger-soft); color: #7c2d12; border-color: #f5cdb6; }
.alert--warn { background: var(--warn-soft); color: #713f12; border-color: #f1e2a6; }
.alert--info { background: #eef4ff; color: #1e3a8a; border-color: #d5e2fb; }

/* ---------- Pills / badges ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: .76rem; font-weight: 700; white-space: nowrap; background: var(--soft); color: var(--muted); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.pill--active, .pill--paid { background: var(--ok-soft); color: var(--ok); }
.pill--pending { background: var(--warn-soft); color: var(--warn); }
.pill--suspended, .pill--cancelled { background: var(--danger-soft); color: var(--danger); }
.pn-site .pill { background: #26302a; }

/* ---------- Tables (jadi kartu di HP) ---------- */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .t-act { text-align: right; white-space: nowrap; }
@media (max-width: 1023px) {
  .table--cards thead { display: none; }
  .table--cards, .table--cards tbody, .table--cards tr, .table--cards td { display: block; width: 100%; }
  .table--cards tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .table--cards tr:last-child { border-bottom: 0; }
  .table--cards td { padding: 5px 0; border: 0; text-align: left; overflow-wrap: anywhere; }
  .table--cards td::before { content: attr(data-label); display: block; font-size: .74rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
  .table--cards td.t-main { padding-bottom: 8px; }
  .table--cards td.t-main::before, .table--cards td.t-act::before { display: none; }
  .table--cards td.t-act { padding-top: 10px; }
}
@media (min-width: 640px) and (max-width: 1023px) {
  .table--cards tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table--cards tr { border-right: 1px solid var(--line); }
  .table--cards tr:nth-child(2n) { border-right: 0; }
  .table--cards tr:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
}
.table-wrap { overflow-x: auto; }
.acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: flex-start; }
@media (max-width: 1023px) { .acts { justify-content: flex-start; } }
.table .t-act { white-space: normal; }
.siteform { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; align-items: end; min-width: 0; }
.siteform .select, .siteform .input { min-height: 38px; padding-top: 6px; padding-bottom: 6px; }
@media (min-width: 1024px) { .siteform { grid-template-columns: 130px minmax(150px, 1fr) 150px auto; } }
.tmain { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tmain img, .tmain .ph { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex: none; background: var(--soft); }
.tmain b { display: block; line-height: 1.3; }

/* ---------- Stats ---------- */
.stat { padding: 16px 18px; }
.stat__k { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat__v { font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; margin-top: 4px; }
.bars { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 3px; align-items: end; height: 140px; padding-top: 8px; }
.bars div { position: relative; border-radius: 4px 4px 1px 1px; background: #dfe7dc; min-height: 3px; }
.bars div i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: inherit; background: var(--primary); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend span::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }

/* checklist */
.todo { display: grid; gap: 2px; }
.todo a { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-radius: 10px; }
.todo a:hover { background: var(--soft); }
.todo .dot { width: 22px; height: 22px; border-radius: 99px; border: 2px solid var(--line-2); display: grid; place-items: center; flex: none; color: #fff; }
.todo .is-done .dot { background: var(--ok); border-color: var(--ok); }
.todo .is-done span { color: var(--muted); text-decoration: line-through; }
.progress { height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ok); border-radius: inherit; }

/* ---------- Home builder ---------- */
.sections { display: grid; gap: 10px; }
.secrow { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.secrow.is-off { opacity: .6; background: #faf9f6; }
.secrow.is-drag { opacity: .4; }
.secrow.is-over { border-color: var(--primary); box-shadow: 0 0 0 2px rgb(26 61 47 / .2); }
.secrow__handle { display: grid; gap: 4px; justify-items: center; }
.secrow__grip { cursor: grab; color: var(--muted); display: none; padding: 4px; }
@media (hover: hover) and (pointer: fine) { .secrow__grip { display: block; } }
.secrow__arrows { display: grid; gap: 4px; }
.secrow__arrows button { width: 32px; height: 28px; border-radius: 7px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; }
.secrow__arrows .ic { width: 15px; height: 15px; }
.secrow__body { display: grid; gap: 10px; min-width: 0; }
.secrow__top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.secrow__ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--soft); flex: none; }
.secrow__t { min-width: 0; }
.secrow__t b { display: block; line-height: 1.25; }
.secrow__t small { display: block; color: var(--muted); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.secrow__ctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.secrow__ctl .select { width: auto; min-height: 36px; padding-top: 4px; padding-bottom: 4px; font-size: .86rem; flex: 1 1 140px; max-width: 220px; }
@media (min-width: 900px) {
  .secrow__body { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
}
.savebar { position: sticky; bottom: 12px; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding: 12px 14px; border-radius: 14px; background: #16181d; color: #fff; box-shadow: 0 12px 30px -10px rgb(0 0 0 / .4); }
.savebar .btn { border-color: transparent; }

/* ---------- Template picker ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-2); background: #fff; font-size: .86rem; font-weight: 600; white-space: nowrap; }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.tpl { position: relative; display: grid; border: 2px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; cursor: pointer; }
.tpl input { position: absolute; opacity: 0; }
.tpl:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px rgb(26 61 47 / .16); }
.tpl.is-current { border-color: var(--ok); }
.tpl__b { padding: 10px 12px; display: grid; gap: 2px; }
.tpl__b b { font-size: .92rem; line-height: 1.3; }
.tpl__b small { color: var(--muted); font-size: .8rem; }

/* mini mockup template (dipakai juga di landing) */
.mock { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--m-bg); color: var(--m-ink); isolation: isolate; }
.mock__img { position: absolute; inset: 0; z-index: -1; }
.mock__img img { width: 100%; height: 100%; object-fit: cover; }
.mock__img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgb(0 0 0 / .55)); }
.mock__bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: color-mix(in srgb, var(--m-bg) 88%, transparent); }
.mock__bar i { width: 7px; height: 7px; border-radius: 99px; background: color-mix(in srgb, var(--m-ink) 25%, transparent); }
.mock__brand { margin-left: 4px; font-family: var(--m-font); font-weight: 700; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mock__h { position: absolute; left: 12px; right: 12px; bottom: 12px; color: #fff; font-family: var(--m-font); font-weight: var(--m-w, 700); font-size: 1rem; line-height: 1.15; letter-spacing: -.01em; text-shadow: 0 1px 12px rgb(0 0 0 / .3); }
.mock__h span { display: inline-block; margin-top: 8px; padding: 4px 9px; border-radius: 99px; background: var(--m-primary); color: var(--m-on); font-family: "Plus Jakarta Sans", sans-serif; font-size: .66rem; font-weight: 700; text-shadow: none; letter-spacing: 0; }
.dots { display: flex; gap: 4px; }
.dots i { width: 14px; height: 14px; border-radius: 99px; border: 1px solid rgb(0 0 0 / .1); }

/* swatches */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.swatch { display: grid; gap: 6px; padding: 8px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; text-align: left; }
.swatch:hover { border-color: var(--line-2); }
.swatch__c { display: flex; height: 36px; border-radius: 8px; overflow: hidden; }
.swatch__c i { flex: 1; }
.swatch small { font-size: .76rem; color: var(--muted); }
.colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 12px; }
.color { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; align-items: center; }
.color input[type=color] { width: 44px; height: 44px; padding: 3px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; cursor: pointer; }
.color .input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
.fontprev { padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: #fcfbf9; }
.fontprev b { display: block; font-size: 1.4rem; line-height: 1.2; }

/* ---------- Misc ---------- */
.empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .ic { width: 36px; height: 36px; }
.divider { height: 1px; background: var(--line); margin: 4px 0; }
details.acc { border: 1px solid var(--line); border-radius: 12px; background: #fff; }
details.acc > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; font-weight: 650; }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc[open] > summary { border-bottom: 1px solid var(--line); }
details.acc > div { padding: 16px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.pager { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }
.pager a, .pager span { display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line-2); background: #fff; font-weight: 600; font-size: .88rem; }
.pager .is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.pager .is-off { opacity: .4; }
.inline-form { display: inline; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .input, .toolbar .select { width: auto; flex: 1 1 200px; }

/* ---------- Auth ---------- */
.auth { min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; }
.auth__card { width: min(100%, 420px); }
.auth__brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 800; font-size: 1.2rem; margin-bottom: 18px; }
[hidden] { display: none !important; }

/* Tombol simpan selalu terlihat di form panjang */
.card__f { position: sticky; bottom: 0; z-index: 5; }
.formbar {
  position: sticky; bottom: 0; z-index: 15; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap;
  margin-top: 4px; padding: 14px 0 calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(rgb(245 244 240 / 0), var(--bg) 35%);
}
@media (max-width: 639px) { .formbar .btn { flex: 1 1 100%; min-height: 48px; } }

/* mockup kecil: judul maksimal 3 baris, tombol disembunyikan jika kartu sangat sempit */
.mock { container-type: inline-size; }
.mock__t { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-weight: inherit; }
.mock__h span { margin-top: 6px; }
@container (max-width: 200px) {
  .mock__h { left: 9px; right: 9px; bottom: 9px; font-size: .74rem; }
  .mock__t { -webkit-line-clamp: 2; }
  .mock__h span { font-size: .58rem; padding: 3px 7px; margin-top: 5px; }
  .mock__bar { padding: 6px 8px; }
  .mock__brand { font-size: .66rem; }
}

/* ---------- Statistik ---------- */
.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
.delta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-top: 6px; font-size: .8rem; font-weight: 700; line-height: 1.3; }
.delta .ic { width: 16px; height: 16px; }
.delta .muted { font-weight: 500; }
.delta.is-up { color: var(--ok); }
.delta.is-down { color: var(--danger); }
.legend--line span::before { width: 14px; height: 2px; border-radius: 2px; }
.chart { position: relative; height: 252px; touch-action: pan-y; outline: none; }
.chart--sm { height: 200px; }
.chart:focus-visible { box-shadow: 0 0 0 3px rgb(26 61 47 / .25); border-radius: 8px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid-l { stroke: #ecebe6; stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis-l { stroke: #d6d3cb; stroke-width: 1; shape-rendering: crispEdges; }
.chart text { font-size: 11.5px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .end-l { font-size: 12px; font-weight: 700; fill: var(--ink); }
.chart .xhair { stroke: #9aa0a6; stroke-width: 1; shape-rendering: crispEdges; }
.chart .col { transition: opacity .12s ease; }
.chart .col.is-hover { opacity: .72; }
.ctip {
  position: absolute; top: 0; z-index: 3; pointer-events: none; min-width: 140px;
  padding: 10px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--line); box-shadow: 0 10px 28px -8px rgb(20 20 20 / .25);
  font-size: .82rem; line-height: 1.35;
}
.ctip__d { color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.ctip__r { display: flex; align-items: center; gap: 8px; }
.ctip__r i { width: 12px; height: 2px; border-radius: 2px; flex: none; }
.ctip__r b { font-size: .95rem; font-variant-numeric: tabular-nums; }
.ctip__r span { color: var(--muted); }
.tview summary { cursor: pointer; font-size: .86rem; font-weight: 600; color: var(--muted); min-height: 36px; display: inline-flex; align-items: center; }
.tnum td, .tnum th { font-variant-numeric: tabular-nums; }
.hbars { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.hbars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: baseline; }
.hbars__l { font-size: .9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbars__v { font-weight: 800; font-variant-numeric: tabular-nums; }
.hbars__v small { font-weight: 500; color: var(--muted); margin-left: 4px; font-size: .78rem; }
.hbars__t { grid-column: 1 / -1; display: block; height: 8px; border-radius: 4px; background: #f0efea; }
.hbars__t i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: #2a78d6; }
code { font-size: .86em; padding: 1px 5px; border-radius: 5px; background: var(--soft); white-space: nowrap; }

/* ---------- Halaman bio (editor) ---------- */
.blrow__media { overflow: hidden; }
.blrow__media img { width: 100%; height: 100%; object-fit: cover; }
.blrow--h { background: #faf9f6; }
.blrow__clicks { margin-left: auto; flex: none; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.blrow__clicks b { color: var(--ink); font-size: .95rem; font-variant-numeric: tabular-nums; }
.blrow__edit > summary { list-style: none; width: fit-content; }
.blrow__edit > summary::-webkit-details-marker { display: none; }
.blrow__edit[open] > summary { background: var(--soft); }
.blrow__edit[open] { padding-top: 4px; border-top: 1px dashed var(--line-2); }
.bthemes { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; margin: 0; padding: 0; border: 0; min-width: 0; }
.bthemes legend { margin-bottom: 8px; padding: 0; font-weight: 600; font-size: .88rem; }
.btheme { position: relative; display: grid; gap: 6px; cursor: pointer; }
.btheme input { position: absolute; opacity: 0; pointer-events: none; }
.btheme__sw { position: relative; display: grid; align-content: center; gap: 5px; height: 64px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-2); overflow: hidden; }
.btheme__sw i { display: block; height: 10px; border-radius: 99px; }
.btheme__sw .ic { position: absolute; top: 6px; right: 6px; width: 14px; height: 14px; color: #fff; }
.btheme__n { font-size: .8rem; font-weight: 600; text-align: center; }
.btheme input:checked + .btheme__sw { outline: 2.5px solid var(--primary); outline-offset: 2px; }
.btheme input:focus-visible + .btheme__sw { outline: 2.5px solid var(--primary); outline-offset: 2px; }
.phone { width: min(100%, 340px); margin-inline: auto; aspect-ratio: 9 / 18; max-height: 660px; border: 8px solid #16181d; border-radius: 32px; overflow: hidden; background: #fff; }
.phone iframe { width: 100%; height: 100%; border: 0; display: block; }
.qr { width: 200px; height: 200px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.card__ht { display: flex; align-items: center; gap: 8px; min-width: 0; }
.card__ht .ic { flex: none; }
@media (max-width: 559px) { .quick { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Editor varian produk ---------- */
.vgroup { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: #fbfaf7; }
.vgroup__h { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.vgroup__h .field { flex: 1 1 200px; }
.vrows { display: grid; gap: 8px; }
.vrow { display: grid; grid-template-columns: 52px minmax(0, 1fr) 40px; grid-template-areas: "img label del" "price price stock"; gap: 8px; align-items: center; padding: 8px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.vrow--head { display: none; }
.vrow__img { grid-area: img; position: relative; }
.vrow__label { grid-area: label; }
.vrow__price { grid-area: price; }
.vrow__stock { grid-area: stock; }
.vrow__del { grid-area: del; }
.vrow .field { gap: 2px; }
.vlab { font-size: .74rem; font-weight: 600; color: var(--muted); }
.vrow__price .input-group > span { font-size: .78rem; }
.vrow__prev { display: grid; place-items: center; width: 52px; height: 52px; overflow: hidden; border-radius: 10px; border: 1px dashed var(--line-2); background: var(--soft); color: var(--muted); cursor: pointer; }
.vrow__prev img { width: 100%; height: 100%; object-fit: cover; }
.vrow__prev:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.vrow__clear { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 99px; border: 0; background: var(--ink); color: #fff; }
.vrow__clear .ic { width: 12px; height: 12px; }
@media (min-width: 720px) {
  .vrow, .vrow--head { grid-template-columns: 52px minmax(0, 1.4fr) minmax(0, 1fr) 96px 40px; grid-template-areas: "img label price stock del"; }
  .vrow--head { display: grid; padding: 0 9px; border: 0; background: none; font-size: .74rem; font-weight: 600; color: var(--muted); }
  .vrow .vlab { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
.stockpill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: .78rem; font-weight: 700; background: var(--soft); }
.stockpill.is-low { background: var(--warn-soft); color: var(--warn); }
.stockpill.is-out { background: var(--danger-soft); color: var(--danger); }

/* ---------- Pesanan masuk ---------- */
.pn-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; display: inline-grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: .74rem; font-weight: 800; }
.chip__n { font-size: .74rem; font-weight: 700; opacity: .65; }
.olist { list-style: none; margin: 0; padding: 0; }
.olist li + li { border-top: 1px solid var(--line); }
.orow { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 18px; transition: background-color .15s ease; }
.orow:hover { background: #faf9f6; }
.orow__ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--soft); color: var(--muted); }
.orow__ic--booking { background: #eef4ff; color: #2a5bd7; }
.orow__ic--manual { background: var(--warn-soft); color: var(--warn); }
.orow__main { display: grid; gap: 2px; min-width: 0; }
.orow__top { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.orow__top b { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.orow__top .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.orow__sum { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.orow__meta { font-size: .78rem; color: var(--muted); }
.orow__end { display: grid; justify-items: end; gap: 4px; }
.orow__total { font-size: .92rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 559px) {
  .orow { grid-template-columns: 36px minmax(0, 1fr); padding: 12px 14px; }
  .orow__ic { width: 36px; height: 36px; }
  .orow__end { grid-column: 2; grid-row: 2; display: flex; justify-content: space-between; align-items: center; }
}
.ostatus { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 99px; font-size: .76rem; font-weight: 700; white-space: nowrap; vertical-align: middle; }
.ostatus--baru { background: #fff4d6; color: #7a4b00; }
.ostatus--diproses { background: #e8f0ff; color: #1d4ed8; }
.ostatus--selesai { background: var(--ok-soft); color: var(--ok); }
.ostatus--batal { background: #f1f0ec; color: var(--muted); text-decoration: line-through; }
.oitems td { vertical-align: middle; }
.t-num { text-align: right; font-variant-numeric: tabular-nums; }
.oitem { display: flex; gap: 10px; align-items: center; min-width: 0; }
.oitem img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; background: var(--soft); }
.oitem > div { display: grid; min-width: 0; }
.oitems tfoot td { border-top: 1.5px solid var(--line-2); font-size: .9rem; }
@media (max-width: 559px) {
  .oitems thead { display: none; }
  .oitems, .oitems tbody, .oitems tr, .oitems td, .oitems tfoot { display: block; width: 100%; }
  .oitems tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .oitems td { padding: 0; border: 0; text-align: left; }
  .oitems td:first-child { grid-column: 1 / -1; }
  .oitems tbody td:nth-child(2)::before { content: "Jumlah "; color: var(--muted); }
  .oitems tbody td:nth-child(3) { display: none; }
  .oitems tbody td:nth-child(4), .oitems tfoot td:last-child { text-align: right; font-weight: 700; }
  .oitems tfoot tr { border: 0; }
  .oitems tfoot td:first-child { grid-column: 1; }
}
.nota .card__h { align-items: flex-start; }
.nota__brand { font-weight: 800; font-size: .9rem; }
.nota__admin { padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); font-size: .9rem; }
.nota__admin p { white-space: pre-line; margin-top: 4px; }
.ostatuses { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.ostat { display: block; cursor: pointer; }
.ostat input { position: absolute; opacity: 0; pointer-events: none; }
.ostat span { display: grid; gap: 1px; padding: 10px 12px 10px 38px; border: 1.5px solid var(--line); border-radius: 12px; position: relative; }
.ostat span::before { content: ""; position: absolute; left: 12px; top: 13px; width: 16px; height: 16px; border-radius: 99px; border: 2px solid var(--line-2); }
.ostat small { color: var(--muted); font-size: .8rem; }
.ostat input:checked + span { border-color: var(--primary); background: #f3f8f2; }
.ostat input:checked + span::before { border: 5px solid var(--primary); }
.ostat input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.orow-edit { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.orow-edit .rep__del { justify-self: start; }

@media print {
  body.pn { background: #fff; }
  .pn-side, .pn-top, .pn-scrim, .no-print, .alert, .savebar { display: none !important; }
  .pn-main { margin: 0 !important; padding: 0 !important; }
  .pn-content { padding: 0 !important; }
  .grid--side { display: block !important; }
  .card { box-shadow: none !important; border: 0 !important; }
}
