/* Edge Retail — склад. Токены → компоненты → страницы. */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-hover: #f1f3f6;
  --border: #e5e7ec;
  --border-strong: #d4d8e0;
  --text: #0e1218;
  --text-2: #3b4250;
  --muted: #6b7382;
  --faint: #9aa1ae;

  --accent: #2f5bff;
  --accent-hover: #2149e6;
  --accent-soft: #eaefff;
  --accent-text: #1d44d8;

  --green: #0f9d6b;  --green-soft: #e3f6ee;
  --red: #e0384b;    --red-soft: #fdebed;
  --amber: #c27803;  --amber-soft: #fdf3dc;
  --blue: #2f5bff;   --blue-soft: #eaefff;
  --violet: #7a4cf0; --violet-soft: #f0eafe;
  --grey: #6b7382;   --grey-soft: #eef0f3;

  --side-bg: #0b0e14;
  --side-text: #a7afbd;
  --side-text-hi: #ffffff;
  --side-hover: rgba(255, 255, 255, .06);
  --side-active: rgba(47, 91, 255, .18);
  --side-border: rgba(255, 255, 255, .07);

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, .22), 0 4px 12px rgba(16, 24, 40, .06);

  --radius: 12px;
  --radius-sm: 8px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --side-w: 248px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0a0d12;
  --surface: #11151c;
  --surface-2: #151a22;
  --surface-hover: #1a2029;
  --border: #212833;
  --border-strong: #2c3441;
  --text: #eef1f6;
  --text-2: #c3cad6;
  --muted: #8a93a3;
  --faint: #5d6675;

  --accent: #4d74ff;
  --accent-hover: #6687ff;
  --accent-soft: rgba(77, 116, 255, .14);
  --accent-text: #8ea6ff;

  --green: #2fca8e;  --green-soft: rgba(47, 202, 142, .13);
  --red: #ff5d6e;    --red-soft: rgba(255, 93, 110, .13);
  --amber: #f0b13d;  --amber-soft: rgba(240, 177, 61, .13);
  --blue: #6d8cff;   --blue-soft: rgba(109, 140, 255, .14);
  --violet: #a487ff; --violet-soft: rgba(164, 135, 255, .14);
  --grey: #8a93a3;   --grey-soft: rgba(138, 147, 163, .14);

  --side-bg: #07090d;
  --shadow-sm: none;
  --shadow: 0 0 0 1px rgba(255, 255, 255, .02);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-text); text-decoration: none; }
.num, .tnum, td.r, th.r { font-variant-numeric: tabular-nums; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8;
        stroke-linecap: round; stroke-linejoin: round; }

