/* ==========================================================================
   Tokoku — storefront + admin styles. One file, no build step, no webfonts.
   Mobile first. Everything scales from 360px up.
   ========================================================================== */

:root {
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --bg: #ffffff;
  --bg-soft: #f7f9fc;
  --brand: #1259d6;
  --brand-dark: #0d3f9c;
  --brand-soft: #eaf1fe;
  --sale: #d92d20;
  --ok: #067647;
  --warn: #b54708;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 6px 20px rgba(15, 23, 42, .08);
  --wrap: 1200px;
  --tap: 44px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; font-weight: 750; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 .8em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: grid; gap: 12px; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.mono { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--tap); min-height: var(--tap); box-sizing: border-box; padding: 0 18px;
  border: 1px solid var(--line-2); border-radius: 10px;
  background: #fff; font-family: var(--font-body); font-weight: 650; font-size: .95rem;
  cursor: pointer; transition: background .15s, border-color .15s, transform .06s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line-2); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-danger { background: #fff; border-color: #f3c1bd; color: var(--sale); }
.btn-sm { height: 36px; min-height: 36px; padding: 0 12px; font-size: .85rem; border-radius: 8px; }
.admin :is(.row, .cat-edit):has(> input:is([type=text], [type=search], [type=email], [type=tel], [type=password], [type=number], [type=file]), > select) > .btn-sm {
  height: var(--tap); min-height: var(--tap);
}
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* --------------------------------------------------------------- forms */

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > label, .field > .field-label { font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: .78rem; color: var(--muted); }
input[type=text], input[type=search], input[type=email], input[type=tel],
input[type=password], input[type=number], input[type=file], input[type=date],
input[type=time], input[type=datetime-local], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-2); border-radius: 10px;
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
input[type=text], input[type=search], input[type=email], input[type=tel],
input[type=password], input[type=number], input[type=file], select {
  height: var(--tap); min-height: var(--tap); box-sizing: border-box;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(18, 89, 214, .12);
}
textarea { min-height: 96px; resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: .9rem; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }

/* --------------------------------------------------------------- header */

.topbar {
  background: var(--ink); color: #dbe3ef; font-size: .78rem;
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 34px; gap: 10px; }
.topbar a { color: #dbe3ef; }
.topbar a:hover { color: #fff; }
.topbar .tb-links { display: none; gap: 16px; }

.header { border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 40; }
.header .wrap { display: flex; align-items: center; gap: 10px; padding-top: 10px; padding-bottom: 10px; }

.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.02rem; letter-spacing: -.02em; }
.logo .mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: linear-gradient(140deg, var(--brand), #3b82f6);
  color: #fff; display: grid; place-items: center; font-size: .82rem; font-weight: 800;
}
.logo span.name { display: block; line-height: 1.1; }
.logo-img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; display: block; background: #fff; }
.logo span.sub { display: block; font-size: .64rem; font-weight: 600; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }

.search { flex: 1; position: relative; display: none; }
.search input { min-height: 42px; padding-left: 38px; border-radius: 999px; background: var(--bg-soft); }
.search .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.header .actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.icon-btn {
  display: inline-grid; place-items: center; position: relative;
  width: 42px; height: 42px; border-radius: 10px; border: 1px solid transparent;
  background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--bg-soft); }
.icon-btn .count {
  position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 999px; background: var(--brand); color: #fff;
  font-size: .66rem; font-weight: 700; display: grid; place-items: center;
}

