:root {
    --bg: #f4f6fa;
    --panel: #ffffff;
    --ink: #1c2434;
    --muted: #6b7691;
    --line: #e3e8f0;
    --brand: #141a2e;
    --brand-2: #232b4a;
    --green: #00c882;
    --ozon: #0069ff;
    --wb: #cb11ab;
    --amber: #e08a00;
    --red: #e0455a;
    --radius: 12px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

a { color: inherit; }

/* ---------- шапка ---------- */
.topbar {
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
    color: #fff;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 28px;
    height: 62px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.logo {
    font-weight: 700;
    letter-spacing: .3px;
    font-size: 17px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    width: 10px; height: 22px;
    background: var(--green);
    border-radius: 3px;
    display: inline-block;
}

.nav { display: flex; gap: 4px; margin-left: 8px; }

.nav a {
    color: #b6c0d8;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
}

.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a.on { background: rgba(255,255,255,.14); color: #fff; }

.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 13px; color: #b6c0d8; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; margin-right: 6px; }

/* ---------- каркас ---------- */
.wrap { max-width: 1360px; margin: 0 auto; padding: 24px; }

h1 { font-size: 22px; margin: 0 0 4px; }
.sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; }

/* ---------- плитки ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }

.tile {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
}

.tile .label { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.tile .value { font-size: 25px; font-weight: 700; letter-spacing: -.4px; }
.tile .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.tile .value small { font-size: 15px; font-weight: 600; color: var(--muted); }

/* ---------- карточка/таблица ---------- */
.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.card-head {
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.card-head h2 { font-size: 16px; margin: 0; }
.card-head .count { color: var(--muted); font-size: 13px; }
.filters { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.filters select, .filters input {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
    font-size: 14px;
    background: #fff;
    color: var(--ink);
    outline: none;
}

.filters input { min-width: 190px; }
.filters select:focus, .filters input:focus { border-color: #b9c6e0; }

.tablescroll { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; min-width: 900px; }

th {
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--muted);
    background: #f7f9fc;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

td { padding: 13px 14px; border-bottom: 1px solid #eef1f7; font-size: 14px; }
tbody tr:hover { background: #fafbfe; }
td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
th.num { text-align: right; }
.dim { color: var(--muted); font-size: 13px; }

/* ---------- чипы ---------- */
.chip {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .3px;
}

.chip.ozon { background: #e0edff; color: var(--ozon); }
.chip.wb   { background: #ffe2f7; color: var(--wb); }

.st { font-weight: 600; font-size: 13px; white-space: nowrap; }
.st.new        { color: var(--green); }
.st.assembling { color: var(--amber); }
.st.shipped    { color: #4a7fd6; }
.st.delivered  { color: var(--muted); }
.st.returned   { color: var(--red); }

.bar { height: 8px; border-radius: 4px; background: #eef1f7; overflow: hidden; min-width: 90px; }
.bar span { display: block; height: 100%; background: var(--green); }
.bar span.low { background: var(--red); }

.badge-low { color: var(--red); font-weight: 600; font-size: 12px; }

.foot {
    padding: 14px 18px;
    color: var(--muted);
    font-size: 13px;
    background: #fafbfe;
    border-top: 1px solid var(--line);
}

.note {
    margin-top: 22px;
    padding: 14px 18px;
    border-radius: var(--radius);
    background: #eaf7f1;
    border: 1px solid #c9e9db;
    color: #14684a;
    font-size: 14px;
}

@media (max-width: 900px) {
    .tiles { grid-template-columns: repeat(2, 1fr); }
    .nav { display: none; }
    .wrap { padding: 16px; }
}

/* ---------- график ---------- */
.chart-card { margin-bottom: 22px; }

.legend { display: flex; gap: 16px; align-items: center; margin-left: auto; font-size: 13px; color: var(--muted); }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: -1px; }
.legend .lg-ozon { background: var(--ozon); }
.legend .lg-wb   { background: var(--wb); }

.chart-wrap { padding: 18px 18px 6px; }
.chart { width: 100%; height: 300px; display: block; }

.chart .grid { stroke: #e9edf5; stroke-width: 1; }
.chart .axis { fill: #8a94ad; font-size: 12px; font-family: inherit; }
.chart .axis-now { fill: var(--ink); font-weight: 700; }

.chart .bar-ozon { fill: var(--ozon); }
.chart .bar-wb   { fill: var(--wb); }
.chart .bar-ozon, .chart .bar-wb { transition: opacity .15s; }

.chart .hit { fill: transparent; }
.chart .hit:hover { fill: rgba(20, 26, 46, .05); }

@media (max-width: 900px) {
    .chart { height: 220px; }
    .legend { width: 100%; margin-left: 0; }
}
