/* ============================================================
   WB CRM · демо-интерфейс
   Светлая/тёмная тема, плотные таблицы, печатные формы.
   ============================================================ */

:root {
  --bg: #f4f5fa;
  --bg-soft: #eceefa;
  --panel: #ffffff;
  --panel-2: #f8f8fd;
  --panel-3: #f0f1f9;
  --text: #171827;
  --text-soft: #3d4056;
  --muted: #73778c;
  --line: #e4e6f0;
  --line-strong: #d3d6e5;
  --accent: #6c4cf1;
  --accent-2: #c026d3;
  --accent-soft: #eee9ff;
  --green: #159a63;
  --green-soft: #e4f7ee;
  --amber: #b8730a;
  --amber-soft: #fff4dd;
  --red: #d43b4b;
  --red-soft: #ffe8eb;
  --blue: #2563d9;
  --blue-soft: #e7efff;
  --pink: #c0268a;
  --pink-soft: #ffe8f6;
  --shadow: 0 1px 2px rgba(23, 24, 39, .04), 0 8px 28px rgba(23, 24, 39, .06);
  --shadow-lg: 0 18px 60px rgba(23, 24, 39, .18);
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar: #141221;
  --sidebar-2: #1d1834;
  --sidebar-text: #cfcae6;
  --sidebar-muted: #8c86aa;
  --font: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #0d0d15;
  --bg-soft: #13131f;
  --panel: #171725;
  --panel-2: #1d1d2e;
  --panel-3: #222235;
  --text: #f1f0fa;
  --text-soft: #c8c6db;
  --muted: #908da8;
  --line: #2a2a40;
  --line-strong: #3a3a55;
  --accent: #9a7bff;
  --accent-2: #e05bd8;
  --accent-soft: #2a2147;
  --green: #4bd39b;
  --green-soft: #163a2c;
  --amber: #f0b45a;
  --amber-soft: #3a2c17;
  --red: #ff7585;
  --red-soft: #401e25;
  --blue: #75a4ff;
  --blue-soft: #1c2a49;
  --pink: #ff7ac6;
  --pink-soft: #3b1b31;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 34px rgba(0, 0, 0, .35);
  --shadow-lg: 0 22px 70px rgba(0, 0, 0, .6);
  --sidebar: #0a0a11;
  --sidebar-2: #11101c;
}

