/* =====================================================================
   LiveSoko Admin — Design System
   Dense, keyboard-first, light default with dark toggle.
   Brand tokens shared with the consumer site; orange is reserved for
   primary actions and active state only — admin work is neutral.
   ===================================================================== */

:root{
  --brand:#FF5F35;
  --brand-600:#EF4A1D;
  --brand-050:#FFF0EB;

  --ok:#0E9F6E;      --ok-bg:#E7F7F1;
  --warn:#C77700;    --warn-bg:#FFF5E5;
  --danger:#DC2626;  --danger-bg:#FEECEC;
  --info:#2563EB;    --info-bg:#EAF1FE;
  --hold:#159A8C;    --hold-bg:#E6F5F3;
  --muted-bg:#F1F2F4;

  --bg:#F7F8F9;
  --panel:#FFFFFF;
  --panel-2:#FBFBFC;
  --sidebar:#0E1013;
  --sidebar-text:#9BA2AA;
  --sidebar-active:#FFFFFF;
  --text:#0B0B0C;
  --text-2:#5A6069;
  --text-3:#8A9199;
  --line:#E4E6EA;
  --line-2:#EFF0F3;
  --focus:#FF5F35;

  --shadow-sm:0 1px 2px rgba(11,11,12,.06);
  --shadow:0 1px 3px rgba(11,11,12,.08), 0 8px 24px rgba(11,11,12,.06);
  --shadow-lg:0 24px 60px rgba(11,11,12,.18);

  --r-xs:6px; --r-sm:8px; --r:10px; --r-lg:14px; --r-pill:999px;
  --ff:'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --ff-mono:'JetBrains Mono', ui-monospace, Menlo, monospace;

  --sidebar-w:250px;
  --sidebar-w-collapsed:64px;
  --topbar-h:56px;
  --row-h:44px;
}

html[data-theme="dark"]{
  --bg:#0B0D0F;
  --panel:#141719;
  --panel-2:#191D20;
  --sidebar:#08090A;
  --sidebar-text:#7E868F;
  --text:#F2F4F6;
  --text-2:#9BA2AA;
  --text-3:#6B737B;
  --line:#252A2F;
  --line-2:#1D2126;
  --muted-bg:#1D2126;
  --ok-bg:rgba(14,159,110,.16);
  --warn-bg:rgba(199,119,0,.18);
  --danger-bg:rgba(220,38,38,.16);
  --info-bg:rgba(37,99,235,.18);
  --hold-bg:rgba(21,154,140,.18);
  --brand-050:rgba(255,95,53,.15);
  --shadow-sm:0 1px 2px rgba(0,0,0,.5);
  --shadow:0 1px 3px rgba(0,0,0,.5), 0 8px 24px rgba(0,0,0,.4);
  --shadow-lg:0 24px 60px rgba(0,0,0,.7);
}

