/* SeeTech Склад. Язык — как у сайта SeeTech: системный SF, светло-серый фон, белые группы, синий Apple для действий. */
:root {
  --bg: #f5f5f7;            /* фон страницы */
  --side: #fbfbfd;          /* боковая панель */
  --group: #ffffff;         /* белые группы, карточки, окна */
  --ink: #1d1d1f;
  --ink-2: #6e6e73;         /* вторичный текст: 4.6:1 на фоне, 5.1:1 на белом */
  --ink-3: #86868b;         /* третичный: только подписи и крупное */
  --sep: rgba(0, 0, 0, .09);
  --fill: rgba(118, 118, 128, .12);   /* поля ввода, серые кнопки, трек сегментов */
  --fill-2: rgba(118, 118, 128, .2);
  --hover: rgba(0, 0, 0, .04);
  --sel: #e8e8ed;
  --accent: #0071e3; --accent-hover: #0077ed; --on-accent: #fff; --accent-soft: rgba(0, 113, 227, .1);
  --ok: #248a3d; --ok-soft: rgba(36, 138, 61, .12);
  --warn: #b25000; --warn-soft: rgba(255, 149, 0, .16);
  --bad: #d70015; --bad-soft: rgba(255, 59, 48, .12);
  --ring: rgba(0, 113, 227, .45);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 2px 8px rgba(0, 0, 0, .04);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .16), 0 2px 8px rgba(0, 0, 0, .06);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.25, .1, .25, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000; --side: #161617; --group: #1c1c1e; --ink: #f5f5f7; --ink-2: #a1a1a6; --ink-3: #8e8e93;
    --sep: rgba(255, 255, 255, .1); --fill: rgba(118, 118, 128, .24); --fill-2: rgba(118, 118, 128, .36);
    --hover: rgba(255, 255, 255, .05); --sel: #2c2c2e;
    --accent: #2997ff; --accent-hover: #47a6ff; --on-accent: #fff; --accent-soft: rgba(41, 151, 255, .16);
    --ok: #30d158; --ok-soft: rgba(48, 209, 88, .16); --warn: #ff9f0a; --warn-soft: rgba(255, 159, 10, .16);
    --bad: #ff453a; --bad-soft: rgba(255, 69, 58, .16); --ring: rgba(41, 151, 255, .55);
    --shadow: 0 0 0 1px rgba(255, 255, 255, .06); --shadow-lg: 0 0 0 1px rgba(255, 255, 255, .08), 0 20px 50px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000; --side: #161617; --group: #1c1c1e; --ink: #f5f5f7; --ink-2: #a1a1a6; --ink-3: #8e8e93;
  --sep: rgba(255, 255, 255, .1); --fill: rgba(118, 118, 128, .24); --fill-2: rgba(118, 118, 128, .36);
  --hover: rgba(255, 255, 255, .05); --sel: #2c2c2e;
  --accent: #2997ff; --accent-hover: #47a6ff; --on-accent: #fff; --accent-soft: rgba(41, 151, 255, .16);
  --ok: #30d158; --ok-soft: rgba(48, 209, 88, .16); --warn: #ff9f0a; --warn-soft: rgba(255, 159, 10, .16);
  --bad: #ff453a; --bad-soft: rgba(255, 69, 58, .16); --ring: rgba(41, 151, 255, .55);
  --shadow: 0 0 0 1px rgba(255, 255, 255, .06); --shadow-lg: 0 0 0 1px rgba(255, 255, 255, .08), 0 20px 50px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ─── База ───────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.47 var(--font); letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: var(--accent); text-decoration: none; }
::selection { background: var(--accent-soft); }
input, textarea { caret-color: var(--accent); }
* { scrollbar-width: thin; scrollbar-color: var(--fill-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--fill-2); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 1px; border-radius: 8px; }
.num, .money { font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: 0; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: 0; }
.muted { color: var(--ink-2); } .faint { color: var(--ink-3); }
.small { font-size: 13px; letter-spacing: -.005em; }
.hidden { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ─── Каркас ─────────────────────────────────────────── */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side); border-right: 1px solid var(--sep); padding: 22px 12px 14px; position: sticky; top: 0;
  height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: block; padding: 0 10px 18px; color: var(--ink); }
