/* ============================================================
   BecaShop — Admin shell (sidebar + content) and shared widgets
   Builds on styles.css tokens + account.css (forms, .tag, .data-table).
   ============================================================ */

body.adm { background: var(--gray); }
body.adm-locked { overflow: hidden; }

.adm-layout { display: flex; min-height: 100vh; }

/* ---------- sidebar ---------- */
.adm-side {
  width: 248px; flex: 0 0 248px;
  background: linear-gradient(180deg, var(--navy), #0b1a20);
  color: #cfe3e8; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.adm-brand {
  display: flex; align-items: center; gap: .6rem;
  padding: 1.15rem 1.15rem .9rem; color: #fff;
  font-weight: 800; letter-spacing: -.02em; font-size: 1.02rem;
  text-decoration: none;
}
.adm-brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold-bright); box-shadow: 0 0 12px var(--gold-bright); }
.adm-brand small { display: block; font-weight: 600; color: #7fa3ad; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; }

.adm-nav { flex: 1; padding: .4rem .7rem 1rem; }
.adm-nav .sec {
  font-size: .64rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: #6e929c; padding: 1.05rem .5rem .35rem;
}
.adm-nav a {
  display: flex; align-items: center; gap: .6rem;
  padding: .48rem .55rem; border-radius: 9px; margin-bottom: 2px;
  font-size: .88rem; font-weight: 500; color: #c3d8de;
  transition: background .15s, color .15s;
}
.adm-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.adm-nav a.active { background: rgba(27,143,163,.28); color: #fff; font-weight: 600; }
.adm-nav a .ico { width: 16px; height: 16px; flex: 0 0 16px; opacity: .8; }
.adm-nav a.active .ico { opacity: 1; color: var(--gold-bright); }
.nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 .4rem; border-radius: 999px;
  background: var(--gold); color: #fff; font-size: .66rem; font-weight: 800; display: inline-grid; place-items: center;
}
.nav-badge[hidden] { display: none; }

.adm-side .foot { padding: .9rem 1.15rem 1.1rem; border-top: 1px solid rgba(255,255,255,.08); font-size: .78rem; color: #7fa3ad; }
.adm-side .foot .me { display: flex; align-items: center; gap: .6rem; margin-bottom: .8rem; min-height: 32px; }
.adm-side .foot .me-txt { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.adm-side .foot .me-txt b { color: #fff; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-side .foot .me-txt small { color: #7fa3ad; font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-side .foot-link { display: flex; align-items: center; gap: .45rem; color: #aecdd5; font-weight: 600; padding: .25rem 0; }
.adm-side .foot-link:hover { color: #fff; }
.adm-side .foot-link .ico { width: 14px; height: 14px; }

/* ---------- main ---------- */
.adm-main { flex: 1; min-width: 0; padding: 1.6rem clamp(1.2rem, 3vw, 2.4rem) 4rem; }

.adm-head { display: flex; align-items: center; gap: .95rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.adm-head h1 { font-size: 1.45rem; letter-spacing: -.02em; line-height: 1.15; }
.adm-head .head-txt p { color: var(--text-2); font-size: .88rem; margin-top: .2rem; max-width: 70ch; }
.adm-head .spacer { flex: 1; }
.adm-head .head-actions { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; }
.head-ico {
  flex: 0 0 46px; width: 46px; height: 46px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
}
.head-ico .ico { width: 24px; height: 24px; }

.ico { width: 1em; height: 1em; vertical-align: -.15em; flex: none; }
.ico.big { width: 40px; height: 40px; opacity: .5; }
.btn .ico { width: 15px; height: 15px; margin-right: .1rem; }
.btn.busy { opacity: .7; pointer-events: none; }
.btn-ghost { background: transparent; border: 1px solid transparent; color: var(--text-3); }
.btn-ghost:hover { background: var(--gray-2); color: var(--text); }
.btn-outline .ico { color: var(--text-3); }

/* colour pairs shared by page headers, stat tiles, drawer icons */
.ico-teal { background: rgba(27,143,163,.12); color: #0f6573; }
.ico-blue { background: rgba(45,80,180,.1); color: #2d50b4; }
.ico-gold { background: rgba(200,150,78,.16); color: #9a6a24; }
.ico-red  { background: rgba(217,45,32,.09); color: #c2372b; }
.ico-purple { background: rgba(122,62,190,.1); color: #7a3ebe; }
.ico-green { background: rgba(24,140,90,.11); color: #157a4e; }
.ico-navy { background: rgba(15,33,40,.1); color: var(--navy); }
.ico-pink { background: rgba(180,40,122,.1); color: #b4287a; }
.ico-gray { background: var(--gray-2); color: var(--text-3); }

.adm-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-card); padding: 1.1rem 1.2rem; margin-bottom: 1.2rem;
}
.adm-card.tight { padding: .8rem 1rem; }
.adm-card > h3 { font-size: .95rem; margin-bottom: .6rem; display: flex; align-items: center; gap: .5rem; }
.adm-card > h3 .ico { color: var(--muted); }

.adm-table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; }
.adm-table-card .table-wrap { border: none; border-radius: 0; }
.adm-table-card .tbl-pager { padding: .75rem 1rem; border-top: 1px solid var(--border); margin: 0; background: var(--gray); }
.card-toolbar { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; padding: .8rem 1rem; border-bottom: 1px solid var(--border); }
.card-toolbar .spacer { flex: 1; }
.card-toolbar .field { margin: 0; }
.card-toolbar .field label { display: none; }
.card-toolbar select.input { padding: .5rem 2rem .5rem .75rem; font-size: .84rem; width: auto; }

/* ---------- stat tiles ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .9rem; margin-bottom: 1.3rem; }
.stat {
  display: flex; align-items: center; gap: .85rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-card); padding: .95rem 1.1rem; min-width: 0; position: relative; overflow: hidden;
}
.stat.clickable { cursor: pointer; transition: border-color .15s, transform .15s; }
.stat.clickable:hover { border-color: var(--gold); transform: translateY(-1px); }
.stat-ico { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; }
.stat-ico .ico { width: 20px; height: 20px; }
.stat-body { min-width: 0; flex: 1; }
.stat .lbl { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .val { font-size: 1.45rem; font-weight: 800; letter-spacing: -.03em; margin-top: .15rem; color: var(--text); line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .val .money small { font-size: .6em; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.stat .sub { font-size: .76rem; color: var(--text-2); margin-top: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .sub b { color: var(--text); }
.stat .sub .up { color: #157a4e; font-weight: 700; }
.stat .sub .down { color: #b42318; font-weight: 700; }
.stat-spark { color: var(--gold); flex: none; }
.stat.ok .val { color: #157a4e; }
.stat.bad .val { color: #b42318; }
.stat.warn .val { color: #92600a; }
.stat.hero { background: linear-gradient(135deg, var(--navy), #164554); border-color: transparent; color: #fff; }
.stat.hero .lbl { color: #9fc3cc; }
.stat.hero .val { color: #fff; }
.stat.hero .sub { color: #b8d5dc; }
.stat.hero .sub b { color: #fff; }
.stat.hero .stat-spark { color: var(--gold-bright); }
.stat.hero .stat-ico { background: rgba(255,255,255,.12); color: var(--gold-bright); }

/* ---------- data table ---------- */
.dt-wrap { position: relative; }
.dt-wrap.loading .table-wrap { opacity: .6; transition: opacity .2s; }
.data-table.dt th { padding: .65rem .85rem; }
.data-table.dt th .th-in { display: inline-flex; align-items: center; gap: .3rem; }
.data-table.dt th.sortable { cursor: pointer; user-select: none; transition: color .12s; }
.data-table.dt th.sortable:hover { color: var(--text); }
.data-table.dt th.sortable .arr { display: inline-flex; opacity: .35; transition: opacity .12s; }
.data-table.dt th.sortable .arr .ico { width: 13px; height: 13px; }
.data-table.dt th.sortable:hover .arr { opacity: .8; }
.data-table.dt th.sortable.on { color: var(--gold-deep); }
.data-table.dt th.sortable.on .arr { opacity: 1; color: var(--gold-deep); }
.data-table.dt th.al-right .th-in, .data-table.dt td.al-right { text-align: right; justify-content: flex-end; }
.data-table.dt th.al-right { text-align: right; }
.data-table.dt th.al-center, .data-table.dt td.al-center { text-align: center; }
.data-table.dt th.al-center .th-in { justify-content: center; }
.data-table.dt td { padding: .7rem .85rem; }
.data-table.dt td.nowrap { white-space: nowrap; }
.data-table.dt td.num { font-variant-numeric: tabular-nums; }
.data-table.dt tr.clickable { cursor: pointer; }
.data-table.dt tr.clickable:hover td { background: var(--cream); }
.data-table.dt tr.hi td { background: #fffaf0; }
.data-table.dt tr.hi:hover td { background: #fff4de; }
.data-table.dt tr.dim td { opacity: .55; }
.data-table.dt tr.new-row td { animation: rowIn .6s ease; }
@keyframes rowIn { from { background: var(--chip-bg); } to { background: transparent; } }
.data-table.dt .empty-row td { padding: 0; }
.data-table.dt .empty-row:hover td { background: transparent; }
.data-table td .money small { font-size: .72em; color: var(--muted); font-weight: 600; margin-right: .05em; }
.data-table td b .money, .data-table td .money b { color: var(--text); }
.data-table .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; }
.data-table .muted { color: var(--muted); }
.data-table .strong { color: var(--text); font-weight: 700; }
.data-table .lnk { color: var(--text-2); }
.data-table .lnk:hover { color: var(--gold-deep); text-decoration: underline; }
.data-table.compact td { padding: .45rem .7rem; font-size: .84rem; }
.data-table.compact th { padding: .5rem .7rem; }

/* skeleton */
.sk { display: inline-block; height: .85em; border-radius: 6px; background: linear-gradient(90deg, var(--gray-2) 25%, #f4f8f9 50%, var(--gray-2) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; vertical-align: middle; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.sk-row td { padding: .9rem .85rem; }

/* date cells */
.dcell { display: inline-flex; flex-direction: column; line-height: 1.25; white-space: nowrap; }
.dcell b { font-weight: 600; color: var(--text); font-size: .86rem; }
.dcell small { color: var(--muted); font-size: .72rem; }
.dcell.empty { color: var(--muted); }

/* who cells */
.who { display: inline-flex; align-items: center; gap: .65rem; min-width: 0; max-width: 100%; }
.who-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.who-txt b { color: var(--text); font-weight: 700; font-size: .87rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.who-txt small { color: var(--muted); font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.av { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: .02em; flex: none; }
.av.sm { width: 28px; height: 28px; font-size: .62rem; }
.av.lg { width: 52px; height: 52px; font-size: 1.05rem; }
/* account.css styles table avatars for the storefront (teal text on cream); admin
   avatars carry a coloured background, so keep their initials white. */
.data-table .who .av, .av { color: #fff; }

/* tags with dot */
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.tag.outline { background: transparent; border: 1px solid var(--border-input); color: var(--text-3); }
.tag.blue { background: rgba(45,80,180,.1); color: #2d50b4; }
.tag.purple { background: rgba(122,62,190,.1); color: #7a3ebe; }
.tag.pink { background: rgba(180,40,122,.1); color: #b4287a; }
.tag.gold { background: rgba(200,150,78,.16); color: #9a6a24; }

/* lang tag */
.lang-tag {
  display: inline-flex; align-items: center; gap: .25rem; min-width: 26px; justify-content: center; font-size: .62rem; font-weight: 800;
  letter-spacing: .08em; color: var(--chip-text); background: var(--chip-bg);
  border-radius: 5px; padding: .12rem .35rem; margin-right: .4rem; vertical-align: 1px;
}
.lang-tag .flag { font-size: .85rem; line-height: 1; }
.lang-tag.muted { background: var(--gray-2); color: var(--muted); }
.i18n-group .i18n-row { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.i18n-group .i18n-row.ta { align-items: flex-start; }
.i18n-group .i18n-row.ta .lang-tag { margin-top: .6rem; }

/* copy + row actions */
.cp { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: var(--muted); vertical-align: middle; margin-left: .2rem; background: transparent; }
.cp:hover { background: var(--gray-2); color: var(--gold-deep); }
.cp .ico { width: 13px; height: 13px; }
.row-actions { display: flex; gap: .3rem; justify-content: flex-end; align-items: center; }
.row-actions .act {
  width: 32px; height: 32px; border-radius: 8px; display: inline-grid; place-items: center;
  border: 1px solid transparent; background: transparent; color: var(--text-3); transition: .12s;
}
.row-actions .act .ico { width: 16px; height: 16px; }
.row-actions .act:hover { background: #fff; border-color: var(--border-input); color: var(--gold-deep); box-shadow: 0 1px 3px rgba(15,33,40,.08); }
.row-actions .act.danger:hover { border-color: #f1c4c0; color: #d92d20; background: #fef3f2; }
.row-actions .act.on { color: var(--gold-deep); }
.row-actions .act.star.on .ico { fill: #e0a83a; color: #e0a83a; }
.row-actions button.txt {
  font-size: .78rem; font-weight: 600; padding: .3rem .6rem; border-radius: 8px;
  border: 1px solid var(--border-input); background: #fff; color: var(--text-3);
}
.row-actions button.txt:hover { border-color: var(--gold); color: var(--gold-deep); }
tr:hover .row-actions .act { color: var(--text); }

/* pager */
.tbl-pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; }
.tbl-pager .info { font-size: .82rem; color: var(--muted); }
.tbl-pager .info b { color: var(--text); font-weight: 700; }
.tbl-pager .pages { display: flex; gap: .3rem; align-items: center; }
.tbl-pager .pages button { min-width: 34px; height: 34px; border-radius: 8px; padding: 0 .55rem; font-size: .84rem; }
.tbl-pager .pages button .ico { width: 15px; height: 15px; }
.tbl-pager .pages button.cur { background: var(--navy); color: #fff; border-color: var(--navy); opacity: 1; }
.tbl-pager .pages .gap { color: var(--muted); padding: 0 .2rem; font-size: .85rem; }
.tbl-pager .per { display: flex; align-items: center; gap: .45rem; font-size: .78rem; color: var(--muted); font-weight: 600; }
.tbl-pager .per select { width: auto; padding: .35rem 1.8rem .35rem .6rem; font-size: .8rem; background-position: right .5rem center; }

/* empty state */
.empty-state { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: 2.8rem 1rem; text-align: center; color: var(--muted); }
.empty-state .ico.big { margin-bottom: .4rem; }
.empty-state b { color: var(--text-2); font-size: .95rem; }
.empty-state small { font-size: .82rem; max-width: 46ch; line-height: 1.5; }
.empty-state .btn { margin-top: .8rem; }
.empty-note { padding: 2.4rem 1rem; text-align: center; color: var(--muted); font-size: .92rem; }

/* segmented tabs */
.seg-tabs { display: inline-flex; gap: .25rem; padding: .25rem; background: var(--gray-2); border-radius: 12px; margin-bottom: 1rem; flex-wrap: wrap; max-width: 100%; }
.seg-tabs button {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .42rem .85rem; border-radius: 9px; font-size: .84rem; font-weight: 600;
  color: var(--text-3); background: transparent; transition: .12s; white-space: nowrap;
}
.seg-tabs button .ico { width: 14px; height: 14px; opacity: .7; }
.seg-tabs button:hover { color: var(--text); }
.seg-tabs button.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(15,33,40,.12); }
.seg-tabs .cnt { font-size: .68rem; font-weight: 800; padding: .08rem .42rem; border-radius: 999px; background: rgba(15,33,40,.08); color: var(--text-3); font-variant-numeric: tabular-nums; }
.seg-tabs button.active .cnt { background: var(--chip-bg); color: var(--chip-text); }
.kind-tabs { display: flex; gap: .4rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.kind-tabs button {
  padding: .42rem .95rem; border-radius: 999px; font-size: .84rem; font-weight: 600;
  border: 1px solid var(--border-input); background: #fff; color: var(--text-3);
}
.kind-tabs button.active { background: var(--btn-primary); color: #fff; border-color: transparent; box-shadow: var(--shadow-btn); }

/* filter toolbar */
/* every control in a toolbar shares one height so the row lines up */
.toolbar, .card-toolbar { --tb-h: 38px; }
.toolbar { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar .spacer { flex: 1; }
.toolbar .field { margin: 0; }
/* labelled fields sit inline so they don't push the row out of line */
.toolbar .field:has(> label:not(.chip)) { display: flex; align-items: center; gap: .5rem; }
.toolbar .field > label:not(.chip) { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0; white-space: nowrap; }
.toolbar select.input, .card-toolbar select.input { height: var(--tb-h); padding: 0 2rem 0 .8rem; font-size: .85rem; width: auto; min-width: 140px; }
.toolbar input.input, .card-toolbar input.input { height: var(--tb-h); padding: 0 .8rem; font-size: .85rem; }
.toolbar .btn, .card-toolbar .btn { height: var(--tb-h); padding: 0 .95rem; font-size: .84rem; border-radius: 9px; white-space: nowrap; }
.toolbar .chip { min-height: 32px; }

/* search box — selectors carry the extra class so toolbar input rules can't override the icon gutter */
.search-box { position: relative; display: flex; align-items: center; flex: 1 1 240px; max-width: 420px; min-width: 200px; }
.search-box > .ico { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; z-index: 1; }
.search-box > input.input { height: var(--tb-h, 38px); padding: 0 2.6rem 0 2.35rem; font-size: .86rem; width: 100%; }
.search-box > input.input::-webkit-search-cancel-button, .search-box > input.input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.search-box > .clr { position: absolute; right: .45rem; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: var(--muted); }
.search-box > .clr[hidden] { display: none; }
.search-box > .clr:hover { background: var(--gray-2); color: var(--text); }
.search-box > .clr .ico { width: 13px; height: 13px; }
.search-box > kbd { position: absolute; right: .6rem; top: 50%; transform: translateY(-50%); font-family: inherit; font-size: .66rem; font-weight: 700; line-height: 1.4; color: var(--muted); border: 1px solid var(--border-input); border-radius: 5px; padding: 0 .38rem; background: var(--gray); pointer-events: none; }
.search-box.has > kbd, .search-box > input:focus ~ kbd { display: none; }
.chip-filters { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip-filters .chip .cnt { font-size: .68rem; font-weight: 800; background: rgba(15,33,40,.08); border-radius: 999px; padding: .05rem .4rem; }

/* progress bar */
.prog { display: inline-block; width: 72px; height: 6px; border-radius: 999px; background: var(--gray-2); overflow: hidden; vertical-align: middle; }
.prog-bar { display: block; height: 100%; background: var(--gold); border-radius: 999px; transition: width .3s; }
.prog.warn .prog-bar { background: #e0a83a; }
.prog.bad .prog-bar { background: #d92d20; }
.prog.ok .prog-bar { background: #16a34a; }

/* bar chart */
.barchart { display: flex; align-items: stretch; gap: .35rem; padding-top: 1.2rem; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; position: relative; }
.bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bar { width: min(100%, 36px); border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--gold-light), var(--gold)); transition: height .4s ease; min-height: 0; }
.bar-col.hi .bar { background: linear-gradient(180deg, #2ba9c4, var(--gold-deep)); box-shadow: 0 0 0 3px rgba(27,143,163,.18); }
.bar-col.zero .bar { background: var(--gray-2); height: 3px !important; }
.bar-col:hover .bar { filter: brightness(1.08); }
.bar-lbl { font-size: .68rem; color: var(--muted); font-weight: 600; margin-top: .4rem; text-transform: capitalize; white-space: nowrap; }
.bar-col.hi .bar-lbl { color: var(--gold-deep); }
.bar-val { position: absolute; top: -1.15rem; font-size: .66rem; font-weight: 700; color: var(--text-3); opacity: 0; transition: opacity .12s; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar-col:hover .bar-val { opacity: 1; }
.spark { display: block; overflow: visible; }

/* misc */
.money { white-space: nowrap; font-variant-numeric: tabular-nums; }
.money small { font-size: .78em; font-weight: 600; color: var(--muted); }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: .8rem; padding: .42rem 0; font-size: .9rem; border-bottom: 1px dashed var(--border); align-items: baseline; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); font-size: .8rem; font-weight: 600; }
.kv .v { color: var(--text-2); min-width: 0; overflow-wrap: anywhere; }
.kv .v b { color: var(--text); }
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2rem; }
.kv-grid .kv.full { grid-column: 1 / -1; }
.hl-box { border: 1px solid var(--border); border-radius: 12px; padding: .85rem 1rem; background: var(--gray); font-size: .9rem; line-height: 1.55; }
.hl-box b { color: var(--text); }
.confirm-msg { font-size: .95rem; line-height: 1.55; color: var(--text-2); }
.pill-list { display: flex; flex-wrap: wrap; gap: .35rem; }
.thumb {
  width: 44px; height: 44px; border-radius: 8px; object-fit: cover;
  background: var(--img-bg); border: 1px solid var(--border);
}
.thumb.lg { width: 56px; height: 56px; border-radius: 10px; }
.thumb.empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .65rem; }
.thumb.empty .ico { width: 18px; height: 18px; opacity: .5; }
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--border-input); vertical-align: -4px; margin-right: .45rem; box-shadow: inset 0 0 0 1px rgba(255,255,255,.4); }
.swatch.lg { width: 28px; height: 28px; border-radius: 8px; vertical-align: middle; }
.link-ext { color: var(--gold-deep); font-weight: 600; display: inline-flex; align-items: center; gap: .3rem; }
.link-ext:hover { text-decoration: underline; }
.note-box { background: #fffaf0; border: 1px solid #f3dfb8; border-radius: 10px; padding: .7rem .9rem; font-size: .86rem; color: #6b4d12; line-height: 1.5; }
.note-box .ico { color: #c8964e; margin-right: .3rem; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.split > .adm-card { margin-bottom: 0; }
@media (max-width: 1000px) { .split { grid-template-columns: 1fr; } }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 1100px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .grid-3 { grid-template-columns: 1fr; } }
.section-title { display: flex; align-items: center; gap: .55rem; font-size: .95rem; margin-bottom: .75rem; }
.section-title .ico { color: var(--muted); }
.section-title .spacer { flex: 1; }
.section-title a { font-size: .8rem; font-weight: 600; color: var(--gold-deep); }
.section-title a:hover { text-decoration: underline; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; align-items: center; gap: .7rem; padding: .55rem 0; border-bottom: 1px solid var(--border); font-size: .88rem; }
.list-plain li:last-child { border-bottom: 0; }
.list-plain .spacer { flex: 1; }
.ol-num { width: 22px; height: 22px; border-radius: 6px; background: var(--gray-2); color: var(--text-3); font-size: .7rem; font-weight: 800; display: inline-grid; place-items: center; flex: none; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.1rem; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 .9rem .9rem; font-size: .86rem; color: var(--text-2); }
.timeline li::before { content: ""; position: absolute; left: -1.55rem; top: .3rem; width: 10px; height: 10px; border-radius: 50%; background: var(--border-input); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border-input); }
.timeline li.on::before { background: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.timeline li.ok::before { background: #16a34a; box-shadow: 0 0 0 1px #16a34a; }
.timeline li b { display: block; color: var(--text); }
.timeline li small { color: var(--muted); }
.timeline li:last-child { padding-bottom: 0; }

/* ---------- modal / drawer ---------- */
.adm-overlay {
  position: fixed; inset: 0; background: rgba(15,33,40,.45); z-index: 90;
  display: flex; justify-content: flex-end;
  opacity: 0; pointer-events: none; transition: opacity .18s;
  backdrop-filter: blur(2px);
}
.adm-overlay.show { opacity: 1; pointer-events: auto; }
.adm-drawer {
  width: min(920px, 96vw); height: 100%; background: var(--surface);
  display: flex; flex-direction: column;
  transform: translateX(30px); transition: transform .18s;
  box-shadow: var(--shadow-panel);
}
.adm-drawer.wide { width: min(1100px, 96vw); }
.adm-overlay.show .adm-drawer { transform: none; }
.adm-drawer header {
  display: flex; align-items: center; gap: .9rem;
  padding: .95rem 1.4rem; border-bottom: 1px solid var(--border);
}
.adm-drawer header .dr-ico { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; }
.adm-drawer header .dr-ico .ico { width: 19px; height: 19px; }
.adm-drawer header .dr-title { flex: 1; min-width: 0; }
.adm-drawer header h2 { font-size: 1.1rem; line-height: 1.2; }
.adm-drawer header small { display: block; color: var(--muted); font-size: .8rem; margin-top: .1rem; }
.adm-drawer header .dr-extra { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.adm-drawer header .x { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); }
.adm-drawer header .x:hover { background: var(--gray); color: var(--text); }
.adm-drawer header .x .ico { width: 18px; height: 18px; }
.adm-drawer .body { flex: 1; overflow-y: auto; padding: 1.3rem 1.4rem; }
.adm-drawer footer {
  display: flex; gap: .7rem; align-items: center;
  padding: .85rem 1.4rem; border-top: 1px solid var(--border); background: var(--gray);
}
.adm-drawer footer .spacer { flex: 1; }
.adm-drawer footer .foot-extra { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; font-size: .82rem; color: var(--muted); }
.adm-drawer.dialog { align-self: center; margin: auto; height: auto; max-height: 92vh; border-radius: var(--r-card); width: min(640px, 94vw); }
.adm-drawer.dialog.wide { width: min(920px, 94vw); }
.adm-drawer.dialog.narrow { width: min(460px, 94vw); }
.adm-overlay.center { justify-content: center; align-items: center; }

.f-sec { margin-bottom: 1.5rem; }
.f-sec > h3 {
  font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold-deep); margin-bottom: .7rem; padding-bottom: .35rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: .45rem;
}
.f-sec > h3 .ico { width: 14px; height: 14px; }
.f-sec > h3 .spacer { flex: 1; }
.f-sec > h3 .btn { font-size: .74rem; letter-spacing: 0; text-transform: none; padding: .3rem .6rem; }
.f-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem .9rem; }
.f-grid .full { grid-column: 1 / -1; }
.f-grid .field { margin: 0; }

.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  border: 1px solid var(--border-input); border-radius: 999px;
  padding: .3rem .75rem; font-size: .82rem; font-weight: 600; color: var(--text-3);
  cursor: pointer; user-select: none; background: #fff; position: relative;
}
/* .field label{display:block} (account.css) would otherwise stack icon + text */
.field label.chip, .field .chip { display: inline-flex; margin-bottom: 0; font-size: .82rem; color: var(--text-3); }
.field label.chip:has(input:checked) { color: var(--chip-text); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked), .chip.on { border-color: var(--gold); background: var(--chip-bg); color: var(--chip-text); }
.chip:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }
.chip .ico { width: 13px; height: 13px; }

/* ---------- product zone editor ---------- */
.zone-card { border: 1px solid var(--border); border-radius: 10px; padding: .6rem; margin-bottom: .6rem; background: #fff; }
.zone-card.dragging { opacity: .45; }
.zone-head { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.zone-head .rm { color: var(--muted); font-size: 1.05rem; padding: .2rem .45rem; }
.zone-head .rm:hover { color: #d92d20; }
.zdrag { cursor: grab; color: var(--muted); font-size: 1.05rem; padding: .1rem .3rem; user-select: none; touch-action: none; }
.zdrag:active { cursor: grabbing; }
.zone-editor { margin-top: .7rem; border-top: 1px dashed var(--border); padding-top: .7rem; }
.zone-colors { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .55rem; }
.zone-colors button {
  display: inline-flex; align-items: center; gap: .35rem;
  border: 1px solid var(--border-input); border-radius: 999px;
  padding: .25rem .65rem; background: #fff; cursor: pointer;
  font-size: .78rem; font-weight: 600; color: var(--text-3);
}
.zone-colors button.active { border-color: var(--gold); background: var(--chip-bg); color: var(--chip-text); }
.zone-colors button.noimg { opacity: .55; }
.zone-imgbar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .6rem; }
.zone-stage { position: relative; max-width: 720px; margin: 0 auto; touch-action: none; user-select: none; }
.zone-stage img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: 8px; pointer-events: none; }
.zone-noimg { border: 1px dashed var(--border-input); border-radius: 8px; padding: 2rem 1rem; text-align: center; color: var(--muted); font-size: .85rem; }
.zrect { position: absolute; border: 2px dashed #0f6573; background: rgba(15, 101, 115, .22); cursor: move; }
.zh { position: absolute; width: 11px; height: 11px; background: #fff; border: 2px solid #0f6573; border-radius: 3px; }
.zh-nw { top: -6px; left: -6px; cursor: nwse-resize; }
.zh-n { top: -6px; left: calc(50% - 6px); cursor: ns-resize; }
.zh-ne { top: -6px; right: -6px; cursor: nesw-resize; }
.zh-e { top: calc(50% - 6px); right: -6px; cursor: ew-resize; }
.zh-se { bottom: -6px; right: -6px; cursor: nwse-resize; }
.zh-s { bottom: -6px; left: calc(50% - 6px); cursor: ns-resize; }
.zh-sw { bottom: -6px; left: -6px; cursor: nesw-resize; }
.zh-w { top: calc(50% - 6px); left: -6px; cursor: ew-resize; }
.zgeo { text-align: center; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; color: var(--muted); margin-top: .45rem; }

.rep-row { display: flex; gap: .6rem; align-items: center; margin-bottom: .55rem; }
.rep-row .input { margin: 0; }
.rep-row .rm { color: var(--muted); font-size: 1.05rem; padding: .2rem .45rem; }
.rep-row .rm:hover { color: #d92d20; }
.rep-row .rep-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); background: var(--img-bg); flex: none; }

/* ---------- shop settings (config page) ---------- */
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }
.set-grid .set-card.wide { grid-column: 1 / -1; }
@media (max-width: 1100px) { .set-grid { grid-template-columns: 1fr; } }

.set-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-card); padding: 1.25rem 1.35rem 1.05rem; scroll-margin-top: 1rem;
  transition: border-color .15s, box-shadow .15s;
}
.set-card.dirty { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(27,143,163,.12); }
.set-head { display: flex; gap: .85rem; align-items: flex-start; margin-bottom: 1.1rem; }
.set-head h2 { font-size: 1.02rem; letter-spacing: -.01em; }
.set-head p { color: var(--text-2); font-size: .82rem; margin-top: .15rem; }
.set-head .dirty-tag { margin-left: auto; font-size: .66rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #92600a; background: #fdf3e0; border-radius: 999px; padding: .2rem .55rem; white-space: nowrap; }
.set-ico {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
}
.set-ico svg { width: 21px; height: 21px; }
.set-nav { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.set-nav a { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 600; color: var(--text-3); border: 1px solid var(--border-input); background: #fff; border-radius: 999px; padding: .35rem .8rem; }
.set-nav a:hover { border-color: var(--gold); color: var(--gold-deep); }
.set-nav a .ico { width: 13px; height: 13px; }

/* currency rows: flag + code, the synced rate, the shop's own bump, and the
   effective rate the storefront will actually use */
.cur-row {
  display: grid; grid-template-columns: 190px 92px 1fr 1.15fr 1.2fr; gap: 1rem; align-items: center;
  padding: .85rem 0; border-top: 1px solid var(--border);
}
.cur-row:first-child { border-top: 0; }
.cur-row.off { opacity: .5; }
.cur-id { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.cur-id b { font-size: .92rem; color: var(--text); }
.cur-id small { color: var(--muted); font-size: .76rem; overflow-wrap: anywhere; }
.cur-flag { width: 22px; height: 15.4px; border-radius: 2px; flex: none; box-shadow: 0 0 0 1px rgba(15,33,40,.14) inset; }
.cur-base-note { grid-column: 2 / -1; color: var(--muted); font-size: .79rem; }
.cur-row .field label { font-size: .72rem; }
.cur-rng { grid-template-columns: 1fr 60px; }
.cur-rng label { font-size: .72rem; }
.cur-eff { font-size: .79rem; color: var(--text-3); line-height: 1.45; }
.cur-eff b { color: var(--text); }
.cur-eff small { display: block; color: var(--muted); font-size: .73rem; }
@media (max-width: 900px) {
  .cur-row { grid-template-columns: 1fr 1fr; }
  .cur-id, .cur-eff, .cur-base-note { grid-column: 1 / -1; }
}

.cur-sync-box {
  display: flex; gap: 1.2rem; align-items: flex-start; flex-wrap: wrap; justify-content: space-between;
  margin-top: 1.1rem; padding: .95rem 1.05rem; border: 1px solid var(--border);
  border-radius: 11px; background: var(--img-bg);
}
.cur-sync-box > div:first-child { flex: 1 1 320px; min-width: 0; }
.cur-sync-box b { font-size: .84rem; color: var(--text); }
.cur-sync-box p { color: var(--muted); font-size: .77rem; line-height: 1.5; margin: .25rem 0 .5rem; }
.cur-sync-box code { display: block; font-size: .73rem; color: var(--text-3); overflow-wrap: anywhere; }
.cur-sync-btns { display: flex; gap: .5rem; flex-wrap: wrap; }

.input.color { padding: .2rem .3rem; height: 42px; cursor: pointer; }

.logo-variants { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .7rem; }
.logo-variant { position: relative; cursor: pointer; }
.logo-variant input { position: absolute; opacity: 0; pointer-events: none; }
.logo-variant .lv-card {
  display: flex; flex-direction: column; gap: .6rem; padding: .7rem; border-radius: 12px;
  border: 1.5px solid var(--border-input); background: var(--img-bg); transition: border-color .15s, box-shadow .15s;
}
.logo-variant .lv-preview {
  display: flex; align-items: center; justify-content: center; height: 56px; padding: .4rem .8rem;
  background: #fff; border-radius: 8px;
}
.logo-variant .lv-preview img { max-height: 100%; max-width: 100%; object-fit: contain; }
.logo-variant .lv-meta { display: grid; grid-template-columns: 24px 1fr; grid-template-rows: auto auto; column-gap: .55rem; align-items: center; }
.logo-variant .lv-fav { grid-row: 1 / span 2; width: 24px; height: 24px; border-radius: 6px; object-fit: contain; }
.logo-variant .lv-meta b { font-size: .86rem; color: var(--text); }
.logo-variant .lv-meta small { font-size: .72rem; color: var(--muted); }
.logo-variant:has(input:checked) .lv-card { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent); }
.logo-variant:has(input:focus-visible) .lv-card { outline: 2px solid var(--gold); outline-offset: 2px; }
.logo-box { display: flex; gap: .9rem; align-items: flex-start; }
.logo-thumb {
  flex: 0 0 96px; width: 96px; height: 64px; border: 1px dashed var(--border-input);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: var(--img-bg); color: var(--muted); overflow: hidden;
}
.logo-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-ctrl { flex: 1; min-width: 0; }
.logo-btns { display: flex; gap: .5rem; margin-top: .5rem; }
.logo-btns .btn[hidden] { display: none; }
.logo-ctrl small { display: block; margin-top: .45rem; color: var(--muted); font-size: .74rem; overflow-wrap: anywhere; }
.banner-preview {
  display: flex; align-items: center; justify-content: center; gap: .85rem; white-space: nowrap; overflow: hidden;
  font-size: .82rem; font-weight: 500; padding: .6rem 1rem; border-radius: 9px; letter-spacing: .01em;
  transition: opacity .15s;
}
.banner-preview .sep { opacity: .35; }
.banner-preview .count {
  font-variant-numeric: tabular-nums; font-weight: 700;
  background: rgba(255,255,255,.12); padding: .18rem .5rem; border-radius: 6px;
}
.banner-preview.off { opacity: .35; }

.set-foot { display: flex; justify-content: flex-end; align-items: center; gap: .8rem; margin-top: 1.05rem; padding-top: .9rem; border-top: 1px solid var(--border); }
.set-foot small { color: var(--muted); font-size: .76rem; margin-right: auto; }
.set-hint { color: var(--muted); font-size: .78rem; margin-top: .8rem; line-height: 1.5; }

/* percentage sliders */
.rng-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1.6rem; }
@media (max-width: 760px) { .rng-grid { grid-template-columns: 1fr; } }
.rng-row { display: grid; grid-template-columns: 1fr 64px; gap: .1rem .6rem; align-items: center; }
.rng-row label { font-size: .8rem; font-weight: 600; color: var(--text-3); grid-column: 1 / -1; }
.rng-row output {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; font-weight: 700;
  color: var(--chip-text); background: var(--chip-bg); border-radius: 7px;
  text-align: center; padding: .22rem 0;
}
.rng-row input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer;
}
.rng-row input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 999px;
  background: linear-gradient(to right, var(--gold) var(--fill, 50%), var(--border) var(--fill, 50%));
}
.rng-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px;
  border-radius: 50%; background: #fff; border: 2px solid var(--gold-deep);
  box-shadow: 0 1px 4px rgba(15,33,40,.25);
}
.rng-row input[type="range"]::-moz-range-track { height: 6px; border-radius: 999px; background: var(--border); }
.rng-row input[type="range"]::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--gold); }
.rng-row input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--gold-deep);
  box-shadow: 0 1px 4px rgba(15,33,40,.25);
}

/* toggle switch */
.set-switch { display: flex; gap: .8rem; align-items: flex-start; cursor: pointer; user-select: none; }
.set-switch input { position: absolute; opacity: 0; pointer-events: none; }
.set-switch .sl {
  flex: 0 0 42px; width: 42px; height: 24px; border-radius: 999px; margin-top: .1rem;
  background: var(--border-input); position: relative; transition: background .18s;
}
.set-switch .sl::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15,33,40,.3); transition: left .18s;
}
.set-switch input:checked + .sl { background: var(--gold); }
.set-switch input:checked + .sl::after { left: 21px; }
.set-switch input:focus-visible + .sl { outline: 2px solid var(--gold); outline-offset: 2px; }
.set-switch b { font-size: .88rem; display: block; }
.set-switch small { color: var(--muted); font-size: .78rem; line-height: 1.45; display: block; margin-top: .15rem; }
/* compact inline switch (tables, toolbars) */
.sw { position: relative; display: inline-block; width: 34px; height: 20px; cursor: pointer; vertical-align: middle; }
.sw input { position: absolute; opacity: 0; pointer-events: none; }
.sw .sl { position: absolute; inset: 0; border-radius: 999px; background: var(--border-input); transition: background .18s; }
.sw .sl::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15,33,40,.3); transition: left .18s; }
.sw input:checked + .sl { background: #16a34a; }
.sw input:checked + .sl::after { left: 16px; }
.sw input:disabled + .sl { opacity: .5; }

.stub-card {
  background: var(--surface); border: 1px dashed var(--border-input); border-radius: var(--r-card);
  padding: 3rem 2rem; text-align: center; color: var(--text-2); max-width: 560px;
}
.stub-card h2 { margin-bottom: .5rem; }

/* toast tweaks */
.bs-toast { z-index: 300; }

/* responsive columns */
@media (max-width: 1200px) { .hide-xl { display: none !important; } }
@media (max-width: 1000px) { .hide-lg { display: none !important; } }
@media (max-width: 760px) { .hide-md { display: none !important; } .kv { grid-template-columns: 1fr; gap: .15rem; } .kv-grid { grid-template-columns: 1fr; } }

@media (max-width: 880px) {
  .adm-side { position: fixed; z-index: 80; transform: translateX(-100%); transition: transform .2s; }
  .adm-side.open { transform: none; }
  .adm-main { padding-top: 3.6rem; }
  .adm-burger { position: fixed; top: .7rem; left: .7rem; z-index: 85; background: var(--navy); color: #fff; border-radius: 10px; padding: .45rem .6rem; display: grid; place-items: center; }
  .adm-burger .ico { width: 20px; height: 20px; }
  .f-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 881px) { .adm-burger { display: none; } }

/* shipping zones (config) */
.ship-zones { display: flex; flex-direction: column; gap: .6rem; }
.ship-zone { display: grid; grid-template-columns: minmax(0, 1.6fr) 1fr 1fr; gap: .9rem; align-items: end;
  padding: .8rem .9rem; border: 1px solid var(--border); border-radius: 12px; transition: opacity .15s; }
.ship-zone .field { margin: 0; }
.ship-zone .sz-name { align-self: center; margin: 0; }
.ship-zone .sz-name b { display: block; }
.ship-zone .sz-name small { color: var(--muted); font-size: .76rem; }
.ship-zone.off .field { opacity: .45; }
@media (max-width: 720px) { .ship-zone { grid-template-columns: 1fr 1fr; } .ship-zone .sz-name { grid-column: 1 / -1; } }