/* ─── Каркас ─────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--side-bg); color: var(--side-text);
  display: flex; flex-direction: column; padding: 18px 12px 12px;
  border-right: 1px solid var(--side-border);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 20px; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
              background: linear-gradient(135deg, #2f5bff 0%, #6b3bff 100%);
              box-shadow: 0 6px 18px -6px rgba(63, 91, 255, .8), inset 0 1px 0 rgba(255,255,255,.25); }
.brand-mark svg { width: 18px; height: 18px; }
.brand-name { color: var(--side-text-hi); font-weight: 700; font-size: 15px; letter-spacing: -.01em; line-height: 1.15; }
.brand-sub { font-size: 11.5px; color: #6f7888; letter-spacing: .02em; }

.nav-group { margin-top: 14px; }
.nav-title { font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
             color: #586172; padding: 0 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 12px; margin: 1px 0;
  border-radius: 8px; color: var(--side-text); font-weight: 500; font-size: 13.5px;
  transition: background .12s, color .12s;
}
.nav a:hover { background: var(--side-hover); color: var(--side-text-hi); }
.nav a.active { background: var(--side-active); color: var(--side-text-hi); }
.nav a.active svg.i { color: #7f9bff; }
.nav .badge { margin-left: auto; background: #2f5bff; color: #fff; font-size: 11px; font-weight: 600;
              min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; }
.nav .badge.warn { background: #f0b13d; color: #1d1400; }

.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--side-border); }
.me { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
          background: #1c2230; color: #c9d3ff; font-weight: 600; font-size: 13px; }
.me-name { color: var(--side-text-hi); font-weight: 600; font-size: 13px; line-height: 1.2; }
.me-role { font-size: 11.5px; color: #6f7888; }
.me-actions { margin-left: auto; display: flex; gap: 2px; }
.icon-btn { width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; cursor: pointer;
            display: grid; place-items: center; color: inherit; }
.side .icon-btn:hover { background: var(--side-hover); color: #fff; }

.main { min-width: 0; padding: 28px 36px 60px; max-width: 1480px; width: 100%; }
.topbar-mobile { display: none; }

/* ─── Заголовок страницы ─────────────────────────────────── */
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.page-head .sub { color: var(--muted); margin-top: 3px; font-size: 13.5px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ─── Кнопки и поля ──────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface);
  font-weight: 550; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-sm); transition: background .12s, border-color .12s, transform .05s;
}
.btn:hover { background: var(--surface-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg.i { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff;
               box-shadow: 0 1px 2px rgba(47, 91, 255, .3), inset 0 1px 0 rgba(255,255,255,.15); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.success { background: var(--green); border-color: var(--green); color: #fff; }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-hover); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; font-weight: 550; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.input, select.input, textarea.input {
  height: 38px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--border-strong);
  background: var(--surface); outline: none; width: 100%; transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; min-height: 76px; padding: 9px 12px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.sm { height: 32px; padding: 0 10px; font-size: 13px; }
.input::placeholder { color: var(--faint); }
.search { position: relative; }
.search svg.i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); pointer-events: none; }
.search .input { padding-left: 34px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ─── Сегменты / табы ────────────────────────────────────── */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--grey-soft); border-radius: 10px; }
.seg button { border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 8px;
              font-size: 13px; font-weight: 550; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg .cnt { font-size: 11.5px; color: var(--faint); font-weight: 600; }
.seg button.on .cnt { color: var(--accent-text); }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search { width: 280px; }

/* ─── Карточки и метрики ─────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 0; }
.card-head h3 { margin: 0; font-size: 14.5px; font-weight: 650; letter-spacing: -.005em; }
.card-head .more { margin-left: auto; font-size: 13px; font-weight: 550; }
.card-body { padding: 14px 18px 18px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis.k5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi { padding: 16px 18px; position: relative; overflow: hidden; }
.kpi-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; font-weight: 550; }
.kpi-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; }
.kpi-ico svg.i { width: 15px; height: 15px; }
.kpi-value { font-size: 25px; font-weight: 700; letter-spacing: -.025em; margin-top: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value small { font-size: 15px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.kpi-foot { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.tone-blue .kpi-ico { background: var(--blue-soft); color: var(--blue); }
.tone-green .kpi-ico { background: var(--green-soft); color: var(--green); }
.tone-amber .kpi-ico { background: var(--amber-soft); color: var(--amber); }
.tone-violet .kpi-ico { background: var(--violet-soft); color: var(--violet); }
.tone-red .kpi-ico { background: var(--red-soft); color: var(--red); }

.hero {
  position: relative; overflow: hidden; border-radius: 16px; padding: 24px 26px; margin-bottom: 18px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #6b3bff 0%, rgba(107,59,255,0) 55%),
              linear-gradient(120deg, #1638d9 0%, #2f5bff 55%, #4b6dff 100%);
  box-shadow: 0 18px 40px -18px rgba(47, 91, 255, .6);
}
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 28px 28px; mask-image: linear-gradient(90deg, transparent 30%, #000 100%); }
.hero h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.hero p { margin: 4px 0 0; opacity: .8; }
.hero-stats { display: flex; gap: 34px; margin-top: 20px; position: relative; z-index: 1; flex-wrap: wrap; }
.hero-stat .l { font-size: 12px; opacity: .75; font-weight: 500; }
.hero-stat .v { font-size: 26px; font-weight: 700; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }

.dash { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 18px; }
.dash > div { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* Внимание */
.attn { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.attn a { display: block; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); transition: border-color .12s, background .12s; }
.attn a:hover { border-color: var(--accent); background: var(--accent-soft); }
.attn .n { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.attn .t { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }

/* Полоски-рейтинги */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row .top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 5px; }
.bar-row .top b { font-weight: 600; font-variant-numeric: tabular-nums; }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 7px; border-radius: 4px; background: var(--grey-soft); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), #7a4cf0); }