.brand svg { display: block; width: 152px; height: auto; }
.nav-sec { font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 16px 10px 5px; letter-spacing: 0; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 0 10px; min-height: 34px; border-radius: 8px;
  color: var(--ink); font-weight: 500; transition: background .15s var(--ease); }
.nav a:hover { background: var(--hover); }
.nav a.on { background: var(--sel); font-weight: 600; }
.nav svg { width: 18px; height: 18px; flex: none; color: var(--accent); }
.side .me { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--sep); display: grid; gap: 10px; }
.side .me b { font-weight: 600; }
.main-wrap { min-width: 0; }
.main { min-width: 0; padding: 26px 32px 48px; max-width: 1600px; }
.topbar { display: none; }
.page-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 18px; }
.page-h h1 { font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -.022em; margin: 0; }
.page-h .grow { flex: 1; }

@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 40; left: 0; top: 0; width: 272px; transform: translateX(-100%);
    transition: transform .25s var(--ease); box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .topbar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 30; height: 52px; padding: 0 8px;
    background: color-mix(in srgb, var(--bg) 78%, transparent); -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--sep); }
  .topbar b { flex: 1; font-size: 17px; font-weight: 600; }
  .main { padding: 18px 16px 40px; }
}
@media (max-width: 640px) { .hide-sm { display: none; } .page-h h1 { font-size: 24px; } }

