/* app.css — интерфейс «Эксимфорвард · Аренда оборудования» */
:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --ink: #0e1a2b;
  --muted: #6c7c92;
  --line: #e4eaf2;
  --line-soft: #eef2f8;
  --accent: #e98a0b;
  --accent-ink: #8a4b00;
  --accent-soft: #fff3e0;
  --steel: #2f6bf6;
  --steel-soft: #eaf1ff;
  --green: #0f9d58;
  --green-soft: #e8f7ee;
  --red: #d93a3f;
  --red-soft: #ffecec;
  --violet: #7c5ce0;
  --violet-soft: #f2ecff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 32, 56, .04), 0 8px 24px rgba(16, 32, 56, .05);
  --shadow-lg: 0 20px 50px rgba(13, 27, 49, .2);
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
p { margin: 0; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.ico { width: 18px; height: 18px; flex: 0 0 auto; }
.muted-text { color: var(--muted); font-size: 12.5px; }
.text { color: #33445e; font-size: 13.5px; line-height: 1.55; }
.text.small { font-size: 12.5px; }
.spacer { flex: 1; }
.mono { font-family: var(--mono); }
.pos { color: #0b7a44; }
.neg { color: #c0232a; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.center { text-align: center; }
.right { text-align: right; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 254px; flex: 0 0 254px; position: sticky; top: 0; height: 100vh;
  background: radial-gradient(120% 60% at 0% 0%, #17263f 0%, #101c30 55%, #0b1626 100%);
  color: #c6d2e2; display: flex; flex-direction: column; padding: 18px 14px 12px; z-index: 60;
  transition: transform .2s ease;
}
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.view { padding: 24px 26px 70px; flex: 1; }
.page { max-width: 1460px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }

/* ---------- sidebar ---------- */
.brand { display: flex; gap: 11px; align-items: center; padding: 4px 8px 16px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #f8b23c, #e07a05); box-shadow: 0 6px 18px rgba(233, 138, 11, .38);
}
.brand-mark .ico { width: 22px; height: 22px; }
.brand-name { color: #fff; font-weight: 700; font-size: 15px; letter-spacing: .2px; }
.brand-sub { font-size: 10.5px; color: #93a6c1; letter-spacing: .05em; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 2px; overflow: auto; flex: 1; padding-right: 2px; }
.nav::-webkit-scrollbar { width: 4px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border-radius: 4px; }
.nav-group { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: #7287a5; padding: 16px 10px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 9px;
  color: #c1cfe2; font-weight: 500; font-size: 13px; position: relative; transition: background .15s, color .15s;
}
.nav-link .ico { color: #94aac9; }
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-link:hover .ico { color: #ffd79a; }
.nav-link.active { background: linear-gradient(90deg, rgba(233, 138, 11, .3), rgba(233, 138, 11, .05)); color: #fff; }
.nav-link.active .ico { color: #f9bf67; }
.nav-link.active::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px;
  background: #f0a53a; border-radius: 0 3px 3px 0;
}
.nav-link > span:first-of-type { flex: 1; }
.nav-badge { font-size: 11px; background: rgba(255, 255, 255, .1); padding: 1px 7px; border-radius: 20px; color: #dbe6f7; font-weight: 600; }
.nav-link.active .nav-badge { background: #e98a0b; color: #201203; }
.sidebar-foot {
  margin-top: auto; display: flex; align-items: center; gap: 9px; padding: 14px 8px 4px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.user-meta { display: flex; flex-direction: column; line-height: 1.25; flex: 1; min-width: 0; }
.user-meta b { color: #fff; font-size: 12.5px; font-weight: 600; }
.user-meta small { color: #93a6c1; font-size: 11px; }
.sidebar-veil { display: none; }

/* ---------- topbar ---------- */
.topbar {
  height: 62px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px; padding: 0 22px; position: sticky; top: 0; z-index: 40;
}
.crumbs { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.crumbs .ico { width: 15px; height: 15px; color: #a4b2c5; }
.crumbs b { color: #2d3e57; font-weight: 600; }
.crumbs a:hover { color: var(--accent); }
.search-wrap { position: relative; flex: 1; max-width: 540px; margin: 0 auto; }
.search {
  display: flex; align-items: center; gap: 9px; background: #f4f7fc; border: 1px solid transparent;
  border-radius: 10px; padding: 0 12px; height: 38px; color: #8896aa; transition: .15s;
}
.search:focus-within { background: #fff; border-color: #ffd9a3; box-shadow: 0 0 0 3px rgba(233, 138, 11, .12); }
.search input { flex: 1; border: 0; background: none; outline: none; font-size: 13px; color: var(--ink); min-width: 0; }
.search input::-webkit-search-cancel-button { display: none; }
.search-pop {
  position: absolute; top: 46px; left: 0; right: 0; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 8px; display: none; max-height: 70vh; overflow: auto; z-index: 70;
}
.search-pop.open { display: block; }
.search-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #93a1b5; padding: 8px 10px 4px; }
.search-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; width: 100%; text-align: left; }
.search-item:hover { background: #fff8ec; }
.search-item b { display: block; font-size: 13px; font-weight: 600; }
.search-item small { display: block; color: var(--muted); font-size: 11.5px; }
.search-ico { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: #fdf3e3; color: #a5701f; }
.search-empty { padding: 16px; text-align: center; color: var(--muted); font-size: 13px; }
.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.icon-btn { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: #5c6c82; transition: .15s; }
.icon-btn:hover { background: #f5f8fd; color: var(--ink); }
.tb-date { display: flex; align-items: center; gap: 6px; color: #7b8a9f; font-size: 12.5px; padding: 0 4px; }
.tb-date .ico { width: 15px; height: 15px; }
.burger { display: none; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center;
  background: color-mix(in srgb, var(--c, #e98a0b) 14%, #fff);
  color: var(--c, #b46f0a); font-weight: 700; font-size: 11.5px; letter-spacing: .02em;
  border: 1px solid color-mix(in srgb, var(--c, #e98a0b) 26%, #fff);
}
.avatar.lg { width: 44px; height: 44px; font-size: 14px; }

/* ---------- page head ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding-top: 2px; }
.page-head h1 { font-size: 25px; }
.page-head .muted-text { margin-top: 5px; }
.head-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.live-badge {
  display: inline-flex; align-items: center; gap: 7px; background: #eaf7ef; color: #0b7a44;
  padding: 7px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.live-badge i { width: 7px; height: 7px; border-radius: 50%; background: #12a35d; box-shadow: 0 0 0 3px rgba(18, 163, 93, .18); }
.live-badge.neutral { background: #eef3fb; color: #45607f; }
.live-badge.neutral i { background: #7f93ad; box-shadow: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px;
  border-radius: 10px; font-size: 13px; font-weight: 600; border: 1px solid transparent; transition: .15s; white-space: nowrap;
}
.btn .ico { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(233, 138, 11, .3); }
.btn-primary:hover { background: #d47c05; }
.btn-steel { background: var(--steel); color: #fff; box-shadow: 0 4px 12px rgba(47, 107, 246, .24); }
.btn-steel:hover { background: #245ae0; }
.btn-soft { background: var(--accent-soft); color: #a25c00; }
.btn-soft:hover { background: #ffe9c9; }
.btn-ghost { background: #fff; border-color: var(--line); color: #33445e; }
.btn-ghost:hover { border-color: #d6c3a6; color: #a25c00; }
.btn-danger { background: var(--red-soft); color: #b0242a; }
.btn-danger:hover { background: #ffdedf; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; border-radius: 8px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 14px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; color: #b06b08; font-size: 12.5px; font-weight: 600; }
.link-btn .ico { width: 14px; height: 14px; }
.link-btn:hover { color: #7d4b02; }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 7px; }
.icon-btn.sm .ico { width: 15px; height: 15px; }

/* ---------- chips / pills ---------- */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 6px 11px; border-radius: 8px; background: #f2f5fa; color: #55657c; font-size: 12px; font-weight: 500;
  border: 1px solid transparent; transition: .15s;
}
.chip:hover { background: #eaf0fa; color: #2e3f57; }
.chip.on { background: var(--accent-soft); color: #a25c00; border-color: #ffdca9; font-weight: 600; }
.chip.small { padding: 4px 9px; font-size: 11.5px; }
.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 2.5px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 1.5;
}
.pill.draft { background: #eef1f6; color: #5d6b80; }
.pill.reserve { background: #fff3e0; color: #a36800; }
.pill.rented { background: var(--steel-soft); color: #2158cf; }
.pill.closed { background: var(--green-soft); color: #0b7a44; }
.pill.canceled { background: #f7e7e7; color: #a83a3a; }
.pill.overdue { background: var(--red-soft); color: #c0232a; }
.pill.repair { background: var(--violet-soft); color: #6b3fd4; }
.pill.neutral { background: #f2f5fa; color: #63738c; }
.pill.ok { background: var(--green-soft); color: #0b7a44; }
.tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; background: #f1f5fb; color: #5a6b83; font-size: 11.5px; font-weight: 500; }

/* ---------- cards ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line-soft); }
.card-head h3 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.card-head .muted-text { margin-top: 2px; }
.card-head .head-actions { margin-left: auto; }
.card-body { padding: 16px 18px; }
.card-body.tight { padding: 10px 14px; }
.card-body.flush { padding: 0; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line-soft); display: flex; align-items: center; gap: 10px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.calc { grid-template-columns: minmax(0, 1fr) 372px; align-items: start; }
.grid.order { grid-template-columns: minmax(0, 1fr) 372px; align-items: start; }
.span-2 { grid-column: span 2; }

/* ---------- kpi ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.kpi {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 15px;
  box-shadow: var(--shadow); position: relative; overflow: hidden; transition: .15s; text-align: left;
}
.kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c, var(--accent)); opacity: .8; }
.kpi:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(16, 32, 56, .09); }
.kpi-label { font-size: 11.5px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: 25px; font-weight: 700; letter-spacing: -.03em; margin-top: 6px; line-height: 1.1; }
.kpi-value small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.kpi-note { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.kpi-note.neg { color: #c0232a; }
.kpi-note.pos { color: #0b7a44; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #8595ab;
  font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fbfcfe; white-space: nowrap;
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr.click:hover { background: #fffaf1; }
.table th.num, .table td.num { text-align: right; }
.table td.num { font-variant-numeric: tabular-nums; }
.table.compact th { padding: 8px 10px; }
.table.compact td { padding: 8px 10px; }
.table .strong { font-weight: 600; }
.table .sub { color: var(--muted); font-size: 11.5px; display: block; }
.row-title { display: flex; align-items: center; gap: 10px; }
.row-title img { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; border: 1px solid var(--line); }
.row-title .thumb {
  width: 40px; height: 40px; border-radius: 9px; background: #fdf5e8; color: #a5701f;
  display: grid; place-items: center; font-size: 10px; font-weight: 700; border: 1px solid #f6e3c6; text-align: center; line-height: 1.1;
}
.row-title b { font-size: 13px; font-weight: 600; display: block; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .label { font-size: 11.5px; font-weight: 600; color: #6d7d93; letter-spacing: .01em; }
.input, .select, .textarea {
  height: 38px; border: 1px solid #dde5f0; border-radius: 9px; padding: 0 11px; font: inherit; font-size: 13px;
  color: var(--ink); background: #fff; outline: none; transition: .15s; width: 100%; min-width: 0;
}
.textarea { height: auto; padding: 9px 11px; resize: vertical; min-height: 76px; }
.input:focus, .select:focus, .textarea:focus { border-color: #f0b25c; box-shadow: 0 0 0 3px rgba(233, 138, 11, .12); }
.input.sm, .select.sm { height: 32px; font-size: 12.5px; border-radius: 8px; }
.input.num, .input.money { text-align: right; font-variant-numeric: tabular-nums; }
.input[type="date"] { padding-right: 6px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236c7c92' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; }
.input-suffix { position: relative; }
.input-suffix .input { padding-right: 38px; }
.input-suffix span { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); font-size: 12px; color: #93a1b5; pointer-events: none; }
.form-row { display: grid; gap: 12px; }
.form-row.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-row.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-row.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: #33445e; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.seg { display: flex; width: 100%; background: #f2f5fa; border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { flex: 1; padding: 6px 8px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: #61718a; white-space: nowrap; }
.seg button.on { background: #fff; color: #a25c00; box-shadow: 0 1px 3px rgba(16, 32, 56, .1); }
.hint { font-size: 11.5px; color: var(--muted); }
.alert { border-radius: 11px; padding: 11px 13px; font-size: 12.5px; line-height: 1.5; display: flex; gap: 9px; align-items: flex-start; }
.alert .ico { width: 16px; height: 16px; margin-top: 1px; }
.alert-warn { background: #fff8ea; color: #8a5b00; border: 1px solid #f7e2bb; }
.alert-danger { background: #fff1f1; color: #a32026; border: 1px solid #ffd9da; }
.alert-info { background: #f2f6fd; color: #2c517f; border: 1px solid #dee8f8; }

/* ---------- stepper ---------- */
.stepper { display: flex; align-items: center; gap: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; box-shadow: var(--shadow); }
.step { display: flex; align-items: center; gap: 9px; flex: 1; padding: 2px 0; }
.step-num {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: #f1f4f9; color: #7d8ba1; flex: 0 0 auto;
}
.step-label { font-size: 12.5px; font-weight: 600; color: #6f7f95; }
.step-label small { display: block; font-weight: 500; font-size: 11px; color: #9aa8bb; }
.step.done .step-num { background: var(--green-soft); color: #0b7a44; }
.step.active .step-num { background: var(--accent); color: #fff; box-shadow: 0 0 0 4px rgba(233, 138, 11, .15); }
.step.active .step-label { color: var(--ink); }
.step-sep { width: 22px; height: 1px; background: var(--line); margin: 0 12px; flex: 0 0 auto; }

/* ---------- calc specifics ---------- */
.wall-row {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) 88px 88px 88px 88px 32px; gap: 9px; align-items: end;
  padding: 10px 0; border-bottom: 1px dashed var(--line);
}
.wall-row:last-child { border-bottom: 0; }
.wall-num { font-size: 12px; font-weight: 700; color: #94a2b6; padding-bottom: 10px; }
.wall-total { font-size: 12.5px; color: var(--muted); padding-bottom: 10px; text-align: right; font-variant-numeric: tabular-nums; }
.node-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.node { border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; background: #fcfdff; }
.node .label { font-size: 11.5px; }
.node .input { margin-top: 6px; }
.summary-strip { display: flex; gap: 22px; flex-wrap: wrap; padding: 12px 14px; background: #fbf7ef; border: 1px solid #f6e7cd; border-radius: 11px; }
.summary-strip div span { display: block; font-size: 11px; color: #97733d; }
.summary-strip div b { font-size: 17px; letter-spacing: -.02em; }

/* ---------- totals panel ---------- */
.totals { display: flex; flex-direction: column; gap: 9px; }
.total-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; color: #46566e; }
.total-row b { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.total-row.discount b { color: #0b7a44; }
.total-row.sep { border-top: 1px dashed var(--line); padding-top: 9px; margin-top: 1px; }
.total-row.grand { font-size: 15px; }
.total-row.grand b { font-size: 21px; letter-spacing: -.03em; }
.total-card { background: linear-gradient(160deg, #fffaf2, #fff); border: 1px solid #f6e3c6; border-radius: 12px; padding: 13px 14px; }
.total-card .cap { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: #a1814f; }
.total-card .val { font-size: 22px; font-weight: 700; letter-spacing: -.03em; margin-top: 3px; }

/* ---------- catalog ---------- */
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 15px; }
.cat-card { background: #fff; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: .15s; text-align: left; }
.cat-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(16, 32, 56, .1); border-color: #f0dbb8; }
.cat-img { position: relative; aspect-ratio: 16 / 11; background: #f7f9fc; overflow: hidden; }
.cat-img img { width: 100%; height: 100%; object-fit: cover; }
.cat-img .ph { width: 100%; height: 100%; display: grid; place-items: center; color: #b09a76; background: repeating-linear-gradient(45deg, #fbf7ef, #fbf7ef 10px, #f7f1e4 10px, #f7f1e4 20px); }
.cat-img .ph b { font-size: 15px; letter-spacing: .02em; }
.cat-img .tag-abs { position: absolute; top: 9px; left: 9px; background: rgba(255, 255, 255, .94); border-radius: 6px; padding: 2px 8px; font-size: 11px; font-weight: 600; color: #56677f; }
.cat-body { padding: 11px 13px 13px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.cat-body b { font-size: 13.5px; font-weight: 600; }
.cat-meta { font-size: 11.5px; color: var(--muted); }
.cat-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; }
.cat-price { font-size: 15px; font-weight: 700; }
.cat-price small { font-size: 11px; font-weight: 500; color: var(--muted); }
.stock-line { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); }
.bar { height: 5px; border-radius: 4px; background: #eef2f8; overflow: hidden; flex: 1; min-width: 40px; }
.bar i { display: block; height: 100%; background: var(--green); border-radius: 4px; }
.bar i.warn { background: var(--accent); }
.bar i.bad { background: var(--red); }

/* ---------- warehouse ---------- */
.stock-split { display: flex; height: 8px; border-radius: 5px; overflow: hidden; background: #eef2f8; min-width: 130px; }
.stock-split i { display: block; height: 100%; }
.stock-split i.free { background: #34a86b; }
.stock-split i.res { background: #f0a53a; }
.stock-split i.rent { background: #4b7de0; }
.stock-split i.rep { background: #9a7bea; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* ---------- order card ---------- */
.kv { display: flex; flex-direction: column; gap: 9px; }
.kv-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.kv-row span:first-child { color: var(--muted); }
.kv-row b { font-weight: 600; text-align: right; }
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: flex; gap: 11px; padding-bottom: 14px; position: relative; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 13px; height: 13px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); background: #cbd5e3; flex: 0 0 auto; margin-top: 3px; position: relative; z-index: 1; }
.tl-dot.act { background: var(--accent); box-shadow: 0 0 0 1px #f0c286; }
.tl-dot.ok { background: #34a86b; box-shadow: 0 0 0 1px #b9e2cc; }
.tl-dot.bad { background: var(--red); box-shadow: 0 0 0 1px #f6c3c4; }
.tl-body b { font-size: 12.8px; font-weight: 600; display: block; }
.tl-body small { color: var(--muted); font-size: 11.5px; }
.doc-list { display: flex; flex-direction: column; gap: 8px; }
.doc-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-align: left; width: 100%; }
.doc-item:hover { border-color: #f0dbb8; background: #fffdf9; }
.doc-item .ico { color: #a5701f; }
.doc-item b { font-size: 12.5px; display: block; }
.doc-item small { color: var(--muted); font-size: 11px; }

/* ---------- modal ---------- */
.modal-root { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 20px; background: rgba(9, 18, 32, .45); backdrop-filter: blur(2px); overflow: auto; }
.modal { background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; animation: pop .16s ease; }
.modal.wide { max-width: 880px; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--line-soft); }
.modal-head h3 { font-size: 17px; letter-spacing: -.01em; }
.modal-head .muted-text { margin-top: 3px; }
.modal-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 13px 20px 17px; border-top: 1px solid var(--line-soft); }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: flex; flex-direction: column; gap: 9px; }
.toast {
  background: #101c30; color: #f2f6fc; padding: 11px 15px; border-radius: 11px; font-size: 13px;
  box-shadow: 0 14px 34px rgba(9, 18, 32, .32); display: flex; align-items: center; gap: 9px; animation: pop .16s ease;
  max-width: 380px;
}
.toast .ico { color: #6fd39b; }
.toast.err .ico { color: #ff9a9d; }

/* ---------- misc ---------- */
.empty { padding: 34px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.empty .ico { width: 30px; height: 30px; color: #c3cddc; margin: 0 auto 10px; }
.divider { height: 1px; background: var(--line-soft); margin: 2px 0; }
.section-hint { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: #7d8ba0; }
.section-hint .ico { width: 15px; height: 15px; margin-top: 1px; flex: 0 0 auto; }
.quick-actions { display: flex; flex-direction: column; gap: 8px; }
.qa {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 11px; border: 1px solid var(--line);
  background: #fff; text-align: left; width: 100%; transition: .15s;
}
.qa:hover { border-color: #f0dbb8; background: #fffdf8; }
.qa-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: #a25c00; flex: 0 0 auto; }
.qa b { display: block; font-size: 13px; }
.qa small { color: var(--muted); font-size: 11.5px; }

/* ---------- пользователь, роли, синхронизация ---------- */
button.sidebar-foot {
  width: 100%; text-align: left; font: inherit; color: inherit; background: none; cursor: pointer;
  border-left: 0; border-right: 0; border-bottom: 0; transition: background .15s;
}
button.sidebar-foot:hover { background: rgba(255, 255, 255, .05); }
button.sidebar-foot .ico { width: 14px; height: 14px; color: #7f92ac; transform: rotate(90deg); }
.user-chip {
  display: flex; align-items: center; gap: 9px; height: 44px; padding: 0 10px 0 6px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; transition: .15s;
}
.user-chip:hover { border-color: #c9d6ea; background: #f8fafd; }
.user-chip .ico { width: 14px; height: 14px; color: var(--muted); transform: rotate(90deg); }
.user-chip-meta { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.user-chip-meta b { font-size: 12.5px; }
.user-chip-meta small { font-size: 11px; color: var(--muted); }
.sync-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
  background: #f2f5fa; color: #63738c; font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.sync-chip i { width: 7px; height: 7px; border-radius: 50%; background: #34a86b; }
.sync-chip.ok { background: var(--green-soft); color: #0b7a44; }
.sync-chip.bad { background: var(--red-soft); color: #b0242a; }
.role-list { display: flex; flex-direction: column; gap: 8px; }
.role-card {
  display: grid; grid-template-columns: 38px minmax(0, 160px) minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  text-align: left; width: 100%; transition: .15s;
}
.role-card:hover { border-color: #f0dbb8; background: #fffdf8; }
.role-card.on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(233, 138, 11, .14); }
.role-meta { display: flex; flex-direction: column; line-height: 1.2; }
.role-meta small { color: var(--muted); font-size: 11.5px; }
.role-desc { font-size: 12.5px; color: var(--muted); }
.select.sm { height: 30px; padding: 0 8px; font-size: 12.5px; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.calc, .grid.order { grid-template-columns: minmax(0, 1fr) 330px; }
}
@media (max-width: 1080px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); }
  .sidebar.open { transform: none; box-shadow: 0 0 60px rgba(9, 18, 32, .4); }
  .sidebar-veil { display: none; position: fixed; inset: 0; background: rgba(9, 18, 32, .4); z-index: 55; }
  .sidebar-veil.on { display: block; }
  .burger { display: grid; place-items: center; }
  .grid.calc, .grid.order, .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .search-wrap { max-width: none; }
  .tb-date { display: none; }
}
@media (max-width: 760px) {
  .user-chip-meta { display: none; }
  .sync-chip { display: none; }
  .role-card { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .role-desc { display: none; }
  .view { padding: 16px 13px 60px; }
  .topbar { padding: 0 13px; height: 56px; gap: 10px; }
  .page-head h1 { font-size: 21px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-value { font-size: 21px; }
  .form-row.c3, .form-row.c4, .form-row.c2 { grid-template-columns: minmax(0, 1fr); }
  .node-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wall-row { grid-template-columns: 26px minmax(0, 1fr) 1fr; }
  .wall-row .wall-total, .wall-row .del { display: none; }
  .card-head, .card-body { padding-left: 13px; padding-right: 13px; }
  .stepper { padding: 9px 10px; }
  .step-label small { display: none; }
  .step-sep { margin: 0 6px; width: 8px; }
  .modal-root { padding: 0; align-items: flex-end; }
  .modal { border-radius: 16px 16px 0 0; max-height: 92vh; overflow: auto; }
}
@media print {
  .sidebar, .topbar, .head-actions, .toasts, .no-print { display: none !important; }
  .view { padding: 0; }
  .modal-root { position: static; background: none; padding: 0; backdrop-filter: none; }
  .modal { box-shadow: none; max-width: none; }
  .card { box-shadow: none; }
}