/* Пончик статусов */
.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut { width: 128px; height: 128px; border-radius: 50%; flex: none; position: relative; }
.donut::after { content: ""; position: absolute; inset: 18px; border-radius: 50%; background: var(--surface); }
.donut .c { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; text-align: center; }
.donut .c b { font-size: 22px; display: block; line-height: 1; }
.donut .c span { font-size: 11.5px; color: var(--muted); }
.legend { display: flex; flex-direction: column; gap: 8px; font-size: 13px; flex: 1; }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend b { margin-left: auto; font-variant-numeric: tabular-nums; }

/* ─── Таблицы ────────────────────────────────────────────── */
.table-card { overflow: hidden; }
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; }
.t th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em;
        padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.t td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.t tbody tr:last-child td { border-bottom: 0; }
.t tbody tr.click { cursor: pointer; transition: background .08s; }
.t tbody tr.click:hover td { background: var(--surface-hover); }
.t .r { text-align: right; }
.t .c { text-align: center; }
.t tfoot td { background: var(--surface-2); font-weight: 650; border-top: 1px solid var(--border); border-bottom: 0; }
.t .id { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 550; }
.t .strong { font-weight: 600; }
.t .w-name { min-width: 240px; }
.cell-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.t.compact td { padding: 9px 12px; }
.t.compact th { padding: 9px 12px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.pos { color: var(--green); }
.neg { color: var(--red); }
.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 12.5px; }

/* ─── Пилюли статусов ────────────────────────────────────── */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 12px;
        font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }
.p-blue { background: var(--blue-soft); color: var(--blue); }
.p-green { background: var(--green-soft); color: var(--green); }
.p-amber { background: var(--amber-soft); color: var(--amber); }
.p-red { background: var(--red-soft); color: var(--red); }
.p-grey { background: var(--grey-soft); color: var(--grey); }
.p-violet { background: var(--violet-soft); color: var(--violet); }
.tag { display: inline-block; padding: 2px 7px; border-radius: 6px; background: var(--grey-soft); color: var(--text-2); font-size: 11.5px; font-weight: 550; }

/* ─── Пусто / загрузка ───────────────────────────────────── */
.empty { padding: 56px 20px; text-align: center; color: var(--muted); }
.empty .ico { width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 14px; background: var(--grey-soft); display: grid; place-items: center; color: var(--faint); }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 3px; }
.skeleton { background: linear-gradient(90deg, var(--grey-soft) 0%, var(--surface-hover) 50%, var(--grey-soft) 100%); background-size: 200% 100%;
            animation: sk 1.2s infinite linear; border-radius: 8px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.loading { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.loading .skeleton { height: 18px; }

/* ─── Дровер и модалка ───────────────────────────────────── */
.overlay { position: fixed; inset: 0; background: rgba(8, 11, 18, .45); backdrop-filter: blur(2px); z-index: 40; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); background: var(--surface); z-index: 41;
          box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .2s cubic-bezier(.2,.8,.2,1); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 16px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { margin: 0; font-size: 19px; letter-spacing: -.015em; }
.drawer-head .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.drawer-head .icon-btn { margin-left: auto; color: var(--muted); }
.drawer-head .icon-btn:hover, .modal-head .icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px 24px; display: flex; flex-direction: column; gap: 18px; }
.drawer-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-wrap: wrap; background: var(--surface-2); }

