/* Store admin — modelled on Shopify's admin (Polaris). */
:root {
  --bg: #f1f1f1;
  --surface: #ffffff;
  --surface-2: #f7f7f7;
  --surface-3: #f3f3f3;
  --hover: #f7f7f7;
  --selected: #ebebeb;
  --border: #e3e3e3;
  --border-2: #d4d4d4;
  --text: #303030;
  --text-2: #616161;
  --text-3: #8a8a8a;
  --dark: #1a1a1a;
  --focus: #005bd3;
  --blue: #005bd3;
  --blue-soft: #eaf4ff;
  --green: #29845a;
  --green-soft: #cdfee1;
  --green-text: #0c5132;
  --yellow-soft: #ffeb78;
  --yellow-text: #4f4700;
  --orange-soft: #ffd6a4;
  --orange-text: #5e4200;
  --red: #c70a24;
  --red-soft: #fedad9;
  --red-text: #8e0b21;
  --purple-soft: #e8dbff;
  --purple-text: #3e1c96;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 1px 0 rgba(26, 26, 26, .07), inset 0 -1px 0 rgba(0, 0, 0, .08), inset 0 0 0 1px rgba(0, 0, 0, .05);
  --shadow-pop: 0 0 0 1px rgba(0,0,0,.06), 0 8px 24px -6px rgba(0,0,0,.2);
  --top: 56px;
  --side: 240px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 450 13px/1.45 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
svg { display: block; flex: none; }
.i { width: 20px; height: 20px; }
.i-sm { width: 16px; height: 16px; }
.i-xs { width: 14px; height: 14px; }
h1, h2, h3, h4, p { margin: 0; }

/* ---------- shell */
.topbar { position: fixed; top: 0; left: 0; right: 0; height: var(--top); z-index: 50; display: grid; grid-template-columns: var(--side) 1fr auto; align-items: center; gap: 16px; padding: 0 12px 0 16px; background: var(--dark); color: #e3e3e3; }
.topbar__brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 650; font-size: 14px; text-decoration: none; min-width: 0; }
.topbar__brand:hover { text-decoration: none; }
.topbar__logo { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: linear-gradient(135deg, #36fba1, #1f9e6a); color: #0b3; color: #06301d; font-weight: 800; font-size: 13px; flex: none; }
.topbar__brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__search { position: relative; max-width: 560px; width: 100%; justify-self: center; }
.topbar__search input { width: 100%; height: 34px; padding: 0 12px 0 36px; border-radius: 10px; border: 1px solid #4a4a4a; background: #303030; color: #fff; outline: none; transition: .15s; }
.topbar__search input::placeholder { color: #a8a8a8; }
.topbar__search input:focus { background: #fff; color: var(--text); border-color: #fff; }
.topbar__search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #a8a8a8; pointer-events: none; }
.topbar__right { display: flex; align-items: center; gap: 6px; }
.topbar__btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: #e3e3e3; font-weight: 550; }
.topbar__btn:hover { background: #303030; text-decoration: none; }
.topbar__avatar { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: #36fba1; color: #06301d; font-weight: 700; font-size: 12px; }
.topbar__menu { display: none; }

.sidebar { position: fixed; top: var(--top); bottom: 0; left: 0; width: var(--side); z-index: 40; display: flex; flex-direction: column; padding: 12px 8px; background: #ebebeb; overflow-y: auto; }
.nav { display: grid; gap: 1px; }
.nav__item { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 8px; border-radius: 8px; color: var(--text); font-weight: 550; text-decoration: none; }
.nav__item:hover { background: #f1f1f1; text-decoration: none; }
.nav__item.is-active { background: #fafafa; color: var(--text); font-weight: 650; box-shadow: 0 1px 0 rgba(0,0,0,.05); }
.nav__item svg { color: var(--text-2); }
.nav__item.is-active svg { color: var(--text); }
.nav__item .grow { flex: 1; }
.nav__count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 6px; background: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center; color: var(--text-2); }
.nav__sub { display: grid; gap: 1px; margin: 1px 0 4px 28px; }
.nav__sub .nav__item { min-height: 28px; font-weight: 500; padding-left: 8px; }
.nav__group { padding: 14px 8px 6px; font-size: 12px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; justify-content: space-between; }
.nav__spacer { flex: 1; }
.sidebar__foot { padding-top: 8px; border-top: 1px solid #dcdcdc; margin-top: 8px; }

.main { margin-left: var(--side); padding: calc(var(--top) + 20px) 24px 64px; min-height: 100vh; }
.page { max-width: 1000px; margin: 0 auto; display: grid; gap: 16px; }
.page--wide { max-width: 1200px; }
.page--narrow { max-width: 780px; }
.page-head { display: flex; align-items: center; gap: 12px; min-height: 32px; flex-wrap: wrap; }
.page-head__back { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--text); }
.page-head__back:hover { background: rgba(0,0,0,.06); }
.page-head h1 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head__sub { color: var(--text-2); font-size: 13px; font-weight: 450; }
.page-head__actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.cols > div { display: grid; gap: 16px; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ---------- card */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-card); min-width: 0; }
.card__head { display: flex; align-items: center; gap: 8px; padding: 14px 16px 0; min-height: 28px; }
.card__head h2 { font-size: 13px; font-weight: 650; flex: 1; display: flex; align-items: center; gap: 8px; }
.card__body { padding: 14px 16px 16px; }
.card__body > * + * { margin-top: 12px; }
.card__foot { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.card__section { padding: 14px 16px; border-top: 1px solid var(--border); }
.card--flush .card__body { padding: 0; }
.card--pad { padding: 16px; }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); }
.strong { font-weight: 650; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.row { display: flex; align-items: center; gap: 8px; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.stack { display: grid; gap: 8px; }
.stack-lg { display: grid; gap: 16px; }
.divider { height: 1px; background: var(--border); margin: 12px 0; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.right { text-align: right; }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 8px; border: 0; background: var(--surface); color: var(--text); font-weight: 550; white-space: nowrap; box-shadow: inset 0 -1px 0 #b5b5b5, inset 0 0 0 1px #e3e3e3, 0 1px 0 rgba(0,0,0,.05); transition: background .12s; text-decoration: none; }
.btn:hover:not(:disabled) { background: var(--hover); text-decoration: none; }
.btn:active:not(:disabled) { background: var(--selected); box-shadow: inset 0 1px 1px rgba(0,0,0,.15); }
.btn:disabled { opacity: .55; cursor: default; }
.btn--primary { background: #303030; color: #fff; box-shadow: inset 0 -1px 0 #000, inset 0 1px 0 rgba(255,255,255,.15), 0 1px 0 rgba(0,0,0,.2); background-image: linear-gradient(180deg, rgba(255,255,255,.1), transparent); }
.btn--primary:hover:not(:disabled) { background-color: #1a1a1a; }
.btn--critical { background: var(--red); color: #fff; box-shadow: inset 0 -1px 0 #8e0b21; }
.btn--critical:hover:not(:disabled) { background: #a3001c; }
.btn--plain { background: none; box-shadow: none; color: var(--blue); padding: 0 6px; height: auto; min-height: 24px; }
.btn--plain:hover:not(:disabled) { background: none; text-decoration: underline; }
.btn--tertiary { background: transparent; box-shadow: none; }
.btn--tertiary:hover:not(:disabled) { background: rgba(0,0,0,.05); }
.btn--sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn--icon { width: 32px; padding: 0; }
.btn--sm.btn--icon { width: 28px; }
.btn--full { width: 100%; }
.btn.is-loading { color: transparent !important; position: relative; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid rgba(0,0,0,.2); border-top-color: #303030; border-radius: 50%; animation: spin .7s linear infinite; }
.btn--primary.is-loading::after, .btn--critical.is-loading::after { border-color: rgba(255,255,255,.4); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: 8px 0 0 8px; }
.btn-group .btn:last-child { border-radius: 0 8px 8px 0; }

/* ---------- badges */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 8px; font-size: 12px; font-weight: 550; white-space: nowrap; background: #e3e3e3; color: var(--text); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; display: none; }
.badge--dot::before { display: block; }
.badge--success { background: var(--green-soft); color: var(--green-text); }
.badge--attention { background: var(--yellow-soft); color: var(--yellow-text); }
.badge--warning { background: var(--orange-soft); color: var(--orange-text); }
.badge--critical { background: var(--red-soft); color: var(--red-text); }
.badge--info { background: var(--blue-soft); color: #00527c; }
.badge--new { background: var(--purple-soft); color: var(--purple-text); }
.badge--subdued { background: #f1f1f1; color: var(--text-2); }

/* ---------- forms */
.field { display: grid; gap: 6px; min-width: 0; }
.field + .field { margin-top: 12px; }
.fields { display: grid; gap: 12px; }
.fields-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fields-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.label { font-weight: 500; }
.help { color: var(--text-2); font-size: 12px; }
.input, .select, .textarea { width: 100%; min-height: 32px; padding: 5px 10px; border: 1px solid #8a8a8a; border-radius: 8px; background: #fdfdfd; outline: none; font-size: 13px; transition: border-color .12s, box-shadow .12s; }
.input:hover, .select:hover, .textarea:hover { border-color: #616161; }
.input:focus, .select:focus, .textarea:focus, .rte__area:focus { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); background: #fff; }
.select { appearance: none; padding-right: 28px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%234a4a4a'%3E%3Cpath d='M10 13.5 5.5 9h9z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 6px center; background-size: 18px; }
.textarea { min-height: 80px; resize: vertical; padding: 8px 10px; line-height: 1.5; }
.input-group { display: flex; align-items: center; border: 1px solid #8a8a8a; border-radius: 8px; background: #fdfdfd; overflow: hidden; }
.input-group:focus-within { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.input-group input { flex: 1; min-width: 0; border: 0; background: none; outline: none; min-height: 30px; padding: 0 10px; }
.input-group span { padding: 0 10px; color: var(--text-2); white-space: nowrap; }
.input-group span:first-child { padding-right: 0; }
.search { position: relative; }
.search input { padding-left: 32px; }
.search svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--text-2); pointer-events: none; }
.check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: #303030; cursor: pointer; flex: none; }
.switch { position: relative; display: inline-flex; width: 32px; height: 18px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #b5b5b5; transition: .15s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: #303030; }
.switch input:checked + span::after { transform: translateX(14px); }
.rte { border: 1px solid #8a8a8a; border-radius: 8px; overflow: hidden; background: #fdfdfd; }
.rte:focus-within { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.rte__bar { display: flex; gap: 2px; padding: 4px; border-bottom: 1px solid var(--border); background: #fafafa; }
.rte__bar button { width: 28px; height: 26px; border: 0; border-radius: 6px; background: none; display: grid; place-items: center; color: var(--text-2); }
.rte__bar button:hover { background: #ebebeb; color: var(--text); }
.rte__area { min-height: 180px; max-height: 480px; overflow-y: auto; padding: 10px 12px; outline: none; line-height: 1.6; }
.rte__area p { margin: 0 0 .6em; }
.rte__area ul, .rte__area ol { margin: 0 0 .6em; padding-left: 1.3em; }

/* ---------- tabs & filters */
.tabs { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tab { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--text-2); font-weight: 550; white-space: nowrap; }
.tab:hover { background: var(--hover); color: var(--text); }
.tab.is-active { background: var(--selected); color: var(--text); }
.tab__count { font-size: 11px; color: var(--text-3); font-weight: 600; }
.toolbar { display: flex; align-items: center; gap: 8px; padding: 8px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.toolbar .search { flex: 1; min-width: 180px; }
.bulkbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); flex-wrap: wrap; }

/* ---------- table */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 550; font-size: 12px; color: var(--text-2); padding: 8px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; transition: background .08s; }
.table tbody tr:hover { background: var(--hover); }
.table tbody tr.is-selected { background: #f2f7fe; }
.table .col-check { width: 36px; padding-right: 0; }
.table .col-num { text-align: right; white-space: nowrap; }
.thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--surface-3); border: 1px solid var(--border); display: block; flex: none; }
.thumb--sm { width: 32px; height: 32px; border-radius: 6px; }
.thumb--lg { width: 56px; height: 56px; }
.thumb-ph { display: grid; place-items: center; color: var(--text-3); }
.cell-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-main .strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 360px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.empty { padding: 48px 24px; text-align: center; display: grid; justify-items: center; gap: 10px; color: var(--text-2); }
.empty__art { width: 88px; height: 88px; border-radius: 24px; background: var(--surface-3); display: grid; place-items: center; color: var(--text-3); margin-bottom: 4px; }
.empty__art svg { width: 40px; height: 40px; }
.empty h3 { font-size: 16px; color: var(--text); font-weight: 650; }
.empty p { max-width: 420px; }

/* ---------- dashboard */
.range { display: inline-flex; padding: 2px; border-radius: 10px; background: #e3e3e3; gap: 2px; }
.range button { height: 28px; padding: 0 10px; border: 0; border-radius: 8px; background: none; font-weight: 550; color: var(--text-2); }
.range button.is-active { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); }
.kpi { padding: 14px 16px; border-right: 1px solid var(--border); min-width: 0; cursor: pointer; transition: background .1s; }
.kpi:last-child { border-right: 0; }
.kpi:hover, .kpi.is-active { background: var(--surface-2); }
.kpi.is-active { box-shadow: inset 0 -2px 0 #303030; }
.kpi__label { color: var(--text-2); font-weight: 550; font-size: 12px; text-decoration: underline dotted #b5b5b5; text-underline-offset: 3px; }
.kpi__value { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.kpi__value strong { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 600; }
.delta--up { color: var(--green); }
.delta--down { color: var(--red); }
.delta--flat { color: var(--text-3); }
.chart { padding: 8px 16px 12px; position: relative; }
.chart svg { width: 100%; height: 240px; overflow: visible; }
.chart__tip { position: absolute; pointer-events: none; padding: 8px 10px; border-radius: 8px; background: #fff; box-shadow: var(--shadow-pop); font-size: 12px; white-space: nowrap; z-index: 2; }
.chart__legend { display: flex; gap: 16px; padding: 0 16px 14px; color: var(--text-2); font-size: 12px; }
.chart__legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart__legend i { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }
.setup { overflow: hidden; }
.setup__progress { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 12px; }
.setup__bar { flex: 1; max-width: 160px; height: 6px; border-radius: 99px; background: #e3e3e3; overflow: hidden; }
.setup__bar i { display: block; height: 100%; background: #303030; border-radius: inherit; }
.setup__item { display: flex; gap: 12px; padding: 10px 16px; align-items: flex-start; border-top: 1px solid var(--border); }
.setup__check { width: 22px; height: 22px; border-radius: 50%; border: 1.5px dashed #8a8a8a; flex: none; display: grid; place-items: center; margin-top: 1px; }
.setup__item.is-done .setup__check { border: 0; background: #303030; color: #fff; }
.setup__item.is-done .setup__title { color: var(--text-2); text-decoration: line-through; }
.setup__title { font-weight: 600; }
.setup__text { color: var(--text-2); margin-top: 2px; }
.setup__item .btn { margin-top: 8px; }
.list { display: grid; }
.list__item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--border); color: var(--text); text-decoration: none; }
.list__item:hover { background: var(--hover); text-decoration: none; }
.list__item:first-child { border-top: 0; }
.list__item .grow { flex: 1; min-width: 0; }
.list__item small { display: block; color: var(--text-2); font-size: 12px; }
.status-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: #ebebeb; }
.status-bar i { display: block; height: 100%; }
.legend { display: grid; gap: 6px; margin-top: 12px; }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; }
.legend span { flex: 1; color: var(--text-2); }

/* ---------- order / product detail */
.line-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.line-item:first-child { border-top: 0; padding-top: 0; }
.line-item .grow { flex: 1; min-width: 0; }
.totals { display: grid; gap: 6px; }
.totals div { display: flex; justify-content: space-between; gap: 12px; }
.totals .total { font-weight: 700; font-size: 14px; padding-top: 8px; border-top: 1px solid var(--border); }
.kv { display: grid; gap: 4px; }
.kv + .kv { margin-top: 12px; }
.kv dt { font-size: 12px; color: var(--text-2); font-weight: 550; }
.kv dd { margin: 0; }
.timeline { display: grid; gap: 0; }
.timeline__item { display: flex; gap: 12px; padding: 0 0 14px; position: relative; }
.timeline__item::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: 0; width: 2px; background: var(--border); }
.timeline__item:last-child::before { display: none; }
.timeline__dot { width: 12px; height: 12px; border-radius: 50%; background: #8a8a8a; margin-top: 3px; flex: none; box-shadow: 0 0 0 3px #fff; position: relative; }
.timeline__item.is-done .timeline__dot { background: var(--green); }
.status-steps { display: flex; gap: 6px; flex-wrap: wrap; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.media-grid__item { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-3); cursor: grab; }
.media-grid__item img { width: 100%; height: 100%; object-fit: cover; }
.media-grid__item:first-child { grid-column: span 2; grid-row: span 2; }
.media-grid__del { position: absolute; top: 6px; right: 6px; opacity: 0; transition: .12s; background: #fff !important; }
.media-grid__item:hover .media-grid__del { opacity: 1; }
.media-grid__add { aspect-ratio: 1; border: 1px dashed #8a8a8a; border-radius: 10px; display: grid; place-items: center; align-content: center; gap: 6px; background: none; color: var(--text-2); font-weight: 550; text-align: center; padding: 8px; }
.media-grid__add:hover, .media-grid__add.is-over { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }
.serp { display: grid; gap: 2px; }
.serp b { color: #1a0dab; font-weight: 500; font-size: 16px; }
.serp i { color: #006621; font-style: normal; font-size: 12px; }
.serp span { color: #545454; font-size: 12px; }
.savebar { position: fixed; top: 0; left: 0; right: 0; height: var(--top); z-index: 60; display: flex; align-items: center; gap: 12px; padding: 0 16px 0 20px; background: var(--dark); color: #fff; animation: fade .15s ease; }
.savebar__msg { flex: 1; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.savebar .btn { box-shadow: none; }
.savebar .btn--discard { background: #404040; color: #fff; }
.savebar .btn--discard:hover { background: #4a4a4a; }
.savebar .btn--save { background: #fff; color: var(--text); }
@keyframes fade { from { opacity: 0; } }

/* ---------- themes */
.theme-current { display: grid; grid-template-columns: 1.4fr 1fr; gap: 0; overflow: hidden; }
.theme-shot { position: relative; background: #f3f3f3; overflow: hidden; aspect-ratio: 16 / 10; }
.theme-shot iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 800px; border: 0; transform-origin: 0 0; pointer-events: none; background: #fff; }
.theme-shot__ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); }
.theme-current__info { padding: 20px; display: flex; flex-direction: column; gap: 12px; border-left: 1px solid var(--border); }
.theme-current__info h3 { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.palette { display: flex; gap: 4px; }
.palette i { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); display: block; }
.theme-lib__item { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--border); }
.theme-lib__item:first-child { border-top: 0; }
.theme-lib__thumb { width: 96px; flex: none; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); aspect-ratio: 16 / 10; position: relative; background: #f3f3f3; }
.theme-lib__thumb iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 800px; border: 0; transform: scale(.075); transform-origin: 0 0; pointer-events: none; }
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.store-tools { gap: 12px; }
.store-search { flex: 1; max-width: 420px; }
.store-card[hidden], .empty[hidden] { display: none; }
.store-card { overflow: hidden; display: flex; flex-direction: column; }
.store-card .theme-shot { aspect-ratio: 4 / 3; border-bottom: 1px solid var(--border); }
.store-card__body { padding: 14px 16px 16px; display: grid; gap: 8px; flex: 1; align-content: start; }
.store-card__body h3 { font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.store-card__desc { color: var(--text-2); font-size: 12.5px; line-height: 1.5; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.store-card__actions { display: flex; gap: 8px; padding: 0 16px 16px; }
.store-card__actions .btn { flex: 1; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--border-2); background: #fff; font-weight: 550; color: var(--text-2); }
.chip:hover { border-color: #8a8a8a; color: var(--text); }
.chip.is-active { background: #303030; border-color: #303030; color: #fff; }
.hero-banner { padding: 24px; border-radius: var(--radius); background: linear-gradient(120deg, #1a1a1a, #303030 60%, #3d3d3d); color: #fff; display: flex; align-items: center; gap: 24px; overflow: hidden; position: relative; }
.hero-banner h2 { font-size: 20px; font-weight: 700; }
.hero-banner p { color: #cfcfcf; margin-top: 6px; max-width: 520px; }
.hero-banner .btn { margin-top: 14px; }

/* ---------- messages */
.inbox { display: grid; grid-template-columns: 340px 1fr; min-height: 520px; }
.inbox__list { border-right: 1px solid var(--border); overflow-y: auto; max-height: 70vh; }
.inbox__item { display: grid; gap: 2px; padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; }
.inbox__item:hover { background: var(--hover); }
.inbox__item.is-active { background: #f2f7fe; }
.inbox__item.is-unread .inbox__name { font-weight: 700; }
.inbox__item.is-unread .inbox__name > span:first-child::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); margin-right: 6px; vertical-align: middle; }
.inbox__name { display: flex; justify-content: space-between; gap: 8px; }
.inbox__preview { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox__view { padding: 20px; display: grid; gap: 16px; align-content: start; }
.bubble { padding: 14px 16px; border-radius: 12px; background: var(--surface-3); white-space: pre-wrap; line-height: 1.6; }

/* ---------- modal, popover, toast, login */
#layer { position: fixed; inset: 0; pointer-events: none; z-index: 100; }
#layer > * { pointer-events: auto; }
.modal { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.5); animation: fade .15s ease; }
.modal__box { width: min(620px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: #fff; border-radius: 16px; box-shadow: 0 24px 64px -12px rgba(0,0,0,.45); overflow: hidden; animation: pop .18s ease; }
.modal__box--sm { width: min(460px, 100%); }
.modal__box--lg { width: min(920px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal__head { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--border); background: #f7f7f7; }
.modal__head h2 { flex: 1; font-size: 14px; font-weight: 650; }
.modal__body { flex: 1; overflow-y: auto; padding: 16px; }
.modal__foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.modal__foot .grow { flex: 1; }
.pop { position: fixed; min-width: 200px; background: #fff; border-radius: 12px; box-shadow: var(--shadow-pop); padding: 6px; z-index: 110; animation: pop .12s ease; }
.pop__item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 32px; padding: 4px 8px; border: 0; border-radius: 8px; background: none; text-align: left; font-weight: 500; color: var(--text); text-decoration: none; }
.pop__item:hover { background: var(--hover); text-decoration: none; }
.pop__item svg { color: var(--text-2); }
.pop__item--critical, .pop__item--critical svg { color: var(--red); }
.pop__sep { height: 1px; background: var(--border); margin: 4px 0; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 10px 16px; border-radius: 10px; background: var(--dark); color: #fff; font-weight: 550; box-shadow: 0 8px 24px rgba(0,0,0,.25); display: flex; align-items: center; gap: 10px; z-index: 200; animation: pop .18s ease; max-width: calc(100vw - 32px); }
.toast--error { background: var(--red); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 20% -10%, #36fba133, transparent), radial-gradient(900px 500px at 110% 110%, #005bd322, transparent), #f1f1f1; }
.login__card { width: min(400px, 100%); background: #fff; border-radius: 20px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.35), 0 0 0 1px rgba(0,0,0,.05); padding: 32px; display: grid; gap: 18px; text-align: center; }
.login__logo { width: 52px; height: 52px; margin: 0 auto; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, #36fba1, #1f9e6a); color: #06301d; font-weight: 800; font-size: 20px; }
.login__card h1 { font-size: 20px; font-weight: 700; }
.login__pin { text-align: center; font-size: 22px; letter-spacing: .4em; height: 48px; font-weight: 700; }
.login__card .btn { height: 44px; font-size: 14px; }
.skeleton { background: linear-gradient(90deg, #ececec 25%, #f5f5f5 37%, #ececec 63%); background-size: 400% 100%; animation: sk 1.2s ease infinite; border-radius: 8px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.spinner { width: 24px; height: 24px; border: 3px solid #e3e3e3; border-top-color: #303030; border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
.banner { display: flex; gap: 12px; padding: 12px 16px; border-radius: var(--radius); background: var(--blue-soft); color: #00527c; align-items: flex-start; }
.banner--warning { background: #fff1e3; color: #5e4200; }
.banner--success { background: #cdfee1; color: #0c5132; }
.banner .grow { flex: 1; }

/* ---------- print (invoice) */
@media print {
  .topbar, .sidebar, .page-head__actions, .no-print, #layer { display: none !important; }
  .main { margin: 0; padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  body { background: #fff; }
}

/* ---------- responsive */
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, 1fr); } .kpi:nth-child(3) { border-right: 0; } .kpi:nth-child(n+4) { border-top: 1px solid var(--border); } }
@media (max-width: 990px) {
  .cols { grid-template-columns: 1fr; }
  .theme-current { grid-template-columns: 1fr; }
  .theme-current__info { border-left: 0; border-top: 1px solid var(--border); }
  .inbox { grid-template-columns: 1fr; }
  .inbox__list { max-height: 320px; border-right: 0; border-bottom: 1px solid var(--border); }
}
@media (max-width: 860px) {
  :root { --side: 260px; }
  .topbar { grid-template-columns: auto 1fr auto; }
  .topbar__menu { display: inline-grid; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 8px 0 24px rgba(0,0,0,.15); }
  body.nav-open .sidebar { transform: none; }
  .main { margin-left: 0; padding: calc(var(--top) + 16px) 12px 48px; }
  .grid-2, .grid-3, .fields-2, .fields-3 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi { border-right: 0; border-top: 1px solid var(--border); }
  .topbar__brand span { display: none; }
  .hide-sm { display: none !important; }
}
.help svg, .muted svg.i-xs { display: inline-block; vertical-align: -2px; }
