:root {
  color-scheme: light;
  --navy: #0b2545;
  --navy-2: #13315c;
  --accent: #0e6e8c;
  --accent-ink: #0a5670;
  --accent-soft: #e3f1f6;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e2e7ee;
  --line-2: #cfd7e2;
  --ink: #0f1b2d;
  --ink-2: #44526a;
  --ink-3: #6b7890;
  --danger: #c43333;
  --danger-soft: #fdecec;
  --ok: #157a3c;
  --ok-soft: #e6f5ec;
  --warn-soft: #fff6e0;
  /* workflow status colours (validated palette, always shown with a text label) */
  --st-pending: #eda100;
  --st-updated: #2a78d6;
  --st-reviewed: #4a3aa7;
  --st-approved: #1baf7a;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .06), 0 4px 16px rgba(15, 27, 45, .06);
  --shadow-lg: 0 12px 40px rgba(15, 27, 45, .18);
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 8px; }
.wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side {
  background: var(--navy); color: #d6e2f0; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; padding: 18px 12px; z-index: 30;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 2px 8px 18px; color: #fff; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(140deg, #1d7fa3, #0e4f73); display: grid; place-items: center; flex: none; }
.brand b { display: block; font-size: 15px; letter-spacing: .2px; }
.brand span { font-size: 11.5px; color: #9fb4cc; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: #c9d7e8; font-weight: 500;
}
.nav a:hover { background: rgba(255, 255, 255, .07); text-decoration: none; color: #fff; }
.nav a.on { background: rgba(255, 255, 255, .12); color: #fff; }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav .sep { height: 1px; background: rgba(255, 255, 255, .1); margin: 10px 6px; }
.side-foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .1); padding: 12px 8px 0; font-size: 13px; }
.side-foot .who { color: #fff; font-weight: 600; }
.side-foot .role { color: #9fb4cc; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
.side-foot .links { display: flex; gap: 12px; margin-top: 8px; }
.side-foot button { background: none; border: 0; color: #9fc3e0; padding: 0; cursor: pointer; font-size: 12.5px; }
.side-foot button:hover { color: #fff; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar-m { display: none; }
.page { padding: 22px 28px 90px; max-width: 1600px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; margin: 0; letter-spacing: -.2px; }
.page-head .sub { color: var(--ink-3); margin-top: 2px; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); border-color: #b9c4d3; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(15, 27, 45, .06); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }
.input, select.input, textarea.input {
  height: 36px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 10px; background: var(--surface); width: 100%; min-width: 0;
}
textarea.input { height: auto; min-height: 84px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
.input:focus, .btn:focus-visible, .chip:focus-visible { outline: 2px solid rgba(14, 110, 140, .35); outline-offset: 1px; border-color: var(--accent); }
.input:disabled, .input[readonly] { background: var(--surface-2); color: var(--ink-2); }
select.input { padding-right: 28px; }
label.f { display: block; }
label.f > span { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

.search { position: relative; flex: 1; min-width: 220px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 17px; color: var(--ink-3); pointer-events: none; }
.search input { padding-left: 36px; height: 40px; font-size: 15px; }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--ink-3); background: var(--surface); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); cursor: pointer; font-weight: 500; font-size: 13px; color: var(--ink-2); white-space: nowrap;
}
.chip:hover { border-color: #b2bfcf; }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip .n { font-size: 11.5px; opacity: .75; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.card-h h2, .card-h h3 { margin: 0; font-size: 15px; }
.card-b { padding: 16px; }

/* status badge — dot + text label (colour never alone) */
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.st.pending { --c: var(--st-pending); }
.st.updated { --c: var(--st-updated); }
.st.reviewed { --c: var(--st-reviewed); }
.st.approved { --c: var(--st-approved); }
.st.pill { padding: 3px 10px 3px 8px; border-radius: 999px; background: color-mix(in srgb, var(--c) 12%, white); color: var(--ink); }

.tag { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 5px; background: #eef2f7; color: var(--ink-2); font-weight: 500; }

/* ---------- toast / modal / drawer ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 9px; box-shadow: var(--shadow-lg); max-width: 420px; animation: pop .18s ease-out; }
.toast.err { background: var(--danger); }
.toast.ok { background: #145c34; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
.overlay { position: fixed; inset: 0; background: rgba(9, 20, 36, .45); z-index: 100; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); width: min(520px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal.wide { width: min(860px, 100%); }
.modal-h { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal-h h3 { margin: 0; font-size: 16px; flex: 1; }
.modal-b { padding: 18px 20px; overflow: auto; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.drawer-wrap { position: fixed; inset: 0; z-index: 90; background: rgba(9, 20, 36, .3); animation: fade .15s; }
.drawer { position: absolute; right: 0; top: 0; bottom: 0; width: min(520px, 100%); background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: .4; } }
.drawer-h { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.drawer-b { padding: 18px; overflow: auto; flex: 1; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art {
  background: radial-gradient(1200px 600px at 10% 110%, #1b6f93 0%, transparent 60%), linear-gradient(160deg, #0b2545, #0d3b5e);
  color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
}
.login-art h1 { font-size: 34px; line-height: 1.15; margin: 0 0 14px; letter-spacing: -.5px; max-width: 520px; }
.login-art p { color: #b8cde2; max-width: 480px; font-size: 15px; }
.login-form { display: grid; place-items: center; padding: 32px; background: var(--surface); }
.login-form form { width: min(360px, 100%); }
.login-form h2 { margin: 0 0 4px; font-size: 22px; }
.err-box { background: var(--danger-soft); color: var(--danger); padding: 9px 12px; border-radius: 8px; font-size: 13px; }

/* ---------- dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.kpi { padding: 14px 16px; display: block; color: inherit; }
.kpi:hover { text-decoration: none; border-color: var(--line-2); }
.kpi .lab { font-size: 12.5px; color: var(--ink-3); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi .val { font-size: 28px; font-weight: 700; letter-spacing: -.5px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .foot { font-size: 12px; color: var(--ink-3); }
.dash-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; margin-top: 16px; align-items: start; }
.progress { display: flex; height: 14px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--surface); }
.progress > div { background: var(--c); min-width: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 13px; }
.legend .st b { color: var(--ink); font-variant-numeric: tabular-nums; }
.cat-bars { width: 100%; border-collapse: collapse; }
.cat-bars td { padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cat-bars tr:last-child td { border-bottom: 0; }
.cat-bars tr { cursor: pointer; }
.cat-bars tr:hover td { background: var(--surface-2); }
.cat-bars .nm { width: 38%; font-weight: 500; }
.cat-bars .bar { display: flex; height: 10px; gap: 2px; }
.cat-bars .bar > div { background: var(--c); border-radius: 0; }
.cat-bars .bar > div:last-child { border-radius: 0 4px 4px 0; }
.cat-bars .num { width: 60px; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.tip { position: fixed; z-index: 300; background: var(--navy); color: #fff; padding: 8px 10px; border-radius: 7px; font-size: 12.5px; pointer-events: none; box-shadow: var(--shadow-lg); max-width: 280px; }
.tip .st { color: #fff; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.mini-list li:last-child { border-bottom: 0; }
.thumb { width: 40px; height: 40px; border-radius: 7px; background: #eef2f7; border: 1px solid var(--line); object-fit: contain; flex: none; display: grid; place-items: center; color: #a8b4c5; overflow: hidden; }
.thumb svg { width: 18px; }
.thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 54px; }
.spark > div { flex: 1; background: var(--st-updated); border-radius: 3px 3px 0 0; min-height: 2px; }

/* ---------- product list ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0 14px; }
.filters select.input { width: auto; max-width: 260px; height: 32px; font-size: 13px; }
.filters .divider { width: 1px; height: 22px; background: var(--line-2); margin: 0 4px; }
.table-wrap { overflow: auto; }
table.grid { width: 100%; border-collapse: separate; border-spacing: 0; }
table.grid th {
  position: sticky; top: 0; background: var(--surface-2); text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3);
  padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1; text-transform: uppercase; letter-spacing: .3px;
}
table.grid th.sortable { cursor: pointer; }
table.grid th.sortable:hover { color: var(--ink); }
table.grid td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid tbody tr { cursor: pointer; }
table.grid tbody tr:hover td { background: #f6f9fc; }
table.grid tbody tr.sel td { background: var(--accent-soft); }
table.grid .cb { width: 34px; padding-right: 0; }
.p-name { font-weight: 600; color: var(--ink); max-width: 460px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.p-sub { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.p-cat { font-size: 13px; max-width: 250px; }
.p-cat small { display: block; color: var(--ink-3); font-size: 12px; }
.imgcount { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3); font-size: 12.5px; }
.imgcount svg { width: 14px; }
.imgcount.none { color: #c08a00; }
.pager { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.empty { padding: 50px 20px; text-align: center; color: var(--ink-3); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; padding: 14px; }
.pcard { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); cursor: pointer; position: relative; display: flex; flex-direction: column; }
.pcard:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.pcard.sel { outline: 2px solid var(--accent); }
.pcard .ph { aspect-ratio: 4/3; background: #f1f4f8; display: grid; place-items: center; color: #b5c0cf; }
.pcard .ph img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.pcard .ph svg { width: 34px; }
.pcard .bd { padding: 9px 11px 11px; font-size: 13px; }
.pcard .bd .p-name { font-size: 13px; }
.pcard .cbx { position: absolute; top: 8px; left: 8px; background: #fff; border-radius: 5px; padding: 3px; line-height: 0; box-shadow: var(--shadow); }
.bulkbar {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); background: var(--navy); color: #fff; border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 9px 10px 9px 16px; display: flex; gap: 8px; align-items: center; z-index: 60; flex-wrap: wrap; max-width: calc(100vw - 24px);
}
.bulkbar .btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .15); color: #fff; height: 32px; }
.bulkbar .btn:hover { background: rgba(255, 255, 255, .2); }
.bulkbar a { color: #9fd6ef; cursor: pointer; }
.bulkbar .count { font-weight: 600; margin-right: 6px; }

/* ---------- product detail ---------- */
.pd-head { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 16px; }
.pd-head h1 { font-size: 20px; margin: 4px 0 6px; line-height: 1.3; letter-spacing: -.2px; }
.crumb { font-size: 13px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.navpos { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.pd { display: grid; grid-template-columns: minmax(320px, 440px) 1fr; gap: 18px; align-items: start; }
.pd-left { position: sticky; top: 16px; }
.gal-main { aspect-ratio: 1; background: #fff; border-radius: 10px 10px 0 0; display: grid; place-items: center; overflow: hidden; cursor: zoom-in; border-bottom: 1px solid var(--line); position: relative; }
.gal-main img { width: 100%; height: 100%; object-fit: contain; }
.gal-main .noimg { text-align: center; color: var(--ink-3); cursor: default; padding: 20px; }
.gal-main .noimg svg { width: 56px; color: #c3ccd8; margin: 0 auto 8px; }
.gal-main .badge-main { position: absolute; left: 10px; top: 10px; background: rgba(11, 37, 69, .85); color: #fff; font-size: 11.5px; padding: 2px 8px; border-radius: 5px; font-weight: 600; }
.gal-thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 12px; }
.gt { position: relative; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; cursor: pointer; }
.gt img { width: 100%; height: 100%; object-fit: contain; }
.gt.cur { outline: 2px solid var(--accent); outline-offset: 1px; }
.gt.drag { opacity: .4; }
.gt.over { outline: 2px dashed var(--accent); }
.gt .first { position: absolute; left: 3px; top: 3px; background: var(--navy); color: #fff; font-size: 10px; font-weight: 700; padding: 0 5px; border-radius: 4px; }
.gal-actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 12px 12px; }
.drop {
  margin: 0 12px 12px; border: 1.5px dashed var(--line-2); border-radius: 9px; padding: 14px; text-align: center; color: var(--ink-3); cursor: pointer; font-size: 13px;
}
.drop:hover, .drop.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.drop b { color: var(--accent); }
.uploading { margin: 0 12px 12px; font-size: 12.5px; }
.uploading .bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 4px; }
.uploading .bar > div { height: 100%; background: var(--accent); width: 0; transition: width .15s; }
.meta-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 13px; }
.meta-list dt { color: var(--ink-3); }
.meta-list dd { margin: 0; font-weight: 500; }
.form-sec { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.form-sec:last-child { border-bottom: 0; }
.form-sec h3 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3); }
.fgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 14px; }
.fgrid .full { grid-column: 1 / -1; }
.f.changed > span::after { content: " • edited"; color: var(--st-updated); font-weight: 600; }
.f.changed .input { border-color: var(--st-updated); background: #f5f9ff; }
.status-seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; background: var(--surface); flex-wrap: wrap; }
.status-seg button { border: 0; background: transparent; padding: 7px 12px; cursor: pointer; border-right: 1px solid var(--line); }
.status-seg button:last-child { border-right: 0; }
.status-seg button:hover:not(:disabled) { background: var(--surface-2); }
.status-seg button.on { background: color-mix(in srgb, var(--c) 14%, white); }
.status-seg button:disabled { cursor: not-allowed; opacity: .5; }
.savebar {
  position: sticky; bottom: 0; background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px); border-top: 1px solid var(--line); padding: 12px 18px;
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-radius: 0 0 var(--radius) var(--radius); z-index: 5;
}
.dirty-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--st-updated); display: inline-block; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 12px; }
.tabs button { border: 0; background: none; padding: 12px 10px; cursor: pointer; font-weight: 600; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-color: var(--accent); }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li { padding: 11px 18px; border-bottom: 1px solid var(--line); font-size: 13px; }
.hist .when { color: var(--ink-3); font-size: 12px; }
.hist .chg { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; margin-top: 4px; }
.hist .old { color: var(--danger); text-decoration: line-through; text-decoration-color: rgba(196, 51, 51, .4); word-break: break-word; }
.hist .new { color: var(--ok); word-break: break-word; }
.lightbox { position: fixed; inset: 0; background: rgba(5, 12, 22, .92); z-index: 150; display: flex; flex-direction: column; }
.lightbox .lb-top { display: flex; gap: 8px; align-items: center; padding: 12px 16px; color: #fff; }
.lightbox .lb-top .btn { background: rgba(255, 255, 255, .12); border-color: transparent; color: #fff; }
.lightbox .lb-img { flex: 1; display: grid; place-items: center; min-height: 0; padding: 0 60px 20px; position: relative; }
.lightbox .lb-img img { max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; }
.lightbox .lb-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox .lb-nav.l { left: 12px; }
.lightbox .lb-nav.r { right: 12px; }

/* ---------- categories ---------- */
.cat-layout { display: grid; grid-template-columns: 360px 1fr; gap: 16px; align-items: start; }
.cat-list { max-height: calc(100vh - 190px); overflow: auto; }
.cat-item { display: flex; gap: 8px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.cat-item:hover { background: var(--surface-2); }
.cat-item.on { background: var(--accent-soft); }
.cat-item .nm { flex: 1; font-weight: 500; }
.cat-item.off .nm { color: var(--ink-3); text-decoration: line-through; }
.cnt { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.sub-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.sub-table { width: 100%; border-collapse: collapse; }

/* ---------- import ---------- */
.steps { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.steps span { padding: 5px 12px; border-radius: 999px; background: #e9eef4; color: var(--ink-3); font-weight: 600; font-size: 12.5px; }
.steps span.on { background: var(--navy); color: #fff; }
.map-table { width: 100%; border-collapse: collapse; }
.map-table td, .map-table th { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; vertical-align: top; }
.map-table th { font-size: 12px; color: var(--ink-3); text-transform: uppercase; }
.map-table .sample { color: var(--ink-3); font-size: 12px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }
.stat b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--ink-3); }
.notice { background: var(--warn-soft); border: 1px solid #f3dfa6; border-radius: 9px; padding: 10px 12px; font-size: 13px; }
.codebox { background: #0f1b2d; color: #d7e3f1; border-radius: 9px; padding: 12px 14px; font-family: var(--mono); font-size: 12.5px; overflow: auto; white-space: pre; }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1000px) {
  .pd { grid-template-columns: 1fr; }
  .pd-left { position: static; }
  .cat-layout { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 250px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: var(--shadow-lg); }
  .topbar-m { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 20; }
  .topbar-m button { background: none; border: 0; color: #fff; padding: 4px; }
  .page { padding: 16px 16px 90px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .fgrid { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .hide-m { display: none !important; }
  .gal-thumbs { grid-template-columns: repeat(4, 1fr); }
}