*,*::before,*::after{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; background:var(--bg); color:var(--text);
  font-family:var(--ff); font-size:14px; line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
body.no-scroll{overflow:hidden}
a{color:inherit; text-decoration:none}
button,input,select,textarea{font:inherit; color:inherit}
button{background:none; border:0; cursor:pointer; padding:0}
img,svg{display:block; max-width:100%}
h1,h2,h3,h4{margin:0; font-weight:650; letter-spacing:-.02em; line-height:1.2}
h1{font-size:1.4rem} h2{font-size:1.1rem} h3{font-size:.95rem} h4{font-size:.85rem}
p{margin:0}
:focus-visible{outline:2px solid var(--focus); outline-offset:2px; border-radius:4px}
.mono{font-family:var(--ff-mono); font-variant-numeric:tabular-nums}
.num{font-family:var(--ff-mono); font-variant-numeric:tabular-nums; text-align:right}
.muted{color:var(--text-2)}
.dim{color:var(--text-3)}
.tiny{font-size:.75rem}
.nowrap{white-space:nowrap}
.right{text-align:right}
.center{text-align:center}
.grow{flex:1}
.hidden{display:none !important}
.skip{position:absolute;left:-9999px;background:var(--brand);color:#fff;padding:10px 16px;z-index:999}
.skip:focus{left:0;top:0}

/* ---------------- Layout ---------------- */
.app{display:flex; min-height:100vh}
.sidebar{
  width:var(--sidebar-w); flex:none; background:var(--sidebar); color:var(--sidebar-text);
  display:flex; flex-direction:column; position:fixed; inset:0 auto 0 0; z-index:60;
  transition:width .2s ease, transform .25s ease;
}
body.nav-collapsed .sidebar{width:var(--sidebar-w-collapsed)}
.main{
  flex:1; min-width:0; margin-left:var(--sidebar-w);
  display:flex; flex-direction:column; transition:margin-left .2s ease;
}
body.nav-collapsed .main{margin-left:var(--sidebar-w-collapsed)}

.sb-head{
  height:var(--topbar-h); display:flex; align-items:center; gap:10px;
  padding:0 14px; border-bottom:1px solid rgba(255,255,255,.07); flex:none;
}
.sb-logo{display:flex; align-items:center; gap:8px; overflow:hidden}
.sb-logo svg{height:20px; width:auto; flex:none}
.sb-env{
  font-family:var(--ff-mono); font-size:.6rem; letter-spacing:.1em; text-transform:uppercase;
  padding:2px 6px; border-radius:4px; background:var(--warn-bg); color:var(--warn); flex:none;
}
html[data-theme="dark"] .sb-env{background:rgba(199,119,0,.25)}
.sb-scroll{flex:1; overflow-y:auto; padding:12px 10px 20px; scrollbar-width:thin}
.sb-scroll::-webkit-scrollbar{width:6px}
.sb-scroll::-webkit-scrollbar-thumb{background:rgba(255,255,255,.12); border-radius:3px}

.nav-group{margin-bottom:4px}
.nav-label{
  font-size:.62rem; letter-spacing:.14em; text-transform:uppercase; font-weight:700;
  color:rgba(255,255,255,.32); padding:14px 10px 6px; white-space:nowrap; overflow:hidden;
}
body.nav-collapsed .nav-label{opacity:0; height:14px; padding-block:6px}
.nav-item{
  display:flex; align-items:center; gap:11px; padding:8px 10px; border-radius:var(--r-sm);
  color:var(--sidebar-text); font-size:.855rem; font-weight:500; white-space:nowrap;
  transition:background .15s, color .15s; position:relative;
}
.nav-item:hover{background:rgba(255,255,255,.06); color:#fff}
.nav-item.active{background:rgba(255,95,53,.16); color:#fff}
.nav-item.active::before{
  content:""; position:absolute; left:-10px; top:8px; bottom:8px; width:3px;
  background:var(--brand); border-radius:0 3px 3px 0;
}
.nav-item svg{width:17px; height:17px; flex:none; opacity:.9}
.nav-item .label{overflow:hidden; text-overflow:ellipsis}
.nav-item .count{
  margin-left:auto; font-family:var(--ff-mono); font-size:.68rem; font-weight:700;
  background:var(--brand); color:#fff; border-radius:var(--r-pill); padding:1px 6px; min-width:18px; text-align:center;
}
.nav-item .count.neutral{background:rgba(255,255,255,.14); color:rgba(255,255,255,.75)}
body.nav-collapsed .nav-item .label,
body.nav-collapsed .nav-item .count{display:none}
body.nav-collapsed .nav-item{justify-content:center; padding-inline:0}

/* ---------------- Topbar ---------------- */
.topbar{
  height:var(--topbar-h); background:var(--panel); border-bottom:1px solid var(--line);
  display:flex; align-items:center; gap:10px; padding:0 16px; position:sticky; top:0; z-index:50;
}
.iconbtn{
  width:34px; height:34px; border-radius:var(--r-sm); display:grid; place-items:center;
  color:var(--text-2); transition:background .15s, color .15s; flex:none; position:relative;
}
.iconbtn:hover{background:var(--muted-bg); color:var(--text)}
.iconbtn svg{width:18px; height:18px}
.iconbtn .dot{
  position:absolute; top:6px; right:6px; width:7px; height:7px; border-radius:50%;
  background:var(--danger); border:2px solid var(--panel);
}
.searchbtn{
  display:flex; align-items:center; gap:9px; height:34px; padding:0 12px; min-width:230px;
  border:1px solid var(--line); border-radius:var(--r-sm); color:var(--text-3);
  background:var(--panel-2); transition:border-color .15s; font-size:.83rem;
}
.searchbtn:hover{border-color:var(--text-3)}
.searchbtn svg{width:15px; height:15px}
.searchbtn kbd{
  margin-left:auto; font-family:var(--ff-mono); font-size:.68rem; border:1px solid var(--line);
  border-radius:4px; padding:1px 5px; background:var(--panel); color:var(--text-3);
}
.mkt-switch{
  display:flex; align-items:center; gap:7px; height:34px; padding:0 11px;
  border:1px solid var(--line); border-radius:var(--r-sm); font-size:.83rem; font-weight:550;
}
.mkt-switch:hover{background:var(--muted-bg)}
.mkt-flag{
  font-family:var(--ff-mono); font-size:.66rem; font-weight:700; background:var(--muted-bg);
  padding:2px 5px; border-radius:4px;
}
.who{display:flex; align-items:center; gap:9px; padding:4px 10px 4px 4px; border-radius:var(--r-pill)}
.who:hover{background:var(--muted-bg)}
.avatar{
  width:27px; height:27px; border-radius:50%; background:var(--brand); color:#fff;
  display:grid; place-items:center; font-size:.72rem; font-weight:700; flex:none;
}
.who .meta{line-height:1.15; text-align:left}
.who .meta b{display:block; font-size:.8rem; font-weight:600}
.who .meta span{font-size:.68rem; color:var(--text-3)}

/* ---------------- Page ---------------- */
.page{padding:20px; max-width:1600px; width:100%}
.page-head{display:flex; align-items:flex-start; gap:16px; flex-wrap:wrap; margin-bottom:18px}
.page-head .ph-text{min-width:0}
.page-head h1{margin-bottom:4px}
.page-head p{color:var(--text-2); font-size:.85rem}
.page-head .ph-actions{margin-left:auto; display:flex; gap:8px; flex-wrap:wrap}
.crumbs{display:flex; align-items:center; gap:6px; font-size:.78rem; color:var(--text-3); margin-bottom:8px}
.crumbs svg{width:12px; height:12px}
.crumbs a:hover{color:var(--brand)}

/* ---------------- Buttons ---------------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  height:34px; padding:0 14px; border-radius:var(--r-sm); font-size:.83rem; font-weight:600;
  border:1px solid transparent; white-space:nowrap; transition:background .15s, border-color .15s, opacity .15s;
}
.btn svg{width:15px; height:15px; flex:none}
.btn-primary{background:var(--brand); color:#fff}
.btn-primary:hover{background:var(--brand-600)}
.btn-default{background:var(--panel); border-color:var(--line); color:var(--text)}
.btn-default:hover{background:var(--muted-bg)}
.btn-ghost{color:var(--text-2)}
.btn-ghost:hover{background:var(--muted-bg); color:var(--text)}
.btn-danger{background:var(--danger); color:#fff}
.btn-danger:hover{opacity:.9}
.btn-ok{background:var(--ok); color:#fff}
.btn-ok:hover{opacity:.9}
.btn-sm{height:28px; padding:0 10px; font-size:.78rem; border-radius:var(--r-xs)}
.btn-xs{height:24px; padding:0 8px; font-size:.73rem; border-radius:var(--r-xs)}
.btn:disabled{opacity:.45; cursor:not-allowed}
.btn-block{width:100%}

/* ---------------- Cards & panels ---------------- */
.card{background:var(--panel); border:1px solid var(--line); border-radius:var(--r-lg); overflow:hidden}
.card-head{
  display:flex; align-items:center; gap:12px; padding:13px 16px; border-bottom:1px solid var(--line-2);
}
.card-head h3{flex:1; min-width:0}
.card-head .sub{font-size:.76rem; color:var(--text-3); font-weight:400}
.card-body{padding:16px}
.card-foot{padding:12px 16px; border-top:1px solid var(--line-2); background:var(--panel-2); display:flex; gap:8px; align-items:center}

.grid{display:grid; gap:14px}
.g2{grid-template-columns:repeat(2,minmax(0,1fr))}
.g3{grid-template-columns:repeat(3,minmax(0,1fr))}
.g4{grid-template-columns:repeat(4,minmax(0,1fr))}
.g-2-1{grid-template-columns:minmax(0,2fr) minmax(0,1fr)}
.g-1-2{grid-template-columns:minmax(0,1fr) minmax(0,2fr)}
@media (max-width:1180px){ .g4{grid-template-columns:repeat(2,minmax(0,1fr))} .g-2-1,.g-1-2{grid-template-columns:1fr} }
@media (max-width:820px){ .g2,.g3,.g4{grid-template-columns:1fr} }

/* KPI */
.kpi{background:var(--panel); border:1px solid var(--line); border-radius:var(--r-lg); padding:15px}
.kpi .k-label{font-size:.74rem; color:var(--text-3); font-weight:600; letter-spacing:.02em; display:flex; align-items:center; gap:6px}
.kpi .k-label svg{width:14px; height:14px}
.kpi .k-value{font-family:var(--ff-mono); font-size:1.5rem; font-weight:700; letter-spacing:-.03em; margin:8px 0 4px}
.kpi .k-delta{font-size:.75rem; font-weight:600; display:flex; align-items:center; gap:4px}
.k-up{color:var(--ok)} .k-down{color:var(--danger)} .k-flat{color:var(--text-3)}

/* ---------------- Tables ---------------- */
.toolbar{
  display:flex; align-items:center; gap:8px; padding:11px 14px; border-bottom:1px solid var(--line-2);
  flex-wrap:wrap; background:var(--panel);
}
.field{
  display:flex; align-items:center; gap:7px; height:32px; padding:0 10px;
  border:1px solid var(--line); border-radius:var(--r-sm); background:var(--panel-2); font-size:.81rem;
}
.field svg{width:14px; height:14px; color:var(--text-3); flex:none}
.field input,.field select{
  border:0; background:none; outline:none; min-width:0; width:100%; font-size:.81rem;
}
.field.w-search{min-width:220px; flex:1; max-width:340px}
select.field{padding-right:6px; cursor:pointer}
.chipset{display:flex; gap:6px; flex-wrap:wrap}
.chip{
  height:28px; padding:0 11px; border-radius:var(--r-pill); border:1px solid var(--line);
  font-size:.78rem; font-weight:600; color:var(--text-2); display:inline-flex; align-items:center; gap:6px;
  transition:all .15s; background:var(--panel);
}
.chip:hover{border-color:var(--text-3); color:var(--text)}
.chip.on{background:var(--text); color:var(--panel); border-color:var(--text)}
.chip .n{font-family:var(--ff-mono); font-size:.7rem; opacity:.7}

.table-wrap{overflow-x:auto}
table.tbl{width:100%; border-collapse:separate; border-spacing:0; font-size:.83rem}
.tbl thead th{
  position:sticky; top:0; z-index:2; background:var(--panel-2);
  text-align:left; font-weight:600; font-size:.72rem; letter-spacing:.04em; text-transform:uppercase;
  color:var(--text-3); padding:9px 12px; border-bottom:1px solid var(--line); white-space:nowrap;
}
.tbl thead th.sortable{cursor:pointer; user-select:none}
.tbl thead th.sortable:hover{color:var(--text)}
.tbl thead th .arrow{opacity:.4; margin-left:3px}
.tbl tbody td{padding:0 12px; height:var(--row-h); border-bottom:1px solid var(--line-2); vertical-align:middle}
.tbl tbody tr{transition:background .12s}
.tbl tbody tr:hover{background:var(--panel-2)}
.tbl tbody tr.clickable{cursor:pointer}
.tbl tbody tr:last-child td{border-bottom:0}
.tbl .col-tight{width:1%; white-space:nowrap}
.tbl .col-actions{width:1%; white-space:nowrap; text-align:right}
.cell-2{line-height:1.25}
.cell-2 b{display:block; font-weight:600}
.cell-2 span{font-size:.74rem; color:var(--text-3)}
.thumb{
  width:34px; height:34px; border-radius:var(--r-xs); background:var(--muted-bg); flex:none;
  display:grid; place-items:center; font-size:.65rem; font-weight:700; color:var(--text-3); overflow:hidden;
}
.with-thumb{display:flex; align-items:center; gap:10px; min-width:0}
.checkbox{width:15px; height:15px; accent-color:var(--brand); cursor:pointer}

.pager{display:flex; align-items:center; gap:10px; padding:11px 14px; border-top:1px solid var(--line-2); font-size:.79rem; color:var(--text-2); flex-wrap:wrap}
.pager .pages{margin-left:auto; display:flex; gap:4px}
.pager .pg{min-width:28px; height:28px; padding:0 8px; border-radius:var(--r-xs); border:1px solid var(--line); display:inline-flex; align-items:center; justify-content:center; font-size:.78rem; font-weight:600}
.pager .pg.on{background:var(--text); color:var(--panel); border-color:var(--text)}
.pager .pg:hover:not(.on){background:var(--muted-bg)}

/* ---------------- Pills ---------------- */
.pill{
  display:inline-flex; align-items:center; gap:5px; height:22px; padding:0 8px;
  border-radius:var(--r-pill); font-size:.73rem; font-weight:650; white-space:nowrap;
  background:var(--muted-bg); color:var(--text-2);
}
.pill::before{content:""; width:6px; height:6px; border-radius:50%; background:currentColor; flex:none}
.pill.no-dot::before{display:none}
.p-ok{background:var(--ok-bg); color:var(--ok)}
.p-warn{background:var(--warn-bg); color:var(--warn)}
.p-danger{background:var(--danger-bg); color:var(--danger)}
.p-info{background:var(--info-bg); color:var(--info)}
.p-hold{background:var(--hold-bg); color:var(--hold)}
.p-live{background:var(--brand-050); color:var(--brand-600)}
html[data-theme="dark"] .p-live{color:#FF8A66}
.p-live::before{animation:pulse 1.6s ease-in-out infinite}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.25}}
.tag{
  display:inline-flex; align-items:center; height:20px; padding:0 7px; border-radius:var(--r-xs);
  font-family:var(--ff-mono); font-size:.68rem; font-weight:600; background:var(--muted-bg); color:var(--text-2);
}

/* ---------------- Forms ---------------- */
.form-grid{display:grid; gap:14px}
.fg{display:flex; flex-direction:column; gap:6px}
.fg > label{font-size:.78rem; font-weight:600; color:var(--text-2); display:flex; align-items:center; gap:6px}
.fg .req{color:var(--danger)}
.fg .hint{font-size:.73rem; color:var(--text-3)}
.input,.textarea,.select{
  width:100%; min-height:36px; padding:8px 11px; border:1px solid var(--line); border-radius:var(--r-sm);
  background:var(--panel); font-size:.85rem; outline:none; transition:border-color .15s, box-shadow .15s;
}
.input:focus,.textarea:focus,.select:focus{border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-050)}
.input:disabled{background:var(--muted-bg); color:var(--text-3)}
.textarea{min-height:88px; resize:vertical; font-family:inherit}
.select{cursor:pointer; appearance:none;
  background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A9199' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 9px center; background-size:15px; padding-right:30px;
}
.input-group{display:flex; align-items:stretch}
.input-group .addon{
  display:flex; align-items:center; padding:0 10px; background:var(--muted-bg);
  border:1px solid var(--line); font-size:.8rem; color:var(--text-3); font-family:var(--ff-mono);
}
.input-group .addon:first-child{border-right:0; border-radius:var(--r-sm) 0 0 var(--r-sm)}
.input-group .addon:last-child{border-left:0; border-radius:0 var(--r-sm) var(--r-sm) 0}
.input-group .input:not(:first-child){border-radius:0 var(--r-sm) var(--r-sm) 0}
.input-group .input:not(:last-child){border-radius:var(--r-sm) 0 0 var(--r-sm)}
.switch{position:relative; width:38px; height:22px; flex:none}
.switch input{opacity:0; width:0; height:0; position:absolute}
.switch .track{
  position:absolute; inset:0; background:var(--line); border-radius:var(--r-pill);
  transition:background .18s; cursor:pointer;
}
.switch .track::after{
  content:""; position:absolute; top:3px; left:3px; width:16px; height:16px; border-radius:50%;
  background:#fff; transition:transform .18s; box-shadow:var(--shadow-sm);
}
.switch input:checked + .track{background:var(--ok)}
.switch input:checked + .track::after{transform:translateX(16px)}
.switch input:focus-visible + .track{outline:2px solid var(--focus); outline-offset:2px}
.row-toggle{display:flex; align-items:center; gap:12px; padding:11px 0; border-bottom:1px solid var(--line-2)}
.row-toggle:last-child{border-bottom:0}
.row-toggle .rt-text{flex:1; min-width:0}
.row-toggle b{display:block; font-size:.85rem; font-weight:600}
.row-toggle span{font-size:.76rem; color:var(--text-3)}

/* ---------------- Detail lists ---------------- */
.dl{display:grid; grid-template-columns:auto 1fr; gap:9px 18px; font-size:.83rem; align-items:baseline}
.dl dt{color:var(--text-3); font-size:.78rem; white-space:nowrap}
.dl dd{margin:0; font-weight:550; text-align:right}
.stack-list > *{padding:11px 0; border-bottom:1px solid var(--line-2)}
.stack-list > *:last-child{border-bottom:0}

/* Timeline */
.timeline{position:relative; padding-left:22px}
.timeline::before{content:""; position:absolute; left:6px; top:6px; bottom:6px; width:2px; background:var(--line)}
.tl-item{position:relative; padding-bottom:16px}
.tl-item:last-child{padding-bottom:0}
.tl-item::before{
  content:""; position:absolute; left:-19px; top:5px; width:10px; height:10px; border-radius:50%;
  background:var(--panel); border:2px solid var(--line);
}
.tl-item.done::before{background:var(--ok); border-color:var(--ok)}
.tl-item.now::before{background:var(--brand); border-color:var(--brand); box-shadow:0 0 0 4px var(--brand-050)}
.tl-item b{display:block; font-size:.84rem; font-weight:600}
.tl-item span{font-size:.75rem; color:var(--text-3)}

/* ---------------- Tabs ---------------- */
.tabs{display:flex; gap:2px; border-bottom:1px solid var(--line); margin-bottom:16px; overflow-x:auto; scrollbar-width:none}
.tabs::-webkit-scrollbar{display:none}
.tab{
  padding:9px 13px; font-size:.84rem; font-weight:600; color:var(--text-3);
  border-bottom:2px solid transparent; margin-bottom:-1px; white-space:nowrap; transition:color .15s;
}
.tab:hover{color:var(--text)}
.tab.on{color:var(--brand); border-bottom-color:var(--brand)}
.tab .n{font-family:var(--ff-mono); font-size:.7rem; opacity:.65; margin-left:4px}

/* ---------------- Category tree ---------------- */
.tree{font-size:.85rem}
.tree-row{
  display:flex; align-items:center; gap:9px; height:38px; padding-right:10px;
  border-bottom:1px solid var(--line-2); transition:background .12s;
}
.tree-row:hover{background:var(--panel-2)}
.tree-row .twist{
  width:20px; height:20px; display:grid; place-items:center; flex:none; color:var(--text-3);
  border-radius:4px; transition:transform .15s;
}
.tree-row .twist:hover{background:var(--muted-bg); color:var(--text)}
.tree-row .twist svg{width:13px; height:13px}
.tree-row.open > .twist{transform:rotate(90deg)}
.tree-row .twist.leaf{visibility:hidden}
.tree-row .drag{color:var(--text-3); cursor:grab; opacity:0; transition:opacity .15s}
.tree-row:hover .drag{opacity:1}
.tree-row .drag svg{width:14px; height:14px}
.tree-row .tname{font-weight:550; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.tree-row .tmeta{margin-left:auto; display:flex; align-items:center; gap:12px; flex:none}
.tree-children.collapsed{display:none}

/* ---------------- Slide-over ---------------- */
.scrim{
  position:fixed; inset:0; background:rgba(8,9,10,.5); backdrop-filter:blur(2px);
  opacity:0; visibility:hidden; transition:opacity .22s, visibility .22s; z-index:80;
}
.scrim.on{opacity:1; visibility:visible}
.sheet{
  position:fixed; top:0; right:0; bottom:0; width:min(560px, 96vw); background:var(--panel);
  box-shadow:var(--shadow-lg); transform:translateX(102%); transition:transform .3s cubic-bezier(.32,.72,0,1);
  z-index:85; display:flex; flex-direction:column;
}
.sheet.on{transform:none}
.sheet.wide{width:min(880px, 98vw)}
.sheet-head{display:flex; align-items:center; gap:12px; padding:14px 18px; border-bottom:1px solid var(--line); flex:none}
.sheet-head h3{flex:1; min-width:0}
.sheet-body{flex:1; overflow-y:auto; padding:18px}
.sheet-foot{padding:13px 18px; border-top:1px solid var(--line); display:flex; gap:8px; justify-content:flex-end; background:var(--panel-2); flex:none}

/* ---------------- Modal ---------------- */
.modal{
  position:fixed; inset:0; z-index:90; display:grid; place-items:center; padding:20px;
  opacity:0; visibility:hidden; transition:opacity .2s, visibility .2s;
}
.modal.on{opacity:1; visibility:visible}
.modal-box{
  position:relative; background:var(--panel); border-radius:var(--r-lg); width:min(460px,100%);
  box-shadow:var(--shadow-lg); transform:translateY(10px) scale(.99); transition:transform .24s cubic-bezier(.32,.72,0,1);
  max-height:88vh; display:flex; flex-direction:column;
}
.modal.on .modal-box{transform:none}
.modal-box.lg{width:min(720px,100%)}
.modal-head{padding:18px 20px 0}
.modal-head h3{margin-bottom:5px}
.modal-head p{font-size:.83rem; color:var(--text-2)}
.modal-body{padding:18px 20px; overflow-y:auto}
.modal-foot{padding:14px 20px; border-top:1px solid var(--line-2); display:flex; gap:8px; justify-content:flex-end}
.modal-icon{
  width:40px; height:40px; border-radius:var(--r); display:grid; place-items:center; margin-bottom:12px;
}
.modal-icon svg{width:20px; height:20px}
.mi-danger{background:var(--danger-bg); color:var(--danger)}
.mi-warn{background:var(--warn-bg); color:var(--warn)}
.mi-ok{background:var(--ok-bg); color:var(--ok)}
.mi-brand{background:var(--brand-050); color:var(--brand)}

/* ---------------- Command palette ---------------- */
.cmdk{position:fixed; inset:0; z-index:95; display:flex; justify-content:center; padding-top:12vh;
  opacity:0; visibility:hidden; transition:opacity .16s, visibility .16s}
.cmdk.on{opacity:1; visibility:visible}
.cmdk-box{
  position:relative; width:min(580px,94vw); max-height:64vh; background:var(--panel);
  border-radius:var(--r-lg); box-shadow:var(--shadow-lg); display:flex; flex-direction:column; overflow:hidden;
  transform:translateY(-8px); transition:transform .2s;
}
.cmdk.on .cmdk-box{transform:none}
.cmdk-input{display:flex; align-items:center; gap:10px; padding:14px 16px; border-bottom:1px solid var(--line-2)}
.cmdk-input svg{width:17px; height:17px; color:var(--text-3)}
.cmdk-input input{flex:1; border:0; outline:none; background:none; font-size:.95rem}
.cmdk-list{overflow-y:auto; padding:6px}
.cmdk-sec{font-size:.65rem; letter-spacing:.12em; text-transform:uppercase; color:var(--text-3); font-weight:700; padding:9px 10px 5px}
.cmdk-item{display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:var(--r-sm); font-size:.87rem; cursor:pointer}
.cmdk-item svg{width:16px; height:16px; color:var(--text-3)}
.cmdk-item.sel{background:var(--brand-050)}
.cmdk-item .path{margin-left:auto; font-size:.72rem; color:var(--text-3); font-family:var(--ff-mono)}

/* ---------------- Misc ---------------- */
.empty{padding:56px 20px; text-align:center}
.empty svg{width:38px; height:38px; color:var(--text-3); margin:0 auto 14px}
.empty b{display:block; font-size:.95rem; margin-bottom:5px}
.empty p{font-size:.83rem; color:var(--text-2); max-width:34ch; margin:0 auto 16px}

.banner{
  display:flex; align-items:flex-start; gap:11px; padding:12px 14px; border-radius:var(--r);
  font-size:.83rem; border:1px solid transparent; margin-bottom:16px;
}
.banner svg{width:17px; height:17px; flex:none; margin-top:1px}
.banner b{display:block; margin-bottom:2px}
.b-warn{background:var(--warn-bg); color:var(--warn); border-color:rgba(199,119,0,.25)}
.b-danger{background:var(--danger-bg); color:var(--danger); border-color:rgba(220,38,38,.25)}
.b-info{background:var(--info-bg); color:var(--info); border-color:rgba(37,99,235,.25)}
.b-ok{background:var(--ok-bg); color:var(--ok); border-color:rgba(14,159,110,.25)}
.banner .banner-act{margin-left:auto; flex:none}

.bar-track{height:6px; border-radius:3px; background:var(--muted-bg); overflow:hidden}
.bar-track i{display:block; height:100%; border-radius:3px; background:var(--brand)}
.spark{display:flex; align-items:flex-end; gap:2px; height:34px}
.spark i{flex:1; background:var(--brand-050); border-radius:2px 2px 0 0; min-height:2px}
.spark i.hi{background:var(--brand)}

.toast-wrap{position:fixed; bottom:18px; left:50%; transform:translateX(-50%); z-index:120; display:flex; flex-direction:column; gap:8px; align-items:center}
.toast{
  display:flex; align-items:center; gap:9px; background:var(--text); color:var(--bg);
  padding:10px 16px; border-radius:var(--r-pill); font-size:.83rem; font-weight:600;
  box-shadow:var(--shadow); animation:toastIn .25s cubic-bezier(.2,.8,.3,1);
}
.toast svg{width:15px; height:15px}
@keyframes toastIn{from{opacity:0; transform:translateY(10px)}to{opacity:1;transform:none}}

.role-lock{opacity:.45; pointer-events:none; position:relative}

/* Mobile */
.nav-scrim{display:none}
@media (max-width:1000px){
  .sidebar{transform:translateX(-100%)}
  body.nav-open .sidebar{transform:none}
  .main{margin-left:0 !important}
  .nav-scrim{display:block; position:fixed; inset:0; background:rgba(8,9,10,.5); z-index:55; opacity:0; visibility:hidden; transition:.2s}
  body.nav-open .nav-scrim{opacity:1; visibility:visible}
  .searchbtn{min-width:0; width:34px; padding:0; justify-content:center}
  .searchbtn span,.searchbtn kbd{display:none}
  .who .meta{display:none}
  .page{padding:14px}
}
@media (prefers-reduced-motion:reduce){
  *{animation-duration:.001ms !important; transition-duration:.001ms !important}
}

/* =====================================================================
   FORMS, EDITORS & MEDIA  (added with the create/edit surfaces)
   ===================================================================== */

.form-grid.split{grid-template-columns:repeat(2,minmax(0,1fr))}
.form-grid.split > .fg:not(.half),
.form-grid.split > .form-divider,
.form-grid.split > .banner,
.form-grid.split > .row-toggle{grid-column:1 / -1}
@media (max-width:640px){ .form-grid.split{grid-template-columns:1fr} }

.form-divider{
  display:flex; align-items:center; gap:12px; margin:6px 0 2px;
  font-size:.68rem; letter-spacing:.12em; text-transform:uppercase;
  font-weight:700; color:var(--text-3);
}
.form-divider::after{content:""; flex:1; height:1px; background:var(--line)}

.input-inline{
  min-height:28px; padding:4px 8px; font-size:.8rem; border-color:transparent;
  background:transparent; width:100%; min-width:64px;
}
.input-inline:hover{border-color:var(--line); background:var(--panel)}
.input-inline:focus{border-color:var(--brand); background:var(--panel)}
td .input-inline{text-align:inherit}

.select-sm{min-height:28px; padding:3px 26px 3px 8px; font-size:.78rem; background-position:right 6px center}
.select.locked{opacity:.5; cursor:not-allowed}

.dropzone{
  border:1.5px dashed var(--line); border-radius:var(--r); padding:22px 14px;
  display:flex; flex-direction:column; align-items:center; gap:6px; text-align:center;
  color:var(--text-3); cursor:pointer; transition:border-color .15s, background .15s;
}
.dropzone:hover{border-color:var(--brand); background:var(--brand-050)}
.dropzone svg{width:22px; height:22px}
.dropzone b{font-size:.83rem; color:var(--text-2); font-weight:600}

.taglist{
  display:flex; flex-wrap:wrap; gap:6px; align-items:center; padding:7px;
  border:1px solid var(--line); border-radius:var(--r-sm); background:var(--panel); min-height:38px;
}
.tagchip{
  display:inline-flex; align-items:center; gap:5px; height:24px; padding:0 5px 0 9px;
  border-radius:var(--r-xs); background:var(--muted-bg); font-size:.78rem; font-weight:550;
}
.tagchip button{display:grid; place-items:center; color:var(--text-3); width:16px; height:16px; border-radius:3px}
.tagchip button:hover{background:var(--danger-bg); color:var(--danger)}
.tagchip svg{width:11px; height:11px}
.taginput{border:0; outline:none; background:none; flex:1; min-width:80px; font-size:.82rem; padding:0 4px}

.swatch-cell{display:flex; align-items:center; gap:7px}
.swatch{width:18px; height:18px; border-radius:4px; border:1px solid var(--line); flex:none}

.drag-handle{color:var(--text-3); cursor:grab; display:grid; place-items:center}
.drag-handle:active{cursor:grabbing}
.drag-handle svg{width:14px; height:14px}

.media-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(108px,1fr)); gap:10px}
.media-grid.lib{grid-template-columns:repeat(auto-fill,minmax(132px,1fr))}
.media-tile{
  position:relative; aspect-ratio:1; background:var(--muted-bg); border-radius:var(--r-sm);
  display:grid; place-items:center; color:var(--text-3); border:1px solid var(--line-2);
}
.media-tile svg{width:22px; height:22px}
.media-tile.add{border:1.5px dashed var(--line); cursor:pointer; gap:4px; align-content:center}
.media-tile.add:hover{border-color:var(--brand); color:var(--brand)}
.media-tile.lib{cursor:pointer}
.media-tile.lib:hover{border-color:var(--brand)}
.media-pos{
  position:absolute; left:6px; top:6px; width:18px; height:18px; border-radius:4px;
  background:var(--text); color:var(--panel); font-size:.65rem; font-weight:700;
  display:grid; place-items:center; font-family:var(--ff-mono);
}
.media-x{
  position:absolute; right:5px; top:5px; width:20px; height:20px; border-radius:4px;
  background:var(--panel); color:var(--text-3); display:grid; place-items:center;
  opacity:0; transition:opacity .15s; box-shadow:var(--shadow-sm);
}
.media-tile:hover .media-x{opacity:1}
.media-x:hover{color:var(--danger)}
.media-x svg{width:12px; height:12px}
.media-meta{
  position:absolute; left:0; right:0; bottom:0; padding:4px 6px; font-size:.65rem;
  font-family:var(--ff-mono); color:var(--text-3); background:linear-gradient(transparent,var(--panel) 60%);
  text-align:center;
}
.media-badge{
  position:absolute; left:6px; top:6px; padding:1px 6px; border-radius:var(--r-pill);
  background:var(--warn-bg); color:var(--warn); font-size:.62rem; font-weight:700;
}

.inherit-box{
  margin-top:14px; padding:14px; border:1px solid var(--line); border-left:3px solid var(--hold);
  border-radius:var(--r-sm); background:var(--panel-2);
}
.inherit-head{display:flex; align-items:center; gap:8px; margin-bottom:12px; font-size:.8rem; color:var(--hold)}
.inherit-head svg{width:15px; height:15px; flex:none}
.inherit-head b{color:var(--text-2); font-weight:600}

.perm-grid{display:flex; flex-wrap:wrap; gap:6px}

table.matrix td{padding:6px 10px}
table.matrix td:first-child{min-width:180px}
table.matrix th:not(:first-child){text-align:center}

.push-preview{
  display:flex; gap:11px; padding:12px; border-radius:var(--r); background:var(--muted-bg);
  border:1px solid var(--line-2);
}
.pp-icon{
  width:34px; height:34px; border-radius:9px; background:var(--brand); color:#fff;
  display:grid; place-items:center; font-size:.7rem; font-weight:700; flex:none;
}
.pp-body b{display:block; font-size:.85rem; margin-bottom:2px}
.pp-body p{font-size:.8rem; color:var(--text-2); margin-bottom:4px; line-height:1.45}

/* =====================================================================
   MULTI-PAGE ADDITIONS
   Utility classes used by the generated pages.
   ===================================================================== */
.link{color:var(--brand)}
.link:hover{text-decoration:underline}
.link-brand{color:var(--brand); font-weight:600}
.bold{font-weight:600}
.ml-auto{margin-left:auto}
.mt-8{margin-top:8px} .mt-18{margin-top:18px} .mt-20{margin-top:20px} .mt-22{margin-top:22px}
.ok-text{color:var(--ok)} .danger-text{color:var(--danger)} .warn-text{color:var(--warn)}
.grow{flex:1}
.chev-sm{width:13px !important; height:13px !important; opacity:.5}

.btn-row{display:flex; gap:8px; flex-wrap:wrap; margin-top:16px}
.btn-block{width:100%}
.btn-tall{height:40px}
.is-disabled{opacity:.45; pointer-events:none}

.spark-x{display:flex; justify-content:space-between; margin-top:8px}
.bar-head{display:flex; justify-content:space-between}
.rollout{display:flex; align-items:center; gap:8px; justify-content:flex-end}
.rollout .bar-track{width:60px}

.att-row{display:flex; align-items:center; gap:11px; padding:11px 0; border-bottom:1px solid var(--line-2)}
.att-row:last-child{border-bottom:0}
.att-ico{width:30px; height:30px; border-radius:8px; display:grid; place-items:center; flex:none}
.att-ico svg{width:16px; height:16px}

.attr-row{display:flex; align-items:center; gap:8px}
.attr-row svg{width:14px; height:14px; flex:none; color:var(--text-3)}

.stars{font-size:.8rem; letter-spacing:1px}
.stars .on{color:var(--brand)}
.stars .off{color:var(--line)}

.thumb.sm{width:26px; height:26px; font-size:.6rem}

.chat-scroll{max-height:340px; overflow-y:auto}
.chat-msg{display:flex; gap:10px; padding:10px 16px; border-bottom:1px solid var(--line-2)}
.chat-msg.flagged{background:var(--danger-bg)}
.chat-msg .cm-body{flex:1; min-width:0}
.chat-msg .cm-head{display:flex; gap:7px; align-items:center}
.chat-msg .cm-text{font-size:.83rem}
.chat-msg .cm-acts{display:flex; gap:4px; align-self:center}

.tree-row .tnum{min-width:56px; text-align:right}
.tree-row .tsub{min-width:64px; text-align:right}

.check-inline{display:flex; align-items:center; gap:8px; cursor:pointer; color:var(--text-2); font-size:.83rem}
.check-inline.start{align-items:flex-start; font-size:.8rem}
.check-inline.start .checkbox{margin-top:2px}
.row-between{display:flex; align-items:center; justify-content:space-between; font-size:.83rem}

/* Table cells with an input keep their alignment */
td .input-inline{width:100%}

/* Media tiles now carry real <img> placeholders */
.media-tile img{width:100%; height:100%; object-fit:cover; border-radius:inherit}
.media-tile{overflow:hidden}
/* Avatar fallback image, used when a user has no uploaded photo */
.avatar.img-fallback{background:var(--muted-bg) url("../images/placeholder-avatar.svg") center/cover no-repeat; color:transparent}

/* =====================================================================
   SELLER PORTAL ADDITIONS
   Same design system, warmer surfaces. The seller is a customer, not staff.
   ===================================================================== */
.link{color:var(--brand)} .link:hover{text-decoration:underline}
.link-brand{color:var(--brand); font-weight:600}
.bold{font-weight:600}
.ml-auto{margin-left:auto}
.mt-8{margin-top:8px} .mt-18{margin-top:18px} .mt-20{margin-top:20px} .mt-22{margin-top:22px}
.ok-text{color:var(--ok)} .danger-text{color:var(--danger)} .warn-text{color:var(--warn)}
.grow{flex:1}
.btn-row{display:flex; gap:8px; flex-wrap:wrap; margin-top:16px}
.btn-block{width:100%} .btn-tall{height:40px}
.is-disabled{opacity:.45; pointer-events:none}
.spark-x{display:flex; justify-content:space-between; margin-top:8px}
.bar-head{display:flex; justify-content:space-between}
.check-inline{display:flex; align-items:center; gap:8px; cursor:pointer; color:var(--text-2); font-size:.83rem}
.check-inline.start{align-items:flex-start; font-size:.8rem}
.check-inline.start .checkbox{margin-top:2px}
.row-between{display:flex; align-items:center; justify-content:space-between; font-size:.83rem}
.media-tile img{width:100%; height:100%; object-fit:cover; border-radius:inherit}
.media-tile{overflow:hidden}
.stars{font-size:.8rem; letter-spacing:1px}
.stars .on{color:var(--brand)} .stars .off{color:var(--line)}
.thumb.sm{width:26px; height:26px; font-size:.6rem}
.attr-row{display:flex; align-items:center; gap:10px; padding:10px 0; border-bottom:1px solid var(--line-2)}
.attr-row:last-child{border-bottom:0}
.attr-row svg{width:15px; height:15px; flex:none; color:var(--text-3)}
.att-row{display:flex; align-items:center; gap:11px; padding:11px 16px; border-bottom:1px solid var(--line-2)}
.att-row:last-child{border-bottom:0}
.att-ico{width:32px; height:32px; border-radius:9px; display:grid; place-items:center; flex:none}
.att-ico svg{width:16px; height:16px}
table.matrix td:first-child{min-width:200px}
table.matrix th:not(:first-child){text-align:center}
table.matrix td:not(:first-child){text-align:center}

/* Shop identity block under the logo */
.sb-shop{
  display:flex; align-items:center; gap:10px; padding:12px 16px; margin:0 10px 6px;
  background:rgba(255,255,255,.06); border-radius:var(--r); border:1px solid rgba(255,255,255,.08);
}
.shop-avatar{
  width:34px; height:34px; border-radius:9px; background:var(--brand); color:#fff;
  display:grid; place-items:center; font-size:.78rem; font-weight:700; flex:none;
}
.shop-meta{min-width:0}
.shop-meta b{display:block; color:#fff; font-size:.83rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.shop-meta span{font-size:.7rem; color:rgba(255,255,255,.5)}
body.nav-collapsed .sb-shop{padding:10px; justify-content:center}
body.nav-collapsed .shop-meta{display:none}

.golive-btn{gap:6px}
.golive-btn svg{width:15px; height:15px}
@media (max-width:720px){ .golive-btn span{display:none} }

/* Hero KPI — the number sellers open the portal for */
.kpi-hero{
  background:linear-gradient(135deg, var(--brand) 0%, #E8481F 100%); color:#fff; border-color:transparent;
}
.kpi-hero .k-label{color:rgba(255,255,255,.8)}
.kpi-hero .k-label svg{color:rgba(255,255,255,.9)}
.kpi-hero .k-value{color:#fff}
.kpi-hero .k-delta{color:rgba(255,255,255,.85)}

/* Today's to-do list */
.todo-list{padding:4px 0}
.todo-row{
  display:flex; align-items:center; gap:12px; padding:13px 16px;
  border-bottom:1px solid var(--line-2); transition:background .12s;
}
.todo-row:last-child{border-bottom:0}
.todo-row:hover{background:var(--panel-2)}
.todo-ico{width:32px; height:32px; border-radius:9px; display:grid; place-items:center; flex:none}
.todo-ico svg{width:16px; height:16px}
.t-warn{background:var(--warn-bg); color:var(--warn)}
.t-danger{background:var(--danger-bg); color:var(--danger)}
.t-brand{background:var(--brand-050); color:var(--brand)}
.t-ok{background:var(--ok-bg); color:var(--ok)}
.todo-text{min-width:0; flex:1}
.todo-text b{display:block; font-size:.86rem}
.todo-text span{font-size:.76rem; color:var(--text-3)}

.rank-row{display:flex; align-items:center; gap:12px; margin-bottom:14px}
.rank-num{font-size:1.9rem; letter-spacing:-.03em; color:var(--brand)}

/* Margin breakdown — the single most-read block in the portal */
.margin-box{
  margin-top:14px; padding:12px 14px; background:var(--panel-2); border:1px solid var(--line);
  border-radius:var(--r-sm);
}
.mb-row{display:flex; justify-content:space-between; align-items:center; padding:5px 0; font-size:.82rem}
.mb-row.total{border-top:1px solid var(--line); margin-top:5px; padding-top:9px; font-size:.88rem}

/* Money flow explainer */
.money-flow{display:grid; grid-template-columns:repeat(5,1fr); gap:10px}
@media (max-width:900px){ .money-flow{grid-template-columns:1fr} }
.mf-step{
  padding:14px; border:1px solid var(--line); border-radius:var(--r); position:relative; background:var(--panel);
}
.mf-step b{display:block; font-size:.84rem; margin-bottom:5px}
.mf-step p{color:var(--text-3)}
.mf-dot{
  width:30px; height:30px; border-radius:9px; background:var(--muted-bg); color:var(--text-3);
  display:grid; place-items:center; margin-bottom:10px;
}
.mf-dot svg{width:15px; height:15px}
.mf-step.done .mf-dot{background:var(--ok-bg); color:var(--ok)}
.mf-step.now{border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-050)}
.mf-step.now .mf-dot{background:var(--brand); color:#fff}

/* Escrow explainer on the order page */
.escrow-box{padding:2px 0}
.eb-head{display:flex; align-items:center; gap:8px; margin-bottom:8px; color:var(--hold)}
.eb-head svg{width:16px; height:16px}
.eb-head b{color:var(--text)}
.eb-bar{margin:12px 0 6px}

/* Pre-flight check before going live */
.preflight{padding:4px 0}
.pf-row{display:flex; align-items:center; gap:11px; padding:12px 16px; border-bottom:1px solid var(--line-2)}
.pf-row:last-child{border-bottom:0}
.pf-row > svg{width:17px; height:17px; flex:none}
.pf-row.ok > svg{color:var(--ok)}
.pf-row.warn > svg{color:var(--warn)}

.row-pinned{background:var(--brand-050)}
.chat-scroll{max-height:300px; overflow-y:auto}
.chat-msg{display:flex; gap:10px; padding:10px 16px; border-bottom:1px solid var(--line-2)}
.chat-msg.flagged{background:var(--danger-bg)}
.chat-msg .cm-body{flex:1; min-width:0}
.chat-msg .cm-head{display:flex; gap:7px; align-items:center}
.chat-msg .cm-text{font-size:.83rem}
.chat-msg .cm-acts{align-self:center}
.chat-send{display:flex; gap:8px; padding:12px 16px; border-top:1px solid var(--line)}

/* Numbered tips */
.tips{display:grid; gap:12px}
.tip{display:flex; gap:11px; align-items:flex-start}
.tip-n{
  width:22px; height:22px; border-radius:50%; background:var(--brand-050); color:var(--brand);
  display:grid; place-items:center; font-size:.7rem; font-weight:700; flex:none;
}
.tip b{display:block; font-size:.83rem}
.tip span{font-size:.78rem; color:var(--text-3); line-height:1.5}

/* Questions */
.qa-list{padding:0}
.qa{padding:14px 16px; border-bottom:1px solid var(--line-2)}
.qa:last-child{border-bottom:0}
.qa.answered{opacity:.6}
.qa-head{display:flex; align-items:center; gap:10px; margin-bottom:8px}
.qa-body{font-size:.86rem; margin-bottom:10px; padding-left:36px}
.qa-reply{display:flex; gap:8px; padding-left:36px}

/* Campaigns */
.camp-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); gap:12px; padding:16px}
.camp{padding:14px; border:1px solid var(--line); border-radius:var(--r); background:var(--panel)}
.camp.joined{border-color:var(--ok); background:var(--ok-bg)}
.camp.ended{opacity:.55}
.camp-head{display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:3px}
.camp-head b{font-size:.9rem}
.camp-when{margin-bottom:8px}
.camp p{color:var(--text-2); line-height:1.5; margin-bottom:12px}
.camp-foot{display:flex; align-items:center; justify-content:space-between; gap:8px}

/* Rating summary */
.rating-big{display:flex; align-items:center; gap:10px; margin-bottom:16px; flex-wrap:wrap}
.rating-big b{font-size:2.2rem; letter-spacing:-.03em}
.rate-row{display:flex; align-items:center; gap:10px; margin-bottom:7px}
.rate-row .bar-track{flex:1}
.rate-row span:first-child{min-width:48px}

/* Shopfront preview */
.shop-preview{border:1px solid var(--line); border-radius:var(--r); overflow:hidden}
.sp-cover{height:74px; background:linear-gradient(135deg,var(--brand),#E8481F)}
.sp-body{padding:0 14px 14px; margin-top:-22px}
.sp-logo{
  width:48px; height:48px; border-radius:12px; background:var(--text); color:var(--panel);
  display:grid; place-items:center; font-weight:700; border:3px solid var(--panel); margin-bottom:8px;
}
.sp-body b{font-size:1rem; margin-right:7px}
.sp-body p{color:var(--text-2); margin:6px 0 10px}
.sp-stats{display:flex; gap:14px; color:var(--text-3)}
.sp-stats b{font-size:.8rem; color:var(--text); margin:0}

/* Checklists */
.progress-big{display:flex; align-items:center; gap:14px; margin-bottom:18px}
.progress-big .pb-bar{flex:1}
.progress-big b{font-size:1.3rem}
.checklist{display:grid; gap:2px}
.ck{display:flex; align-items:center; gap:11px; padding:11px 0; border-bottom:1px solid var(--line-2)}
.ck:last-child{border-bottom:0}
.ck > svg{width:18px; height:18px; color:var(--ok); flex:none}
.ck-empty{
  width:18px; height:18px; border-radius:50%; border:2px solid var(--line); flex:none; display:block;
}
.ck.done b{color:var(--text-3); text-decoration:line-through}

.status-track{display:grid; gap:2px; margin-bottom:18px}
.st{display:flex; align-items:center; gap:11px; padding:11px 0; border-bottom:1px solid var(--line-2)}
.st:last-child{border-bottom:0}
.st > svg{width:18px; height:18px; color:var(--ok); flex:none}
.st.now .ck-empty{border-color:var(--brand); background:var(--brand-050)}
.st b{display:block; font-size:.86rem}

/* Return options */
.choice-list{display:grid; gap:10px}
.choice{padding:12px; border:1px solid var(--line); border-radius:var(--r-sm); background:var(--panel-2)}
.choice b{font-size:.86rem}
.choice p{color:var(--text-2); margin:4px 0 6px; line-height:1.5}

/* Policies / FAQ */
.policy-list{display:grid; gap:2px}
.policy{border-bottom:1px solid var(--line-2); padding:11px 0}
.policy:last-child{border-bottom:0}
.policy summary{cursor:pointer; font-size:.86rem; font-weight:600; list-style:none; display:flex; gap:8px}
.policy summary::-webkit-details-marker{display:none}
.policy summary::before{content:"+"; color:var(--brand); font-weight:700; width:12px}
.policy[open] summary::before{content:"\2212"}
.policy p{margin-top:8px; padding-left:20px; color:var(--text-2); line-height:1.65}

/* Help */
.help-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:10px; margin-top:14px}
.help-card{
  padding:14px; border:1px solid var(--line); border-radius:var(--r); background:var(--panel);
  display:block; transition:border-color .15s, transform .15s;
}
.help-card:hover{border-color:var(--brand); transform:translateY(-1px)}
.help-card svg{width:19px; height:19px; color:var(--brand); margin-bottom:9px}
.help-card b{display:block; font-size:.86rem; margin-bottom:3px}
.contact-list{display:grid}
.contact{display:flex; align-items:center; gap:11px; padding:11px 0; border-bottom:1px solid var(--line-2)}
.contact:last-child{border-bottom:0}

/* Save bar for inline-edited tables */
.save-bar{
  display:flex; align-items:center; gap:14px; justify-content:space-between; margin-top:14px;
  padding:12px 16px; background:var(--panel); border:1px solid var(--line); border-radius:var(--r);
  position:sticky; bottom:12px; box-shadow:var(--shadow);
}

/* Onboarding */
.onb-steps{display:flex; gap:6px; margin-bottom:22px}
.onb-steps span{height:3px; flex:1; border-radius:2px; background:var(--line)}
.onb-steps span.on{background:var(--ok)}
.onb-steps span.now{background:var(--brand)}
.upload-list{display:grid; gap:8px; margin-bottom:18px}
.upl{display:flex; align-items:center; gap:11px; padding:11px; border:1px solid var(--line); border-radius:var(--r-sm)}
.upl-ico{width:32px; height:32px; border-radius:9px; background:var(--muted-bg); color:var(--text-3); display:grid; place-items:center; flex:none}
.upl-ico svg{width:16px; height:16px}
.next-list{display:grid; gap:12px; margin-bottom:20px}
.nx{display:flex; gap:11px; align-items:flex-start}
.nx-n{width:22px; height:22px; border-radius:50%; background:var(--brand-050); color:var(--brand); display:grid; place-items:center; font-size:.7rem; font-weight:700; flex:none}
.nx b{display:block; font-size:.85rem}

/* =====================================================================
   Seller portal additions — components that only exist now the pages
   are backed by real data.
   ===================================================================== */

/* Six-box code entry. Without this the inputs render full width and the
   code reads as a form rather than as one number. */
.otp{display:flex; gap:8px; flex-wrap:nowrap}
.otp input{
  width:100%; min-width:0; flex:1 1 0; max-width:56px; aspect-ratio:1/1.15;
  padding:0; text-align:center; font-family:var(--ff-mono); font-size:1.35rem;
  font-weight:700; color:var(--text); background:var(--panel);
  border:1px solid var(--line); border-radius:var(--r-sm);
  transition:border-color .12s, box-shadow .12s, background .12s; -moz-appearance:textfield}
.otp input::-webkit-outer-spin-button,
.otp input::-webkit-inner-spin-button{-webkit-appearance:none; margin:0}
.otp input:focus{outline:none; border-color:var(--brand);
  box-shadow:0 0 0 3px var(--brand-bg, rgba(255,95,53,.16))}
.otp input.filled{background:var(--panel-2); border-color:var(--text-3)}
@media (max-width:420px){ .otp{gap:6px} .otp input{font-size:1.15rem} }
.modal-body .otp input{max-width:48px}

/* Inline validation */
.fg-err{display:block; margin-top:6px; font-size:.76rem; color:var(--danger); font-weight:500}
.fg.has-err .input,.fg.has-err .select,.fg.has-err .textarea{border-color:var(--danger)}

/* Pills and small text tones */
.p-neutral{background:var(--muted-bg); color:var(--text-2)}
.mono.danger,.num .danger,.danger{color:var(--danger)}
.mono.warn,.num .warn,.warn{color:var(--warn)}
.ok{color:var(--ok)}

/* Back link above a page title */
.back-link{display:inline-flex; align-items:center; gap:5px; margin-bottom:7px;
  font-size:.79rem; font-weight:600; color:var(--text-3)}
.back-link:hover{color:var(--brand)}
.back-link svg{width:14px; height:14px}

/* Bulk action bar */
.bulk-bar{display:flex; align-items:center; gap:10px; padding:10px 14px;
  border-bottom:1px solid var(--line-2); background:var(--muted-bg); font-size:.82rem}

/* Product media grid */
.media-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(132px,1fr)); gap:12px}
.media-item{margin:0; border:1px solid var(--line); border-radius:var(--r-sm);
  overflow:hidden; background:var(--panel-2)}
.media-item img,.media-item video{display:block; width:100%; aspect-ratio:1; object-fit:cover}
.media-item figcaption{display:flex; align-items:center; gap:6px; padding:6px 8px;
  border-top:1px solid var(--line-2)}

/* Product picker used by the go-live screen */
.pick-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:10px}
.pick-item{display:flex; align-items:center; gap:9px; padding:8px; cursor:pointer;
  border:1px solid var(--line); border-radius:var(--r-sm); transition:border-color .12s}