.modal-host { position: fixed; inset: 0; z-index: 51; display: grid; place-items: center; padding: 20px; overflow-y: auto; }
.modal-host .overlay { z-index: 50; }
.modal { position: relative; z-index: 51; background: var(--surface); border-radius: 16px; width: min(560px, 100%); box-shadow: var(--shadow-lg);
         animation: pop .18s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
.modal.wide { width: min(880px, 100%); }
@keyframes pop { from { transform: scale(.97) translateY(6px); opacity: 0; } }
.modal-head { display: flex; align-items: center; padding: 18px 22px 0; }
.modal-head h2 { margin: 0; font-size: 18px; letter-spacing: -.015em; }
.modal-head .icon-btn { margin-left: auto; color: var(--muted); }
.modal-body { padding: 18px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 14px 22px 18px; display: flex; justify-content: flex-end; gap: 8px; }
.form-error { background: var(--red-soft); color: var(--red); padding: 10px 12px; border-radius: 9px; font-size: 13px; font-weight: 500; }

.dl { display: grid; grid-template-columns: 150px 1fr; gap: 9px 14px; font-size: 13.5px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 500; }
.section-title { font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.sum-box { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); border-radius: 11px; overflow: hidden; }
.sum-box > div { padding: 12px 14px; border-right: 1px solid var(--border); }
.sum-box > div:last-child { border-right: 0; }
.sum-box .l { font-size: 12px; color: var(--muted); }
.sum-box .v { font-size: 17px; font-weight: 700; letter-spacing: -.015em; font-variant-numeric: tabular-nums; margin-top: 2px; }

.steps { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--faint); font-weight: 550; }
.steps .s { display: flex; align-items: center; gap: 6px; }
.steps .s i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--grey-soft); font-style: normal; font-size: 11px; }
.steps .s.done { color: var(--text-2); }
.steps .s.done i { background: var(--accent); color: #fff; }
.steps .line { width: 26px; height: 2px; background: var(--border-strong); border-radius: 1px; }
.steps .line.done { background: var(--accent); }

.token-box { background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 10px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; }
.token-box code { flex: 1; word-break: break-all; white-space: pre-wrap; font-size: 13px; }

/* Комбобокс */
.combo { position: relative; }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border-strong);
              border-radius: 10px; box-shadow: var(--shadow-lg); max-height: 280px; overflow-y: auto; z-index: 60; padding: 4px; }
.combo-item { padding: 8px 10px; border-radius: 7px; cursor: pointer; display: flex; gap: 10px; align-items: center; }
.combo-item:hover, .combo-item.hi { background: var(--accent-soft); }
.combo-item .meta { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.combo-empty { padding: 12px; color: var(--muted); font-size: 13px; }

/* Редактор позиций */
.lines { border: 1px solid var(--border); border-radius: 11px; overflow: hidden; }
.lines table { width: 100%; border-collapse: collapse; }
.lines th { font-size: 11.5px; color: var(--muted); font-weight: 600; text-align: left; padding: 8px 10px; background: var(--surface-2); border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: .04em; }
.lines td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.lines tr:last-child td { border-bottom: 0; }
.lines .input.sm { min-width: 0; }
.lines-add { padding: 10px; background: var(--surface-2); border-top: 1px solid var(--border); }
.lines-total { display: flex; justify-content: flex-end; gap: 18px; padding: 10px 12px; font-size: 13.5px; }
.lines-total b { font-size: 16px; font-variant-numeric: tabular-nums; }

/* ─── Тосты ──────────────────────────────────────────────── */
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #11151c; color: #fff; padding: 11px 16px; border-radius: 11px; font-size: 13.5px; box-shadow: var(--shadow-lg);
         display: flex; align-items: center; gap: 10px; max-width: 420px; animation: pop .18s ease; }
