/* Shop dashboard layout. Chart colours live here as roles so they change in one place. */
:root {
  --series-1: #4f46e5;   /* single-series bars (brand) */
  --cat-1: #257de0;      /* B&W pages */
  --cat-2: #f47230;      /* colour pages */
  --grid: #eef2f7; --axis: #94a3b8;
}

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--grad); color: #fff; padding: 40px; display: flex; flex-direction: column; justify-content: space-between; gap: 30px; }
.auth-side h1 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.1; letter-spacing: -.03em; margin: 0 0 22px; }
.auth-side ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; font-size: 16px; }
.auth-side li::before { content: "✓"; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.2); margin-right: 10px; font-size: 12px; font-weight: 800; }
.auth-main { display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 420px; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-side { padding: 24px 20px; } .auth-side h1 { font-size: 26px; margin-bottom: 12px; } .auth-side ul { font-size: 14px; } }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; background: linear-gradient(90deg, #0f172a 250px, transparent 250px); }
.side { background: #0f172a; color: #cbd5e1; padding: 20px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brandmark { color: #fff; font-size: 19px; padding: 0 8px; }
.side .brandmark .logo { background: var(--grad); }
.side nav { display: grid; gap: 3px; }
.side nav button { justify-content: flex-start; background: transparent; color: #cbd5e1; font-weight: 600; padding: 10px 12px; border-radius: 10px; width: 100%; }
.side nav button:hover { background: rgba(255,255,255,.06); box-shadow: none; }
.side nav button.on { background: rgba(129,140,248,.18); color: #fff; }
.side nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.side .count { margin-left: auto; background: #6366f1; color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 8px; }
.side .count.soft { background: rgba(255,255,255,.1); color: #cbd5e1; }
.side-foot { margin-top: auto; display: grid; gap: 8px; }
.side-foot .ghost { color: #cbd5e1; }
.side-foot .ghost:hover { background: rgba(255,255,255,.06); }
.shopchip { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; background: rgba(255,255,255,.05); }
.shopchip b { display: block; color: #fff; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shopchip .muted { color: #94a3b8; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av { width: 36px; height: 36px; border-radius: 10px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.main { padding: 20px 28px 40px; min-width: 0; }
.mainbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.mainbar h1 { font-size: 24px; margin: 0; letter-spacing: -.02em; }
.menu { display: none; }
.status-chip { font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 0 100vw rgba(15,23,42,.45); }
  .app { background: none; }
  .menu { display: inline-flex; }
  #pageSub, .status-chip { display: none; }
  .mainbar h1 { font-size: 21px; }
  .filters .btn { margin-left: 0; }
  #recentTx td, #recentTx th, #txTable td, #txTable th, #jobTypes td, #ordersTable td { white-space: nowrap; }
  .main { padding: 14px 16px 32px; }
}

/* ---------- filters ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); }
.filters input[type=date] { width: auto; padding: 8px 10px; font-size: 14px; }
.filters select, .filters input[type=search] { padding: 8px 10px; font-size: 14px; }
.presets { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: 11px; flex-wrap: wrap; }
.presets button { background: transparent; color: var(--ink-2); padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.presets button:hover { box-shadow: none; background: #fff; }
.presets button.on { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(15,23,42,.1); }
.filters .btn { margin-left: auto; }

/* ---------- KPIs ---------- */
.alerts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.alerts:empty { display: none; }
.alert { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 12px; font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid transparent; }
.alert.warn { background: var(--warn-soft); color: var(--warn); border-color: #fde68a; }
.alert.bad { background: var(--bad-soft); color: var(--bad); border-color: #fecaca; }
.alert.info { background: var(--brand-soft); color: var(--brand); border-color: #c7d2fe; }
.alert b { font-size: 18px; }
.kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-top: 14px; }
@media (max-width: 1280px) { .kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 620px) { .kpi-grid { grid-template-columns: 1fr 1fr; } }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.kpi .k { color: var(--muted); font-size: 13px; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.kpi .k svg { width: 16px; height: 16px; fill: none; stroke: var(--brand); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kpi .v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.kpi .d { font-size: 12px; font-weight: 700; color: var(--muted); }
.kpi .d.up { color: var(--ok); } .kpi .d.down { color: var(--bad); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 14px; }
.grid-2 > .card, .grid-3 > .card { margin: 14px 0 0; min-width: 0; }
@media (max-width: 1100px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- charts ---------- */
.chart-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.chart-head h2 { margin: 0; }
.chart-head button { margin-left: auto; }
.chart { position: relative; height: 220px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .bar { fill: var(--series-1); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .bar, .chart .bar.hl { fill: #3730a3; }
.chart .empty { fill: var(--muted); font-size: 13px; }
.tooltip { position: fixed; z-index: 70; pointer-events: none; background: #0f172a; color: #fff; border-radius: 10px; padding: 8px 11px; font-size: 13px; box-shadow: 0 10px 24px rgba(15,23,42,.25); white-space: nowrap; }
.tooltip b { display: block; font-size: 15px; }
.tooltip .muted { color: #94a3b8; font-size: 12px; }

/* segmented share bar */
.split { display: flex; gap: 2px; height: 28px; border-radius: 6px; overflow: hidden; margin: 6px 0 10px; background: var(--bg); }
.split > span { display: flex; align-items: center; padding-left: 8px; font-size: 12px; font-weight: 700; color: #fff; min-width: 0; white-space: nowrap; border-radius: 4px; }
.split > span.dark { color: #0f172a; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }
.hbars { display: grid; gap: 12px; }
.hbar .lbl { display: flex; justify-content: space-between; font-size: 14px; gap: 10px; }
.hbar .lbl span:first-child { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .lbl span:last-child { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hbar .track { height: 8px; border-radius: 99px; background: var(--bg); margin-top: 5px; }
.hbar .fill { height: 8px; border-radius: 99px; background: var(--series-1); }

/* ---------- printers & QR ---------- */
.printer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.pbox { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fff; }
.pbox .top { display: flex; gap: 10px; align-items: center; }
.pbox .pic { width: 40px; height: 40px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.pbox.online .pic { background: var(--ok-soft); color: var(--ok); }
.pbox .sys { font-size: 12px; color: var(--muted); word-break: break-all; }
.pbox .caps { display: flex; gap: 14px; flex-wrap: wrap; margin: 12px 0 6px; font-size: 14px; }
.pbox .caps label, .pbox .sizes label { display: inline-flex; gap: 6px; align-items: center; margin: 0; font-weight: 500; }
.pbox .sizes { display: flex; gap: 12px; flex-wrap: wrap; font-size: 14px; margin: 6px 0 12px; }
.pbox .stats { display: flex; gap: 16px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line-2); padding-top: 10px; margin-bottom: 10px; }
.pbox .stats b { color: var(--ink); }
.qr-hero { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.qr-frame { padding: 14px; border-radius: 20px; background: var(--grad); }
.qr-frame img { display: block; width: 220px; height: 220px; border-radius: 12px; background: #fff; }
ol.setup li { margin: 6px 0; }