/* ─── Группы и раскладка ─────────────────────────────── */
.card { background: var(--group); border-radius: 14px; box-shadow: var(--shadow); }
.card.pad { padding: 16px 18px; }
.card h3 { margin: 0 0 10px; font-size: 17px; font-weight: 600; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
.sec-title { font-size: 17px; font-weight: 600; margin: 22px 0 8px; letter-spacing: -.015em; }
.sec-title:first-child { margin-top: 0; }

/* Сводка ключ — значение, как в «Настройках» */
.kvl { background: var(--group); border-radius: 14px; box-shadow: var(--shadow); }
.kvl > div { display: flex; align-items: baseline; gap: 16px; padding: 12px 18px; position: relative; }
.kvl > div + div::before { content: ""; position: absolute; top: 0; left: 18px; right: 0; border-top: 1px solid var(--sep); }
.kvl dt, .kvl .k { color: var(--ink); flex: 1; margin: 0; }
.kvl dd, .kvl .v { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.kvl .note { display: block; font-size: 13px; color: var(--ink-2); font-weight: 400; }
.kvl .big .v { font-size: 22px; letter-spacing: -.02em; }

/* ─── Кнопки ─────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 14px;
  border-radius: 10px; border: 0; background: var(--fill); color: var(--ink); cursor: pointer; font-weight: 500;
  white-space: nowrap; transition: background .15s var(--ease), opacity .15s; }
.btn:hover { background: var(--fill-2); }
.btn:active { opacity: .7; }
.btn:disabled { opacity: .4; cursor: default; }
.btn.primary, .btn.accent { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover, .btn.accent:hover { background: var(--accent-hover); }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { min-height: 30px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.lg { min-height: 50px; font-size: 17px; font-weight: 600; padding: 0 24px; border-radius: 980px; }
.btn svg { width: 16px; height: 16px; flex: none; }
.icon-btn { width: 36px; padding: 0; }
.btn .kbd { font-size: 12px; font-weight: 500; opacity: .7; }

/* ─── Поля ───────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; color: var(--ink-2); }
.input, select.input, textarea.input { width: 100%; min-height: 36px; padding: 7px 11px; border: 0; border-radius: 10px;
  background: var(--fill); outline: none; transition: box-shadow .15s var(--ease), background .15s; }
.input::placeholder { color: var(--ink-3); }
.input:focus { background: var(--group); box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-soft); }
select.input { appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5l3-3' fill='none' stroke='%2386868b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 12px; }
.input.big { min-height: 46px; font-size: 17px; padding: 10px 14px; border-radius: 12px; }
.input.money { text-align: right; font-variant-numeric: tabular-nums; }
.search { position: relative; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }
.search .input { padding-left: 40px; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }

/* ─── Метки ──────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 980px; font-size: 12px; font-weight: 600;
  background: var(--fill); color: var(--ink-2); white-space: nowrap; letter-spacing: 0; vertical-align: 1px; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--accent-soft); color: var(--accent); }

/* ─── Таблицы ────────────────────────────────────────── */
table.t { width: 100%; border-collapse: separate; border-spacing: 0; }
.t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 10px 14px 8px; border-bottom: 1px solid var(--sep);
  position: sticky; top: 0; background: var(--group); white-space: nowrap; }
.t td { padding: 11px 14px; border-bottom: 1px solid var(--sep); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tr.click { cursor: pointer; }
.t tr.click:hover td { background: var(--hover); }
.t .r { text-align: right; }
.t-wrap { overflow-x: auto; }
.card.t-wrap { overflow: auto; }
.empty { padding: 40px 18px; text-align: center; color: var(--ink-2); }
.empty b { display: block; color: var(--ink); font-size: 17px; font-weight: 600; margin-bottom: 4px; }

/* Сегменты, как в macOS */
.tabs, .paytabs { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--fill); border-radius: 9px; padding: 2px; gap: 2px; }
.tabs button, .paytabs button { border: 0; background: transparent; padding: 0 14px; min-height: 30px; border-radius: 7px; cursor: pointer;
  font-weight: 500; color: var(--ink); transition: background .15s var(--ease); white-space: nowrap; }
.tabs button.on, .paytabs button.on { background: var(--group); box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); font-weight: 600; }
:root[data-theme="dark"] .tabs button.on, :root[data-theme="dark"] .paytabs button.on { background: #636366; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tabs button.on, :root:not([data-theme="light"]) .paytabs button.on { background: #636366; } }
.paytabs { display: grid; width: 100%; }
.paytabs button { min-height: 34px; }

/* ─── Касса ──────────────────────────────────────────── */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 20px; align-items: start; }
@media (max-width: 1150px) { .pos { grid-template-columns: minmax(0, 1fr); } }
.shiftbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; min-height: 36px; }
.shiftbar .status { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; }
.shiftbar .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.shiftbar .dot.on { background: var(--ok); }
.shiftbar select.input { width: auto; min-height: 32px; font-weight: 600; }
.results { margin-top: 12px; max-height: calc(100vh - 210px); overflow-y: auto; }
.res { display: grid; grid-template-columns: minmax(0, 1fr) auto 32px; gap: 14px; align-items: center; padding: 10px 14px 10px 18px;
  cursor: pointer; position: relative; transition: background .12s var(--ease); }
.res + .res::before { content: ""; position: absolute; top: 0; left: 18px; right: 0; border-top: 1px solid var(--sep); }
.res:hover { background: var(--hover); }
.res.kb { background: var(--accent-soft); }
.res:first-child { border-radius: 14px 14px 0 0; } .res:last-child { border-radius: 0 0 14px 14px; }
.res .nm { font-weight: 500; }
.res .st { font-size: 13px; color: var(--ink-2); margin-top: 1px; }
.res .st .here { color: var(--ok); font-weight: 600; }
.res .pr { font-weight: 600; font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.res.off .nm, .res.off .pr { color: var(--ink-2); }
.add { width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); display: grid;
  place-items: center; cursor: pointer; padding: 0; }