.pick-item:hover{border-color:var(--text-3)}
.pick-item:has(input:checked){border-color:var(--brand); background:var(--panel-2)}
.pick-item img{width:40px; height:40px; border-radius:var(--r-xs); object-fit:cover; flex:none}

/* Replay gallery */
.replay-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:14px}
.replay-cover{position:relative; display:block; aspect-ratio:16/9; background:var(--muted-bg)}
.replay-cover img{width:100%; height:100%; object-fit:cover; display:block}
.replay-placeholder{width:100%; height:100%; display:grid; place-items:center; color:var(--text-3)}
.replay-placeholder svg{width:30px; height:30px}
.replay-time{position:absolute; right:8px; bottom:8px; background:rgba(0,0,0,.72); color:#fff;
  font-family:var(--ff-mono); font-size:.68rem; padding:2px 6px; border-radius:4px}
.replay-stats{display:flex; gap:12px; color:var(--text-2); flex-wrap:wrap}
.replay-stats span{display:inline-flex; align-items:center; gap:4px}
.replay-stats svg{width:13px; height:13px}

/* Checkbox list standing in for a multiselect */
.chip-check{display:flex; flex-wrap:wrap; gap:10px 16px}

/* Rows that have been muted or selected */
tr.is-muted td{opacity:.5}
tr.is-selected td{background:var(--muted-bg)}
.att-row.is-selected{background:var(--muted-bg); border-radius:var(--r-xs)}

