:root {
  --brand: #d9466f;
  --brand-deep: #b8325a;
  --brand-soft: #fde7ee;
  --ink: #2b2233;
  --muted: #6f6475;
  --bg: #fff8f5;
  --card: #ffffff;
  --line: #f0e2e6;
  --ok: #2e9e6a;
  --danger: #c0392b;
  --wa: #1ea952;
  --wa-hover: #178a42;
  --shadow: 0 6px 24px rgba(43, 34, 51, 0.08);
  --radius: 14px;
  --dot-line: rgba(128, 128, 128, .55); /* color-dot outline, visible on light and dark */
  --font: 'Noto Sans Lao', 'Noto Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

/* Dark mode: only when the visitor turns it on (theme.js). */
:root[data-theme="dark"] {
  --brand: #ff6f96;
  --brand-deep: #ff8fae;
  --brand-soft: #3a2230;
  --ink: #f5eef3;
  --muted: #b7aab8;
  --bg: #17121b;
  --card: #221b28;
  --line: #362c3d;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--brand-deep); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); margin: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 8px 18px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s, transform .1s;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--brand); color: var(--on-brand, #fff); }
.btn.primary:hover:not(:disabled) { background: var(--brand-deep); }
.btn.soft { background: var(--brand-soft); color: var(--brand-deep); }
.btn.soft:hover:not(:disabled) { border-color: var(--brand); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.ghost:hover { border-color: var(--brand); }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.whatsapp { background: var(--wa); color: #fff; }
.btn.whatsapp:hover { background: var(--wa-hover); }
.btn.block { width: 100%; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); cursor: pointer; flex: none;
}
.link { background: none; border: 0; padding: 0; cursor: pointer; text-align: left; color: inherit; }
.link:hover { color: var(--brand-deep); text-decoration: underline; }
.link.danger { color: var(--danger); font-size: .875rem; }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.topbar-inner {
  /* flex, not a fixed grid: the header has 3–4 buttons (theme, language, logout after login) */
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding-top: 10px; padding-bottom: 10px;
}
.topbar-inner .logo { margin-right: auto; min-width: 0; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo strong { display: block; font-size: 1.15rem; }
.logo small { display: block; color: var(--muted); font-size: .75rem; line-height: 1.2; }
.logo-mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 1.3rem;
}
.search input {
  width: 100%; min-height: 42px; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card);
}

/* ---------- product picture & price (shop dialog, cart, admin) ---------- */
.ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: 3.4rem; }
.price { font-weight: 700; color: var(--brand-deep); margin: 0; }
.price.big { font-size: 1.4rem; }
.status { text-align: center; color: var(--muted); }
.status:not(:empty) { padding: 32px 0; }
.status .btn { margin-top: 8px; }

/* ---------- dialogs ---------- */
dialog { border: 0; padding: 0; color: var(--ink); background: var(--card); }
dialog::backdrop { background: rgba(23, 18, 27, .55); }
.modal { width: min(860px, calc(100% - 32px)); border-radius: 20px; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; }
.modal-media { aspect-ratio: 1; background: var(--brand-soft); }
.modal-media img { width: 100%; height: 100%; object-fit: cover; }
.modal-media .ph { font-size: 6rem; }
.modal-info { position: relative; padding: 28px; display: flex; flex-direction: column; gap: 8px; }
.modal-close { position: absolute; top: 14px; right: 14px; }
.eyebrow { margin: 0; color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
.desc { color: var(--muted); white-space: pre-line; flex: 1; }

.drawer {
  margin: 0 0 0 auto; height: 100%; max-height: 100%; width: min(440px, 100%);
  display: none; flex-direction: column;
}
.drawer[open] { display: flex; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 1.2rem; }
.drawer-body { padding: 16px 18px 24px; overflow-y: auto; flex: 1; }
.empty { text-align: center; padding: 48px 0; color: var(--muted); }
.cart-list { list-style: none; margin: 0; padding: 0; }
.cart-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.thumb { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: var(--brand-soft); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .ph { font-size: 1.8rem; }
.cart-name { margin: 0; font-weight: 600; }
.cart-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; margin-top: 6px; }
.stepper button { width: 34px; height: 32px; border: 0; background: none; cursor: pointer; font-size: 1.1rem; }
.stepper span { min-width: 28px; text-align: center; font-weight: 600; }
.total { display: flex; justify-content: space-between; font-size: 1.15rem; padding: 14px 0; margin: 0; }
.total strong { color: var(--brand-deep); }
.checkout { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.checkout h3 { margin: 0; font-size: 1rem; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: .9rem; font-weight: 600; }
.field input, .field textarea, .field select {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg);
}
.field [aria-invalid="true"] { border-color: var(--danger); }
.field-err { color: var(--danger); font-size: .85rem; margin: 0; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100;
  background: var(--ink); color: var(--bg); padding: 10px 20px; border-radius: 999px; box-shadow: var(--shadow);
  max-width: calc(100% - 32px);
}
.toast[data-type="error"] { background: var(--danger); color: #fff; }

/* ---------- admin ---------- */
.admin-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.notice { background: var(--brand-soft); border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; overflow-wrap: anywhere; }
.login-card { max-width: 400px; margin: 48px auto; background: var(--card); padding: 28px; border-radius: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .85rem; color: var(--muted); }
.table .thumb { width: 52px; height: 52px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions .btn { min-height: 34px; padding: 4px 12px; }
.pill { font-size: .8rem; padding: 2px 10px; border-radius: 999px; background: var(--brand-soft); white-space: nowrap; }
.pill.off { background: var(--line); color: var(--muted); }
.form-modal { width: min(760px, calc(100% - 32px)); border-radius: 20px; }
.form-modal form { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.form-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-panel.one { display: flex; flex-direction: column; gap: 12px; }
.form-modal .full { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.preview { width: 96px; height: 96px; border-radius: 12px; overflow: hidden; background: var(--brand-soft); }
.preview img { width: 100%; height: 100%; object-fit: cover; }
.hint { margin: 0; color: var(--muted); font-size: .85rem; }
.form-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.form-top h2 { margin: 0; }
.form-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--brand-soft); }
.form-tab, .chip-btn {
  min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid transparent; background: transparent; cursor: pointer; font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px;
}
.form-tab[aria-pressed="true"] { background: var(--card); box-shadow: var(--shadow); }
.chip-btn { border-color: var(--line); background: var(--card); min-height: 44px; }
.chip-btn:hover:not(:disabled) { border-color: var(--brand); }
.chip-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip-btn:disabled { opacity: .45; cursor: not-allowed; }
.chips-row { display: flex; gap: 6px; flex-wrap: wrap; }
.btn.small { min-height: 34px; padding: 4px 12px; font-size: .85rem; }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.icon-btn.danger { color: var(--danger); }
.opt-title { margin: 0; font-weight: 700; }

/* live card preview (Info tab) */
.pv { align-items: flex-start; }
.pv-card { width: 180px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px; }
.pv-media { position: relative; aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden; background: var(--brand-soft); }
.pv-media img { width: 100%; height: 100%; object-fit: cover; }
.pv-sale { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 999px; background: #b2292a; color: #fff; font-size: .75rem; font-weight: 800; }
.pv-body { display: flex; flex-direction: column; padding: 8px 4px 2px; line-height: 1.3; }
.pv-body small { color: var(--muted); font-size: .75rem; text-transform: uppercase; }
.pv-body s { color: var(--muted); font-size: .8rem; }
.pv-body b { font-size: 1.3rem; }

/* colors tab */
.color-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.color-row { display: grid; grid-template-columns: 48px 1fr 1fr auto auto auto; gap: 8px; align-items: center; padding: 8px; border-radius: 12px; background: var(--bg); }
.color-row input[type="text"] { min-height: 40px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); min-width: 0; }
.color-row input[type="color"] { width: 44px; height: 44px; padding: 2px; border: 1px solid var(--line); border-radius: 50%; background: var(--card); cursor: pointer; }
.color-photo { display: flex; align-items: center; gap: 6px; }
.color-photo img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }
.color-tools, .quick-colors { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qc-dot { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--dot-line); }

/* sizes tab */
.kinds { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.kind-btn { min-height: 64px; padding: 8px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); cursor: pointer; display: flex; flex-direction: column; justify-content: center; gap: 2px; text-align: left; }
.kind-btn small { color: var(--muted); font-size: .75rem; }
.kind-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.kind-btn[aria-pressed="true"] small { color: inherit; opacity: .8; }
.size-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.size-chip { position: relative; overflow: hidden; min-width: 56px; min-height: 48px; padding: 0 14px; border-radius: 10px; font-weight: 700; cursor: pointer; border: 1.5px solid; }
.st-on.size-chip { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.st-out.size-chip { background: #fbe4e1; border-color: #c9786f; color: #8f1f1a; }
.st-out.size-chip::after { content: ''; position: absolute; left: -2px; right: -2px; top: 50%; height: 2px; background: #a3261c; transform: rotate(-20deg); }
.st-off.size-chip { background: transparent; border-style: dashed; border-color: var(--muted); color: var(--muted); }
.size-count { margin: 0; display: flex; gap: 14px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.st-key::before { content: ''; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.st-key.st-on::before { background: var(--ink); }
.st-key.st-out::before { background: #fbe4e1; border: 1px solid #c9786f; }
.st-key.st-off::before { border: 1px dashed var(--muted); }
.custom-add { display: flex; gap: 8px; }
.custom-add input, .chart-edit textarea { flex: 1; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.chart-edit { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }

/* admin menu */
.admin-nav { display: flex; gap: 4px; margin: 20px 0; padding: 4px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); width: fit-content; max-width: 100%; overflow-x: auto; }
.admin-tab { min-height: 44px; padding: 0 20px; border-radius: 999px; border: 0; background: transparent; cursor: pointer; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.admin-tab[aria-current="page"] { background: var(--ink); color: var(--bg); }
.tab-badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #fbb315; color: #3a2600; font-size: .75rem; display: grid; place-items: center; }

/* order status colors: label text always shown, color is extra */
.st-pill { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.st-pill.st-new { background: #fff1cc; color: #6b4600; }
.st-pill.st-confirmed { background: #ebe8e2; color: #3a3f37; }
.st-pill.st-sent { background: #dcf5df; color: #16651f; }
.st-pill.st-cancelled { background: #fbe4e1; color: #a3261c; }

/* orders */
.orders-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.order-list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.order-head, .order-row { display: grid; grid-template-columns: 1.1fr 1.3fr 1.3fr .8fr auto; gap: 12px; align-items: center; padding: 10px 14px; }
.order-head { font-size: .8rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.order-row { width: 100%; border: 0; border-bottom: 1px solid var(--line); border-left: 4px solid transparent; background: var(--card); text-align: left; cursor: pointer; }
.order-row:hover, .order-row[aria-pressed="true"] { background: var(--bg); }
.order-row.st-new { border-left-color: #fbb315; }
.order-row.st-sent { border-left-color: #2e9e6a; }
.order-row.st-cancelled { border-left-color: var(--danger); }
.order-row > span { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.order-row small, .or-where { color: var(--muted); font-size: .8rem; }
.order-row > .or-where { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.or-total { font-variant-numeric: tabular-nums; }
.order-detail { position: sticky; top: 16px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.od-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.od-head h2 { margin: 0; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.od-quick { min-height: 56px; font-size: 1.05rem; }
.od-pay { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; border: 1.5px solid var(--line); }
.od-pay-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.od-pay .link { align-self: flex-start; min-height: 44px; }
.or-pills { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.pay-pill { padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 800; white-space: nowrap; }
.pay-pill.not-paid { background: #fbe4e1; color: #9a2418; }
.pay-pill.is-paid { background: #dfe6da; color: #2f4a2c; }
.od-who { margin: 0; display: flex; flex-direction: column; gap: 2px; font-size: .9rem; overflow-wrap: anywhere; }
.od-who span { color: var(--muted); }
.od-items { list-style: none; margin: 0; padding: 12px; border-radius: 12px; background: var(--bg); display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }
.od-items li { display: flex; justify-content: space-between; gap: 10px; }
.od-total { font-weight: 800; padding-top: 6px; border-top: 1px solid var(--line); }
.od-status { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.st-btn { min-height: 44px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); font-weight: 700; cursor: pointer; }
.st-btn[aria-pressed="true"].st-new { background: #fff1cc; border-color: #fbb315; color: #6b4600; }
.st-btn[aria-pressed="true"].st-confirmed { background: #ebe8e2; border-color: #8a8579; color: #3a3f37; }
.st-btn[aria-pressed="true"].st-sent { background: #dcf5df; border-color: #2e9e6a; color: #16651f; }
.st-btn[aria-pressed="true"].st-cancelled { background: #fbe4e1; border-color: var(--danger); color: #a3261c; }
.od-track { display: flex; gap: 6px; }
.od-track input { flex: 1; min-width: 0; }
.btn.whatsapp { min-height: 48px; }

/* dashboard */
.dash { display: flex; flex-direction: column; gap: 16px; padding-bottom: 32px; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.dash-head h1 { margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi, .panel-box { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi-label { color: var(--muted); font-size: .85rem; }
.kpi-value { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; overflow-wrap: anywhere; }
.kpi-change { font-size: .8rem; color: var(--muted); }
.kpi-change.up b { color: #23602e; }
.kpi-change.down b { color: #a3261c; }
.dash-row { display: grid; gap: 16px; }
.dash-row.wide { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.dash-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.panel-title { margin: 0; font-size: 1rem; }
.table-box { max-height: 320px; overflow: auto; }
.table-box .table { box-shadow: none; }

/* daily sales bars: one series, one hue (validated light/dark), rounded top, 2px gap, hover/focus tooltip */
.chart { --bar: #2f7d3c; --bar-hi: #1f5a29; padding: 8px 0 26px 40px; }
.chart-plot { position: relative; height: 240px; border-bottom: 1px solid var(--muted); }
.tick { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.tick small { position: absolute; right: 100%; top: -9px; padding-right: 6px; font-size: .7rem; color: var(--muted); }
.bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.bar-col { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; outline-offset: 0; }
.bar { width: 100%; min-height: 0; border-radius: 4px 4px 0 0; background: var(--bar); }
.bar-col:hover .bar, .bar-col:focus .bar { background: var(--bar-hi); }
.bar-tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 2; display: none; flex-direction: column; padding: 6px 10px; border-radius: 8px; background: var(--ink); color: var(--bg); font-size: .75rem; white-space: nowrap; pointer-events: none; }
.bar-col:hover .bar-tip, .bar-col:focus .bar-tip { display: flex; }
.bar-col:first-child .bar-tip { left: 0; transform: none; }
.bar-col:last-child .bar-tip { left: auto; right: 0; transform: none; }
.bar-x { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); padding-top: 4px; font-size: .7rem; color: var(--muted); white-space: nowrap; }
.status-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.status-link { width: 100%; min-height: 48px; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); cursor: pointer; text-align: left; }
.status-link:hover { border-color: var(--brand); }
.status-link strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hbars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.hbar-track { grid-column: 1 / -1; grid-row: 2; height: 8px; border-radius: 4px; background: var(--line); }
.hbar { display: block; height: 100%; border-radius: 4px; background: #2f7d3c; }
.hbar-n { grid-column: 2; grid-row: 1; font-size: .85rem; font-variant-numeric: tabular-nums; }
.split { display: flex; gap: 2px; height: 28px; border-radius: 6px; overflow: hidden; }
.split > span { display: grid; place-items: center; color: #fff; font-size: .75rem; font-weight: 700; min-width: 0; }
.split-clothes, .key-clothes { background: #2f7d3c; }
.split-home, .key-home { background: #6d5aa8; }
.cat-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }
.cat-list li { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: center; }
.key { width: 12px; height: 12px; border-radius: 3px; }
.cust { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.cust > div { padding: 10px; border-radius: 10px; background: var(--bg); display: flex; flex-direction: column; }
.cust strong { font-size: 1.4rem; }
.reward-line { margin: 0; padding: 10px; border-radius: 10px; background: #dcf5df; color: #16651f; font-size: .85rem; }
/* Dark mode: only when the visitor turns it on (theme.js). */
:root[data-theme="dark"] .chart { --bar: #4fa35f; --bar-hi: #7cc48a; }
:root[data-theme="dark"] .hbar, :root[data-theme="dark"] .split-clothes, :root[data-theme="dark"] .key-clothes { background: #4fa35f; }
:root[data-theme="dark"] .split-home, :root[data-theme="dark"] .key-home { background: #8f7fd0; }
:root[data-theme="dark"] .kpi-change.up b { color: #7cc48a; }
:root[data-theme="dark"] .kpi-change.down b { color: #ff8f86; }
@media (max-width: 960px) {
  .orders-grid, .dash-row.wide, .dash-row.three { grid-template-columns: 1fr; }
  .order-detail { position: static; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kinds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .order-head { display: none; }
  .order-row { grid-template-columns: 1fr auto; }
  .or-where { grid-column: 1 / -1; }
  .color-row { grid-template-columns: 48px 1fr; }
  .color-row > :nth-child(n+4) { grid-column: 1 / -1; }
  .kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart { padding-left: 34px; }
}

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .modal-grid { grid-template-columns: 1fr; }
  .modal-media { aspect-ratio: 4 / 3; }
  .modal-info { padding: 20px; }
  .form-panel { grid-template-columns: 1fr; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { display: grid; grid-template-columns: 60px 1fr; gap: 4px 12px; padding: 12px; border-bottom: 1px solid var(--line); }
  .table td { border: 0; padding: 0; }
  .table td:first-child { grid-row: span 4; }
  .row-actions { justify-content: flex-start; }
}
@media (max-width: 639px) {
  .logo small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Light / dark switch button: moon in light mode, sun in dark mode. */
.theme-btn { display: inline-grid; place-items: center; }
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn .i-sun, :root[data-theme="dark"] .theme-btn .i-moon { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }

/* Admin: slip photo + stamp box */
.od-slip { display: flex; gap: 10px; align-items: center; }
.od-slip img, .od-slip-ph { width: 96px; height: 136px; object-fit: cover; border-radius: 10px; background: var(--bg); display: grid; place-items: center; font-size: .8rem; color: var(--muted); text-align: center; flex: none; }
.od-slip > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.od-slip small { color: var(--muted); }
.od-stamp-box { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); }
.od-stamp-box.reward { border-color: #3f5a3c; background: #dfe6da; color: #1d211c; }
.od-stamp-box p { margin: 0; font-weight: 700; }
.od-stamp-box small { color: #6b4e00; }
.od-stamp-dots { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.od-stamp-dots li { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: .7rem; font-weight: 800; color: var(--muted); }
.od-stamp-dots li.on { background: #3f5a3c; border-color: #3f5a3c; color: #ffffff; }
.od-stamp-dots li.gift { border-style: dashed; }
.stamp-chip { padding: 2px 10px; border-radius: 999px; background: #3f5a3c; color: #ffffff; font-size: .75rem; font-weight: 800; white-space: nowrap; }


/* Free plan usage (Admin → Overview) */
.usage-box { gap: 14px; }
.usage-row { display: flex; flex-direction: column; gap: 6px; }
.usage-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.usage-num { font-weight: 700; font-size: .9rem; white-space: nowrap; }
.usage-num.ok { color: #2f4a2c; } .usage-num.warn { color: #6b4e00; } .usage-num.full { color: #9a2418; }
.usage-bar { height: 12px; border-radius: 999px; background: var(--line); overflow: hidden; }
.usage-fill { display: block; height: 100%; border-radius: 999px; background: #3f5a3c; transition: width .4s ease; }
.usage-fill.warn { background: #c98a00; } .usage-fill.full { background: #b2292a; }
.usage-alert { margin: 0; border-radius: 12px; padding: 10px 12px; font-weight: 600; font-size: .9rem; }
.usage-alert.warn { background: #fff1cc; color: #5a4300; } .usage-alert.full { background: #fbe4e1; color: #7a1d14; }
.usage-msg { margin: 0; border-radius: 12px; padding: 12px; background: var(--bg); color: var(--muted); font-size: .9rem; }
.usage-foot { border-top: 1px dashed var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
.usage-foot a { font-weight: 700; color: var(--ink); }
.usage-skel { display: flex; flex-direction: column; gap: 12px; }
.usage-skel span { height: 14px; width: 55%; border-radius: 6px; background: var(--line); }
.usage-skel span.bar { height: 12px; width: 100%; border-radius: 999px; }
.usage-box .panel-head .btn { min-height: 44px; }
:root[data-theme="dark"] .usage-num.ok { color: #7cc48a; } :root[data-theme="dark"] .usage-num.warn { color: #f2c94c; } :root[data-theme="dark"] .usage-num.full { color: #ff8a80; }
:root[data-theme="dark"] .usage-fill { background: #4fa35f; }
:root[data-theme="dark"] .usage-fill.warn { background: #e0a400; } :root[data-theme="dark"] .usage-fill.full { background: #e5534b; }
:root[data-theme="dark"] .usage-alert.warn { background: #3a3014; color: #f7dc8a; } :root[data-theme="dark"] .usage-alert.full { background: #3d1c1a; color: #ffb4ab; }
