/* Ssentials dashboard — Shopify-admin structure (dark sidebar, light canvas, white cards), black and white. */
@font-face { font-family: 'Inter'; src: url('/assets/fonts/inter-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Plex Mono'; src: url('/assets/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); font-display: swap; }

:root {
  --bg: #f1f1f1; --card: #fff; --side: #1a1a1a; --side-2: #2b2b2b; --side-fg: #e3e3e3; --side-muted: #9a9a9a;
  --navy: #303030; --cream: #f1f1f1;
  --ink: #303030; --ink-strong: #1a1a1a; --muted: #616161; --soft: #8a8a8a; --line: #e3e3e3; --line-2: #ebebeb; --hover: #f7f7f7; --sel: #f1f1f1;
  --btn: #303030; --focus: #005bd3; --link: #005bd3;
  --ok-bg: #affebf; --ok-fg: #014b40; --warn-bg: #ffeb78; --warn-fg: #4f4700; --crit-bg: #fedad9; --crit-fg: #8e1f0b; --info-bg: #e0f0ff; --info-fg: #00527c; --att-bg: #ffd6a4; --att-fg: #5e4200; --gray-bg: #e3e3e3; --gray-fg: #303030;
  --r: 12px; --r-sm: 8px;
  --shadow: 0 1px 0 0 rgba(26,26,26,.07), 0 1px 0 0 rgba(208,208,208,.4) inset, 1px 0 0 0 #cccccc33 inset, -1px 0 0 0 #cccccc33 inset, 0 -1px 0 0 #cccccc33 inset;
  --side-w: 240px; --top-h: 56px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'Plex Mono', ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 450 13px/1.45 var(--font); color: var(--ink); background: var(--side); -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01'; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; color: var(--ink-strong); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.mono { font-family: var(--mono); font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.soft { color: var(--soft); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ── Shell ───────────────────────────────────────────────── */
.top { position: fixed; inset: 0 0 auto 0; height: var(--top-h); display: grid; grid-template-columns: var(--side-w) 1fr auto; align-items: center; gap: 12px; padding: 0 12px 0 0; background: var(--side); color: var(--side-fg); z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 16px; color: #fff; }
.brand img { height: 20px; width: auto; display: block; }
.brand:hover { text-decoration: none; }
.brand small { font: 500 10px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--side-muted); border: 1px solid #444; border-radius: 6px; padding: 2px 6px; }
.top-search { justify-self: center; width: min(560px, 100%); display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border-radius: 10px; background: #303030; color: #b5b5b5; border: 1px solid #3d3d3d; cursor: text; }
.top-search svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; flex: none; }
.top-search kbd { white-space: nowrap; margin-left: auto; font: 500 11px var(--font); background: #3d3d3d; border-radius: 4px; padding: 1px 5px; color: #ccc; }
.top-right { display: flex; align-items: center; gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 8px; background: #e3e3e3; color: #1a1a1a; display: grid; place-items: center; font-weight: 650; font-size: 12px; border: 0; }
.user-btn { display: flex; align-items: center; gap: 8px; background: none; border: 0; color: #e3e3e3; padding: 4px 6px; border-radius: 8px; }
.user-btn:hover { background: var(--side-2); }
.side { position: fixed; top: var(--top-h); bottom: 0; left: 0; width: var(--side-w); background: var(--side); color: var(--side-fg); overflow-y: auto; padding: 4px 8px 12px; z-index: 20; display: flex; flex-direction: column; scrollbar-width: thin; scrollbar-color: #444 transparent; }
.nav-group { margin: 0 0 2px; }
.nav-label { display: flex; align-items: center; gap: 4px; padding: 14px 10px 6px; font-size: 12px; font-weight: 550; color: var(--side-muted); }
.nav a { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border-radius: 8px; color: var(--side-fg); font-weight: 550; text-decoration: none; }
.nav a:hover { background: var(--side-2); }
.nav a.on { background: #303030; color: #fff; }
.nav a svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; opacity: .9; }
.nav a .badge-n { margin-left: auto; background: #fff; color: #1a1a1a !important; font-weight: 650; color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; line-height: 18px; }
.nav .sub { padding-left: 38px; font-weight: 450; color: #c7c7c7; height: 28px; }
.nav .sub.on { background: transparent; color: #fff; font-weight: 600; }
.side-foot { margin-top: auto; padding-top: 12px; }
.health-pill { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; font-weight: 550; color: var(--side-fg); }
.health-pill:hover { background: var(--side-2); text-decoration: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #29845a; flex: none; }
.dot.warning { background: #e8b400; }
.dot.critical { background: #e51c00; box-shadow: 0 0 0 0 rgba(229,28,0,.6); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(229,28,0,0); } 100% { box-shadow: 0 0 0 0 rgba(229,28,0,0); } }
.main { position: fixed; top: var(--top-h); left: var(--side-w); right: 0; bottom: 0; background: var(--bg); border-radius: 12px 0 0 0; overflow-y: auto; }
.page { max-width: 1000px; margin: 0 auto; padding: 20px 24px 120px; }
.page.wide { max-width: 1240px; }
.page.full { max-width: none; }
.banner-top { background: #fedad9; color: #8e1f0b; border-radius: 10px; padding: 9px 14px; margin-bottom: 14px; display: flex; gap: 10px; align-items: center; font-weight: 550; }
.banner-top.warn { background: #fff1c2; color: #4f4700; }
.banner-top.info { background: #eaf4ff; color: #00527c; }
.mock-flag { background: #303030; color: #fff; font-size: 11px; border-radius: 6px; padding: 2px 6px; }

/* ── Page head ───────────────────────────────────────────── */
.ph { display: flex; align-items: center; gap: 10px; min-height: 36px; margin-bottom: 16px; flex-wrap: wrap; }
.ph h1 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.ph .back { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--ink); }
.ph .back:hover { background: #e3e3e3; text-decoration: none; }
.ph .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ph .sub { width: 100%; color: var(--muted); margin-top: -6px; }

/* ── Cards / layout ──────────────────────────────────────── */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; }
.card-b { padding: 16px; }
.card-h { display: flex; align-items: center; gap: 8px; padding: 14px 16px 0; }
.card-h h2 { font-size: 13px; font-weight: 650; }
.card-h .actions { margin-left: auto; display: flex; gap: 6px; }
.card-sec { padding: 14px 16px; border-top: 1px solid var(--line-2); }
.card-sec:first-child { border-top: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.divider { height: 1px; background: var(--line-2); margin: 12px 0; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state h3 { font-size: 16px; margin-bottom: 6px; }
.empty-state .btn { margin-top: 14px; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 8px; border: 0; background: #fff; color: var(--ink-strong); font-weight: 600; font-size: 12px; box-shadow: 0 -1px 0 0 #b5b5b5 inset, 0 0 0 1px rgba(0,0,0,.1) inset, 0 .5px 0 1.5px #fff inset; white-space: nowrap; text-decoration: none !important; }
.btn:hover { background: #f7f7f7; }
.btn:active { box-shadow: 0 2px 1px 0 rgba(26,26,26,.2) inset; }
.btn.primary { background: var(--btn); color: #fff; box-shadow: 0 -1px 0 1px rgba(0,0,0,.8) inset, 0 0 0 1px #303030 inset, 0 .5px 0 1.5px rgba(255,255,255,.25) inset; }
.btn.primary:hover { background: #1a1a1a; }
.btn.danger { background: #c70a24; color: #fff; box-shadow: 0 -1px 0 1px rgba(0,0,0,.4) inset; }
.btn.plain { background: none; box-shadow: none; color: var(--link); padding: 0 6px; }
.btn.plain:hover { text-decoration: underline !important; background: none; }
.btn.icon { width: 30px; padding: 0; }
.btn[disabled], .btn.busy { opacity: .5; pointer-events: none; }
.btn.busy::after { content: ''; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.lg { height: 36px; padding: 0 16px; font-size: 13px; }

/* ── Forms ───────────────────────────────────────────────── */
.f { display: grid; gap: 4px; }
.f > span, .lbl { font-weight: 550; color: var(--ink); }
.f .help { color: var(--muted); font-size: 12px; }
.in, .sel, .ta { width: 100%; height: 32px; padding: 0 10px; border: 1px solid #8a8a8a; border-radius: 8px; background: #fdfdfd; transition: border-color .12s; }
.in:hover, .sel:hover, .ta:hover { border-color: #616161; }
.in:focus, .sel:focus, .ta:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: #616161; }
.ta { height: auto; min-height: 80px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
.sel { appearance: none; -webkit-appearance: none; padding-right: 28px; background: #fdfdfd url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 20 20'%3E%3Cpath d='M5 8l5 5 5-5' fill='none' stroke='%23303030' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 10px center; }
.in.sm, .sel.sm { height: 28px; font-size: 12px; }
.in-pre { display: flex; align-items: center; border: 1px solid #8a8a8a; border-radius: 8px; background: #fdfdfd; overflow: hidden; }
.in-pre:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.in-pre > span { padding: 0 8px; color: var(--muted); white-space: nowrap; }
.in-pre .in { border: 0; border-radius: 0; outline: 0; background: transparent; }
.chk { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.chk input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--navy); }
.err-text { color: #8e1f0b; font-size: 12px; }
.field-err .in { border-color: #c70a24; background: #fff4f4; }
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { position: absolute; opacity: 0; }
.switch i { position: absolute; inset: 0; background: #b5b5b5; border-radius: 10px; transition: background .12s; }
.switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + i { background: var(--navy); }
.switch input:checked + i::after { transform: translateX(16px); }
.rte { border: 1px solid #8a8a8a; border-radius: 8px; overflow: hidden; background: #fff; }
.rte-bar { display: flex; gap: 2px; padding: 4px; border-bottom: 1px solid var(--line); background: #fafafa; flex-wrap: wrap; }
.rte-bar button { height: 26px; min-width: 28px; border: 0; background: none; border-radius: 6px; font-weight: 600; }
.rte-bar button:hover { background: #ebebeb; }
.rte-body { min-height: 160px; padding: 10px 12px; outline: 0; line-height: 1.6; }
.rte-body p { margin: 0 0 .7em; }

/* ── Tables ──────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 550; color: var(--muted); background: #f7f7f7; padding: 7px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 12px; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover td { background: var(--hover); }
.tbl .r { text-align: right; }
.tbl .chkcol { width: 32px; padding-right: 0; }
.tbl strong { font-weight: 650; color: var(--ink-strong); }
.thumb { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--line); background: #f4f4f4; object-fit: contain; flex: none; }
.thumb.lg { width: 56px; height: 56px; }
.thumb-ph { width: 40px; height: 40px; border-radius: 8px; border: 1px dashed #c8c8c8; background: #fafafa; flex: none; }
.tabs { display: flex; gap: 2px; padding: 8px 8px 0; flex-wrap: wrap; align-items: center; }
.tabs a { padding: 6px 10px; border-radius: 8px; color: var(--muted); font-weight: 550; }
.tabs a:hover { background: var(--hover); text-decoration: none; }
.tabs a.on { background: #ebebeb; color: var(--ink-strong); }
.tbl-tools { display: flex; gap: 8px; padding: 8px; align-items: center; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tbl-tools .in { max-width: 360px; }
.bulkbar { display: flex; gap: 8px; align-items: center; padding: 8px 12px; background: #f7f7f7; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pager { display: flex; justify-content: center; gap: 6px; padding: 10px; }

/* ── Badges ──────────────────────────────────────────────── */
.bd { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 8px; font-size: 12px; font-weight: 550; background: var(--gray-bg); color: var(--gray-fg); white-space: nowrap; }
.bd::before { content: ''; width: 6px; height: 6px; border-radius: 50%; border: 1.5px solid currentColor; }
.bd.fill::before { background: currentColor; }
.bd.nodot::before { display: none; }
.bd.ok { background: var(--ok-bg); color: var(--ok-fg); }
.bd.warn { background: var(--warn-bg); color: var(--warn-fg); }
.bd.att { background: var(--att-bg); color: var(--att-fg); }
.bd.crit { background: var(--crit-bg); color: var(--crit-fg); }
.bd.info { background: var(--info-bg); color: var(--info-fg); }
.bd.dark { background: #303030; color: #fff; }

/* ── Stats / charts ──────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); }
.kpi { padding: 14px 16px; border-right: 1px solid var(--line-2); position: relative; min-width: 0; }
.kpi:last-child { border-right: 0; }
.kpi .k { color: var(--muted); font-weight: 550; border-bottom: 1px dotted #b5b5b5; display: inline-block; }
.kpi .v { font-size: 20px; font-weight: 700; color: var(--ink-strong); margin: 6px 0 2px; letter-spacing: -.01em; }
.kpi .d { font-size: 12px; font-weight: 550; }
.kpi .d.up { color: #29845a; } .kpi .d.down { color: #c70a24; } .kpi .d.flat { color: var(--soft); }
.kpi svg { display: block; width: 100%; height: 34px; margin-top: 6px; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; }
.chart .tip { position: absolute; pointer-events: none; background: #1a1a1a; color: #fff; padding: 6px 8px; border-radius: 6px; font-size: 12px; white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .1s; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 12px; }
.legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; background: #303030; }
.bars .bar-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.bars .bar-row:last-child { border-bottom: 0; }
.bars .bar-track { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: #f1f1f1; overflow: hidden; }
.bars .bar-track i { display: block; height: 100%; background: var(--navy); border-radius: 3px; }
.funnel { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line-2); }
.funnel > div { background: #fff; padding: 12px 14px; }
.funnel .v { font-size: 18px; font-weight: 700; color: var(--ink-strong); }
.funnel .pct { color: var(--muted); font-size: 12px; }
.funnel .fb { height: 60px; display: flex; align-items: flex-end; margin-top: 8px; }
.funnel .fb i { display: block; width: 100%; background: var(--navy); border-radius: 4px 4px 0 0; min-height: 2px; }
.range { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.map { position: relative; background: #111; border-radius: 12px; overflow: hidden; aspect-ratio: 2 / 1; }
.map svg { width: 100%; height: 100%; display: block; }

/* ── Health / todo lists ─────────────────────────────────── */
.todo { display: grid; }
.todo a { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line-2); color: var(--ink); text-decoration: none; }
.todo a:hover { background: var(--hover); }
.todo .t { font-weight: 600; color: var(--ink-strong); }
.todo .s { color: var(--muted); font-size: 12px; }

/* ── Timeline ────────────────────────────────────────────── */
.timeline { position: relative; padding: 0 16px 16px 34px; }
.timeline::before { content: ''; position: absolute; left: 21px; top: 0; bottom: 16px; width: 2px; background: #e3e3e3; }
.tl { position: relative; padding: 10px 0; }
.tl::before { content: ''; position: absolute; left: -17px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: #8a8a8a; border: 2px solid #fff; }
.tl.comment::before { background: #303030; }
.tl.error::before, .tl.warning::before { background: #e51c00; }
.tl .when { color: var(--soft); font-size: 12px; }
.tl-day { font-size: 12px; font-weight: 600; color: var(--muted); padding: 12px 0 2px; }
.comment-box { padding: 12px 16px; display: flex; gap: 8px; }

/* ── Product editor ──────────────────────────────────────── */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.media-grid .m { position: relative; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #f4f4f4; cursor: grab; }
.media-grid .m:first-child { grid-column: span 2; grid-row: span 2; }
.media-grid .m img { width: 100%; height: 100%; object-fit: contain; }
.media-grid .m img.cover { object-fit: cover; }
.media-grid .m .x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 6px; border: 0; background: rgba(255,255,255,.9); opacity: 0; font-size: 14px; line-height: 1; }
.media-grid .m .fit { position: absolute; left: 4px; bottom: 4px; height: 20px; border-radius: 6px; border: 0; background: rgba(255,255,255,.9); font-size: 10px; padding: 0 6px; opacity: 0; }
.media-grid .m:hover .x, .media-grid .m:hover .fit { opacity: 1; }
.media-grid .m.drag { opacity: .4; }
.drop { border: 1px dashed #8a8a8a; border-radius: 8px; display: grid; place-items: center; text-align: center; padding: 18px; color: var(--muted); background: #fafafa; cursor: pointer; aspect-ratio: 1; }
.drop.over { background: #eef5ff; border-color: var(--focus); }
.drop.wide { aspect-ratio: auto; min-height: 110px; }
.vtbl input { min-width: 70px; }
.vtbl td { padding: 6px 8px; }
.kind-pick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.kind-pick label { border: 1px solid var(--line); border-radius: 8px; padding: 8px; text-align: center; cursor: pointer; font-weight: 550; font-size: 12px; }
.kind-pick input { display: none; }
.kind-pick input:checked + span { color: #fff; }
.kind-pick label:has(input:checked) { background: var(--navy); color: #fff; border-color: var(--navy); }
.seo-prev { padding: 12px; border-radius: 8px; background: #fafafa; }
.seo-prev .t { color: #1a0dab; font-size: 16px; }
.seo-prev .u { color: #006621; font-size: 12px; }
.blocks { display: grid; gap: 10px; }
.blk { border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.blk-h { display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px; border-bottom: 1px solid var(--line-2); background: #fafafa; border-radius: 10px 10px 0 0; }
.blk-h b { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.blk-h .actions { margin-left: auto; display: flex; gap: 2px; }
.blk-b { padding: 10px 12px; display: grid; gap: 8px; }
.blk-add { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Overlays ────────────────────────────────────────────── */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 60; display: grid; place-items: center; padding: 20px; animation: fade .12s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 14px; width: min(620px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal.lg { width: min(900px, 100%); }
.modal-h { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal-h h3 { font-size: 14px; }
.modal-h button { margin-left: auto; }
.modal-b { padding: 16px; overflow-y: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.savebar { position: fixed; top: 0; left: 0; right: 0; height: var(--top-h); background: #1a1a1a; z-index: 50; display: flex; align-items: center; gap: 10px; padding: 0 16px 0 calc(var(--side-w) + 16px); color: #fff; transform: translateY(-100%); transition: transform .2s ease; }
.savebar.on { transform: none; }
.savebar .msg { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.savebar .actions { margin-left: auto; display: flex; gap: 8px; }
.savebar .btn { background: #303030; color: #fff; box-shadow: none; }
.savebar .btn.primary { background: #fff; color: #1a1a1a; }
.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; }
.toast { background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 10px; font-weight: 550; box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: up .2s ease; }
.toast.err { background: #8e1f0b; }
@keyframes up { from { transform: translateY(10px); opacity: 0; } }
.palette { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.35); display: flex; justify-content: center; align-items: flex-start; padding-top: 10vh; }
.palette-box { width: min(620px, 92vw); background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.palette-box input { width: 100%; border: 0; border-bottom: 1px solid var(--line); height: 48px; padding: 0 16px; font-size: 15px; outline: 0; }
.palette-list { max-height: 420px; overflow-y: auto; padding: 6px; }
.palette-item { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; padding: 6px 10px; border-radius: 8px; cursor: pointer; color: var(--ink); text-decoration: none !important; }
.palette-item.on { background: #f1f1f1; }
.palette-item .ic { width: 32px; height: 32px; border-radius: 8px; background: #f1f1f1; display: grid; place-items: center; overflow: hidden; }
.palette-item .ic img { width: 100%; height: 100%; object-fit: contain; }
.palette-item .ty { color: var(--soft); font-size: 12px; }
.palette-sec { padding: 8px 10px 4px; font-size: 12px; font-weight: 600; color: var(--soft); }
.menu { position: absolute; background: #fff; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 6px; z-index: 65; min-width: 200px; color: var(--ink); }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 7px 10px; border-radius: 8px; border: 0; background: none; color: var(--ink); text-decoration: none; }
.menu a:hover, .menu button:hover { background: #f1f1f1; text-decoration: none; }

/* ── Auth screens ────────────────────────────────────────── */
.auth { min-height: 100vh; display: grid; place-items: center; background: var(--cream); padding: 20px; }
.auth-card { width: min(420px, 100%); background: #fff; border-radius: 16px; box-shadow: var(--shadow), 0 20px 40px rgba(0,0,0,.06); padding: 32px; }
.auth-card .mark { margin-bottom: 6px; }
.auth-card .mark img { height: 30px; width: auto; display: block; }
.auth-card h1 { font-size: 18px; margin: 18px 0 4px; }
.auth-card p { color: var(--muted); margin: 0 0 18px; }
.auth-card .stack { gap: 14px; }
.auth-card .btn { height: 38px; }
.pw { position: relative; }
.pw button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); font-size: 12px; font-weight: 600; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, 1fr); } .kpi:nth-child(2) { border-right: 0; } .kpi:nth-child(-n+2) { border-bottom: 1px solid var(--line-2); } }
@media (max-width: 900px) {
  :root { --side-w: 0px; }
  .top { grid-template-columns: auto 1fr auto; }
  .side { width: 260px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .side.open { transform: none; }
  .main { border-radius: 0; }
  .cols, .grid2, .grid3 { grid-template-columns: 1fr; }
  .grid4 { grid-template-columns: 1fr 1fr; }
  .menu-btn { display: grid !important; }
  .top-search kbd { display: none; }
  .savebar { padding-left: 16px; }
  .page { padding: 14px 12px 120px; }
  .funnel { grid-template-columns: 1fr 1fr; }
  .kind-pick { grid-template-columns: repeat(3, 1fr); }
}
.menu-btn { display: none; width: 36px; height: 36px; place-items: center; border: 0; background: none; color: #fff; margin-left: 8px; }
@media print {
  body { background: #fff; }
  .top, .side, .savebar, .no-print { display: none !important; }
  .main { position: static; background: #fff; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}