.toast.err { background: #b4232f; }
.toast svg.i { width: 16px; height: 16px; }

/* ─── Вход ───────────────────────────────────────────────── */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: #07090d; color: #fff; padding: 48px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.login-art::before { content: ""; position: absolute; width: 760px; height: 760px; right: -260px; bottom: -300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(47,91,255,.55) 0%, rgba(107,59,255,.25) 40%, transparent 70%); filter: blur(10px); }
.login-art::after { content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 40px 40px; mask-image: radial-gradient(ellipse at 70% 80%, #000 0%, transparent 70%); }
.login-art > * { position: relative; z-index: 1; }
.login-art h1 { font-size: 44px; line-height: 1.05; letter-spacing: -.035em; margin: auto 0 16px; max-width: 520px; }
.login-art p { color: #9aa3b4; font-size: 16px; max-width: 440px; margin: 0 0 28px; }
.login-feats { display: flex; gap: 10px; flex-wrap: wrap; }
.login-feats span { border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); padding: 7px 12px; border-radius: 20px; font-size: 13px; color: #c7cfdd; }
.login-form { display: grid; place-items: center; padding: 40px; background: var(--surface); }
.login-form form { width: min(380px, 100%); display: flex; flex-direction: column; gap: 16px; }
.login-form h2 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.login-form .sub { color: var(--muted); margin-top: -8px; }
.login-form .btn { height: 42px; justify-content: center; }

/* ─── Адаптив ────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .kpis, .kpis.k5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 45; left: 0; width: 270px; transform: translateX(-100%); transition: transform .2s; }
  .shell.nav-open .side { transform: none; box-shadow: var(--shadow-lg); }
  .topbar-mobile { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--side-bg); color: #fff; position: sticky; top: 0; z-index: 30; }
  .topbar-mobile .icon-btn { color: #fff; }
  .main { padding: 18px 16px 48px; }
  .attn { grid-template-columns: repeat(2, 1fr); }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .toolbar .search { width: 100%; }
  .sum-box { grid-template-columns: repeat(2, 1fr); }
  .sum-box > div:nth-child(2) { border-right: 0; }
  .sum-box > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}
@media (max-width: 520px) {
  .kpis, .kpis.k3, .kpis.k5 { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dd { margin-bottom: 8px; }
}

/* ─── Тёмные кнопки, переключатель, аватары ──────────────── */
.btn.dark { background: #0e1218; border-color: #0e1218; color: #fff; }
.btn.dark:hover { background: #262c36; border-color: #262c36; }
:root[data-theme="dark"] .btn.dark { background: #eef1f6; border-color: #eef1f6; color: #0e1218; }
:root[data-theme="dark"] .btn.dark:hover { background: #fff; }
.btn.block { width: 100%; justify-content: center; height: 42px; }
.btn.sq { width: 32px; padding: 0; justify-content: center; }
.pill.outline { background: transparent; border: 1px solid currentColor; height: 24px; }
.pill.p-green.outline { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.pill.p-red.outline { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.pill.p-grey.outline { border-color: var(--border-strong); }

.cp-ava { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; font-weight: 700;
          background: #eef9d9; color: #4d8a0f; flex: none; }
:root[data-theme="dark"] .cp-ava { background: rgba(140, 200, 60, .14); color: #9fd65a; }
.cp-ava.sm { width: 32px; height: 32px; border-radius: 9px; font-size: 12px; }

.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; border-radius: 13px; background: var(--border-strong); transition: background .15s; }
.switch i::after { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: #fff;
                   box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px var(--accent-soft); }

/* ─── Карточка магазина ──────────────────────────────────── */
.sp-top { display: flex; align-items: center; gap: 8px; margin: -4px 0 20px; }
.sp-top h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.015em; }
.sp-top .icon-btn { color: var(--text); }
.sp-top .icon-btn:hover { background: var(--surface-hover); }
.sp { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.sp-left { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 20px; }
.sp-card { padding: 18px; border-radius: 16px; }
.sp-name { font-size: 19px; font-weight: 700; letter-spacing: -.015em; line-height: 1.25; word-break: break-word; }
.sp-balance { font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin: 2px 0 8px; font-variant-numeric: tabular-nums; }
.sp-balance.neg { color: var(--red); }
.sp-balance.pos { color: var(--green); }
.sp-fin { margin: 16px 0 14px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.sp-fin .seg { display: flex; border-radius: 0; background: var(--surface-2); padding: 4px; border-bottom: 1px solid var(--border); }
.sp-fin .seg button { flex: 1; justify-content: center; padding: 0 4px; }
.sp-fin-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; font-size: 13.5px; color: var(--text-2); }
.sp-fin-row + .sp-fin-row { border-top: 1px solid var(--border); }
.sp-fin-row b { color: var(--text); font-size: 14.5px; font-variant-numeric: tabular-nums; }
.sp-dl { grid-template-columns: 82px 1fr; font-size: 13px; }

.sp-tabs { display: flex; gap: 4px; margin-bottom: 14px; flex-wrap: wrap; }
.sp-tabs button { height: 38px; padding: 0 16px; border-radius: 19px; border: 0; background: transparent; font-weight: 600; font-size: 13.5px;
                  color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.sp-tabs button:hover { background: var(--surface-hover); }
.sp-tabs button.on { background: #0e1218; color: #fff; }
:root[data-theme="dark"] .sp-tabs button.on { background: #eef1f6; color: #0e1218; }
.sp-tabs .cnt { font-size: 11px; font-weight: 600; background: var(--grey-soft); color: var(--muted); padding: 1px 7px; border-radius: 9px; }
.sp-tabs button.on .cnt { background: rgba(255,255,255,.18); color: inherit; }

.sp-form { display: flex; flex-direction: column; gap: 14px; }
.sp-sec { border-radius: 16px; overflow: hidden; }
.sp-sec-head { padding: 18px 18px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.sp-sec-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.sp-sec-head .sub, .sp-row .sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.sp-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.sp-row:last-child { border-bottom: 0; }
.sp-row > div:first-child { flex: 1; min-width: 0; }
.sp-row b { font-weight: 600; font-size: 14px; }
.sp-row.cat .input:first-child { flex: 1; }
.sp-money { position: relative; width: 150px; flex: none; display: block; }
.sp-money .input { padding-right: 30px; height: 40px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.sp-money span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.sp-money.pctf { width: 100px; }
.sp-save { position: sticky; bottom: 16px; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 18px;
           background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px);
           border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); color: var(--muted); font-size: 13.5px; }
.sp-save .btn { margin-left: auto; height: 40px; padding: 0 18px; }
.sp-save.dirty { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 40%, var(--border)); }

/* ─── Кассы и настройки ──────────────────────────────────── */
.cash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.cash-card { padding: 18px; }
.cash-card.off { opacity: .6; }
.cash-bal { font-size: 26px; font-weight: 750; letter-spacing: -.025em; margin: 14px 0; font-variant-numeric: tabular-nums; }
.cash-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; font-size: 12.5px; }
.cash-mini div { display: flex; justify-content: space-between; gap: 8px; }
.cash-mini span { color: var(--muted); }
.cash-mini b { font-weight: 600; font-variant-numeric: tabular-nums; }
.set-list { display: flex; flex-direction: column; }
.set-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.set-item:last-child { border-bottom: 0; }
.set-item.off b { color: var(--faint); }
.imp { display: flex; flex-direction: column; gap: 9px; padding: 14px; border: 1px dashed var(--border-strong); border-radius: 12px; background: var(--surface-2); }
.imp b { display: flex; align-items: center; gap: 7px; }
.imp .btn { align-self: flex-start; }
.imp input[type=file].input { padding: 4px; height: auto; }

@media (max-width: 1000px) {
  .sp { grid-template-columns: 1fr; }
  .sp-left { position: static; }
}
@media (max-width: 520px) {
  .sp-money { width: 120px; }
  .sp-row { flex-wrap: wrap; }
}
.content { min-width: 0; }
.t td.nw, .t .nw { white-space: nowrap; }

/* ─── Поиск Ctrl+K ───────────────────────────────────────── */
.side-search { display: flex; align-items: center; gap: 10px; white-space: nowrap; width: 100%; height: 36px; padding: 0 10px 0 12px; margin: 0 0 6px;
               border-radius: 9px; border: 1px solid var(--side-border); background: rgba(255,255,255,.04); color: #8b94a5; cursor: pointer; font-size: 13px; }
.side-search:hover { background: var(--side-hover); color: #fff; }
.side-search svg.i { width: 16px; height: 16px; }
.side-search kbd { margin-left: auto; }
kbd { font: 600 10.5px/1 var(--font); padding: 3px 5px; border-radius: 5px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--muted); }
.side-search kbd { background: transparent; border-color: rgba(255,255,255,.14); color: #8b94a5; }
.palette-host { place-items: start center; padding-top: 12vh; }
.palette { position: relative; z-index: 51; width: min(640px, 100%); background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg);
           overflow: hidden; animation: pop .14s ease; border: 1px solid var(--border); }
.pal-input { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--border); }
.pal-input svg.i { color: var(--faint); width: 20px; height: 20px; }
.pal-input input { flex: 1; height: 56px; border: 0; outline: 0; background: transparent; font-size: 16px; }
.pal-list { max-height: min(420px, 60vh); overflow-y: auto; padding: 6px; }
.pal-group { font-size: 11px; font-weight: 650; color: var(--faint); text-transform: uppercase; letter-spacing: .07em; padding: 10px 12px 4px; }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px; cursor: pointer; }
.pal-item svg.i { color: var(--muted); width: 17px; height: 17px; }
.pal-item.hi { background: var(--accent-soft); }
.pal-item.hi svg.i { color: var(--accent); }
.pal-item .meta { margin-left: auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pal-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 12px; color: var(--muted); }
.pal-foot kbd { margin-right: 3px; }

/* ─── Сортировка, цена в таблице, количество ─────────────── */
.t th.sortable { cursor: pointer; user-select: none; }
.t th.sortable:hover { color: var(--text); }
.t th[data-sort]::after { content: " ↑"; color: var(--accent); }
.t th[data-sort="desc"]::after { content: " ↓"; }
.price-edit { border: 0; background: transparent; font: inherit; font-weight: 600; cursor: pointer; padding: 4px 6px; margin: -4px -6px; border-radius: 6px;
              display: inline-flex; align-items: center; gap: 5px; color: inherit; }
.price-edit svg.i { width: 13px; height: 13px; opacity: 0; color: var(--accent); transition: opacity .1s; }
.price-edit:hover { background: var(--accent-soft); }
.price-edit:hover svg.i, tr:hover .price-edit svg.i { opacity: 1; }
.price-input { width: 110px; text-align: right; }
.qty { display: flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; background: var(--surface); }
.qty button { width: 26px; height: 30px; border: 0; background: var(--surface-2); cursor: pointer; font-size: 15px; color: var(--muted); flex: none; }
.qty button:hover { background: var(--accent-soft); color: var(--accent); }
.qty .input.sm { border: 0; border-radius: 0; height: 30px; text-align: center; padding: 0 2px; -moz-appearance: textfield; box-shadow: none; }
.qty .input::-webkit-outer-spin-button, .qty .input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.drawer-foot .btn.ghost { padding: 0 10px; }
@media (max-width: 720px) {
  .lines th:nth-child(2) { width: 84px !important; }
  .lines th:nth-child(3) { width: 96px !important; }
  .lines th:nth-child(4) { width: 84px !important; }
  .lines td, .lines th { padding-left: 6px; padding-right: 6px; }
  .qty button { width: 22px; }
}