.add svg { width: 15px; height: 15px; stroke-width: 2.4; }
.res.off .add { background: var(--fill-2); color: var(--ink-2); }
.cart { position: sticky; top: 24px; display: flex; flex-direction: column; max-height: calc(100vh - 48px); border-radius: 18px; }
.cart-h { display: flex; align-items: center; gap: 8px; padding: 16px 16px 10px 20px; }
.cart-h h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; flex: 1; }
.cart-lines { overflow-y: auto; flex: 1; min-height: 120px; }
.cl { padding: 12px 20px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; position: relative; }
.cl + .cl::before { content: ""; position: absolute; top: 0; left: 20px; right: 0; border-top: 1px solid var(--sep); }
.cl .nm { font-weight: 500; }
.cl .sn { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); letter-spacing: 0; }
.cl .ctl { display: flex; gap: 6px; align-items: center; grid-column: 1 / -1; margin-top: 6px; }
.cl .ctl .input { min-height: 30px; padding: 4px 8px; width: 96px; border-radius: 8px; font-size: 14px; }
.cl .ctl .qty { width: 58px; text-align: center; }
.cl .ctl .disc { width: 74px; }
.cl .sum { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.cart-foot { padding: 14px 20px 20px; display: grid; gap: 12px; border-top: 1px solid var(--sep); }
.total { display: flex; justify-content: space-between; align-items: baseline; }
.total span { color: var(--ink-2); }
.total b { font-size: 34px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.change { font-size: 13px; color: var(--ink-2); min-height: 18px; }

/* ─── Окна и уведомления ─────────────────────────────── */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .32); z-index: 60; display: grid; place-items: center; padding: 16px;
  animation: fade .18s var(--ease); }
.modal { background: var(--group); border-radius: 18px; box-shadow: var(--shadow-lg); width: min(540px, 100%); max-height: calc(100vh - 32px);
  display: flex; flex-direction: column; animation: rise .22s cubic-bezier(.16, 1, .3, 1); }
.modal.wide { width: min(960px, 100%); }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 18px 16px 6px 22px; }
.modal-h h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.02em; flex: 1; }
.modal-h .btn.icon-btn { width: 30px; min-height: 30px; border-radius: 50%; }
.modal-b { padding: 12px 22px 18px; overflow-y: auto; display: grid; gap: 14px; }
.modal-b .card { box-shadow: none; background: var(--bg); }
.modal-b .kvl { box-shadow: none; background: var(--bg); }
.modal-b .card .t th { background: var(--bg); }
.modal-f { padding: 12px 22px 20px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px;
  width: min(480px, calc(100% - 24px)); justify-items: center; }
.toast { background: #1d1d1f; color: #f5f5f7; padding: 11px 18px; border-radius: 14px; box-shadow: var(--shadow-lg); font-weight: 500;
  animation: rise .22s cubic-bezier(.16, 1, .3, 1); max-width: 100%; }
.toast.err { background: var(--bad); color: #fff; }
.toast.ok::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #30d158; margin-right: 9px; vertical-align: 1px; }

/* ─── Вход ───────────────────────────────────────────── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login form { width: min(360px, 100%); display: grid; gap: 14px; }
.login .brand { padding: 0 0 18px; justify-self: center; }
.login .brand svg { width: 200px; }
.login h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.022em; text-align: center; }
.login p { margin: 0; text-align: center; color: var(--ink-2); }
.login .btn.lg { width: 100%; margin-top: 6px; }

/* ─── Прочее ─────────────────────────────────────────── */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 0; }
.kv dt { color: var(--ink-2); } .kv dd { margin: 0; }
.imei-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 0 4px 0 12px; min-height: 30px; border-radius: 980px; background: var(--fill);
  font-family: var(--mono); font-size: 13px; letter-spacing: 0; border: 0; color: var(--ink); }
button.chip { cursor: pointer; padding: 0 12px; } button.chip:hover { background: var(--fill-2); }
.chip button { border: 0; background: transparent; cursor: pointer; color: var(--ink-2); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; padding: 0; }
.chip button:hover { background: var(--fill-2); }
.chip button svg { width: 12px; height: 12px; }
.group-sel { box-shadow: 0 0 0 2px var(--accent) !important; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 12px; }
.sticky-foot { position: sticky; bottom: 12px; margin-top: 14px; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 20px;
  background: color-mix(in srgb, var(--group) 82%, transparent); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-radius: 980px; box-shadow: var(--shadow-lg); }
@media print {
  body { background: #fff; }
  .app > .side, .topbar, .no-print, .modal-bg { display: none !important; }
}