[data-contrast="1"] {
  --line: #9298ad;
  --line-strong: #6f7488;
  --muted: #4f5265;
  --shadow: none;
}
[data-theme="dark"][data-contrast="1"] {
  --line: #7f84a0;
  --muted: #bdbad2;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }
body {
  margin: 0;
  background:
    radial-gradient(1000px 700px at 88% -10%, rgba(108, 76, 241, .09), transparent 60%),
    radial-gradient(800px 600px at 5% 100%, rgba(192, 38, 211, .05), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
code, .mono { font-family: var(--mono); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small-text { font-size: 12px; }
.block { display: block; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.eyebrow { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }

/* ---------- layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 252px;
  flex: none;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  background:
    radial-gradient(420px 240px at 50% -10%, rgba(124, 92, 255, .28), transparent 70%),
    linear-gradient(180deg, var(--sidebar-2), var(--sidebar));
  color: var(--sidebar-text);
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 16px; color: #fff; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 20px; color: #fff;
  background: linear-gradient(135deg, #8b6cff, #d946ef);
  box-shadow: 0 8px 20px rgba(139, 108, 255, .35);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 16px; letter-spacing: .01em; }
.brand-text small { color: var(--sidebar-muted); font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; }

.project-pill {
  display: flex; align-items: center; gap: 9px;
  margin: 0 4px 16px; padding: 10px 11px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .05);
  border-radius: 12px;
}
.project-pill > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.project-pill strong { font-size: 12px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-pill small { font-size: 10px; color: var(--sidebar-muted); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #3ddc97; box-shadow: 0 0 0 3px rgba(61, 220, 151, .16); flex: none; }
.revision-mini { font-family: var(--mono); font-size: 9.5px; padding: 3px 6px; border-radius: 6px; background: rgba(255, 255, 255, .08); color: var(--sidebar-text); }

.nav { flex: 1; overflow-y: auto; padding-right: 2px; }
.nav-section { margin-bottom: 14px; }
.nav-title { padding: 0 10px 6px; font-size: 9.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--sidebar-muted); }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  min-height: 36px; padding: 7px 10px; margin-bottom: 2px;
  border-radius: 9px; color: var(--sidebar-text); font-size: 13px; font-weight: 500;
  transition: background .15s, color .15s, transform .15s;
}
.nav-link .icon { opacity: .72; }
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-link.active { background: linear-gradient(90deg, rgba(124, 92, 255, .28), rgba(124, 92, 255, .1)); color: #fff; }
.nav-link.active .icon { opacity: 1; color: #b8a7ff; }
.nav-count { margin-left: auto; font-size: 10px; font-weight: 700; background: rgba(255, 255, 255, .12); padding: 2px 7px; border-radius: 99px; }
.nav-count.soft { background: rgba(217, 70, 239, .22); color: #f6b7ff; }

.sidebar-foot { border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 12px; }
.sidebar-user { width: 100%; display: flex; align-items: center; gap: 9px; background: none; border: 0; color: inherit; padding: 6px; border-radius: 10px; text-align: left; }
.sidebar-user:hover { background: rgba(255, 255, 255, .05); }
.sidebar-user-text { display: flex; flex-direction: column; line-height: 1.2; flex: 1; }
.sidebar-user-text strong { color: #fff; font-size: 12px; }
.sidebar-user-text small { color: var(--sidebar-muted); font-size: 10px; }
.sidebar-user .icon { opacity: .5; }
.demo-note { display: flex; gap: 8px; margin-top: 10px; padding: 9px 10px; border-radius: 10px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .06); }
.demo-note .spark { color: #c4b5fd; }
.demo-note p { margin: 0; font-size: 10px; line-height: 1.4; color: var(--sidebar-muted); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  height: 62px; padding: 0 26px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.crumbs { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.crumbs a:hover { color: var(--accent); }
.crumbs span { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb-sep { width: 13px; height: 13px; opacity: .45; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.sync-pill {
  display: flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 10px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text-soft);
  border-radius: 99px; font-size: 11.5px;
}
.sync-pill:hover { border-color: var(--accent); }
.sync-pill .revision-mini { background: var(--panel-3); color: var(--muted); }
.spin-on-hover:hover { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center;
  border: 1px solid var(--line); background: var(--panel); color: var(--text-soft);
  border-radius: 10px; transition: .15s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.icon-btn.xs { width: 28px; height: 28px; border-radius: 8px; }
.icon-btn .icon { width: 17px; height: 17px; }
.theme-moon { display: none; }
[data-theme="dark"] .theme-sun { display: none; }
[data-theme="dark"] .theme-moon { display: block; }
.account-chip { display: flex; align-items: center; gap: 8px; padding: 3px 5px 3px 3px; border: 1px solid var(--line); background: var(--panel); border-radius: 99px; color: var(--text); }
.account-chip-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; padding-right: 6px; }
.account-chip-text strong { font-size: 11.5px; }
.account-chip-text small { font-size: 9.5px; color: var(--muted); }
.mobile-only { display: none; }

.content { padding: 26px 26px 90px; max-width: 1680px; width: 100%; margin: 0 auto; }

/* ---------- typography / page head ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin-bottom: 20px; }
.page-head h1 { margin: 4px 0 5px; font-size: 28px; line-height: 1.1; letter-spacing: -.025em; font-weight: 750; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; max-width: 760px; }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- buttons / inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--panel); color: var(--text); font-size: 12.5px; font-weight: 600;
  transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.btn .icon { width: 16px; height: 16px; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; box-shadow: 0 5px 16px rgba(108, 76, 241, .24); }
.btn.primary:hover { filter: brightness(1.06); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 36%, var(--line)); background: var(--red-soft); }
.btn.small { height: 31px; padding: 0 10px; font-size: 11.5px; border-radius: 8px; }
.btn.full { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.select, .input {
  height: 36px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel); color: var(--text); font-size: 12.5px; outline: none;
}
.select:focus, .input:focus, .search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.mono { font-family: var(--mono); font-size: 11px; }
.tiny-input { width: 70px; height: 30px; padding: 0 7px; font-size: 12px; }
.unit-input { width: 64px; height: 30px; padding: 0 7px; font-size: 12px; }
.compact-select { height: 30px; padding: 0 6px; font-size: 11.5px; }
.search-field {
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel);
  min-width: 280px; color: var(--muted);
}
.search-field input { border: 0; outline: none; background: transparent; color: var(--text); width: 100%; font-size: 12.5px; }
.search-field .icon { width: 16px; height: 16px; }
.check-pill { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; font-size: 11.5px; color: var(--text-soft); background: var(--panel); cursor: pointer; }
.check-pill input { accent-color: var(--accent); }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-soft); cursor: pointer; }
.check-line input { accent-color: var(--accent); }
.inline-filters { display: flex; gap: 8px; }

/* ---------- avatars / badges ---------- */
.avatar {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: inline-grid; place-items: center;
  background: color-mix(in srgb, var(--a) 18%, var(--panel));
  color: var(--a); border: 1px solid color-mix(in srgb, var(--a) 30%, transparent);
  font-size: 11px; font-weight: 800; letter-spacing: -.02em;
}
.avatar.sm { width: 28px; height: 28px; border-radius: 9px; font-size: 9.5px; }
.avatar.xs { width: 22px; height: 22px; border-radius: 7px; font-size: 8px; }
.avatar.lg { width: 46px; height: 46px; border-radius: 13px; font-size: 14px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 7px; border-radius: 6px;
  background: var(--panel-3); color: var(--text-soft);
  font-size: 10px; font-weight: 700; white-space: nowrap; line-height: 1.3;
}
.badge-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.violet { background: var(--accent-soft); color: var(--accent); }
.badge.pink { background: var(--pink-soft); color: var(--pink); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.neutral { background: var(--panel-3); color: var(--muted); }
.badge.tiny { padding: 1px 5px; font-size: 8.5px; margin-left: 4px; }

/* ---------- panels / stats ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; }
.panel-head h2 { margin: 2px 0 0; font-size: 15px; letter-spacing: -.01em; }
.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stats-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-card { display: flex; align-items: center; gap: 12px; padding: 14px 15px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.stat-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.stat-card.pink .stat-icon { background: var(--pink-soft); color: var(--pink); }
.stat-card.blue .stat-icon { background: var(--blue-soft); color: var(--blue); }
.stat-card.amber .stat-icon { background: var(--amber-soft); color: var(--amber); }
.stat-card.green .stat-icon { background: var(--green-soft); color: var(--green); }
.stat-text { display: flex; flex-direction: column; min-width: 0; }
.stat-text span { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.stat-text strong { font-size: 21px; letter-spacing: -.03em; line-height: 1.15; }
.stat-text small { font-size: 9.5px; color: var(--muted); }

/* ---------- tabs / toolbar ---------- */
.tabs-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; overflow-x: auto; padding-bottom: 2px; flex-wrap: wrap; }
.tabs { display: flex; align-items: center; gap: 3px; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 3px; box-shadow: var(--shadow); flex: none; }
.tab { display: inline-flex; align-items: center; gap: 7px; height: 31px; padding: 0 11px; border-radius: 8px; font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.tab span { font-size: 9.5px; background: var(--panel-3); padding: 1px 5px; border-radius: 99px; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--text); color: var(--panel); }
.tab.active span { background: rgba(255, 255, 255, .16); color: inherit; }
.tabs-divider { width: 1px; height: 24px; background: var(--line); flex: none; }
.folder-tabs { display: flex; gap: 6px; overflow-x: auto; flex-wrap: wrap; }
.folder-tab { display: inline-flex; align-items: center; gap: 6px; height: 31px; padding: 0 10px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-size: 11px; white-space: nowrap; }
.folder-tab .icon { width: 14px; height: 14px; }
.folder-tab b { font-size: 9.5px; background: var(--panel-3); padding: 1px 5px; border-radius: 99px; }
.folder-tab:hover, .folder-tab.active { border-color: var(--accent); color: var(--accent); }
.folder-tab.active { background: var(--accent-soft); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 13px; margin-bottom: 14px; flex-wrap: wrap; }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.toolbar-meta b { color: var(--text); }
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }
.toolbar-sep { width: 1px; height: 22px; background: var(--line); }

/* ---------- folder banner ---------- */
.folder-banner { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 14px; border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line)); border-radius: 14px; background: linear-gradient(120deg, var(--accent-soft), transparent 65%), var(--panel); }
.folder-banner-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: #fff; }
.folder-banner h2 { margin: 1px 0 2px; font-size: 16px; }
.folder-banner p { margin: 0; font-size: 11px; color: var(--muted); }
.folder-banner-actions { margin-left: auto; display: flex; gap: 7px; }

/* ---------- tables ---------- */
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.data-table thead th { position: sticky; top: 0; z-index: 2; background: var(--panel-2); color: var(--muted); font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table tbody td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:hover td { background: color-mix(in srgb, var(--accent-soft) 42%, transparent); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table.compact tbody td { padding: 8px 10px; }
.data-table .num { text-align: right; white-space: nowrap; }
.data-table .check-cell { width: 38px; text-align: center; padding-right: 2px; }
.data-table input[type="checkbox"], #select-all, .group-check { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.table-panel { padding: 0; overflow: hidden; }
.table-scroll { overflow: auto; max-height: calc(100vh - 330px); }
.table-scroll.tall { max-height: calc(100vh - 290px); }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 15px; border-top: 1px solid var(--line); font-size: 10.5px; color: var(--muted); }
.actions-cell { text-align: right; white-space: nowrap; }
.actions-cell .icon-btn { margin-left: 3px; }
.order-id { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--accent); display: block; }
.order-id:hover { text-decoration: underline; }
.order-row td:first-child { border-left: 2px solid transparent; }
.order-row.selected td { background: var(--accent-soft) !important; }
.order-row.selected td:first-child { border-left-color: var(--accent); }

.product-cell { display: flex; align-items: center; gap: 9px; min-width: 240px; }
.product-cell.compact { min-width: 190px; }
.product-cell img, .order-photo { width: 40px; height: 48px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-3); flex: none; }
.order-photo.sm { width: 40px; height: 48px; }
.order-photo.xs { width: 30px; height: 36px; }
.product-cell > div { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.product-title, .product-cell strong { font-weight: 650; font-size: 11.5px; color: var(--text); line-height: 1.3; }
a.product-title:hover { color: var(--accent); }
.product-cell span { font-size: 10px; color: var(--muted); }
.product-cell small { font-size: 9px; color: var(--muted); font-family: var(--mono); }
.account-cell { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--text-soft); max-width: 140px; }
.account-cell span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-sticker { border: 0; background: var(--panel-3); color: var(--muted); font-family: var(--mono); font-size: 9px; padding: 3px 6px; border-radius: 5px; }
.copy-sticker:hover { color: var(--accent); background: var(--accent-soft); }
.sticker-code { font-family: var(--mono); font-size: 9.5px; background: var(--panel-3); padding: 2px 5px; border-radius: 4px; color: var(--text-soft); white-space: nowrap; }

.group-row td { background: var(--panel-2) !important; border-top: 1px solid var(--line-strong); }
.group-title { display: flex; align-items: center; gap: 10px; }
.group-title img { width: 38px; height: 46px; object-fit: cover; border-radius: 7px; }
.group-title > div { display: flex; flex-direction: column; gap: 1px; }
.group-title strong { font-size: 12.5px; }
.group-title span { font-size: 10px; color: var(--muted); }

/* ---------- bulkbar ---------- */
.bulkbar {
  position: fixed; left: 50%; bottom: 18px; transform: translate(-50%, 150%);
  z-index: 55; display: flex; align-items: center; gap: 12px;
  padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(18px);
  box-shadow: var(--shadow-lg); transition: transform .22s ease;
}
.bulkbar.visible { transform: translate(-50%, 0); }
.bulk-count { display: flex; align-items: baseline; gap: 4px; padding: 0 8px 0 5px; border-right: 1px solid var(--line); }
.bulk-count b { font-size: 17px; color: var(--accent); }
.bulk-count span { font-size: 10px; color: var(--muted); }
.bulk-actions { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

/* ---------- empty ---------- */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 50px 20px; text-align: center; color: var(--muted); }
.empty-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; background: var(--panel-3); color: var(--muted); }
.empty strong { color: var(--text); font-size: 14px; }
.empty p { margin: 0; font-size: 12px; max-width: 380px; }