/* =====================================================================
   Onboarding, account-state screens, and the page pieces that had markup
   but no styling. Grouped here rather than scattered so the shared bits
   (icon sizing, list resets) are stated once.
   ===================================================================== */

/* Every inline icon in these blocks is a bare <svg> with no intrinsic size.
   Without this it inherits the SVG default of 300x150 and swallows the page. */
.onboard-steps svg, .tick-list svg, .step-list svg, .checklist-item svg,
.state-page svg, .state-icon svg, .stack-row svg, .locked-field svg{
  width:1em; height:1em; flex:none;
}

/* ---- Onboarding progress -------------------------------------------- */
/* list-style:none matters: the markup supplies its own numerals, so the
   browser counter would otherwise render "2Your ID". */
.onboard-steps{
  list-style:none; margin:0 0 20px; padding:0;
  display:flex; align-items:center; gap:6px;
}
.onboard-steps li{
  flex:1; display:flex; flex-direction:column; align-items:center; gap:6px;
  font-size:.72rem; line-height:1.2; text-align:center; color:var(--text-3);
  position:relative;
}
.onboard-steps li span{
  width:26px; height:26px; border-radius:var(--r-pill);
  display:inline-flex; align-items:center; justify-content:center;
  font-size:.76rem; font-weight:600;
  background:var(--muted-bg); color:var(--text-3);
  border:1px solid var(--line); box-sizing:border-box;
}
/* The connector sits behind the numerals, stopping short of each circle. */
.onboard-steps li::before{
  content:""; position:absolute; top:13px; right:calc(50% + 17px);
  width:calc(100% - 34px); height:1px; background:var(--line);
}
.onboard-steps li:first-child::before{display:none}
.onboard-steps li.on{color:var(--text); font-weight:600}
.onboard-steps li.on span{background:var(--brand); border-color:var(--brand); color:#fff}
.onboard-steps li.done{color:var(--text-2)}
.onboard-steps li.done span{background:var(--ok); border-color:var(--ok); color:#fff}
.onboard-steps li.done::before{background:var(--ok)}

/* ---- Account-state screens ------------------------------------------ */
.state-page{text-align:center; padding:40px 20px; max-width:520px; margin:0 auto}
.state-icon{
  width:48px; height:48px; border-radius:var(--r-lg); margin:0 auto 18px;
  display:flex; align-items:center; justify-content:center;
  background:var(--muted-bg); color:var(--text-2);
}
.state-icon svg{width:22px; height:22px}
.state-summary{
  text-align:left; background:var(--panel-2); border:1px solid var(--line);
  border-radius:var(--r); padding:14px 16px;
}
.state-summary .kv{margin:0}

/* ---- Long-form copy (seller agreement) ------------------------------ */
.agreement{text-align:left; font-size:.86rem; line-height:1.65; color:var(--text-2)}
.agreement h2{
  font-size:.95rem; font-weight:650; color:var(--text);
  margin:22px 0 8px; padding-top:16px; border-top:1px solid var(--line-2);
}
.agreement h2:first-child{margin-top:0; padding-top:0; border-top:0}
.agreement ul{margin:8px 0; padding-left:18px}
.agreement li{margin-bottom:6px}
.agreement li b{color:var(--text)}

/* ---- Lists with leading icons --------------------------------------- */
.tick-list{list-style:none; margin:0; padding:0}
.tick-list li{
  display:flex; align-items:flex-start; gap:8px; margin-bottom:8px; line-height:1.5;
}
.tick-list li:last-child{margin-bottom:0}
.tick-list svg{margin-top:.25em; color:var(--text-3)}
.tick-list li b{color:var(--text)}

.step-list{margin:0; padding-left:18px}
.step-list li{margin-bottom:8px; line-height:1.5}
.step-list li:last-child{margin-bottom:0}
.step-list li b{color:var(--text)}

/* ---- Getting-started checklist -------------------------------------- */
.checklist-item{
  display:flex; align-items:flex-start; gap:12px;
  padding:14px 0; border-bottom:1px solid var(--line-2);
}
.checklist-item:last-child{border-bottom:0; padding-bottom:0}
.checklist-item .check{
  width:24px; height:24px; border-radius:var(--r-pill); flex:none;
  display:inline-flex; align-items:center; justify-content:center;
  font-size:.74rem; font-weight:600;
  background:var(--muted-bg); color:var(--text-3); border:1px solid var(--line);
  box-sizing:border-box;
}
.checklist-item.done .check{background:var(--ok); border-color:var(--ok); color:#fff}
.checklist-item.done .cell-2 b{color:var(--text-2); text-decoration:line-through}
.checklist-item .ml-auto{align-self:center}

/* ---- Help FAQ -------------------------------------------------------- */
.faq{border-bottom:1px solid var(--line-2); padding:12px 0}
.faq:last-child{border-bottom:0}
.faq summary{
  cursor:pointer; font-weight:600; font-size:.86rem; color:var(--text);
  list-style:none; display:flex; align-items:center; gap:8px;
}
.faq summary::-webkit-details-marker{display:none}
.faq summary::before{
  content:"+"; color:var(--text-3); font-weight:400; font-size:1rem; flex:none;
}
.faq[open] summary::before{content:"\2013"}
.faq p{margin:8px 0 0 20px; font-size:.82rem; line-height:1.6; color:var(--text-2)}

/* ---- Read-only field (approved KYC) --------------------------------- */
.locked-field{
  display:flex; align-items:center; gap:8px;
  padding:9px 12px; border-radius:var(--r-sm);
  background:var(--ok-bg); color:var(--text-2); font-size:.84rem;
}
.locked-field svg{color:var(--ok)}

/* ---- Generic stacked row -------------------------------------------- */
.stack-row{
  display:flex; align-items:center; gap:10px;
  padding:10px 0; border-bottom:1px solid var(--line-2);
}
.stack-row:last-child{border-bottom:0; padding-bottom:0}
.stack-row:first-child{padding-top:0}

/* ---- Statement / worked-example tables ------------------------------ */
.tbl.statement td{padding:8px 0; border-bottom:1px solid var(--line-2)}
.tbl.statement tr:last-child td{border-bottom:0}
.tbl.statement .sub-total td{border-top:1px solid var(--line); font-weight:600}
.tbl.statement .grand td{
  border-top:2px solid var(--line); padding-top:12px; font-size:.95rem;
}

/* ---- Ratings --------------------------------------------------------- */
.rating-summary{display:flex; gap:24px; align-items:center; flex-wrap:wrap}
.rating-big{text-align:center; flex:none}
.rating-big b{display:block; font-size:2.2rem; line-height:1; font-weight:700}
.rating-bars{flex:1; min-width:180px}
.rating-bar{display:flex; align-items:center; gap:8px; margin-bottom:5px}
.rating-bar:last-child{margin-bottom:0}
.rating-bar .bar{
  flex:1; height:6px; border-radius:var(--r-pill); background:var(--muted-bg); overflow:hidden;
}
.rating-bar .bar i{display:block; height:100%; background:var(--brand); border-radius:inherit}
.stars{display:inline-flex; gap:1px; color:var(--line); font-size:.9rem; letter-spacing:1px}
.stars i{font-style:normal}
.stars i.on{color:#F5A524}

/* ---- Reviews and questions ------------------------------------------ */
.review, .qa{padding:16px 0; border-bottom:1px solid var(--line-2)}
.review:last-child, .qa:last-child{border-bottom:0; padding-bottom:0}
.qa.pinned{
  background:var(--brand-050); margin:0 -16px; padding-left:16px; padding-right:16px;
  border-radius:var(--r-sm);
}
.review-head{display:flex; align-items:flex-start; gap:10px; margin-bottom:10px}
.review-title{display:block; font-size:.88rem; margin-bottom:4px}
.review-body, .qa-question{
  font-size:.86rem; line-height:1.6; color:var(--text-2); margin:0;
}
.review-reply{
  margin-top:10px; padding:10px 12px; border-radius:var(--r-sm);
  background:var(--panel-2); border-left:2px solid var(--brand);
}
.review-reply b{display:block; color:var(--text-3); margin-bottom:4px}
.review-reply p{margin:0; font-size:.84rem; line-height:1.55; color:var(--text-2)}
.review-form{display:flex; gap:8px; align-items:flex-start; margin-top:10px}
.review-form textarea{flex:1; resize:vertical}

/* ---- Promotions ------------------------------------------------------ */
.promo-grid{
  display:grid; gap:14px;
  grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));
}
.promo.joined{border-color:var(--brand); box-shadow:0 0 0 1px var(--brand) inset}
.promo-head{
  display:flex; align-items:flex-start; justify-content:space-between;
  gap:10px; margin-bottom:8px;
}
.promo-head b{font-size:.92rem; line-height:1.3}

/* ---- Shopfront ------------------------------------------------------- */
.banner-preview{
  width:100%; border-radius:var(--r-sm); display:block;
  aspect-ratio:4/1; object-fit:cover; background:var(--muted-bg);
}
.banner-placeholder{
  width:100%; aspect-ratio:4/1; border-radius:var(--r-sm);
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px;
  background:var(--muted-bg); border:1px dashed var(--line); color:var(--text-3);
}
.banner-placeholder svg{width:20px; height:20px}
.shop-preview{text-align:center; padding:8px 0}
.shop-preview b{display:block; margin:10px 0 2px; font-size:.95rem}
.shop-preview .thumb{margin:0 auto}

/* ---- Media grid actions ---------------------------------------------- */
.media-actions{display:flex; gap:2px; justify-content:flex-end; margin-top:4px}

@media (max-width:640px){
  .onboard-steps li{font-size:.66rem}
  .rating-summary{gap:14px}
  .review-form{flex-direction:column}
  .review-form .btn{align-self:flex-end}
}

/* Default size for any icon that no context rule claims.
   icon() emits a bare <svg> with no width or height, and an unsized inline SVG
   falls back to 300x150 — which is how a tick ends up half a page tall. A bare
   `svg` selector is specificity 0,0,1, so every `.btn svg`, `.banner svg` and
   the rest still win despite coming earlier in the file. The sprite is
   inline-styled to zero and the logo is class-scoped, so neither is caught. */
svg{width:16px; height:16px; flex:none}

/* ---- Drag to reorder ------------------------------------------------ */
[data-sortable] [data-id]{
  cursor:grab; position:relative;
  /* touch-action:none is what lets a held finger drag instead of scrolling.
     The JS still waits for a short hold, so an ordinary swipe scrolls. */
  touch-action:none;
  transition:transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
[data-sortable] [data-id]:focus-visible{
  outline:2px solid var(--brand); outline-offset:2px;
}
[data-sortable] [data-id].is-dragging{
  cursor:grabbing; opacity:.9; transform:scale(1.04);
  box-shadow:0 8px 24px rgba(0,0,0,.18); z-index:5;
}
[data-sortable].is-sorting [data-id]:not(.is-dragging){opacity:.65}

/* The cover photo is the one doing the selling, so it is marked, not implied. */
[data-sortable] [data-id].is-cover::after{
  content:""; position:absolute; inset:0; border-radius:inherit;
  border:2px solid var(--brand); pointer-events:none;
}
.sortable-status{margin:8px 0 0; min-height:1.1em}
.sortable-hint{
  display:flex; align-items:center; gap:6px;
  margin:0 0 10px; color:var(--text-3);
}

/* The position boxes are the no-JS way to reorder. Once the drag script has
   initialised it adds .js-sortable, and they are no longer needed. */
[data-sortable].js-sortable .pos-fallback{display:none}

/* ---- Product tag chips ---------------------------------------------- */
/* Background comes from the tag row, text colour is computed server-side
   from that background's luminance, so contrast is never left to chance. */
.tagchips{display:inline-flex; flex-wrap:wrap; gap:4px; vertical-align:middle}
.tagchip{
  display:inline-flex; align-items:center; gap:4px;
  padding:2px 7px; border-radius:var(--r-pill);
  font-size:.68rem; font-weight:600; line-height:1.5; white-space:nowrap;
  letter-spacing:.01em;
}
.tagchip svg{width:11px; height:11px; flex:none}
.tagchip.sm{padding:1px 6px; font-size:.63rem}
.tagchip.sm svg{width:10px; height:10px}
.tagchip.more{background:var(--muted-bg); color:var(--text-2)}

/* Picker used on the product editors */
.tag-picker{display:flex; flex-wrap:wrap; gap:8px}
.tag-picker label{
  cursor:pointer; position:relative;
  border-radius:var(--r-pill); display:inline-flex;
}
.tag-picker input{position:absolute; opacity:0; width:0; height:0}
.tag-picker .tagchip{opacity:.35; transition:opacity .12s ease, box-shadow .12s ease}
.tag-picker input:checked + .tagchip{opacity:1}
.tag-picker input:focus-visible + .tagchip{
  box-shadow:0 0 0 2px var(--panel), 0 0 0 4px var(--brand);
}
.tag-picker label:hover .tagchip{opacity:.75}
.tag-picker input:checked + .tagchip{opacity:1}

.tag-auto{
  display:flex; flex-wrap:wrap; gap:6px; align-items:center;
  padding:10px 12px; border-radius:var(--r-sm);
  background:var(--panel-2); border:1px dashed var(--line);
}