.nav-shell { position: relative; }
.nav { border-bottom: 1px solid var(--line); background: #fff; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; }
.nav::-webkit-scrollbar { display: none; }
.nav ul { display: flex; gap: 2px; margin: 0; padding: 0 12px; list-style: none; max-width: var(--wrap); margin-inline: auto; }
.nav li { scroll-snap-align: start; }
.nav-next {
  position: absolute; top: 0; right: 0; bottom: 1px; width: 44px;
  display: grid; place-items: center;
  border: 0; border-left: 1px solid var(--line);
  background: #fff;
  box-shadow: -10px 0 10px -10px rgba(15, 23, 42, .22);
  color: var(--ink-2); cursor: pointer; z-index: 2;
}
.nav-next:hover { color: var(--brand); }
.nav-next[hidden] { display: none; }
.nav-prev {
  position: absolute; top: 0; left: 0; bottom: 1px; width: 44px;
  display: grid; place-items: center;
  border: 0; border-right: 1px solid var(--line);
  background: #fff;
  box-shadow: 10px 0 10px -10px rgba(15, 23, 42, .22);
  color: var(--ink-2); cursor: pointer; z-index: 2;
}
.nav-prev:hover { color: var(--brand); }
.nav-prev[hidden] { display: none; }
.nav-prev svg { transform: rotate(180deg); }
.nav a { display: flex; align-items: center; min-height: 44px; padding: 0 9px; font-size: .88rem; font-weight: 600; color: var(--ink-2); white-space: nowrap; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------------------------------------------------------------- hero */

.hero { background: linear-gradient(150deg, var(--hero-from, #0b1b3a) 0%, #12306b 55%, var(--hero-to, #1259d6) 100%); color: #fff; }
.hero-slider {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.hero-slider::-webkit-scrollbar { display: none; }
.hero.slide { flex: 0 0 100%; min-width: 100%; scroll-snap-align: start; }
.hero-dots { display: flex; gap: 7px; justify-content: center; padding: 10px 0 12px; background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.hero-dots .dot {
  width: 8px; height: 8px; border-radius: 50%; border: 0; padding: 0;
  background: #c3cfe2; cursor: pointer; transition: width .2s ease, background .2s ease;
}
.hero-dots .dot.on { width: 22px; border-radius: 5px; background: var(--brand); }
.hero.has-image {
  background-image:
    linear-gradient(115deg, rgba(8, 20, 44, .92) 0%, rgba(10, 28, 66, .78) 45%, rgba(18, 89, 214, .45) 100%),
    var(--hero-img, none);
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
}
.hero.has-image .art { display: none !important; }
.hero .wrap { padding-top: 28px; padding-bottom: 28px; display: grid; gap: 22px; }
.hero .eyebrow { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: #9fc0ff; font-weight: 700; }
.hero h1 { font-size: 1.75rem; line-height: 1.15; letter-spacing: -.025em; }
.hero p { color: #c7d7f5; margin: 10px 0 0; max-width: 46ch; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.hero .btn-white { background: #fff; color: var(--brand-dark); border-color: #fff; font-weight: 700; }
.hero .btn-outline { background: transparent; border-color: rgba(255,255,255,.45); color: #fff; }
.hero .stats { display: flex; gap: 26px; margin-top: 22px; }
.hero .stats b { display: block; font-size: 1.15rem; }
.hero .stats span { font-size: .75rem; color: #9fc0ff; }
.hero .art { display: none; align-self: center; }

/* ------------------------------------------------------------ trust bar */

.trust { background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.trust .wrap { display: grid; gap: 14px; padding-top: 16px; padding-bottom: 16px; }
.trust .item { display: flex; gap: 10px; align-items: center; }
.trust .ico { width: 32px; height: 32px; flex: none; border-radius: 8px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; color: var(--brand); }
.trust b { display: block; font-size: .85rem; }
.trust span { font-size: .78rem; color: var(--muted); }

/* -------------------------------------------------------------- section */

.section { padding: 26px 0; }
.section.tight { padding: 18px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: 1.12rem; }
.section-head .link { font-size: .82rem; font-weight: 650; color: var(--brand); white-space: nowrap; }
.section-head p { margin: 2px 0 0; font-size: .82rem; color: var(--muted); }

/* ------------------------------------------------------------ cat tiles */

.cats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.cat-tile {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; min-height: 64px; transition: border-color .15s, box-shadow .15s;
}
.cat-tile:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.cat-tile .glyph { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; overflow: hidden; }
.cat-tile .glyph img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.cat-edit { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cat-icon-preview {
  width: 34px; height: 34px; border-radius: 9px; background: var(--brand-soft);
  color: var(--brand); display: grid; place-items: center; flex: none; overflow: hidden;
}
.cat-icon-preview img { width: 100%; height: 100%; object-fit: cover; }

/* Material Symbols picker */
.icon-pick { display: inline-flex; align-items: center; gap: 2px; }
.icon-pick-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px;
  border: 1px solid var(--line-2); border-radius: 9px; background: #fff; color: var(--ink-2);
  font-size: .75rem; cursor: pointer; max-width: 200px;
}
.icon-pick-btn:hover { border-color: var(--brand); color: var(--brand); }
.icon-pick-glyph { font-size: 19px; color: var(--brand); }
.icon-pick-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-pick.is-empty .icon-pick-btn { color: var(--muted); }
.icon-pick.is-empty .icon-pick-glyph { color: var(--muted); }
.icon-pick-clear {
  border: 0; background: none; color: var(--muted); font-size: 1.05rem; line-height: 1;
  cursor: pointer; padding: 4px 6px; border-radius: 7px;
}
.icon-pick-clear:hover { background: var(--bg-soft); color: var(--danger, #dc2626); }
.icon-pick.is-empty .icon-pick-clear { display: none; }

.icon-dialog {
  width: min(600px, 94vw); max-height: 84vh; padding: 0; border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden; box-shadow: 0 24px 60px rgba(15, 23, 42, .25);
}
.icon-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.icon-dialog-head {
  display: flex; gap: 8px; align-items: center; padding: 12px;
  background: #fff; border-bottom: 1px solid var(--line);
}
.icon-dialog-head input { flex: 1; }
.icon-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 6px;
  padding: 12px; overflow: auto; max-height: 58vh;
}
.icon-cell {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: 54px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  cursor: pointer; color: var(--ink-2); overflow: hidden;
}
.icon-cell:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.icon-cell .ms { font-size: 22px; }
.icon-cell span:last-child {
  font-size: .58rem; max-width: 92%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted);
}
.icon-meta { padding: 0 14px 12px; margin: 0; }
@media (max-width: 560px) {
  .icon-dialog { width: 100vw; max-width: 100vw; max-height: 92vh; border-radius: 14px 14px 0 0; margin: auto auto 0; }
  .icon-grid { max-height: 66vh; }
}
.cat-tile b { display: block; font-size: .87rem; font-weight: 650; line-height: 1.2; color: var(--ink); }
.cat-tile span { font-size: .72rem; color: var(--muted); }

/* --------------------------------------------------------------- cards */

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid.cols-4 { }
.card {
  position: relative; display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  overflow: hidden; transition: border-color .15s, box-shadow .15s;
}
.card:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.card .thumb { position: relative; aspect-ratio: 1 / 1; background: #fff; display: block; }
.card .thumb img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.card .body { padding: 9px 10px 10px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.card .name { font-size: .82rem; font-weight: 600; line-height: 1.32; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .name:hover { color: var(--brand); }
.card .price-row { margin-top: auto; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.card .price { font-size: .95rem; font-weight: 750; color: var(--brand); }
.card .was { font-size: .74rem; color: var(--muted); text-decoration: line-through; }
.card .meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: .7rem; color: var(--muted); min-height: 16px; padding-right: 40px; }
.card .add {
  position: absolute; right: 8px; bottom: 8px;
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--brand);
  background: var(--brand); color: #fff; display: grid; place-items: center; cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.card .add:hover { background: var(--brand-dark); }
.card .add[disabled] { background: var(--line-2); border-color: var(--line-2); cursor: not-allowed; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 6px;
  font-size: .68rem; font-weight: 700; letter-spacing: .02em;
}
.badge.sale { background: #fee4e2; color: var(--sale); }
.badge.out { background: #f1f5f9; color: var(--muted); }
.badge.low { background: #fef0c7; color: var(--warn); }
.badge.in { background: #dcfae6; color: var(--ok); }
.badge.new { background: var(--brand-soft); color: var(--brand); }
.thumb .badge { position: absolute; left: 8px; top: 8px; z-index: 2; }

/* ------------------------------------------------------------- listing */

.crumbs { display: flex; gap: 6px; align-items: center; font-size: .78rem; color: var(--muted); padding: 12px 0 0; flex-wrap: wrap; }
.crumbs a:hover { color: var(--brand); }
.crumbs .sep { opacity: .5; }

.listing-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px; padding: 8px 0 14px; }
.listing-head h1 { font-size: 1.35rem; }
.listing-head .count { font-size: .82rem; color: var(--muted); }
.listing-head form { align-items: center; flex-wrap: wrap; }
.listing-head form select {
  width: auto; padding: 0 30px 0 10px;
  font-size: .85rem; border: 1px solid var(--line-2); border-radius: 9px; background: #fff;
}
.listing-head form .chip { height: 38px; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 0 0 14px; }
.toolbar form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar select { width: auto; padding: 0 30px 0 10px; font-size: .85rem; border-radius: 9px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 9px; background: #fff; font-size: .85rem; font-weight: 600; cursor: pointer;
  white-space: nowrap;
}
.chip input { accent-color: var(--brand); }
.toolbar .chip { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 9px; background: #fff; font-size: .85rem; font-weight: 600; cursor: pointer;
  white-space: nowrap;
}
.toolbar .chip input { accent-color: var(--brand); }

.layout { display: grid; gap: 18px; }
.side { display: none; }
.side .panel { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.side .panel h3 { padding: 12px 14px; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.side ul { list-style: none; margin: 0; padding: 6px; }
.side li a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 8px; font-size: .86rem; }
.side li a:hover { background: var(--bg-soft); color: var(--brand); }
.side li a .n { font-size: .74rem; color: var(--muted); }

.pager { display: flex; gap: 6px; justify-content: center; padding: 22px 0 4px; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 38px; height: 38px; padding: 0 10px; border-radius: 9px;
  border: 1px solid var(--line); display: grid; place-items: center; font-size: .85rem; font-weight: 600;
}
.pager a:hover { border-color: var(--brand); color: var(--brand); }
.pager .on { background: var(--brand); border-color: var(--brand); color: #fff; }

.empty { border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 34px 18px; text-align: center; color: var(--muted); }

/* ------------------------------------------------------------- product */

.product { display: grid; gap: 18px; padding: 6px 0 20px; }
.gallery { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.gallery img { width: 100%; aspect-ratio: 1/1; max-height: none; object-fit: contain; padding: 12px; }
.gallery .thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 0 12px 12px; scrollbar-width: none; }
.gallery .thumbs::-webkit-scrollbar { display: none; }
.gallery .thumb {
  width: 64px; height: 64px; flex: none; padding: 4px; cursor: pointer;
  border: 1px solid var(--line-2); border-radius: 9px; background: #fff;
}
.gallery .thumb.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.gallery .thumb img { width: 100%; height: 100%; object-fit: contain; }
.variant-head { display: flex; gap: 8px; align-items: center; padding: 0 2px 6px; font-weight: 650; }
.gallery-admin { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.g-item {
  border: 1px solid var(--line); border-radius: 9px; padding: 6px;
  width: 86px; text-align: center; background: #fff;
}
.g-item img { width: 100%; height: 64px; object-fit: contain; }
.g-item span { font-size: .68rem; display: block; margin-top: 2px; color: var(--muted); }

.buybox h1 { font-size: 1.22rem; line-height: 1.3; margin-bottom: 8px; }
.buybox .sku { font-size: .78rem; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.price-block { margin: 12px 0 4px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.price-block .now { font-size: 1.65rem; font-weight: 800; color: var(--brand); letter-spacing: -.02em; }
.price-block .was { color: var(--muted); text-decoration: line-through; font-size: .95rem; }
.price-block .off { background: #fee4e2; color: var(--sale); font-weight: 700; font-size: .74rem; padding: 3px 7px; border-radius: 6px; }

.buy-row { display: flex; gap: 8px; align-items: stretch; margin-top: 14px; }
.qty { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.qty button { width: 40px; height: var(--tap); background: #fff; border: 0; font-size: 1.1rem; cursor: pointer; color: var(--ink-2); }
.qty button:hover { background: var(--bg-soft); }
.qty input { width: 52px; height: var(--tap); border: 0; text-align: center; font-weight: 650; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.buy-row .btn { flex: 1; }

.variants { display: grid; gap: 8px; margin-top: 14px; }
.variants .opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; cursor: pointer; font-size: .88rem;
}
.variants .opt input { accent-color: var(--brand); width: 17px; height: 17px; }
.variants .opt.on { border-color: var(--brand); background: var(--brand-soft); }

.notes { display: grid; gap: 8px; margin-top: 16px; font-size: .84rem; color: var(--ink-2); }
.notes div { display: flex; gap: 8px; align-items: flex-start; }
.notes svg { flex: none; color: var(--brand); margin-top: 2px; }

.tabs { border-top: 1px solid var(--line); margin-top: 22px; }
.tab-head { display: flex; gap: 18px; }
.tab-head button { background: none; border: 0; padding: 12px 0; font-weight: 650; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; font-size: .9rem; }
.tab-head button.on { color: var(--ink); border-bottom-color: var(--brand); }
.tab-body { padding: 14px 0 0; font-size: .9rem; color: var(--ink-2); }
.tab-body h4 { margin: 14px 0 6px; font-size: .9rem; color: var(--ink); }
.tab-body ul, .tab-body ol { padding-left: 20px; }

.sticky-buy { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: #fff; border-top: 1px solid var(--line); padding: 10px 16px; display: flex; gap: 10px; align-items: center; box-shadow: 0 -6px 20px rgba(15,23,42,.06); }
.sticky-buy .p { font-weight: 800; color: var(--brand); }
.sticky-buy .btn { flex: 1; }

/* ---------------------------------------------------------------- cart */

.cart-grid { display: grid; gap: 18px; align-items: start; }
.cart-line { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-line img { width: 68px; height: 68px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; padding: 4px; background: #fff; }
.cart-line .name { font-size: .88rem; font-weight: 600; display: block; }
.cart-line .vt { font-size: .76rem; color: var(--muted); }
.cart-line .bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.summary .line span, .panel .line span { min-width: 0; overflow-wrap: anywhere; }
.link-danger { background: none; border: 0; padding: 0; color: var(--muted); font-size: .78rem; cursor: pointer; text-decoration: underline; }
.link-danger:hover { color: var(--sale); }

.summary { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: #fff; position: sticky; top: 80px; }
.summary h3 { font-size: .95rem; margin-bottom: 12px; }
.summary .line { display: flex; justify-content: space-between; gap: 10px; font-size: .88rem; padding: 6px 0; color: var(--ink-2); }
.summary .total { display: flex; justify-content: space-between; font-size: 1.05rem; font-weight: 800; padding-top: 12px; margin-top: 8px; border-top: 1px dashed var(--line-2); }
.summary .btn { margin-top: 14px; }

.paynote { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: .8rem; color: var(--ink-2); margin-top: 12px; }

/* ------------------------------------------------------------ checkout */

.steps { display: flex; gap: 6px; align-items: center; font-size: .76rem; color: var(--muted); margin: 14px 0 18px; flex-wrap: wrap; }
.steps b { color: var(--ink); }
.steps .on { color: var(--brand); font-weight: 700; }
.checkout-grid { display: grid; gap: 18px; align-items: start; }
.form-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.form-card h3 { font-size: .95rem; margin-bottom: 12px; }
.pay-opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line-2); border-radius: 10px; padding: 12px; cursor: pointer; margin-bottom: 8px; }
.pay-opt.on { border-color: var(--brand); background: var(--brand-soft); }
.pay-opt input { margin-top: 3px; accent-color: var(--brand); }
.pay-opt b { display: block; font-size: .88rem; color: var(--ink); }
.pay-opt span { font-size: .78rem; color: var(--muted); }

.alert { border-radius: 10px; padding: 12px 14px; font-size: .86rem; margin-bottom: 14px; border: 1px solid; }
.alert.err { background: #fef3f2; border-color: #fecdca; color: #912018; }
.alert.ok { background: #ecfdf3; border-color: #abefc6; color: #067647; }
.alert.warn { background: #fffaeb; border-color: #fedf89; color: #b54708; }

.done { max-width: 640px; margin: 0 auto; text-align: center; padding: 30px 0; }
.done .tick { width: 56px; height: 56px; border-radius: 50%; background: #dcfae6; color: var(--ok); display: grid; place-items: center; margin: 0 auto 14px; }
.done .code { font-size: 1.3rem; font-weight: 800; letter-spacing: .04em; }
.bank { text-align: left; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 18px 0; background: var(--bg-soft); }
.bank .k { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.bank .v { font-size: 1.05rem; font-weight: 750; }
.bank .copy { background: none; border: 0; color: var(--brand); font-size: .78rem; font-weight: 650; cursor: pointer; padding: 0; }

/* ------------------------------------------------------------ pembayaran */

.btn-wa {
  background: #25d366; color: #06381a; border: 1px solid #1eb85a;
  font-weight: 750;
}
.btn-wa:hover { background: #1fc25c; color: #042a13; }
.btn-wa svg { stroke: #06381a; }

.pay-box {
  text-align: left; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin: 18px 0; background: var(--bg-soft);
}
.pay-box .k { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.pay-amount { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.pay-box .copy {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  color: var(--brand); font-size: .78rem; font-weight: 700; cursor: pointer; padding: 7px 12px;
}
.pay-box .copy:hover { border-color: var(--brand); }

.pay-lead { font-size: .84rem; color: var(--ink-2); margin: 2px 0 12px; }
.pay-opts { display: grid; gap: 10px; }
.pay-opts.single { grid-template-columns: 1fr; }

/* ------------------------------------------------------------------ ongkir */
.dest-pick { position: relative; }
.dest-results {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px);
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 14px 30px -18px rgba(11, 27, 58, .45);
  max-height: 264px; overflow: auto; padding: 4px;
}
.dest-item {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  padding: 8px 10px; border-radius: 8px; cursor: pointer; font: inherit;
}
.dest-item:hover, .dest-item:focus-visible { background: var(--brand-soft); }
.dest-item b { display: block; font-size: .84rem; font-weight: 650; }
.dest-item span { display: block; font-size: .72rem; color: var(--muted); }
.dest-empty { padding: 10px; font-size: .78rem; color: var(--muted); }
.dest-chosen {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 8px; padding: 8px 10px; border-radius: 8px;
  background: var(--brand-soft); border: 1px solid var(--brand); font-size: .8rem;
}
.dest-chosen svg { vertical-align: -2px; color: var(--brand); }
.link-btn {
  background: none; border: 0; padding: 0; font: inherit; font-size: .78rem;
  font-weight: 650; color: var(--brand); cursor: pointer; text-decoration: underline;
}
.ship-box { margin: 4px 0 14px; padding: 12px; border: 1px dashed var(--line-2); border-radius: 10px; }
.ship-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; gap: 10px; }
.ship-head b { font-size: .88rem; }
.ship-options { display: grid; gap: 6px; }
.ship-options .pay-opt { margin-bottom: 0; }
/* Nama kurir harus terbaca sebagai judul, bukan teks bantuan abu-abu. */
.ship-options .pay-opt b { color: var(--ink); font-weight: 650; }
.ship-options .pay-opt.on b { color: var(--ink); }
/* Isi kartu mengisi lebar supaya harga bisa rata kanan. */
.ship-options .pay-opt > span { flex: 1; min-width: 0; }
.ship-options .ship-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ship-options .ship-cost { color: var(--ink); font-weight: 700; white-space: nowrap; }
.ship-options .ship-group {
  font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-2); margin: 12px 2px 2px;
}
.ship-options .ship-group:first-child { margin-top: 0; }
.ship-options .ship-tag {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 99px;
  background: var(--brand-soft); color: var(--brand); font-size: .62rem; font-weight: 800;
  letter-spacing: .04em; text-transform: uppercase; vertical-align: 1px;
}

/* --------------------------------------------------------------- admin ongkir */
.ongkir-status { display: grid; gap: 8px; }
.ongkir-status .row { display: grid; gap: 2px; font-size: .84rem; padding: 8px 0; border-bottom: 1px dashed var(--line-2); }
.ongkir-status .row > span { color: var(--muted); font-size: .76rem; }
.ongkir-status .row > b { font-weight: 650; overflow-wrap: anywhere; }
.ongkir-status .row:last-child { border-bottom: 0; }
.ongkir-tests { margin-top: 10px; display: grid; gap: 6px; }
.courier-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.courier-actions { display: flex; gap: 10px; }
.courier-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.courier-opt {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px; font-size: .82rem;
  border: 1px solid var(--line-2); border-radius: 8px; background: #fff; cursor: pointer;
}
.courier-opt input { accent-color: var(--brand); width: 16px; height: 16px; flex: none; }
.courier-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
/* Pemilih layanan per kurir */
.notice { border: 1px dashed var(--line-2); border-radius: 10px; padding: 12px; background: #fbfcfe; }
.svc-wrap { display: grid; gap: 12px; }
.svc-group { border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.svc-courier {
  font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-2); background: #f7f9fc; padding: 7px 10px; border-bottom: 1px solid var(--line-2);
}
.svc-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; font-size: .82rem; cursor: pointer; }
.svc-opt + .svc-opt { border-top: 1px dashed var(--line-2); }
.svc-opt input { accent-color: var(--brand); width: 16px; height: 16px; flex: none; }
.svc-opt .svc-name { font-weight: 650; }
.svc-opt .svc-cost { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.svc-opt:has(input:checked) { background: var(--brand-soft); }
.ongkir-tests .row { display: flex; justify-content: space-between; gap: 12px; font-size: .84rem; }

@media (min-width: 520px) { .pay-opts { grid-template-columns: 1fr 1fr; } }
.pay-opt-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 12px; background: #fff;
}
.pay-opt-card.fast { border-color: var(--brand); background: var(--brand-soft); }
.pay-opt-card .k {
  font-size: .72rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
}
.pay-opt-card .pay-amount { font-size: 1.32rem; }
.pay-opt-card p { margin: 2px 0 0; font-size: .76rem; line-height: 1.4; }
.pay-opt-card .copy { margin-top: 8px; }
.pay-badge {
  font-style: normal; color: #fff; background: var(--brand); border-radius: 999px;
  padding: 2px 7px; font-size: .62rem; letter-spacing: .03em; text-transform: none;
}
.pay-note { margin: 10px 0 0; font-size: .76rem; }
.pay-hint { display: block; margin-top: 2px; font-size: .74rem; color: var(--muted); }

.qris { margin-top: 16px; text-align: center; }
.qris img {
  width: 100%; max-width: 240px; height: auto; display: block; margin: 0 auto 8px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 8px;
}

.bank-alt { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line-2); }
.bank-alt .k { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.bank-alt .v { font-size: 1rem; font-weight: 750; }

/* Daftar rekening (bisa lebih dari satu) + logo bank. */
.bank-list { display: grid; gap: 10px; }
.bank-block { display: grid; gap: 4px; }
.bank-edit summary {
  cursor: pointer; font-size: .78rem; font-weight: 650; color: var(--brand);
  padding: 2px 4px; width: fit-content;
}
.bank-edit form {
  margin-top: 4px; padding: 12px; border: 1px dashed var(--line-2);
  border-radius: var(--radius-sm); background: var(--bg-soft);
}
.bank-row, .bank-item {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 9px 10px; background: #fff;
}
.bank-alt .bank-row { margin-top: 8px; background: var(--bg-soft); }
.bank-logo { width: 48px; height: 32px; object-fit: contain; border-radius: 6px; background: #fff; border: 1px solid var(--line); flex: 0 0 auto; }
.bank-mark {
  width: 48px; height: 32px; border-radius: 6px; background: var(--brand-soft);
  color: var(--brand); display: grid; place-items: center; font-size: .66rem;
  font-weight: 800; letter-spacing: .02em; flex: 0 0 auto;
}
.bank-info { min-width: 0; flex: 1; }
.bank-info b { display: block; font-size: .86rem; line-height: 1.3; }
.bank-info span { font-size: .76rem; color: var(--muted); }
.bank-row .copy, .bank-item .copy {
  background: #fff; border: 1px solid var(--line); border-radius: 7px;
  color: var(--brand); font-size: .72rem; font-weight: 700; cursor: pointer; padding: 6px 10px;
}

.proof-box {
  text-align: left; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin: 0 0 18px; background: #fff;
}
.proof-box .k { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.proof-box img { width: 100%; max-width: 220px; height: auto; border-radius: 8px; border: 1px solid var(--line); display: block; }

.proof-form {
  text-align: left; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin: 0 0 18px; background: #fff;
}
.proof-form .k { display: block; font-size: .8rem; font-weight: 700; margin-bottom: 8px; }
.proof-form input[type=file] { width: 100%; font-size: .85rem; }

.file-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 1.5px dashed var(--line-2); border-radius: 10px; padding: 16px 12px;
  cursor: pointer; text-align: center; background: var(--bg-soft); transition: border-color .15s, background .15s;
}
.file-drop:hover, .file-drop:focus-within { border-color: var(--brand); background: #f2f7ff; }
.file-drop input[type=file] {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.file-cta { font-size: .88rem; font-weight: 750; color: var(--brand); }
.file-icon { color: var(--brand); display: flex; }
.file-icon svg { width: 22px; height: 22px; }
.file-name { font-size: .78rem; color: var(--muted); word-break: break-all; }

/* --------------------------------------------------- kotak cari halaman */

.page-search {
  display: flex; align-items: center; gap: 8px;
  margin: 12px 0 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 5px 5px 14px;
}
.page-search .icon { color: var(--muted); display: flex; flex: 0 0 auto; }
.page-search input { flex: 1; min-width: 0; border: 0; background: transparent; min-height: 40px; font-size: .95rem; }
.page-search input:focus { outline: none; }
.page-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.page-search .btn { border-radius: 999px; min-height: 40px; padding: 0 16px; flex: 0 0 auto; }

/* --------------------------------------------------- daftar pesanan saya */
.order-card {
  display: block; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 10px; background: #fff; color: inherit; text-decoration: none;
}
.order-card:hover { border-color: var(--brand); }
.order-card .oc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.order-card .oc-top b { font-size: .92rem; letter-spacing: -.01em; }
.order-card .oc-meta { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.order-card .oc-item { font-size: .84rem; margin-top: 6px; color: var(--ink-2); }
.order-card .oc-total { font-size: 1rem; font-weight: 800; margin-top: 6px; }

/* ------------------------------------------------------------- kupon */
.coupon-form { display: flex; align-items: stretch; gap: 6px; }
.coupon-form input {
  flex: 1; min-width: 0; min-height: 36px; height: 36px; border: 1px solid var(--line); border-radius: 8px;
  padding: 0 10px; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em;
  background: #fff; box-sizing: border-box;
}
.coupon-form input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.coupon-form .btn { white-space: nowrap; height: 36px; min-height: 36px; }

/* --------------------------------------------------- masuk saat checkout */

.account-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--line); border-left: 3px solid var(--brand);
  background: #f2f7ff; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px;
}
.account-bar b { font-size: .88rem; }
.account-bar form { margin: 0; }

.inline-login-card { margin-bottom: 16px; }
.inline-login { display: grid; gap: 10px; }
.inline-login input {
  border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px;
  font-size: .9rem; background: #fff; min-width: 0; width: 100%;
}
.inline-login input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }

/* Kartu login di checkout: ringkas sampai dibuka. */
.login-details {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; margin-bottom: 8px; overflow: hidden;
}
.login-details > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; cursor: pointer; list-style: none; font-size: .86rem;
}
.login-details > summary::-webkit-details-marker { display: none; }
.login-details > summary:hover { background: var(--bg-soft); }
.login-details .chev { display: flex; color: var(--muted); transition: transform .15s; }
.login-details[open] .chev { transform: rotate(90deg); }
.login-details .ld-body { padding: 0 14px 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.login-details[open] > summary { border-bottom: 1px solid var(--line); }
.guest-note { margin: 0 0 14px; font-size: .78rem; text-align: center; }

@media (min-width: 600px) {
  .inline-login { grid-template-columns: 1fr 1fr; align-items: end; }
  .inline-login .btn { grid-column: 1 / -1; }
  .inline-login .btn { white-space: nowrap; }
}

/* --------------------------------------------------------------- toast */
.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 16px);
  background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 10px;
  font-size: .86rem; font-weight: 600; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 60; max-width: 90vw; text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* -------------------------------------------------------------- footer */

.footer { border-top: 1px solid var(--line); margin-top: 30px; background: var(--bg-soft); }
.footer .wrap { padding-top: 26px; padding-bottom: 26px; display: grid; gap: 22px; }
.footer h4 { font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: .85rem; color: var(--ink-2); }
.footer a:hover { color: var(--brand); }
.footer .bottom { border-top: 1px solid var(--line); padding: 14px 0; font-size: .78rem; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ------------------------------------------------------ mobile tab bar */

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 46; background: #fff; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { display: grid; place-items: center; gap: 2px; padding: 8px 0 9px; font-size: .66rem; font-weight: 600; color: var(--muted); min-height: 52px; position: relative; }
.tabbar a.on { color: var(--brand); }
.tabbar .count { position: absolute; top: 4px; right: 50%; margin-right: -22px; background: var(--brand); color: #fff; border-radius: 999px; font-size: .6rem; padding: 1px 5px; }

/* ---------------------------------------------------------------- admin */

/* Admin spacing scale: 4 / 8 / 12 / 16 / 24 / 32px */
body.admin { --adm-rail: 72px; --adm-rail-open: 240px; --adm-bar: 56px; background: var(--bg-soft); }
@media screen and (min-width: 900px) { body.admin { padding-left: var(--adm-rail); } }
.adm-rail { position: fixed; inset: 0 auto 0 0; z-index: 50; width: var(--adm-rail); transition: width 140ms; background: var(--ink); color: white; display: flex; flex-direction: column; overflow: hidden; padding: 8px; }
.adm-rail:is(:hover,:focus-within) { width: var(--adm-rail-open); box-shadow: 6px 0 20px #0f172a20; }
.adm-rail nav { flex: 1; overflow: auto; scrollbar-width: none; padding: 4px; }
.adm-rail nav::-webkit-scrollbar { display: none; }
.adm-brand, .adm-rail footer { display: flex; align-items: center; gap: 14px; white-space: nowrap; min-height: 52px; color: white; padding: 0 9px; }
.adm-brand > :last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.adm-brand b, .adm-brand img { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; background: var(--brand); object-fit: contain; }
.adm-rail footer { border-top: 1px solid #ffffff26; padding-left: 19px; }
.adm-rail svg { flex: none; }
.adm-rail:not(:hover):not(:focus-within) :is(span,h2) { display: none; }
/* Without hover the rail would stay label-less forever, so touch gets labels always. */
@media (hover: none) { .adm-rail:not(:hover):not(:focus-within) :is(span,h2) { display: revert; } }
.adm-group { display: grid; gap: 3px; padding: 3px 0; }
.adm-rail .adm-group + .adm-group { border-top: 1px solid #ffffff26; }
.adm-group h2 { font-size: 9.5px; text-transform: uppercase; letter-spacing: 1.2px; color: #94a3b8; margin: 6px 12px 2px; }
.adm-group a { display: flex; align-items: center; gap: 12px; min-height: 34px; padding: 0 15px; border-radius: 8px; font-size: 13.5px; white-space: nowrap; }
.adm-rail .adm-group a { color: #becadb; }
.adm-rail .adm-group a:hover { background: #243752; color: white; }
.adm-rail .adm-group a[aria-current] { background: color-mix(in srgb,var(--brand) 44%,var(--ink)); box-shadow: inset 3px 0 var(--brand); color: white; font-weight: 650; }
.adm-top { height: var(--adm-bar); display: flex; align-items: center; gap: 12px; padding: 0 28px; position: sticky; top: 0; z-index: 40; background: white; border-bottom: 1px solid var(--line); font-size: 13px; }
.adm-crumb, .adm-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-crumb span { color: var(--muted); }
.adm-top > a { white-space: nowrap; }
.adm-avatar { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--brand-dark); background: var(--brand-soft); font-weight: 700; }
.adm-search { position: relative; width: 240px; margin-left: auto; color: var(--muted); }
.adm-search > svg, .adm-search kbd { position: absolute; top: 50%; transform: translateY(-50%); pointer-events: none; }
.adm-search > svg { left: 10px; }
.adm-search kbd { right: 8px; background: white; border: 1px solid var(--line); padding: 1px 4px; border-radius: 4px; }
.adm-search input[type=search] { width: 100%; padding: 0 40px 0 34px; background: var(--bg-soft); min-height: 36px; height: 36px; }
.adm-results { position: absolute; top: calc(100% + 4px); width: 100%; max-height: 55vh; overflow: auto; background: white; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px #0f172a20; padding: 4px; }
.adm-results a { display: grid; padding: 6px 10px; color: var(--ink); }
.adm-results a:hover, .adm-results a:focus-visible { background: var(--brand-soft); }
.adm-results small { color: var(--muted); }
.adm-mobile { display: none; }
.adm-top button, .adm-sheet button { width: 44px; height: 44px; background: transparent; border: 0; cursor: pointer; }
.adm-sheet { inset: 0; margin: 0; width: 100%; max-width: none; height: 100dvh; max-height: none; padding: 16px; border: 0; background: white; color: var(--ink); }
.adm-sheet::backdrop { background: #0f172a66; }
body.admin:has(.adm-sheet[open]) { overflow: hidden; }
.adm-sheet header, .adm-sheet footer { display: flex; align-items: center; justify-content: space-between; }
.adm-sheet input { width: 100%; }
.adm-sheet .adm-group { grid-template-columns: repeat(2,minmax(0,1fr)); }
.adm-sheet h2 { grid-column: 1/-1; color: var(--muted); }
.adm-sheet a[aria-current] { background: var(--brand-soft); font-weight: 700; }
.adm-sheet footer a { padding: 12px; }
.adm-sheet [hidden] { display: none; }
:is(.adm-rail,.adm-top,.adm-sheet) :focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.adm-shell .adm-body { padding: 0; }
.adm-body .wrap { max-width: 1440px; padding: 24px 28px 72px; }
@media (width < 900px) {
  .adm-rail, .adm-top :is(.adm-search,.adm-name,.role-badge), .adm-top > a, .adm-crumb span { display: none; }
  .adm-mobile { display: grid; place-items: center; flex: none; }
  .adm-top { padding: 0 14px; gap: 8px; }
  .adm-top [data-sheet="search"] { margin-left: auto; }
  .adm-body .wrap { padding: 16px 14px 84px; }
}
.role-badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; background: #eef2f6; color: #475569; white-space: nowrap; }
.role-badge.owner { background: #e0eaff; color: #1259d6; }
.role-badge.gudang { background: #fef0c7; color: #b54708; }
.role-badge.kasir { background: #dcfae6; color: #067647; }
.role-badge.keuangan { background: #f4e8ff; color: #7a2ea8; }

/* --------------------------------------------------- staf & audit (admin) */


.adm-body { padding: 20px 0 60px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.3rem; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.stat .v { font-size: 1.35rem; font-weight: 800; margin-top: 4px; letter-spacing: -.02em; }
.stat .d { font-size: .76rem; color: var(--muted); margin-top: 2px; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.panel > .head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.panel > .head h3 { font-size: .9rem; }
.panel > .body { padding: 14px; }

.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .85rem; }
table.tbl th { text-align: left; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--bg-soft); }
table.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tr:hover td { background: #fbfcfe; }
.tbl .prod { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.tbl .prod img { width: 38px; height: 38px; object-fit: contain; border: 1px solid var(--line); border-radius: 7px; padding: 2px; background: #fff; }
.tbl .prod b { font-size: .85rem; font-weight: 600; display: block; line-height: 1.3; }

.status { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.status.pending { background: #fef0c7; color: #b54708; }
.status.paid { background: #dcfae6; color: #067647; }
.status.shipped { background: #e0eaff; color: #1259d6; }
.status.done { background: #eef2f6; color: #475569; }
.status.cancelled { background: #fee4e2; color: #b42318; }

.form-grid { display: grid; gap: 14px; }
.form-grid .two { display: grid; gap: 14px; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(160deg, #0b1b3a, #12306b); }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 16px; padding: 26px; box-shadow: 0 20px 50px rgba(2, 8, 23, .35); }
.login-card h1 { font-size: 1.2rem; }
.login-card .logo { margin-bottom: 18px; }

.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.filters a { font-size: .8rem; font-weight: 600; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); }
.filters a.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Mobile admin: card lists instead of wide tables, plus a sticky save bar. */
.show-mobile { display: block; }
.hide-mobile { display: none; }

.adm-card { display: block; color: inherit; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.adm-card .t { display: flex; gap: 10px; align-items: flex-start; }
.adm-card .t img { width: 46px; height: 46px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; padding: 2px; flex: none; background: #fff; }
.adm-card .t b { font-size: .87rem; font-weight: 650; line-height: 1.3; display: block; }
.adm-card .meta { font-size: .74rem; color: var(--muted); margin-top: 2px; }
.adm-card .p { font-weight: 750; color: var(--brand); font-size: .92rem; white-space: nowrap; }
.adm-card .row2 { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.adm-card .row2 .btn { min-height: 40px; }
.adm-card input[type=number] { width: 86px; text-align: center; font-weight: 700; }
.adm-card .code { font-family: ui-monospace, Menlo, monospace; font-size: .75rem; color: var(--ink-2); background: var(--bg-soft); padding: 2px 6px; border-radius: 5px; }

.save-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: #fff; border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  display: flex; gap: 8px; align-items: center;
  box-shadow: 0 -6px 20px rgba(15, 23, 42, .08);
}
.save-bar .btn { flex: 1; }
body.has-save-bar { padding-bottom: 88px; }

.settings-meta { margin: 4px 0 0; }
.settings-links, .settings-jump { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.settings-links { margin-top: 8px; }
.settings-jump { margin-bottom: 12px; }
.settings-links a, .settings-jump a { color: var(--brand); }
.settings-jump a { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: .82rem; }

#settings-form details > summary { cursor: pointer; list-style: none; font-size: .9rem; font-weight: 700; }
#settings-form details > summary::-webkit-details-marker { display: none; }
#settings-form details > summary::after { content: '＋'; font-weight: 600; color: var(--muted); }
#settings-form details[open] > summary::after { content: '−'; }
#settings-form details:not([open]) > summary { border-bottom: 0; }
#settings-form .char-count { color: var(--muted); font-size: .78rem; }
#settings-form .char-count.is-over { color: var(--warn); }
#settings-form .section-save { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
#settings-form .section-state { flex: 1 1 auto; color: var(--muted); font-size: .78rem; }
#settings-form .section-state.is-dirty { color: var(--warn); font-weight: 700; }
#settings-form .section-save .btn-sm { flex: 0 0 auto; min-height: 40px; }

@media (max-width: 599px) {
  #settings-form .section-save { gap: 10px; }
  #settings-form .section-state { flex-basis: 100%; }
  #settings-form .section-save .btn-sm { flex: 1 1 0; min-height: 44px; }
}
#settings-wa-preview { margin-top: 0; color: var(--brand); }
#settings-form .settings-preview { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
#settings-form .settings-preview-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
#settings-form .settings-preview-head button { font-size: .8rem; font-weight: 600; min-height: 38px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; }
#settings-form .settings-preview-head button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
#settings-form .settings-preview iframe { display: block; width: 100%; height: 560px; border: 0; background: #fff; }
#settings-form .settings-preview iframe[hidden] { display: none; }
#settings-form .settings-preview[data-preview="home"] iframe { height: 780px; }
#settings-form .settings-preview.is-mobile iframe { width: 390px; max-width: 100%; height: 620px; margin: 0 auto; border-inline: 1px solid var(--line); }
#settings-form .settings-preview.is-mobile[data-preview="home"] iframe { height: 900px; }

@media (min-width: 700px) {
  .ongkir-status .row { grid-template-columns: 1fr auto; align-items: baseline; }
  .ongkir-status .row > b { text-align: right; }
}

@media (min-width: 900px) {
  .save-bar { position: static; box-shadow: none; border: 0; padding: 0; background: transparent; justify-content: flex-end; }
  .save-bar .btn { flex: 0 0 auto; }
  body.has-save-bar { padding-bottom: 60px; }
}

/* -------------------------------------------------------------- media */

@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .cats { grid-template-columns: repeat(3, 1fr); }
  .trust .wrap { grid-template-columns: repeat(3, 1fr); }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .form-grid.two, .form-grid .two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid.two > .field, .form-grid .two > .field { align-content: start; }
  .cart-line { grid-template-columns: 84px 1fr; }
  .cart-line img { width: 84px; height: 84px; }
}

@media (min-width: 900px) {
  .wrap { padding: 0 24px; }
  .show-mobile { display: none !important; }
  .hide-mobile { display: block !important; }
  .header .wrap { gap: 22px; padding-top: 14px; padding-bottom: 14px; }
  .nav ul { padding: 0 24px; }
  .search { display: block; max-width: 560px; }
  .topbar .tb-links { display: flex; }
  .hero .wrap { grid-template-columns: 1.05fr .95fr; align-items: center; padding-top: 44px; padding-bottom: 44px; gap: 30px; }
  .hero h1 { font-size: 2.4rem; }
  .hero .art { display: block; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .cats { grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .layout { grid-template-columns: 240px 1fr; align-items: start; }
  .side { display: block; }
  .product { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 32px; }
  .cart-grid, .checkout-grid { grid-template-columns: 1fr 340px; }
  .sticky-buy { display: none; }
  .tabbar { display: none; }
  .footer .wrap { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .section { padding: 34px 0; }
  .card .name { font-size: .86rem; }
}

@media (min-width: 1200px) {
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .cats { grid-template-columns: repeat(5, 1fr); }
  .hero h1 { font-size: 2.7rem; }
  .listing-head h1 { font-size: 1.6rem; }
}

@media (max-width: 899px) {
  body { padding-bottom: 68px; }
  .footer { margin-bottom: 0; }
  .buybox h1 { font-size: 1.12rem; }
  .price-block { margin: 8px 0 2px; }
  .price-block .now { font-size: 1.45rem; }
  .buy-row { margin-top: 10px; }
  .section { padding: 20px 0; }
}

/* QRIS dinamis di halaman pesanan */
.qris-box .qris-live { display: flex; gap: 14px; align-items: center; margin-top: 10px; }
.qris-canvas { flex: none; width: 168px; height: 168px; background: #fff; border: 1px solid var(--line-2); border-radius: 12px; padding: 8px; }
.qris-canvas svg { display: block; width: 100%; height: 100%; }
.qris-side { min-width: 0; }
.qris-amount { display: block; font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; margin: 2px 0 6px; }
.qris-timer { margin: 0; font-size: .82rem; color: var(--ink-2); }
.qris-timer b { font-variant-numeric: tabular-nums; }
.qris-expired { border: 1px solid #f3c2c2; background: #fff6f6; border-radius: 10px; padding: 10px 12px; margin-top: 10px; }
@media (max-width: 380px) {
  .qris-box .qris-live { flex-direction: column; align-items: flex-start; }
  .qris-canvas { width: 150px; height: 150px; }
}

.btn-sub { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: rgba(255,255,255,.22); font-size: .72rem; font-weight: 700; letter-spacing: .02em; }
.btn-ghost .btn-sub { background: rgba(11,27,58,.08); color: var(--ink-2); }

/* Hari buka: kotak centang kecil, area ketuknya diperbesar. */
#settings-form fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 6px; }
#settings-form fieldset legend { padding: 0 6px; font-size: .82rem; font-weight: 700; color: var(--ink-2); }
#settings-form .day-check { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 6px; font-size: .86rem; cursor: pointer; }
#settings-form .day-check input { width: 18px; height: 18px; }

/* Menu: penanda sub-menu di tabel admin. */
.menu-child { display: inline-block; margin-right: 6px; color: var(--muted); font-weight: 700; }

/* Admin dashboard and lists */
.admin .adm-subtitle { margin: 4px 0 0; }
.adm-dashboard { display: grid; grid-template-columns: minmax(0,1fr); gap: 16px; }
.adm-secondary, .adm-main-panels { display: contents; }
.adm-dashboard .panel { margin: 0; min-width: 0; }
.adm-quick { order: 1; }
.adm-dashboard .head, .adm-products > .head { background: var(--bg-soft); padding: 14px 16px; }
.adm-dashboard .head a, .adm-link { font-weight: 650; color: var(--brand); }
.adm-hero { display: grid; gap: 4px; padding: 20px; background: var(--ink); color: white; }
.adm-hero strong { font-size: 2rem; line-height: 1.2; }
.adm-metric { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 16px; border-bottom: 1px solid var(--line); color: inherit; }
.adm-metric:last-child { border: 0; }
.adm-metric:hover { background: var(--bg-soft); }
.adm-metric b, .adm-action > svg, .adm-quick a > svg:last-child { margin-left: auto; }
.adm-metric b, table.tbl .adm-number { text-align: right; font-variant-numeric: tabular-nums; }
.adm-negative { color: var(--sale); }
.adm-tile { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; }
.adm-tile.red { background: #fee2e2; color: #991b1b; }
.adm-tile.amber { background: #fef3c7; color: #92400e; }
.adm-tile.blue { background: #dbeafe; color: #1e40af; }
@media (min-width: 1100px) {
  .adm-dashboard { grid-template-columns: minmax(0,2fr) minmax(0,1fr); align-items: start; }
  .adm-secondary, .adm-main-panels { display: grid; gap: 16px; min-width: 0; grid-row: 1; }
  .adm-secondary { grid-column: 2; }
  .adm-main-panels { grid-column: 1; }
}
.adm-toolbar { display: flex; align-items: center; min-height: 44px; gap: 8px; margin-bottom: 14px; }
.adm-toolbar .adm-search { flex: 1; min-width: 0; max-width: 420px; margin: 0; }
.adm-toolbar .adm-search input[type=search], .adm-toolbar .btn { height: 44px; }
.adm-products .tbl tbody tr { height: 56px; }
.adm-products .tbl td { padding-block: 6px; }
.adm-products .prod img, .adm-products .adm-card img { width: 36px; height: 36px; }
.adm-grow { min-width: 0; flex: 1; }
.adm-prices { flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.adm-strike { text-decoration: line-through; }
.adm-stock-cell, .adm-stock { display: flex; align-items: center; gap: 6px; }
.adm-products .adm-stock input { width: 72px; min-height: 34px; padding: 4px 8px; text-align: right; }
.adm-stock-pill { display: inline-block; min-width: 56px; }
.adm-edit { color: var(--brand); background: var(--bg-soft); font-weight: 650; }
.adm-actions-cell { white-space: nowrap; }
.adm-between { justify-content: space-between; gap: 10px; }
.adm-order-summary { display: block; color: inherit; }
.adm-order-summary .meta { margin: 4px 0 8px; }
.adm-order-actions { justify-content: flex-end; gap: 6px; }
.admin .btn.adm-print { width: 36px; height: 36px; min-height: 36px; padding: 0; }

/* Standard page body: head → toolbar → panels → form actions. */
.adm-subtitle { margin: 4px 0 0; }
.adm-note { font-size: .82rem; color: var(--muted); margin: 8px 0 0; }
.adm-empty { border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 26px 18px; text-align: center; color: var(--muted); background: #fff; }
.adm-form-grid { display: grid; gap: 14px; }
.adm-form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.adm-form-actions .btn { min-height: 44px; }
.adm-form-actions .adm-grow { justify-content: flex-start; }
@media (min-width: 760px) {
  .adm-form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm-form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.tbl td.adm-child { position: relative; padding-left: 30px; }
.admin .menu-child { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.adm-order-num input { width: 84px; margin-left: auto; text-align: right; }
.tbl .adm-nowrap { white-space: nowrap; }
.tbl .adm-clip { display: block; max-width: 460px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-toolbar.with-fields { align-items: flex-end; flex-wrap: wrap; }
.adm-toolbar.with-fields .field { margin-bottom: 0; min-width: 150px; }
.adm-toolbar.with-fields :is(input, select) { height: 44px; min-height: 44px; }
.adm-panel-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.admin .panel > .head h3 { font-size: .95rem; font-weight: 700; }
.admin .panel > .head .adm-note { margin: 0; }

.adm-inline-form { display: inline; }
.adm-inline-form.adm-grow { display: block; flex: 1; }

/* Admin order detail and product form */
.order-links { flex-wrap: wrap; gap: 8px; }
.order-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); overflow-wrap: anywhere; }
.order-stats .v { font-size: 1.1rem; }
.order-proof { display: block; width: 100%; max-width: 260px; height: auto; border: 1px solid var(--line); border-radius: 8px; }
#product-form .field { min-width: 0; align-content: start; }
#product-form .product-photo { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 14px; }
.product-photo > div { flex: 1 1 200px; min-width: 0; }
#image-preview { width: 110px; height: 110px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: white; }
#variant-rows > .row { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)) auto; gap: 8px; align-items: end; }
#variant-rows .field { margin: 0; }
#variant-add { margin-top: 10px; }
#product-form .save-bar .btn-danger { flex: 0 0 auto; }
@media (max-width: 560px) {
  #variant-rows > .row { grid-template-columns: repeat(2, minmax(0, 1fr)) auto; }
  #variant-rows .field:first-child { grid-column: 1 / -1; }
}

/* Pembelian list helpers */
.adm-card-top { align-items: flex-start; }
.adm-chiprow { gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.adm-toolbar .adm-select { width: auto; min-width: 160px; height: 44px; }

/* Small admin utilities used by the purchase screens */
.adm-inline-row { display: flex; align-items: center; gap: 0; }
.adm-inline-row > .btn { margin-left: 6px; }
.adm-mb14 { margin-bottom: 14px; }
.adm-p14 { padding: 14px; }
.adm-p0 { padding: 0; }
.adm-flush { display: flex; align-items: flex-start; }
.adm-right { justify-content: flex-end; }
.adm-pre { white-space: pre-line; }
.adm-narrow { max-width: 220px; margin-left: auto; }
.adm-actions-row { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

.adm-form-panel { margin-bottom: 100px; }
.adm-section-title { margin-top: 8px; }
.adm-mb8 { margin-bottom: 8px; }
.adm-relative { position: relative; }
.adm-text-right { text-align: right; }
.adm-mt8 { margin-top: 8px; }
.adm-max540 { max-width: 540px; }
.adm-m0 { margin: 0; }
.adm-mt14 { margin-top: 14px; }
.adm-self-end { align-self: flex-end; }

/* Auth + access denied */
.auth-title { font-size: 1.15rem; margin-bottom: 4px; }
.auth-sub { margin-bottom: 16px; }
.adm-mb6 { margin: 0 0 6px; }
.adm-mb18 { margin: 0 0 18px; }
.deny-panel { max-width: 560px; margin: 40px auto; }
.deny-body { text-align: center; padding: 30px 22px; }
.deny-icon { width: 52px; height: 52px; border-radius: 14px; background: #fee4e2; color: #b42318; display: grid; place-items: center; margin: 0 auto 14px; }
.deny-title { font-size: 1.15rem; margin-bottom: 6px; }

/* ------------------------------------------------- touch, desktop widths
   Phone in "request desktop site" / tablet: hover never fires, so the rail
   keeps its labels, grows its targets, and loses the hover expansion. */
@media (min-width: 900px) and (hover: none) {
  body.admin { --adm-rail: 188px; padding-left: var(--adm-rail); }
  .adm-rail, .adm-rail:is(:hover, :focus-within) { width: var(--adm-rail); box-shadow: none; }
  .adm-group a { min-height: 42px; }
  .adm-rail .adm-group + .adm-group { margin-top: 2px; }
  .adm-top { height: 60px; }
  .adm-search kbd { display: none; }
  .adm-search input[type=search], .adm-sheet input { height: 44px; min-height: 44px; font-size: 16px; }
  .adm-top > a { padding: 10px 4px; }
  .adm-top button { width: 48px; height: 48px; }
  .adm-results a { padding: 12px 10px; }
}

/* Touch, desktop widths: a compact toggle so the labelled rail can shrink. */
.adm-rail-toggle { display: none; }
@media (min-width: 900px) and (hover: none) {
  .adm-rail-toggle { display: grid; place-items: center; width: 100%; height: 40px; margin: 2px 0; border: 0; border-radius: 8px; background: #ffffff1a; color: #cbd5e1; cursor: pointer; }
  .adm-rail-toggle svg { transform: rotate(180deg); }
  body.rail-compact { --adm-rail: 72px; }
  body.rail-compact .adm-rail :is(span, h2) { display: none !important; }
  body.rail-compact .adm-rail-toggle { width: 40px; margin-inline: auto; }
  body.rail-compact .adm-brand { justify-content: center; padding-inline: 0; }
  .adm-rail nav { overscroll-behavior: contain; }
}

/* Scroll cues: a soft fade while there is more content in that direction. */
.adm-rail nav.sc-y:not(.sc-end) { mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent); }
.table-wrap.sc-x:not(.sc-end) { mask-image: linear-gradient(to right, #000 calc(100% - 34px), transparent); }
@media (min-width: 900px) and (max-width: 1100px) and (hover: none) {
  .adm-top .adm-name, .adm-top .role-badge { display: none; }
}

/* Resi pengiriman di halaman admin pesanan. */
.resi-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin-top: 12px; }
.resi-form .field { flex: 1 1 220px; display: grid; gap: 3px; }
.resi-form input { width: 100%; }

/* Teks halaman: label + penanda bawaan/diubah, dan kolom yang enak dibaca. */
#teks-form .copy-field { max-width: 780px; }
#teks-form .copy-field label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#teks-form .copy-field textarea { min-height: 84px; line-height: 1.5; }
.copy-tag {
  padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--bg-soft); color: var(--muted);
  font-size: .64rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
}
.copy-tag.is-custom { background: #fff5dc; border-color: #e6b45a; color: #8a5a00; }
.copy-bawaan { display: block; font-size: .74rem; color: var(--muted); }