/* ---------- supply detail ---------- */
.supply-hero { display: grid; grid-template-columns: 190px 1fr 270px; gap: 18px; padding: 16px; margin-bottom: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.supply-cover { position: relative; border-radius: 12px; overflow: hidden; min-height: 190px; background: var(--panel-3); }
.supply-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.supply-cover-badge { position: absolute; left: 8px; bottom: 8px; background: rgba(10, 10, 17, .74); color: #fff; font-size: 10px; font-weight: 700; padding: 4px 8px; border-radius: 99px; backdrop-filter: blur(8px); }
.supply-meta { display: flex; align-items: center; gap: 7px; font-size: 10.5px; flex-wrap: wrap; }
.supply-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }
.supply-chip { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px; min-width: 210px; }
.supply-chip > div { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.supply-chip strong { font-size: 10.5px; }
.supply-chip span { font-size: 9.5px; color: var(--muted); }
.caption-box { margin-top: 12px; padding: 10px; border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--panel-2); }
.caption-box label { display: block; font-size: 10.5px; font-weight: 650; margin-bottom: 5px; }
.caption-box small { display: block; margin-top: 4px; font-size: 9.5px; color: var(--muted); }
.inline-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-form input[type="text"], .inline-form .input { flex: 1; min-width: 140px; height: 32px; }
.supply-side { border-left: 1px solid var(--line); padding-left: 18px; display: flex; flex-direction: column; gap: 9px; }
.mini-kpi { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.mini-kpi span { font-size: 10.5px; color: var(--muted); }
.mini-kpi strong { font-size: 14px; }
.supply-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 4px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
.stack > .panel:last-child { margin-bottom: 0; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 16px 16px; }
.action-card { display: flex; flex-direction: column; gap: 3px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); transition: .15s; }
.action-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.action-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 3px; }
.action-icon.amber { background: var(--amber-soft); color: var(--amber); }
.action-card strong { font-size: 11.5px; }
.action-card small { font-size: 9.5px; color: var(--muted); }
.retained-list { padding: 0 16px 14px; display: flex; flex-direction: column; gap: 7px; }
.retained-item { display: flex; align-items: center; gap: 9px; padding: 7px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
.retained-item img { width: 32px; height: 38px; object-fit: cover; border-radius: 6px; filter: grayscale(.8); opacity: .8; }
.retained-item > div { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.retained-item strong { font-size: 10.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.retained-item small { font-size: 9px; color: var(--muted); }
.retained-list.compact .retained-item { border-style: dashed; }
.timeline { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 11px; }
.timeline-item { display: flex; gap: 9px; align-items: flex-start; }
.timeline-item > div { display: flex; flex-direction: column; gap: 1px; }
.timeline-item strong { font-size: 10.5px; font-weight: 600; }
.timeline-item small { font-size: 9px; color: var(--muted); }

/* ---------- supplies index ---------- */
.supply-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.supply-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 11px; }
.supply-card-head { display: flex; gap: 10px; align-items: flex-start; }
.supply-card-cover { width: 62px; height: 76px; border-radius: 10px; overflow: hidden; flex: none; background: var(--panel-3); display: grid; place-items: center; color: var(--muted); }
.supply-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.supply-card-head > div:nth-child(2) { flex: 1; min-width: 0; }
.supply-card h2 { margin: 2px 0 3px; font-size: 14px; line-height: 1.2; }
.supply-card h2 a:hover { color: var(--accent); }
.supply-card p { margin: 0; font-size: 10px; color: var(--muted); }
.supply-card-accounts { display: flex; gap: 5px; flex-wrap: wrap; }
.mini-account { display: inline-flex; align-items: center; gap: 4px; padding: 2px 5px 2px 2px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel-2); }
.mini-account b { font-size: 9px; color: var(--muted); }
.supply-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 9px; }
.supply-card-actions { display: flex; gap: 5px; }

