/* ============================================================
   Обіг — CRM для товарного бізнесу
   Design ledger: layout=sidebar-app · type=Manrope+Inter · color=indigo/slate light
   radius=10px soft · motion=fade+scale tap · signature=KPI+канбан+ТТН-трекер
   ============================================================ */

:root {
  /* canvas / surfaces */
  --bg: #F7F8FA;
  --surface: #FFFFFF;
  --surface-2: #F1F3F7;
  --line: #E6E9EF;
  --line-strong: #D5DAE3;

  /* text */
  --ink: #0F172A;
  --ink-2: #475569;
  --ink-3: #8A95A6;

  /* brand */
  --indigo: #4F46E5;
  --indigo-600: #4338CA;
  --indigo-soft: #EEF0FE;

  /* semantic */
  --ok: #10B981;
  --ok-soft: #E6F7F1;
  --warn: #F59E0B;
  --warn-soft: #FEF3E2;
  --bad: #EF4444;
  --bad-soft: #FDECEC;

  /* sidebar (dark slate) */
  --side: #0F172A;
  --side-2: #1B2536;
  --side-ink: #C4CCDA;
  --side-ink-2: #7C8AA0;

  --r: 10px;
  --r-sm: 8px;
  --r-lg: 14px;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 4px 14px rgba(15,23,42,.05);
  --shadow-lg: 0 10px 34px rgba(15,23,42,.10);

  --ease: cubic-bezier(.23,1,.32,1);
  --fast: 150ms;

  --sidebar-w: 244px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .num {
  font-family: "Manrope", "Inter", sans-serif;
  letter-spacing: -.01em;
}
a { color: inherit; text-decoration: none; }
.num { font-variant-numeric: tabular-nums; }

/* ===== APP SHELL ===== */
.app {
  display: flex;
  min-height: 100vh;
}

/* ----- Sidebar ----- */
.side {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--side);
  color: var(--side-ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 8px 18px;
}
.brand .logo {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--indigo), #6366F1);
  display: grid; place-items: center;
  flex: 0 0 38px;
  box-shadow: 0 4px 12px rgba(79,70,229,.45);
}
.brand .logo svg { width: 22px; height: 22px; stroke: #fff; }
.brand .name { font-family: "Manrope", sans-serif; font-weight: 800; font-size: 19px; color: #fff; letter-spacing: -.02em; }
.brand .sub { font-size: 11px; color: var(--side-ink-2); margin-top: 1px; }

.nav-group-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--side-ink-2); padding: 14px 10px 6px; font-weight: 600;
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 11px;
  border-radius: var(--r-sm);
  color: var(--side-ink);
  font-size: 14px; font-weight: 500;
  min-height: 42px;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.nav a svg { width: 19px; height: 19px; stroke: currentColor; flex: 0 0 19px; opacity: .85; }
.nav a .badge {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: var(--indigo); color: #fff;
  padding: 1px 7px; border-radius: 20px; min-width: 20px; text-align: center;
}
.nav a.on { background: var(--side-2); color: #fff; }
.nav a.on svg { opacity: 1; color: #A5B4FC; }
@media (hover: hover) {
  .nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
}
.nav a:active { transform: scale(.985); }

.side-foot {
  margin-top: auto;
  padding: 12px 10px 4px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg,#6366F1,#A855F7);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px;
  flex: 0 0 34px;
}
.side-foot .meta { line-height: 1.25; min-width: 0; }
.side-foot .meta .n { color: #fff; font-size: 13px; font-weight: 600; }
.side-foot .meta .r { color: var(--side-ink-2); font-size: 11px; }

/* mobile top bar (hidden on desktop) */
.topbar { display: none; }

/* ----- Main ----- */
.main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topnav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(247,248,250,.85);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 14px clamp(16px, 3vw, 30px);
  display: flex; align-items: center; gap: 14px;
}
.topnav .title { min-width: 0; }
.topnav h1 { margin: 0; font-size: clamp(18px, 2.4vw, 23px); font-weight: 800; }
.topnav .crumb { font-size: 12.5px; color: var(--ink-3); }
.topnav .spacer { flex: 1 1 auto; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 14px; min-width: 200px;
  color: var(--ink-3);
}
.search svg { width: 17px; height: 17px; stroke: var(--ink-3); }
.search input {
  border: 0; background: transparent; outline: none;
  font-size: 16px; color: var(--ink); width: 100%; font-family: inherit;
}
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: var(--ink-2);
  transition: transform var(--fast) var(--ease), border-color var(--fast) var(--ease);
  position: relative;
}
.icon-btn svg { width: 19px; height: 19px; stroke: currentColor; }
.icon-btn:active { transform: scale(.94); }
@media (hover: hover) { .icon-btn:hover { border-color: var(--line-strong); } }
.icon-btn .dot {
  position: absolute; top: 8px; right: 9px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--bad); border: 2px solid var(--surface);
}

.content { padding: clamp(16px, 3vw, 30px); flex: 1; }
.content > section { margin-bottom: clamp(18px, 3vw, 26px); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: "Inter", sans-serif; font-weight: 600; font-size: 14px;
  padding: 10px 16px; border-radius: var(--r-sm); cursor: pointer;
  border: 1px solid transparent; min-height: 42px; white-space: nowrap;
  transition: transform var(--fast) var(--ease), background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.btn svg { width: 17px; height: 17px; stroke: currentColor; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--indigo); color: #fff; box-shadow: 0 4px 12px rgba(79,70,229,.28); }
@media (hover: hover) { .btn-primary:hover { background: var(--indigo-600); } }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
@media (hover: hover) { .btn-ghost:hover { border-color: var(--line-strong); background: var(--surface-2); } }

/* ===== Card ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.card-h {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.card-h h2 { margin: 0; font-size: 16px; font-weight: 700; }
.card-h .sub { font-size: 12.5px; color: var(--ink-3); }
.card-h .spacer { flex: 1; }
.card-b { padding: 18px; }

/* ===== Chips ===== */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  white-space: nowrap; line-height: 1.4;
}
.chip svg { width: 13px; height: 13px; stroke: currentColor; }
.chip .ico-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip-ok { background: var(--ok-soft); color: #047857; }
.chip-warn { background: var(--warn-soft); color: #B45309; }
.chip-bad { background: var(--bad-soft); color: #B91C1C; }
.chip-neutral { background: var(--surface-2); color: var(--ink-2); }
.chip-indigo { background: var(--indigo-soft); color: var(--indigo-600); }

/* carrier badge */
.carrier {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 6px;
  background: var(--surface-2); color: var(--ink-2);
}
.carrier .mk { width: 7px; height: 7px; border-radius: 2px; }
.carrier.np .mk { background: #E11A22; }
.carrier.up .mk { background: #FFD500; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }

/* ===== Reveal motion ===== */
.reveal { opacity: 0; transform: translateY(10px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* =========================================================
   DASHBOARD
   ========================================================= */
.kpi-row {
  display: grid; gap: 14px;
  grid-template-columns: repeat(5, 1fr);
}
.kpi {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 16px 16px 14px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.kpi .ic {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  margin-bottom: 12px;
}
.kpi .ic svg { width: 18px; height: 18px; stroke-width: 2; }
.kpi .lbl { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.kpi .val { font-family: "Manrope", sans-serif; font-weight: 800; font-size: clamp(20px, 2.4vw, 27px); margin-top: 2px; }
.kpi .delta { font-size: 11.5px; font-weight: 600; margin-top: 4px; display: inline-flex; align-items: center; gap: 3px; }
.kpi .delta.up { color: #047857; }
.kpi .delta.dn { color: #B45309; }
.ic-indigo { background: var(--indigo-soft); color: var(--indigo); }
.ic-ok { background: var(--ok-soft); color: var(--ok); }
.ic-warn { background: var(--warn-soft); color: var(--warn); }
.ic-slate { background: var(--surface-2); color: var(--ink-2); }

.grid-2 { display: grid; gap: 16px; grid-template-columns: 1.6fr 1fr; }
.grid-2b { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }

/* sales chart */
.chart-wrap { padding: 8px 4px 0; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-meta { display: flex; gap: 20px; padding: 4px 14px 0; }
.chart-meta .m .v { font-family: "Manrope", sans-serif; font-weight: 800; font-size: 20px; }
.chart-meta .m .l { font-size: 12px; color: var(--ink-3); }

/* top products */
.toplist { display: flex; flex-direction: column; }
.toprow { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.toprow:last-child { border-bottom: 0; }
.toprow .rank { width: 24px; height: 24px; border-radius: 7px; background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: 0 0 24px; }
.toprow .nm { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; }
.toprow .nm small { display: block; color: var(--ink-3); font-weight: 400; font-size: 12px; }
.toprow .rv { font-family: "Manrope", sans-serif; font-weight: 700; font-size: 14px; white-space: nowrap; }

/* notifications */
.notif { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.notif:last-child { border-bottom: 0; }
.notif .ni { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 34px; }
.notif .ni svg { width: 17px; height: 17px; stroke-width: 2; }
.notif .nb { min-width: 0; }
.notif .nb .nt { font-size: 13.5px; font-weight: 600; }
.notif .nb .nx { font-size: 12.5px; color: var(--ink-2); }
.notif .nb .tm { font-size: 11px; color: var(--ink-3); margin-top: 2px; }

/* =========================================================
   TABLE (warehouse)
   ========================================================= */
.table-wrap { overflow: hidden; border-radius: var(--r-lg); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-3); font-weight: 600; padding: 11px 16px; background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
table.tbl th.r, table.tbl td.r { text-align: right; }
table.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
@media (hover: hover) { table.tbl tbody tr:hover { background: var(--surface-2); } }
.sku { font-family: "Manrope", sans-serif; font-weight: 700; font-size: 13px; color: var(--ink-2); }
.pname { font-weight: 500; }
.muted { color: var(--ink-3); }

.bar { height: 6px; border-radius: 4px; background: var(--surface-2); overflow: hidden; width: 90px; }
.bar > i { display: block; height: 100%; border-radius: 4px; }

/* summary strip */
.sum-strip { display: flex; flex-wrap: wrap; gap: 10px 28px; padding: 14px 18px; }
.sum-strip .s .v { font-family: "Manrope", sans-serif; font-weight: 800; font-size: 19px; }
.sum-strip .s .l { font-size: 12px; color: var(--ink-3); }

/* =========================================================
   KANBAN (orders)
   ========================================================= */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px;
}
.toolbar .search { min-width: 0; flex: 1 1 240px; }
.seg { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button {
  border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 600;
  padding: 7px 13px; border-radius: 999px; cursor: pointer; color: var(--ink-2);
  min-height: 36px; transition: background var(--fast) var(--ease);
}
.seg button.on { background: var(--ink); color: #fff; }

.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(248px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
}
.col {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 10px;
  display: flex; flex-direction: column; gap: 10px;
  min-width: 0;
  scroll-snap-align: start;
}
.col-h { display: flex; align-items: center; gap: 8px; padding: 4px 6px 2px; }
.col-h .dot { width: 9px; height: 9px; border-radius: 50%; }
.col-h .t { font-size: 13.5px; font-weight: 700; }
.col-h .c { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--ink-3); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }

.ocard {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px; box-shadow: var(--shadow); cursor: grab;
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
  position: relative;
}
.ocard:active { cursor: grabbing; transform: scale(.985); }
@media (hover: hover) { .ocard:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); } }
.ocard .grip { position: absolute; top: 12px; right: 11px; color: var(--ink-3); display: flex; gap: 2px; }
.ocard .grip i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; display: block; }
.ocard .gripcol { display: flex; flex-direction: column; gap: 2px; }
.ocard .onum { font-family: "Manrope", sans-serif; font-weight: 800; font-size: 14px; }
.ocard .ocl { font-size: 13px; color: var(--ink-2); margin-top: 1px; }
.ocard .osum { font-family: "Manrope", sans-serif; font-weight: 800; font-size: 17px; margin: 9px 0 8px; }
.ocard .ometa { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ocard .items { font-size: 12px; color: var(--ink-3); }

/* dot colors by column */
.dot-new { background: var(--ink-3); }
.dot-paid { background: var(--ok); }
.dot-pack { background: var(--indigo); }
.dot-shipped { background: var(--warn); }
.dot-done { background: #06B6D4; }

/* =========================================================
   SHIPPING + PAYMENTS
   ========================================================= */
.integ-row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.integ {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.integ .ih { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.integ .mk { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-family: "Manrope", sans-serif; font-weight: 800; color: #fff; font-size: 15px; flex: 0 0 40px; }
.mk-np { background: #E11A22; }
.mk-up { background: #FFD500; color: #1a1a1a; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
.integ .ih .nm { font-weight: 700; font-size: 15px; }
.integ .ih .st { font-size: 12px; color: var(--ink-3); }
.integ .stat-row { display: flex; gap: 18px; padding: 6px 0 14px; }
.integ .stat-row .v { font-family: "Manrope", sans-serif; font-weight: 800; font-size: 20px; }
.integ .stat-row .l { font-size: 11.5px; color: var(--ink-3); }

/* tracking stepper */
.track { display: flex; align-items: center; gap: 4px; margin: 4px 0 2px; }
.track .stp { display: flex; flex-direction: column; align-items: center; gap: 5px; flex: 1; min-width: 0; }
.track .stp .bub { width: 18px; height: 18px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--line-strong); display: grid; place-items: center; }
.track .stp .bub svg { width: 10px; height: 10px; stroke: #fff; stroke-width: 3; }
.track .stp .tl { font-size: 10px; color: var(--ink-3); text-align: center; line-height: 1.2; }
.track .stp.done .bub { background: var(--ok); border-color: var(--ok); }
.track .stp.done .tl { color: var(--ink-2); }
.track .stp.cur .bub { background: var(--indigo); border-color: var(--indigo); box-shadow: 0 0 0 4px var(--indigo-soft); }
.track .lnk { height: 2px; flex: 1; background: var(--line-strong); border-radius: 2px; max-width: 40px; }
.track .lnk.done { background: var(--ok); }

.ttn { font-family: "Manrope", sans-serif; font-weight: 700; font-size: 13.5px; letter-spacing: .01em; }

/* gateway cards */
.gw-row { display: grid; gap: 12px; grid-template-columns: repeat(3,1fr); }
.gw { border: 1px solid var(--line); border-radius: var(--r); padding: 13px 14px; background: var(--surface); }
.gw .nm { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.gw .vv { font-family: "Manrope", sans-serif; font-weight: 800; font-size: 19px; margin-top: 8px; }
.gw .ll { font-size: 11.5px; color: var(--ink-3); }

/* =========================================================
   HUB (index)
   ========================================================= */
.hub { min-height: 100vh; display: flex; flex-direction: column; }
.hub-top {
  display: flex; align-items: center; gap: 12px;
  padding: 18px clamp(18px,4vw,48px);
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.hub-wrap { flex: 1; padding: clamp(36px,7vw,84px) clamp(18px,4vw,48px); max-width: 1080px; width: 100%; margin: 0 auto; }
.hub-tag { display: inline-flex; align-items: center; gap: 7px; background: var(--indigo-soft); color: var(--indigo-600); font-size: 13px; font-weight: 600; padding: 6px 13px; border-radius: 999px; }
.hub h1 { font-size: clamp(30px, 6vw, 52px); font-weight: 800; line-height: 1.05; margin: 20px 0 0; letter-spacing: -.025em; }
.hub .lead { font-size: clamp(15px, 2.2vw, 18px); color: var(--ink-2); max-width: 620px; margin: 16px 0 0; line-height: 1.55; }
.hub-stats { display: flex; flex-wrap: wrap; gap: 10px 32px; margin: 28px 0 0; }
.hub-stats .s .v { font-family: "Manrope", sans-serif; font-weight: 800; font-size: clamp(22px,3vw,28px); }
.hub-stats .s .l { font-size: 13px; color: var(--ink-3); }

.hub-cards { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); margin-top: 40px; }
.hcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.hcard:active { transform: scale(.99); }
@media (hover: hover) { .hcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); } }
.hcard .hi { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 16px; }
.hcard .hi svg { width: 23px; height: 23px; stroke-width: 1.9; }
.hcard h3 { margin: 0; font-size: 18px; font-weight: 700; }
.hcard p { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; flex: 1; }
.hcard .go { margin-top: 16px; font-size: 13.5px; font-weight: 700; color: var(--indigo); display: inline-flex; align-items: center; gap: 6px; }
.hcard .go svg { width: 16px; height: 16px; stroke: currentColor; transition: transform var(--fast) var(--ease); }
@media (hover: hover) { .hcard:hover .go svg { transform: translateX(4px); } }

/* footer */
.foot {
  border-top: 1px solid var(--line); padding: 22px clamp(18px,4vw,48px);
  display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between;
  font-size: 13px; color: var(--ink-3); background: var(--surface);
}
.foot a { color: var(--indigo); font-weight: 600; }
.foot .lab { color: var(--ink-2); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1100px) {
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .hub-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .app { flex-direction: column; }
  .side {
    position: static; width: 100%; height: auto; flex: none;
    flex-direction: row; align-items: center; gap: 8px;
    padding: 10px 14px; overflow-x: auto;
  }
  .brand { padding: 0 8px 0 0; flex: 0 0 auto; }
  .brand .sub { display: none; }
  .nav-group-label, .side-foot { display: none; }
  .nav {
    flex-direction: row; gap: 6px; overflow-x: auto;
    -webkit-overflow-scrolling: touch; flex: 1; padding-bottom: 2px;
  }
  .nav a {
    flex: 0 0 auto; padding: 9px 13px; min-height: 44px; white-space: nowrap;
    background: rgba(255,255,255,.05);
  }
  .nav a .badge { display: none; }
  .topnav { padding: 12px 16px; }
  .search.deskonly { display: none; }
}

@media (max-width: 760px) {
  .integ-row { grid-template-columns: 1fr; }
  .grid-2b { grid-template-columns: 1fr; }
  .gw-row { grid-template-columns: 1fr; }
  .hub-cards { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .topnav .search { display: none; }

  /* table → cards */
  table.tbl thead { display: none; }
  table.tbl, table.tbl tbody, table.tbl tr, table.tbl td { display: block; width: 100%; }
  table.tbl tr {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r); margin-bottom: 10px; padding: 6px 4px; box-shadow: var(--shadow);
  }
  table.tbl td {
    border: 0; padding: 8px 14px; display: flex; align-items: center;
    justify-content: space-between; gap: 14px; text-align: right;
  }
  table.tbl td::before {
    content: attr(data-label); color: var(--ink-3); font-size: 12px; font-weight: 600;
    text-align: left; text-transform: uppercase; letter-spacing: .03em; flex: 0 0 auto;
  }
  table.tbl td.r { text-align: right; }
  .bar { margin-left: auto; }

  .board { grid-template-columns: repeat(5, 84vw); }
}

@media (max-width: 420px) {
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .board { grid-template-columns: repeat(5, 86vw); gap: 12px; }
}

:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; border-radius: 4px; }

/* =========================================================
   CHANNELS / MESSENGERS / CHAT (additions)
   ========================================================= */
.ch-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px;
  color: #fff; white-space: nowrap; line-height: 1.5;
}
.ch-dot { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.ch-dot .d { width: 8px; height: 8px; border-radius: 3px; flex: 0 0 8px; }

.msg-ic {
  width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center;
  flex: 0 0 24px; color: #fff;
}
.msg-ic svg { width: 13px; height: 13px; stroke: currentColor; fill: none; }

/* channel breakdown (dashboard) */
.chstat { display: flex; flex-direction: column; gap: 10px; }
.chrow { display: flex; align-items: center; gap: 10px; }
.chrow .nm { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; width: 96px; flex: 0 0 96px; }
.chrow .nm .d { width: 9px; height: 9px; border-radius: 3px; }
.chrow .track2 { flex: 1; height: 8px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.chrow .track2 > i { display: block; height: 100%; border-radius: 5px; }
.chrow .vv { font-size: 12.5px; font-weight: 700; white-space: nowrap; width: 64px; text-align: right; flex: 0 0 64px; }

/* chat block */
.chat { display: flex; flex-direction: column; gap: 8px; }
.chat .bub {
  max-width: 82%; padding: 8px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.4;
}
.chat .bub .tm { display: block; font-size: 10.5px; opacity: .6; margin-top: 3px; }
.chat .client { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.chat .mgr { align-self: flex-end; background: var(--indigo); color: #fff; border-bottom-right-radius: 4px; }
.chat-input {
  display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
}
.chat-input input { flex: 1; border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; font-size: 16px; font-family: inherit; outline: none; min-width: 0; }
.chat-input input:focus { border-color: var(--indigo); }

/* ABC analysis */
.abc-tag { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-weight: 800; font-size: 12px; color: #fff; flex: 0 0 22px; }
.abc-A { background: var(--ok); }
.abc-B { background: var(--indigo); }
.abc-C { background: var(--ink-3); }

/* finance summary */
.fin-row { display: grid; gap: 14px; grid-template-columns: repeat(4,1fr); }
.fin {
  border: 1px solid var(--line); border-radius: var(--r); padding: 15px 16px; background: var(--surface);
}
.fin .l { font-size: 12.5px; color: var(--ink-3); }
.fin .v { font-family: "Manrope", sans-serif; font-weight: 800; font-size: clamp(18px,2.2vw,23px); margin-top: 4px; }
.fin.accent { background: var(--indigo); border-color: var(--indigo); }
.fin.accent .l, .fin.accent .v { color: #fff; }

/* purchases / returns rows */
.minirow { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.minirow:last-child { border-bottom: 0; }
.minirow .mc { flex: 1; min-width: 0; }
.minirow .mc .tt { font-size: 13.5px; font-weight: 600; }
.minirow .mc .ss { font-size: 12px; color: var(--ink-3); }
.minirow .rg { text-align: right; white-space: nowrap; }
.minirow .rg .am { font-family: "Manrope", sans-serif; font-weight: 700; font-size: 13.5px; }

@media (max-width: 760px) { .fin-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) {
  .chrow .nm { width: 78px; flex: 0 0 78px; font-size: 12px; }
  .chrow .vv { width: 54px; flex: 0 0 54px; }
}

/* =========================================================
   ORDER DETAIL DRAWER (orders.html) + product line-items
   ========================================================= */
.drawer-back {
  position: fixed; inset: 0; background: rgba(15,23,42,.42);
  opacity: 0; pointer-events: none; transition: opacity var(--fast) var(--ease);
  z-index: 60; backdrop-filter: blur(1px);
}
.drawer-back.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: min(460px, 92vw);
  background: var(--surface); box-shadow: -10px 0 40px rgba(15,23,42,.18);
  transform: translateX(100%); transition: transform .26s var(--ease);
  z-index: 61; display: flex; flex-direction: column; overflow: hidden;
}
.drawer.open { transform: none; }
.drawer-h {
  display: flex; align-items: center; gap: 12px; padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.drawer-h .onum { font-family: "Manrope", sans-serif; font-weight: 800; font-size: 19px; }
.drawer-h .cl { font-size: 13px; color: var(--ink-3); }
.drawer-close {
  margin-left: auto; width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink-2);
}
.drawer-close svg { width: 18px; height: 18px; stroke: currentColor; }
.drawer-close:active { transform: scale(.94); }
.drawer-b { padding: 18px 20px; overflow-y: auto; flex: 1; }
.drawer-sec { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; margin: 4px 0 10px; }

.lineitem {
  display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line);
}
.lineitem:last-child { border-bottom: 0; }
.li-thumb {
  width: 48px; height: 48px; border-radius: 9px; flex: 0 0 48px;
  background: linear-gradient(135deg, var(--surface-2), #E8ECF3);
  display: grid; place-items: center; color: var(--ink-3);
}
.li-thumb svg { width: 22px; height: 22px; stroke: currentColor; }
.li-body { flex: 1; min-width: 0; }
.li-body .nm { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.li-body .sk { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.li-qty { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.li-sum { font-family: "Manrope", sans-serif; font-weight: 700; font-size: 14px; white-space: nowrap; text-align: right; min-width: 78px; }

.drawer-total { display: flex; align-items: center; justify-content: space-between; padding: 14px 0 4px; }
.drawer-total .l { font-size: 13px; color: var(--ink-2); }
.drawer-total .v { font-family: "Manrope", sans-serif; font-weight: 800; font-size: 22px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 13.5px; }
.kv .k { color: var(--ink-3); }
.kv .vv { font-weight: 600; text-align: right; }

/* =========================================================
   SHIPMENT DETAIL (shipping.html)
   ========================================================= */
.ship-card {
  border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin-bottom: 12px; background: var(--surface);
}
.ship-card:last-child { margin-bottom: 0; }
.ship-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ship-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin: 10px 0 14px; }
.ship-grid .kv { padding: 4px 0; }
.ship-detail { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; display: none; }
.ship-card.open .ship-detail { display: block; }
.ship-toggle {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--indigo);
  background: none; border: 0; cursor: pointer; padding: 4px 0; font-family: inherit;
}
.ship-toggle svg { width: 15px; height: 15px; stroke: currentColor; transition: transform var(--fast) var(--ease); }
.ship-card.open .ship-toggle svg { transform: rotate(180deg); }

/* status history timeline */
.hist { list-style: none; margin: 4px 0 0; padding: 0; }
.hist li { position: relative; padding: 0 0 14px 22px; }
.hist li:last-child { padding-bottom: 0; }
.hist li::before {
  content: ""; position: absolute; left: 3px; top: 4px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--line-strong); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong);
}
.hist li:first-child::before { background: var(--ok); box-shadow: 0 0 0 1px var(--ok); }
.hist li::after {
  content: ""; position: absolute; left: 7px; top: 11px; bottom: -2px; width: 2px; background: var(--line);
}
.hist li:last-child::after { display: none; }
.hist .ht { font-size: 13px; font-weight: 500; line-height: 1.35; }
.hist .hs { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }

/* =========================================================
   PAYMENTS (payments.html) — balances + filters
   ========================================================= */
.bal-row { display: grid; gap: 14px; grid-template-columns: repeat(4, 1fr); }
.bal {
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; background: var(--surface); box-shadow: var(--shadow);
}
.bal .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; margin-bottom: 12px; }
.bal .ic svg { width: 18px; height: 18px; stroke-width: 2; }
.bal .l { font-size: 12.5px; color: var(--ink-3); }
.bal .b { font-size: 11.5px; color: var(--ink-3); }
.bal .v { font-family: "Manrope", sans-serif; font-weight: 800; font-size: clamp(19px,2.3vw,24px); margin: 4px 0 2px; }
.bal.main { background: var(--indigo); border-color: var(--indigo); }
.bal.main .l, .bal.main .v, .bal.main .b { color: #fff; }
.bal.main .l, .bal.main .b { opacity: .85; }
.bal.main .ic { background: rgba(255,255,255,.15); color: #fff; }

@media (max-width: 900px) { .bal-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) {
  .bal-row { grid-template-columns: 1fr 1fr; }
  .ship-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   HUB selling blocks + offer banner (index.html)
   ========================================================= */
.sell { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); margin-top: 44px; }
.sell .scard {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px;
}
.sell .scard .si { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 14px; }
.sell .scard .si svg { width: 21px; height: 21px; stroke-width: 1.9; }
.sell .scard h3 { margin: 0 0 8px; font-size: 16px; font-weight: 700; }
.sell .scard ul { margin: 0; padding: 0; list-style: none; }
.sell .scard li { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; padding-left: 22px; position: relative; margin-bottom: 7px; }
.sell .scard li:last-child { margin-bottom: 0; }
.sell .scard li::before {
  content: ""; position: absolute; left: 0; top: 5px; width: 13px; height: 13px;
  background: var(--ok-soft); border-radius: 4px;
}
.sell .scard li::after {
  content: ""; position: absolute; left: 3.5px; top: 8px; width: 5px; height: 3px;
  border-left: 1.6px solid var(--ok); border-bottom: 1.6px solid var(--ok); transform: rotate(-45deg);
}

.offer {
  margin-top: 44px; border-radius: 20px; overflow: hidden; position: relative;
  background: linear-gradient(135deg, #1E1B4B 0%, var(--indigo-600) 55%, var(--indigo) 100%);
  color: #fff; padding: clamp(28px, 5vw, 48px);
}
.offer::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(184,247,0,.18), transparent 70%); pointer-events: none;
}
.offer .tag { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: #C7D2FE; }
.offer h2 { font-family: "Manrope", sans-serif; font-weight: 800; font-size: clamp(22px, 3.4vw, 33px); line-height: 1.12; margin: 12px 0 0; max-width: 18ch; }
.offer p { color: #DDE3FF; font-size: clamp(14px,1.8vw,16px); margin: 14px 0 0; max-width: 56ch; line-height: 1.55; }
.offer-prices { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 0; }
.price-pill {
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.18); border-radius: 12px;
  padding: 14px 18px; min-width: 180px;
}
.price-pill .pl { font-size: 12px; color: #C7D2FE; }
.price-pill .pv { font-family: "Manrope", sans-serif; font-weight: 800; font-size: 22px; margin-top: 3px; }
.price-pill .pv small { font-size: 13px; font-weight: 600; color: #C7D2FE; }
.offer-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 0; }
.btn-lime { background: #B8F700; color: #0A0A0A; box-shadow: 0 8px 22px rgba(184,247,0,.28); }
@media (hover: hover) { .btn-lime:hover { background: #C7FF20; } }
.btn-onnight { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25); }
@media (hover: hover) { .btn-onnight:hover { background: rgba(255,255,255,.2); } }

@media (max-width: 900px) { .sell { grid-template-columns: 1fr; } }
