:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --ink: #1b2430;
  --muted: #6b7785;
  --brand: #005bff;
  --line: #e4e8ef;
  --ok: #1a9e5a;
  --alert: #d64545;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.5 system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 8px; }
.muted { color: var(--muted); font-weight: normal; }
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  background: #eef3ff; color: var(--brand); font-size: 12px; font-weight: 600;
  overflow-wrap: anywhere;
}
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 20px; box-shadow: var(--shadow);
}
.btn {
  display: block; width: 100%; margin-top: 8px; padding: 10px 14px; border: none;
  border-radius: 8px; background: var(--brand); color: #fff; font-size: 15px;
  font-weight: 600; cursor: pointer; text-align: center;
}
.btn:hover { opacity: .95; }
.alert {
  background: #fdecec; color: var(--alert); border: 1px solid #f6c9c9;
  padding: 8px 12px; border-radius: 8px; margin-bottom: 12px;
}
label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
input {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px; font-size: 15px; color: var(--ink);
}
input:focus { outline: 2px solid #cfe0ff; border-color: var(--brand); }

/* auth */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { font-size: 22px; }

/* layout */
.layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: #0f1b2d; color: #cdd7e6; padding: 18px 14px; display: flex; flex-direction: column; position: sticky; top: 0; align-self: start; height: 100vh; overflow: visible; }
.brand { font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 20px; }
.brand span { color: var(--brand); }
.nav-item { display: block; color: #cdd7e6; padding: 10px 12px; border-radius: 8px; margin-bottom: 2px; }
.nav-item:hover { background: #17263d; text-decoration: none; }
.nav-item.active { background: var(--brand); color: #fff; }
.nav-group { position: relative; }
.nav-group .caret { opacity: .55; font-size: 11px; float: right; }
.nav-sub { display: none; position: absolute; left: 100%; top: 0; margin-left: 8px; min-width: 230px;
           background: #17263d; border: 1px solid #24395a; border-radius: 10px; padding: 5px; z-index: 60;
           box-shadow: 0 10px 26px rgba(0,0,0,.4); }
.nav-sub::before { content: ""; position: absolute; left: -10px; top: 0; width: 10px; height: 100%; }
.nav-group:hover .nav-sub, .nav-sub:hover { display: block; }
.nav-item.sub { display: block; background: #1e3050; border-radius: 8px; margin: 0 0 5px; padding: 8px 12px; font-size: 13px; white-space: nowrap; }
.nav-item.sub:last-child { margin-bottom: 0; }
.nav-item.sub:hover, .nav-item.sub.active { background: var(--brand); color: #fff; text-decoration: none; }
.fin-ctrl { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.searchdrop { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); z-index: 70; max-height: 360px; overflow: auto; }
.sdrop-item { display: block; padding: 8px 10px; border-bottom: 1px solid var(--line); color: inherit; }
.sdrop-item:last-child { border-bottom: 0; }
.sdrop-item:hover { background: #f2f5fa; text-decoration: none; }
.sdrop-name { display: block; }
.sdrop-meta { display: block; font-size: 12px; color: var(--muted); }
.ci-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.ci-row label { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 0; }
.fin-list .fin-row { display: flex; align-items: center; gap: 10px; padding: 3px 6px; border-radius: 6px; cursor: pointer; }
.fin-list .fin-row:hover { background: #f2f5fa; }
.fin-list .fin-row.active { background: #eef3ff; }
.fin-list .fin-lab { flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-list .fin-bar { flex: 0 0 110px; height: 8px; background: #eef1f6; border-radius: 4px; overflow: hidden; }
.fin-list .fin-bar > i { display: block; height: 100%; }
.fin-list .fin-amt { flex: 0 0 110px; text-align: right; font-variant-numeric: tabular-nums; }
.side-foot { margin-top: auto; font-size: 12px; color: #6b7a92; }
.content { padding: 22px 26px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 8px; }
.topbar h2 { margin: 0; }
.who { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); padding-right: 56px; }
.link { font-weight: 600; }

/* kpi */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 16px; }
.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.kpi-grid .kpi-v { font-size: 22px; }
.kpi-grid .kpi-l { font-size: 11px; }
.kpi { background: #f8fafd; border: 1px solid var(--line); border-radius: 10px; padding: 16px; text-align: center; }
.kpi-v { font-size: 24px; font-weight: 700; }
.kpi-v.ok { color: var(--ok); }
.kpi-v.warn { color: #e08a00; }
.kpi-v.crit { color: var(--alert); }
.rating-group { margin: 6px 0 18px; }
.rg-title { font-weight: 600; color: var(--brand); margin-bottom: 6px; }
.kpi-l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.placeholder { border-style: dashed; }
.nav-item.disabled { opacity: .4; cursor: default; }
.period { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.period label { display: inline-flex; align-items: center; gap: 8px; margin: 0; white-space: nowrap; }
.period input, .period select { display: inline-block; width: auto; margin: 0; padding: 7px 10px; font-size: 14px; }
.period input[type=hidden] { display: none; }
.period input[type=date] { width: 150px; }
.period input[type=number] { width: 80px; }
.period input[type=text], .period input:not([type]) { width: 220px; }
.period select { min-width: 120px; max-width: 320px; }
.period .btn-sm { margin: 0; white-space: nowrap; }
.period .shop-pick { margin-left: auto; white-space: nowrap; }
.pf { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; position: relative; }
.pf-presets { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.pf-btn { border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 10px; font-size: 14px; font-weight: 400; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, color .12s; }
.pf-btn:hover { border-color: var(--brand); color: var(--brand); background: #f5f8ff; }
.pf-btn.active, .pf-btn.is-open { background: var(--brand); border-color: var(--brand); color: #fff; }
.pf-pop { position: absolute; top: 100%; right: 0; margin-top: 10px; z-index: 40; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(16, 24, 40, .16); padding: 16px; width: 300px; }
.pf-pop[hidden] { display: none; }
.pf-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.pf-cap { font-size: 12px; color: var(--muted); }
.pf-field input[type=date] { display: block; width: 100%; min-width: 0; box-sizing: border-box; margin: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; color: var(--ink); }
.pf-pop-actions { display: flex; gap: 8px; }
.pf-pop-actions .btn { margin-top: 0; width: auto; flex: 1; }
.pf-camp { margin-left: auto; min-width: 260px; }
th .sortable { color: inherit; text-decoration: none; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
th .sortable:hover { color: var(--brand); }
.btn-sm { display: inline-block; width: auto; margin: 0; padding: 7px 12px; font-size: 13px; }
.shop-pick { margin-left: auto; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
.tbl .num { text-align: right; }
.tbl .ctr { text-align: center; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; }
.form-grid .btn { grid-column: 1 / -1; }
.alert.ok-box { background: #e9f7ef; color: var(--ok); border-color: #b7e3c6; }
.doc-check { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 8px; }
.check-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-height: 84px; box-sizing: border-box; }
.check-item.ok { border-color: #b7e3c6; background: #f2fbf5; }
.check-item.avail { border-color: #f0d08a; background: #fff8e6; }
.check-item.updated { border-color: #f0b46a; background: #fff2df; }
.ci-ret { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: #fde8c7; color: #9a5b00; font-size: 11px; font-weight: 600; }
.check-item.miss { border-color: #f6c9c9; background: #fdf3f3; }
.ci-name { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ci-note { color: #8a6d1b; font-size: 10px; align-self: flex-end; text-align: right; }
.check-item.miss .ci-note { color: #b06565; }
.check-item button.btn-sm { align-self: flex-end; padding: 3px 9px; font-size: 11px; }
select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: #fff; color: var(--ink); }

.viewsbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-top: 14px; }
.vb-left { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vb-right { display: flex; align-items: center; gap: 8px; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #eef3ff; color: var(--brand); font-size: 13px; }
.chip.del { background: #fdecec; color: var(--alert); border: none; cursor: pointer; }
.inline { display: inline; }
.filters-row { display: flex; gap: 10px; align-items: center; margin: 12px 0; }
.fchip { background: #fff5e6; color: #b06a00; border: 1px solid #f0d9b0; border-radius: 999px; padding: 4px 12px; font-size: 13px; }
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid var(--line); }
.sel { background: #eef6ff; }
.pager { display: flex; gap: 10px; justify-content: center; margin: 16px 0; }
.costform { display: flex; gap: 4px; align-items: center; justify-content: center; }
.costform input[name=cost] { width: 64px; text-align: center; margin: 0; padding: 5px 6px; }
.costform .btn-sm { padding: 4px 8px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--muted); }
.crit { color: var(--alert); font-weight: 700; }
.warn { color: #e08a00; font-weight: 600; }
/* bell */
.bellhost { position: fixed; top: 14px; right: 18px; z-index: 50; }
.bell { position: relative; }
.bell-btn { list-style: none; cursor: pointer; font-size: 22px; display: inline-block; position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 4px 10px; box-shadow: var(--shadow); }
.bell-btn::-webkit-details-marker { display: none; }
.bell-btn::marker { content: ""; }
.badge-count { position: absolute; top: -7px; right: -7px; background: var(--alert); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 6px; min-width: 18px; text-align: center; }
.bell-panel { display: none; position: absolute; right: 0; top: 46px; width: 320px; max-height: 60vh; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 30px rgba(16,24,40,.15); padding: 8px; }
.bell[open] .bell-panel { display: block; }
.bp-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; padding: 2px 4px 8px; }
.bp-close { border: none; background: #eef1f6; color: var(--muted); border-radius: 6px; width: 24px; height: 24px; cursor: pointer; font-size: 14px; line-height: 1; }
.bp-close:hover { background: #fdecec; color: var(--alert); }
.bp-empty { padding: 12px; text-align: center; }
.bell-item { display: block; padding: 8px 10px; border-radius: 8px; border-left: 3px solid var(--line); margin-bottom: 4px; color: var(--ink); }
.bell-item:hover { background: #f6f8fc; text-decoration: none; }
.bell-item.sev-critical { border-left-color: var(--alert); }
.bell-item.sev-warning { border-left-color: #e08a00; }
.bi-title { font-weight: 600; font-size: 14px; }
.bi-sub { font-size: 12px; color: var(--muted); }
.bell-all { display: block; text-align: center; padding: 8px; font-size: 13px; font-weight: 600; }
/* notifications page */
.notif-list { list-style: none; margin: 0; padding: 0; }
.nf { display: flex; gap: 12px; align-items: flex-start; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.nf.is-muted { opacity: .55; }
.nf-main { flex: 1; }
.nf-title { font-weight: 600; }
.nf-body { font-size: 13px; color: var(--muted); }
.sev-pill { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.sev-pill.sev-critical { background: #fdecec; color: var(--alert); }
.sev-pill.sev-warning { background: #fff5e6; color: #b06a00; }
.sev-pill.sev-info { background: #eef3ff; color: var(--brand); }
/* updates status */
.upd-actions { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.upd-meta { margin-bottom: 8px; font-size: 13px; }
.spill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eef1f6; color: var(--muted); }
.spill.ok { background: #e9f7ef; color: var(--ok); }
.spill.err { background: #fdecec; color: var(--alert); }
.spill.run { background: #eaf1ff; color: var(--brand); }
.is-running { background: #f5f9ff; }
.is-err { background: #fdf4f4; }
.small { font-size: 12px; }
tr.is-running .spill.run::after { content: ""; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 1100px) { .grid2 { grid-template-columns: 1fr; } .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; } .nav-sub { position: static; left: auto; margin: 6px 0 6px; min-width: 0; } .kpi-row { grid-template-columns: repeat(2, 1fr); } .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .content { padding: 14px; } .card { overflow-x: auto; } }
@media (max-width: 480px) { .kpi-grid { grid-template-columns: 1fr; } }
@media (max-width: 1400px) { .settings-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .settings-grid { grid-template-columns: 1fr; } }
/* shop switcher + settings */
.shop-switch { margin: 0 0 16px; }
.ss-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #6b7a92; margin-bottom: 4px; }
.shop-switch select { width: 100%; background: #17263d; color: #fff; border-color: #223654; }
.form-inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.pc-hero { display: grid; grid-template-columns: 450px 1fr; gap: 24px; align-items: start; }
.pc-gallery { display: flex; flex-direction: column; gap: 8px; }
.pc-main { width: 100%; aspect-ratio: 1/1; object-fit: contain; background: #f8fafd; border: 1px solid var(--line); border-radius: 12px; cursor: zoom-in; }
.pc-noimg { width: 100%; aspect-ratio: 1/1; display: grid; place-items: center; background: #f8fafd; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); }
.pc-thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-thumb { width: 48px; height: 48px; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; background: #fff; }
.pc-thumb:hover { border-color: var(--brand); }
.pc-name { font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.pc-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.pc-hist { display: flex; flex-direction: column; gap: 3px; margin: 6px 0 12px; max-width: 280px; }
.pc-hist-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.pc-hist-lbl { width: 26px; color: var(--muted); }
.pc-hist-bar { flex: 1; height: 8px; background: #eef1f6; border-radius: 4px; overflow: hidden; }
.pc-hist-bar i { display: block; height: 100%; background: #f0b400; }
.pc-hist-n { width: 34px; text-align: right; color: var(--muted); }
.pc-prices { display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin: 8px 0 14px; }
.pc-price-main { font-size: 30px; font-weight: 800; }
.pc-ptab { width: auto; font-size: 13px; }
.pc-ptab td { border: 0; padding: 2px 10px 2px 0; }
.pc-ptab td.num { text-align: right; white-space: nowrap; }
.pc-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 8px 0; }
.pc-svc { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.pc-attrs td { border-bottom: 1px solid var(--line); padding: 6px 8px; font-size: 13px; }
.pc-ak { color: var(--muted); width: 40%; }
.pc-desc { font-size: 14px; line-height: 1.55; white-space: normal; }
.pc-q { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.6; }
.pc-qa { display: flex; flex-direction: column; gap: 8px; }
.pc-qitem { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.pc-qitem > summary { list-style: none; cursor: pointer; padding: 10px 12px; font-size: 14px; display: flex; gap: 10px; align-items: baseline; background: #fafbfd; }
.pc-qitem > summary::-webkit-details-marker { display: none; }
.pc-qitem > summary::after { content: '▸'; color: var(--muted); margin-left: auto; transition: transform .15s; }
.pc-qitem[open] > summary::after { transform: rotate(90deg); }
.pc-qitem[open] > summary { border-bottom: 1px solid var(--line); }
.pc-qtext { flex: 1; }
.pc-answer { font-size: 13px; margin: 10px 12px; padding: 8px 10px; background: #f6f8fc; border-left: 3px solid var(--brand); border-radius: 0 6px 6px 0; }
.pc-answer-empty { margin: 10px 12px; font-size: 13px; }
.pc-question { font-size: 14px; }
.pc-review { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.pc-review:last-child { border-bottom: 0; }
.pc-stars { color: #f0b400; letter-spacing: 1px; }
.pc-review-text { margin-top: 4px; color: var(--ink); }
.pc-lb { position: fixed; inset: 0; background: rgba(10, 15, 25, .86); display: none; align-items: center; justify-content: center; z-index: 1000; }
.pc-lb.open { display: flex; }
.pc-lb-img { max-width: 90vw; max-height: 86vh; object-fit: contain; cursor: zoom-in; transition: transform .15s; background: #fff; border-radius: 8px; }
.pc-lb-img.zoom { transform: scale(2); cursor: zoom-out; }
.pc-lb-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255, 255, 255, .14); color: #fff; border: 0; font-size: 30px; width: 52px; height: 52px; border-radius: 50%; cursor: pointer; line-height: 1; }
.pc-lb-btn:hover { background: rgba(255, 255, 255, .3); }
.pc-lb-prev { left: 18px; } .pc-lb-next { right: 18px; }
.pc-lb-close { position: absolute; top: 16px; right: 22px; background: none; color: #fff; border: 0; font-size: 34px; cursor: pointer; line-height: 1; }
.pc-lb-count { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: #cfd6e4; font-size: 14px; }
@media (max-width: 720px) { .pc-hero { grid-template-columns: 1fr; } .pc-kpis { grid-template-columns: repeat(2, 1fr); } }
.form-inline .mini { display: flex; flex-direction: column; font-size: 12px; margin: 0; color: var(--muted); }
.form-inline input { padding: 6px 8px; font-size: 13px; margin-top: 2px; }
.editrow td { background: #f8fafd; padding-top: 4px; padding-bottom: 10px; }
.settings-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.settings-grid > .card { min-width: 0; display: flex; flex-direction: column; }
.settings-grid > .card > form.stack { flex: 1 1 auto; display: flex; flex-direction: column; }
.settings-grid .push { margin-top: auto; }
.tbl.meta td:first-child { color: var(--muted); }
.settings-grid .span2 { grid-column: 1 / -1; }
.sub { margin: 18px 0 8px; }
.members td { vertical-align: top; }
.is-me { background: #f5f9ff; }
.acc-check { display: flex; gap: 6px; align-items: center; font-size: 13px; margin: 2px 0; color: var(--ink); }
.acc-check input { width: auto; margin: 0; }
.accessform .btn { margin-top: 6px; }
.btn.danger, .btn-sm.ghost.danger { color: var(--alert); border-color: #f0c4c4; }
/* ads drilldown */
.expand-btn { border: 0; background: transparent; color: var(--brand); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 4px 0 0; }
.camp-row, .sku-row { cursor: pointer; }
.camp-row:hover > td, .sku-row:hover > td { background: #eaf2ff; }
.ad-detail { padding: 10px 0 4px; background: #f8fafd; border-radius: 10px; }
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 10px 8px; }
.sku-table, .day-table { width: 100%; margin: 0 0 10px; background: #fff; table-layout: fixed; }
.sku-table th, .sku-table td, .day-table th, .day-table td { font-size: 13px; padding: 6px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-sku { width: 8%; }
.col-name { width: 24%; }
.col-num { width: 5.667%; }
.sku-row > td { background: #fff; }
.sku-detail-row > td { background: #f8fafd; padding: 8px 0; }
.week-row td { background: #fff8e1; font-weight: 700; }
.week-row td:first-child { color: #8a5a00; }
.ad-detail { overflow-x: auto; }
/* comparison + cards */
.cmp { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 14px 0; }
.cmp-title { font-weight: 600; margin-bottom: 10px; }
.cmp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.cmp-cell { border-left: 3px solid var(--line); padding-left: 10px; }
.cmp-l { font-size: 12px; color: var(--muted); text-transform: uppercase; }
.cmp-v { font-size: 20px; font-weight: 700; }
.cmp-d { font-size: 13px; font-weight: 700; }
.cmp-d.up { color: var(--ok); } .cmp-d.down { color: var(--alert); } .cmp-d.flat { color: var(--muted); font-weight: 500; }
.cmp-prev { font-size: 12px; color: var(--muted); }
.pc-head .pc-name { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.po-status { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.badge.big { font-size: 14px; padding: 5px 14px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
/* load progress */
.prog-slot { margin-top: 10px; }
.prog { background: #f8fafd; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.prog-run { border-color: #bcd3ff; background: #f2f7ff; }
.prog-head { font-weight: 600; display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.prog-head .done { color: var(--ok); } .prog-head .fail { color: var(--alert); }
.spin { display: inline-block; animation: spin 1s linear infinite; color: var(--brand); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; }
.steps li { display: flex; gap: 8px; align-items: baseline; padding: 2px 0; }
.steps .ico { width: 16px; text-align: center; font-weight: 700; }
.st-done .ico { color: var(--ok); } .st-run .ico { color: var(--brand); } .st-error .ico { color: var(--alert); }
.st-wait, .st-skip { opacity: .6; }
.det { margin-left: auto; font-size: 12px; color: var(--muted); }
.prog-sum { margin-top: 6px; font-size: 12px; word-break: break-word; }
/* updates live + controls */
.upd-live { display: block; margin-bottom: 14px; }
.live-bar { display: flex; align-items: center; gap: 10px; background: #f8fafd; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.live-bar .ok-dot { color: var(--ok); }
.live-bar .spin { color: var(--brand); }
.upd-table td, .upd-table th { vertical-align: middle; }
.inl { display: inline-flex; align-items: center; gap: 6px; }
.inl input[type=number] { padding: 5px 6px; margin: 0; }
.inl input[type=checkbox] { width: auto; }
.run { color: var(--brand); font-weight: 600; }
.def { font-size: 11px; }
/* revenue basis toggle */
.basis-bar { display: flex; align-items: center; gap: 10px; margin: 12px 0 10px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg-btn { padding: 5px 14px; font-size: 13px; color: var(--muted); background: var(--card); text-decoration: none; }
.seg-btn:hover { text-decoration: none; }
.seg-btn.on { background: var(--brand); color: #fff; }
.basis-cap { margin: 2px 2px 6px; }
.tbl .neg { color: var(--alert); }
.tbl tr.tot td { border-top: 2px solid var(--line); padding-top: 8px; }
@media (max-width: 700px) { .steps { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .period { flex-wrap: wrap; overflow: visible; } }
@media (max-width: 900px) { .cmp-grid { grid-template-columns: repeat(2, 1fr); } }
.tbl.sortable thead th { cursor: pointer; user-select: none; white-space: nowrap; }
.tbl.sortable thead th:hover { color: var(--brand); }
.tbl.sortable thead th .arw { color: var(--brand); font-size: 11px; }
.action-grid { grid-template-columns: repeat(5, 1fr); }
.kpi-link { display: block; text-decoration: none; color: inherit; transition: border-color .12s, box-shadow .12s; }
.kpi-link:hover { border-color: var(--brand); box-shadow: 0 1px 8px rgba(0, 91, 255, .12); }
@media (max-width: 900px) { .action-grid { grid-template-columns: repeat(2, 1fr); } }
.modal-backdrop { position: fixed; inset: 0; background: rgba(20,28,40,.45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 1000; overflow: auto; }
.modal-backdrop[hidden] { display: none; }
.modal { background: var(--card); border-radius: 14px; width: min(960px, 100%); box-shadow: 0 10px 40px rgba(0,0,0,.25); display: flex; flex-direction: column; max-height: calc(100vh - 64px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.modal-head h3 { margin: 0; }
.modal-x { border: none; background: none; font-size: 20px; cursor: pointer; color: var(--muted); }
.modal-body { padding: 16px 20px; display: flex; flex-direction: column; overflow: hidden; flex: 1 1 auto; min-height: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); flex: 0 0 auto; }
.fld { display: block; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.fld input { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.name-row { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.name-row label { margin-bottom: 0; }
.name-input { flex: 1; height: 42px; box-sizing: border-box; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.active-toggle { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.active-toggle input { width: 16px; height: 16px; }
.fld-cap { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.adot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.adot.on { background: #1a9e5a; }
.adot.off { background: #d64545; }
.picker-bar { display: flex; flex-wrap: nowrap; gap: 10px; align-items: center; margin-bottom: 8px; }
.picker-bar input[type=text] { flex: 1 1 auto; min-width: 120px; height: 40px; box-sizing: border-box; padding: 0 12px; margin: 0; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.picker-bar .inline { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); white-space: nowrap; margin-bottom: 0; }
.picker-bar .inline input { width: 64px; height: 40px; box-sizing: border-box; padding: 0 8px; margin: 0; border: 1px solid var(--line); border-radius: 8px; }
.picker-bar .btn { height: 40px; box-sizing: border-box; margin: 0; display: inline-flex; align-items: center; white-space: nowrap; }
.picker-list { flex: 1 1 auto; min-height: 160px; max-height: none; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.items-wrap { flex: 0 1 auto; max-height: 34vh; overflow: auto; margin-top: 10px; }
table.picktbl { width: 100%; border-collapse: collapse; }
table.picktbl td { padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
table.picktbl td.ck { width: 34px; text-align: center; }
table.picktbl td.ph { width: 46px; }
table.picktbl th { text-align: left; padding: 6px 10px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); }
table.picktbl th.num { text-align: right; }
table.picktbl th.ph { width: 46px; }
.pickallrow td { color: var(--muted); font-size: 12px; }
.pthumb { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; display: block; }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.primary:hover { filter: brightness(1.05); }
.blocks-toggle { align-items: center; }
table.matrix th, table.matrix td { white-space: nowrap; }
table.matrix th.wh, table.matrix td.wh { position: sticky; left: 0; background: var(--card); z-index: 1; text-align: left; box-shadow: 1px 0 0 var(--line); }
table.matrix td.num a { text-decoration: none; }
table.matrix td.num a:hover { text-decoration: underline; }