/* ---------- picking ---------- */
.picking-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.picking-list { display: flex; flex-direction: column; gap: 8px; }
.pick-row { display: grid; grid-template-columns: 34px 86px minmax(0, 1fr) 62px 42px; align-items: center; gap: 12px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.pick-row:hover, .pick-row.active { border-color: var(--accent); }
.pick-row.done { opacity: .55; }
.pick-index { font-family: var(--mono); font-size: 11px; color: var(--muted); text-align: center; }
.pick-photo { width: 86px; height: 100px; border-radius: 9px; object-fit: cover; background: var(--panel-3); }
.pick-info { min-width: 0; }
.pick-info h2 { margin: 2px 0 3px; font-size: 14px; line-height: 1.25; }
.pick-info p { margin: 0 0 5px; font-size: 10px; color: var(--muted); }
.pick-info .eyebrow { display: flex; align-items: center; gap: 5px; text-transform: none; letter-spacing: 0; font-size: 9.5px; }
.pick-tags { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.pick-qty { text-align: center; }
.pick-qty strong { display: block; font-size: 26px; letter-spacing: -.04em; line-height: 1; }
.pick-qty span { font-size: 9px; color: var(--muted); }
.pick-check input { display: none; }
.pick-check span { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line-strong); display: grid; place-items: center; color: transparent; background: var(--panel-2); cursor: pointer; }
.pick-check span .icon { width: 19px; height: 19px; }
.pick-check input:checked + span { background: var(--green); border-color: var(--green); color: #fff; }
.picking-side .panel { position: sticky; top: 76px; }
.next-list { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.next-item { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 8px; }
.next-item:hover { background: var(--panel-2); }
.next-item img { width: 30px; height: 36px; object-fit: cover; border-radius: 6px; }
.next-item div { display: flex; flex-direction: column; min-width: 0; }
.next-item strong { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-item small { font-size: 9px; color: var(--muted); }
.voice-panel { padding: 16px; text-align: center; }
.voice-panel h3 { margin: 6px 0 4px; font-size: 14px; }
.voice-panel p { margin: 0 0 10px; font-size: 10.5px; color: var(--muted); }
.voice-panel .action-icon { margin: 0 auto 4px; }
.voice-status { margin-top: 8px; font-size: 9.5px; color: var(--muted); }

/* ---------- market mobile ---------- */
.market-body { background: #0f0e18; color: #f4f2ff; padding-bottom: 82px; max-width: 560px; margin: 0 auto; min-height: 100vh; }
.market-head { position: sticky; top: 0; z-index: 10; padding: 16px 16px 12px; background: linear-gradient(180deg, #1a1730, #14121f); border-bottom: 1px solid rgba(255, 255, 255, .08); }
.market-topline { display: flex; align-items: center; gap: 9px; }
.market-back { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: rgba(255, 255, 255, .07); color: #fff; transform: rotate(180deg); }
.market-topline .eyebrow { color: #9b95bd; letter-spacing: .08em; }
.market-sync { margin-left: auto; display: flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 9px; background: rgba(255, 255, 255, .07); padding: 4px 7px; border-radius: 99px; }
.market-head h1 { margin: 11px 0 10px; font-size: 23px; letter-spacing: -.03em; }
.market-progress { display: flex; align-items: center; gap: 10px; }
.market-progress-bar { flex: 1; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.market-progress-bar span { display: block; height: 100%; background: linear-gradient(90deg, #8b6cff, #e05bd8); transition: width .3s; }
.market-progress strong { font-size: 11px; color: #cfcae6; }
.market-tools { display: flex; gap: 5px; margin-top: 12px; overflow-x: auto; }
.market-tool { border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .05); color: #cfcae6; border-radius: 99px; padding: 5px 10px; font-size: 10.5px; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.market-tool .icon { width: 13px; height: 13px; }
.market-tool.active { background: #6c4cf1; border-color: #6c4cf1; color: #fff; }
.market-offline { display: inline-flex; align-items: center; gap: 3px; font-size: 9.5px; color: #f0b45a; margin-left: auto; }
.market-banner { margin: 10px 16px; padding: 9px 11px; border-radius: 10px; background: rgba(240, 180, 90, .14); color: #f0c982; font-size: 10.5px; border: 1px solid rgba(240, 180, 90, .3); }
.market-banner.blue { background: rgba(117, 164, 255, .13); color: #a9c4ff; border-color: rgba(117, 164, 255, .3); }
.market-list { display: flex; flex-direction: column; gap: 9px; padding: 14px 12px; }
.market-card { display: grid; grid-template-columns: 70px minmax(0, 1fr) 48px; gap: 10px; align-items: center; padding: 9px; border-radius: 14px; background: #1a1828; border: 1px solid rgba(255, 255, 255, .07); transition: .2s; }
.market-card img { width: 70px; height: 84px; object-fit: cover; border-radius: 10px; }
.market-card-info h2 { margin: 0 0 2px; font-size: 13px; line-height: 1.25; }
.market-card-info p { margin: 0 0 5px; font-size: 9.5px; color: #8f89ad; }
.market-card-meta { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.market-card-meta .badge { background: rgba(255, 255, 255, .08); color: #cfcae6; }
.market-card-meta .sticker-code { background: rgba(255, 255, 255, .07); color: #a9a3c8; }
.market-check { width: 44px; height: 44px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .04); color: transparent; display: grid; place-items: center; }
.market-check .icon { width: 24px; height: 24px; }
.market-card.bought { opacity: .55; }
.market-card.bought .market-check { background: #2bbd82; border-color: #2bbd82; color: #fff; }
.market-card.bought h2 { text-decoration: line-through; }
.market-foot { position: fixed; bottom: 0; left: 0; right: 0; margin: 0 auto; width: 100%; max-width: 560px; padding: 11px 16px calc(11px + env(safe-area-inset-bottom)); background: rgba(20, 18, 31, .94); backdrop-filter: blur(16px); border-top: 1px solid rgba(255, 255, 255, .09); display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 11px; color: #b8b2d1; z-index: 20; }
.market-foot > div { min-width: 0; white-space: nowrap; }
.market-foot .btn { flex: none; }
.market-foot strong { color: #fff; font-size: 15px; }

/* ---------- delivery ---------- */
.delivery-tools { display: flex; align-items: center; gap: 12px; padding: 12px 14px; flex-wrap: wrap; }
.delivery-tool-group { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.delivery-tool-group label { font-size: 10.5px; color: var(--muted); }
.sgtin-input { width: 190px; }
.date-input { width: 138px; }
.excluded-list { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.excluded-item { display: flex; align-items: center; gap: 9px; font-size: 10.5px; padding: 7px 9px; border: 1px dashed var(--line); border-radius: 8px; }
.excluded-item small { margin-left: auto; color: var(--muted); }
.delivery-bottom { margin-top: 0; }
.qr-block { display: flex; gap: 18px; align-items: center; padding: 4px 18px 18px; }
.qr-block img { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 5px; }
.qr-block p { font-size: 11px; color: var(--muted); margin: 4px 0 10px; }
.rule-list { list-style: none; margin: 0; padding: 0 18px 16px; display: flex; flex-direction: column; gap: 9px; }
.rule-list li { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-soft); }
.warn-box { display: flex; align-items: center; gap: 7px; margin: 0 14px 10px; padding: 9px 10px; border-radius: 9px; background: var(--amber-soft); color: var(--amber); font-size: 10.5px; }
.warn-box .icon { width: 16px; height: 16px; }

/* ---------- inventory / prices ---------- */
.inventory-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
.inventory-side { display: flex; flex-direction: column; }
.sticky-panel { position: sticky; top: 76px; }
.form-stack { display: flex; flex-direction: column; gap: 9px; padding: 0 16px 16px; }
.form-stack > label { display: flex; flex-direction: column; gap: 4px; font-size: 10.5px; color: var(--muted); }
.form-stack > label.check-line { flex-direction: row; align-items: center; gap: 8px; }
.plan-items { display: flex; flex-direction: column; gap: 5px; padding: 0 14px 12px; max-height: 320px; overflow: auto; }
.plan-item { display: flex; align-items: center; gap: 8px; padding: 6px 7px; border: 1px solid var(--line); border-radius: 8px; font-size: 10px; background: var(--panel-2); }
.plan-item strong { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-item .old { color: var(--muted); text-decoration: line-through; }
.plan-item .new { color: var(--green); font-weight: 700; }
.plan-item .new.zero { color: var(--red); }
.modal-foot.inline { border-top: 0; padding: 0 14px 14px; }
.history-list { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow: auto; }
.history-item { display: flex; align-items: flex-start; gap: 8px; }
.history-item > div { display: flex; flex-direction: column; min-width: 0; }
.history-item strong { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-item small { font-size: 9px; color: var(--muted); }
.order-pick-list { display: flex; flex-direction: column; gap: 4px; padding: 0 14px 12px; max-height: 290px; overflow: auto; }
.order-pick { display: flex; align-items: center; gap: 7px; padding: 5px; border-radius: 7px; cursor: pointer; }
.order-pick:hover { background: var(--panel-2); }
.order-pick input { accent-color: var(--accent); }
.order-pick img { width: 26px; height: 32px; object-fit: cover; border-radius: 5px; }
.order-pick span { display: flex; flex-direction: column; min-width: 0; }
.order-pick strong { font-size: 9.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-pick small { font-size: 8.5px; color: var(--muted); }

/* ---------- photos ---------- */
.export-row { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 16px 16px; }
.export-chip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); min-width: 240px; }
.export-chip > div { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.export-chip strong { font-size: 10.5px; }
.export-chip small { font-size: 9px; color: var(--muted); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 13px; }
.photo-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.photo-main { position: relative; aspect-ratio: 4 / 5; background: var(--panel-3); overflow: hidden; }
.photo-main img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.photo-card:hover .photo-main img { transform: scale(1.03); }
.photo-badge, .photo-account { position: absolute; top: 8px; padding: 4px 6px; border-radius: 7px; background: rgba(10, 10, 17, .68); backdrop-filter: blur(8px); }
.photo-badge { left: 8px; color: #fff; font-size: 9px; font-weight: 700; }
.photo-account { right: 8px; padding: 2px; }
.photo-info { padding: 9px 10px 5px; display: flex; flex-direction: column; gap: 1px; }
.photo-info strong { font-size: 11px; line-height: 1.25; }
.photo-info span { font-size: 9px; color: var(--muted); }
.photo-info small { font-size: 8.5px; color: var(--muted); font-family: var(--mono); }
.photo-thumbs { display: flex; gap: 4px; padding: 6px 10px 10px; }
.photo-thumb { flex: 1; aspect-ratio: 1; border-radius: 6px; overflow: hidden; border: 2px solid transparent; padding: 0; background: var(--panel-3); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb.active { border-color: var(--accent); }
.photo-thumb:hover { border-color: var(--accent); }

/* ---------- finance ---------- */
.finance-tabs { justify-content: space-between; }
.kpi-grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 15px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.kpi span { font-size: 10px; color: var(--muted); font-weight: 600; }
.kpi strong { font-size: 23px; letter-spacing: -.03em; line-height: 1.1; }
.kpi small { font-size: 9.5px; color: var(--muted); }
.kpi.primary-kpi { background: linear-gradient(140deg, #1b1730, #2a1d53); border-color: #3b2e66; color: #fff; }
.kpi.primary-kpi span, .kpi.primary-kpi small { color: #b9b2d8; }
.kpi.accent-green strong { color: var(--green); }
.finance-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 16px; }
.chart { display: flex; align-items: flex-end; gap: 4px; height: 190px; padding: 14px 18px 0; }
.chart-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.chart-bar { width: 100%; max-width: 22px; background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 42%, transparent)); border-radius: 4px 4px 2px 2px; transition: .2s; }
.chart-col:hover .chart-bar { background: linear-gradient(180deg, var(--accent-2), var(--accent)); }
.chart-col small { font-size: 8px; color: var(--muted); white-space: nowrap; }
.chart-legend { display: flex; align-items: center; justify-content: space-between; padding: 10px 18px 14px; font-size: 10px; color: var(--muted); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; }
.dot.violet { background: var(--accent); }
.state-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 0 16px 12px; }
.state-card { display: flex; align-items: center; gap: 8px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
.state-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.state-dot.onway { background: var(--blue); }
.state-dot.pvz { background: var(--green); }
.state-dot.assembly { background: var(--pink); }
.state-dot.warehouse { background: var(--amber); }
.state-card div { display: flex; flex-direction: column; flex: 1; }
.state-card strong { font-size: 14px; line-height: 1.1; }
.state-card small { font-size: 8.5px; color: var(--muted); }
.state-card b { font-size: 9px; color: var(--muted); }
.formula { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 4px; }
.formula > div { display: flex; justify-content: space-between; gap: 10px; font-size: 10px; color: var(--muted); padding: 3px 0; border-bottom: 1px dashed var(--line); }
.formula b { color: var(--text-soft); font-weight: 600; }
.formula-total { border-bottom: 0 !important; border-top: 1px solid var(--line-strong); padding-top: 7px !important; }
.formula-total span, .formula-total b { color: var(--text); font-size: 12px; font-weight: 750; }
.finance-rules { padding: 0 16px; }
.finance-rule { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.finance-rule > div { display: flex; flex-direction: column; flex: 1; }
.finance-rule strong { font-size: 10.5px; }
.finance-rule small { font-size: 9px; color: var(--muted); }
.finance-rule b { font-size: 11px; }
.rule-add { padding: 12px 16px 16px; }
.rule-add .input { height: 31px; }
.balance-list { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 7px; }
.balance-item { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.balance-item div { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.balance-item strong { font-size: 10.5px; }
.balance-item small { font-size: 9px; color: var(--muted); }
.balance-item b { font-size: 11px; }

/* ---------- cabinets ---------- */
.accounts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 14px; }
.account-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 11px; }
.account-card.archived { opacity: .65; }
.account-card-head { display: flex; align-items: flex-start; gap: 10px; }
.account-card-head div { flex: 1; min-width: 0; }
.account-card h2 { margin: 0 0 2px; font-size: 14px; }
.account-card p { margin: 0 0 2px; font-size: 10px; color: var(--muted); }
.account-card small { font-size: 9px; color: var(--muted); }
.token-list { display: flex; flex-direction: column; gap: 5px; }
.token-row { display: flex; align-items: center; gap: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.token-role { font-size: 8px; font-weight: 750; text-transform: uppercase; padding: 3px 5px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); letter-spacing: .04em; }
.token-role.prices { background: var(--blue-soft); color: var(--blue); }
.token-role.feedback { background: var(--pink-soft); color: var(--pink); }
.token-role.reserve { background: var(--panel-3); color: var(--muted); }
.token-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.token-info strong { font-size: 10px; }
.token-info small { font-size: 8.5px; color: var(--muted); }
.account-card-foot { display: flex; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.warning-panel { display: flex; gap: 12px; align-items: flex-start; padding: 15px 16px; }
.warning-panel h3 { margin: 0 0 3px; font-size: 13px; }
.warning-panel p { margin: 0; font-size: 11px; color: var(--muted); }

/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.setting-row > div { display: flex; flex-direction: column; }
.setting-row strong { font-size: 11.5px; }
.setting-row small { font-size: 9.5px; color: var(--muted); }
.switch { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.switch input { display: none; }
.switch-track { width: 38px; height: 22px; border-radius: 99px; background: var(--line-strong); position: relative; transition: .18s; flex: none; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: .18s; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch-label { font-size: 11px; color: var(--text-soft); }
.info-list { padding: 0 16px 12px; display: flex; flex-direction: column; gap: 6px; }
.info-list > div { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.info-list span { color: var(--muted); }
.shortcut-list { padding: 0 16px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.shortcut-list > div { display: flex; align-items: center; gap: 7px; font-size: 10.5px; color: var(--muted); }
kbd { font-family: var(--mono); font-size: 9px; padding: 3px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--panel-2); color: var(--text-soft); }
.roadmap { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 7px; }
.roadmap-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; }
.roadmap-item > span { width: 28px; height: 24px; display: grid; place-items: center; border-radius: 6px; background: var(--panel-3); color: var(--muted); font-size: 9px; font-weight: 750; flex: none; }
.roadmap-item.done > span { background: var(--green-soft); color: var(--green); }
.roadmap-item div { display: flex; flex-direction: column; }
.roadmap-item strong { font-size: 11px; }
.roadmap-item small { font-size: 9.5px; color: var(--muted); }

/* ---------- drawer / modal / toasts ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(10, 10, 17, .42); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: .2s; z-index: 60; }
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 380px; max-width: 92vw; background: var(--panel); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); transform: translateX(105%); transition: transform .24s ease; z-index: 61; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 16px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { margin: 2px 0 0; font-size: 16px; }
.drawer-body { padding: 14px 16px; overflow: auto; flex: 1; }
.drawer-title { margin: 8px 0 9px; font-size: 10px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.op-list, .event-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.op-item { display: flex; align-items: flex-start; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
.op-item > div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.op-item strong { font-size: 10px; font-weight: 600; }
.op-item small { font-size: 8.5px; color: var(--muted); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 4px; flex: none; background: var(--muted); }
.status-dot.complete { background: var(--green); }
.status-dot.running { background: var(--amber); animation: pulse 1.6s infinite; }
.status-dot.failed, .status-dot.needs_review { background: var(--red); }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--amber) 22%, transparent); } }
.progress { height: 3px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 3px; }
.progress span { display: block; height: 100%; background: var(--accent); }
.event-item { display: flex; align-items: flex-start; gap: 8px; }
.event-icon { width: 27px; height: 27px; border-radius: 8px; display: grid; place-items: center; background: var(--panel-3); color: var(--muted); flex: none; }
.event-icon .icon { width: 14px; height: 14px; }
.event-icon.sync { background: var(--blue-soft); color: var(--blue); }
.event-icon.stickers, .event-icon.photos { background: var(--pink-soft); color: var(--pink); }
.event-icon.inventory, .event-icon.stock { background: var(--green-soft); color: var(--green); }
.event-icon.delivery, .event-icon.supplies { background: var(--accent-soft); color: var(--accent); }
.event-icon.finance { background: var(--amber-soft); color: var(--amber); }
.event-item > div { display: flex; flex-direction: column; }
.event-item strong { font-size: 10px; font-weight: 600; }
.event-item small { font-size: 8.5px; color: var(--muted); }
.event-list.wide { padding: 0 16px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.modal { border: 0; padding: 0; background: transparent; max-width: 520px; width: calc(100% - 32px); color: var(--text); }
.modal::backdrop { background: rgba(9, 9, 16, .55); backdrop-filter: blur(3px); }
.modal-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 2px 0 0; font-size: 17px; }
.modal-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.modal-body label { display: flex; flex-direction: column; gap: 4px; font-size: 10.5px; color: var(--muted); }
.modal-foot { display: flex; justify-content: flex-end; gap: 7px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--panel-2); }

.toast-stack { position: fixed; right: 18px; bottom: 84px; z-index: 100; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; padding: 10px 13px; border-radius: 10px; background: var(--text); color: var(--panel); font-size: 11.5px; box-shadow: var(--shadow-lg); animation: toast-in .22s ease; max-width: 340px; }
.toast.error { background: var(--red); color: #fff; }
.toast.success { background: var(--green); color: #fff; }
.toast .icon { width: 15px; height: 15px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.flash-strip { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 90; padding: 8px 14px; border-radius: 9px; background: var(--text); color: var(--panel); font-size: 11px; box-shadow: var(--shadow-lg); }

/* ---------- print ---------- */
.print-body { background: #fff; color: #111; padding: 16px; font-family: var(--font); }
.print-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; margin-bottom: 16px; border: 1px solid #ddd; border-radius: 10px; background: #f7f7fb; }
.print-toolbar > div { display: flex; align-items: center; gap: 10px; }
.print-toolbar strong { font-size: 13px; }
.print-toolbar span { font-size: 10px; color: #777; }
.stickers-grid { display: grid; grid-template-columns: repeat(auto-fill, 58mm); gap: 4mm; }
.sticker { width: var(--sw, 58mm); height: var(--sh, 40mm); border: 1px dashed #bbb; border-radius: 2mm; padding: 2mm; display: flex; flex-direction: column; justify-content: space-between; background: #fff; overflow: hidden; }
.sticker-top { display: flex; align-items: center; justify-content: space-between; font-size: 6pt; }
.sticker-brand { font-weight: 800; letter-spacing: .04em; }
.sticker-wb { font-family: var(--mono); font-size: 5.5pt; color: #555; }
.barcode { display: flex; align-items: stretch; height: 11mm; gap: 1px; padding: 0 1mm; }
.barcode i { display: block; background: #000; height: 100%; }
.sticker-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 2mm; }
.sticker-foot > div:first-child { display: flex; flex-direction: column; min-width: 0; }
.sticker-foot strong { font-size: 9pt; }
.sticker-foot span { font-size: 5.5pt; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42mm; }
.sticker-account { width: 6mm; height: 6mm; border-radius: 1mm; background: #111; color: #fff; display: grid; place-items: center; font-size: 5pt; font-weight: 800; }
.picking-print { padding: 8mm; }
.print-head { display: flex; align-items: flex-end; justify-content: space-between; border-bottom: 2px solid #111; padding-bottom: 4mm; margin-bottom: 4mm; }
.print-head h1 { margin: 2px 0 0; font-size: 20pt; }
.print-head-meta { text-align: right; display: flex; flex-direction: column; gap: 1mm; font-size: 8pt; color: #555; }
.print-caption { display: inline-block; background: #d11; color: #fff; padding: 1mm 2mm; font-weight: 700; }
.print-table { width: 100%; border-collapse: collapse; font-size: 8pt; }
.print-table th { text-align: left; background: #f2f2f5; padding: 2mm; border-bottom: 1px solid #999; font-size: 7pt; text-transform: uppercase; letter-spacing: .04em; }
.print-table td { padding: 1.6mm 2mm; border-bottom: 1px solid #ddd; vertical-align: middle; }
.print-table img { width: 10mm; height: 13mm; object-fit: cover; border-radius: 1mm; }
.print-table .qty { text-align: center; font-size: 13pt; font-weight: 800; }
.print-table .check-col { width: 10mm; }
.print-table tbody tr:nth-child(even) { background: #fbfbfd; }
.print-foot { display: flex; justify-content: space-between; gap: 6mm; margin-top: 5mm; padding-top: 3mm; border-top: 1px solid #999; font-size: 8pt; }
@media print {
  .no-print { display: none !important; }
  .print-body { padding: 0; }
  .sticker { break-inside: avoid; }
  .print-table tr { break-inside: avoid; }
}

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .stats-grid.four { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .finance-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .supply-hero { grid-template-columns: 170px 1fr; }
  .supply-side { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); padding: 12px 0 0; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .supply-side .mini-kpi { border: 0; padding: 0 14px 0 0; gap: 6px; }
  .supply-actions { margin-left: auto; grid-template-columns: repeat(4, auto); }
}

@media (max-width: 1100px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-105%); transition: transform .22s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .mobile-only { display: inline-grid; }
  .content { padding: 20px 18px 90px; }
  .picking-layout { grid-template-columns: 1fr; }
  .picking-side .panel { position: static; }
  .inventory-layout { grid-template-columns: 1fr; }
  .sticky-panel { position: static; }
  .inventory-side { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
  .inventory-side .panel { margin-bottom: 0; }
  .pick-row { grid-template-columns: 28px 70px minmax(0, 1fr) 52px 36px; }
  .pick-photo { width: 70px; height: 84px; }
}

@media (max-width: 800px) {
  .topbar { padding: 0 14px; height: 56px; }
  .crumbs { display: none; }
  .sync-text { display: none; }
  .account-chip-text { display: none; }
  .content { padding: 16px 12px 90px; }
  .page-head { flex-direction: column; gap: 12px; }
  .page-head h1 { font-size: 24px; }
  .head-actions { justify-content: flex-start; width: 100%; }
  .stats-grid, .stats-grid.three, .stats-grid.four { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 11px; }
  .stat-text strong { font-size: 18px; }
  .tabs { overflow-x: auto; }
  .tab { padding: 0 8px; }
  .folder-tabs { display: none; }
  .bulkbar { left: 8px; right: 8px; bottom: 8px; transform: translate(0, 150%); overflow-x: auto; max-width: calc(100vw - 16px); }
  .bulkbar.visible { transform: none; }
  .bulk-actions { flex-wrap: nowrap; }
  .table-scroll { max-height: none; }
  .supply-hero { grid-template-columns: 1fr; }
  .supply-cover { min-height: 150px; max-height: 210px; }
  .supply-side { flex-wrap: wrap; }
  .supply-actions { margin-left: 0; grid-template-columns: 1fr 1fr; width: 100%; }
  .grid-2, .finance-grid, .inventory-side { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .chart { height: 140px; }
  .accounts-grid, .supply-grid { grid-template-columns: 1fr; }
  .event-list.wide { grid-template-columns: 1fr; }
  .pick-row { grid-template-columns: 24px 60px minmax(0, 1fr) 38px; }
  .pick-check { display: none; }
  .pick-photo { width: 60px; height: 74px; }
  .pick-qty strong { font-size: 20px; }
  .delivery-tools { align-items: flex-start; }
  .qr-block { flex-direction: column; align-items: flex-start; }
  .settings-grid { grid-template-columns: 1fr; }
  .drawer { width: 100%; max-width: 100%; }
}

@media (max-width: 520px) {
  .stats-grid, .stats-grid.three, .stats-grid.four, .kpi-grid { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 22px; }
  .toolbar { align-items: flex-start; }
  .filters { width: 100%; }
  .search-field { min-width: 100%; }
  .filters .select { flex: 1; min-width: 130px; }
  .pick-row { grid-template-columns: 1fr; gap: 6px; }
  .pick-index, .pick-photo { display: none; }
  .pick-qty { text-align: left; }
  .pick-qty strong { display: inline; font-size: 18px; margin-right: 4px; }
  .photo-grid { grid-template-columns: 1fr 1fr; }
  .supply-actions { grid-template-columns: 1fr; }
  .shortcut-list { grid-template-columns: 1fr; }
}
