/* ============================================================
   СтройНаш ERP — shell + components
   ============================================================ */
.spinner { display:inline-block; width:16px; height:16px; border:2px solid color-mix(in oklch, currentColor 30%, transparent); border-top-color: currentColor; border-radius:50%; animation: sn-spin .7s linear infinite; vertical-align:-2px; }
@keyframes sn-spin { to { transform: rotate(360deg); } }

/* ---------------- APP SHELL ---------------- */
.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  height: 100%;
}
.app.collapsed { grid-template-columns: 68px 1fr; }

/* ---- sidebar ---- */
.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  gap: 4px;
  overflow: visible;
  position: relative;
  z-index: 30;
}
.sb-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 6px 8px 14px;
  margin-bottom: 4px;
}
.sb-logo {
  width: 34px; height: 34px; flex: none;
  border-radius: 9px;
  background: var(--accent);
  display: grid; place-items: center;
  color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 17px;
  box-shadow: 0 2px 10px -2px color-mix(in oklch, var(--accent) 60%, transparent);
  position: relative; overflow: hidden;
}
.sb-logo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,.35), transparent 55%); }
.sb-brand-txt { display: flex; flex-direction: column; line-height: 1.05; white-space: nowrap; }
.sb-brand-txt b { font-family: var(--font-display); font-size: 16px; letter-spacing: -.01em; color: #fff; font-weight: 600; }
.sb-brand-txt span { font-size: 10.5px; color: var(--sidebar-text-2); letter-spacing: .14em; text-transform: uppercase; font-weight: 600; margin-top: 2px; }

.sb-section { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--sidebar-text-2); font-weight: 700; padding: 14px 10px 6px; white-space: nowrap; }
.collapsed .sb-section { opacity: 0; height: 10px; padding: 0; overflow: hidden; }
.collapsed .sb-brand-txt { opacity: 0; }

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--sidebar-text);
  font-size: 13.5px; font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  border: none; background: none; width: 100%; text-align: left;
  transition: background var(--fast), color var(--fast);
  position: relative;
}
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--sidebar-active-bg); color: var(--sidebar-active); font-weight: 600; }
.nav-item.active::before { content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%); width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-item .nav-badge { margin-left: auto; font-size: 10.5px; font-weight: 700; background: var(--accent); color: #fff; border-radius: 99px; padding: 1px 7px; min-width: 18px; text-align: center; }
.nav-item.active .nav-badge { background: var(--accent); }
.collapsed .nav-item span, .collapsed .nav-item .nav-badge { display: none; }
.collapsed .nav-item { justify-content: center; padding-left: 0; padding-right: 0; }
.collapsed .nav-item svg { margin: 0; }

.sb-spacer { flex: 1; }
.sb-user {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.07);
  white-space: nowrap;
  transition: background var(--fast);
}
.sb-user:hover { background: var(--sidebar-hover); }
.sb-user .u-meta { display: flex; flex-direction: column; line-height: 1.15; overflow: hidden; }
.sb-user .u-meta b { font-size: 12.5px; color: #fff; font-weight: 600; }
.sb-user .u-meta span { font-size: 10.5px; color: var(--sidebar-text-2); }
.collapsed .sb-user .u-meta { opacity: 0; }

/* ---- main column ---- */
.main { display: flex; flex-direction: column; min-width: 0; height: 100%; background: var(--canvas); }

.topbar {
  height: 60px; flex: none;
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  background: color-mix(in oklch, var(--canvas) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.tb-title { display: flex; flex-direction: column; line-height: 1.1; }
.tb-title h1 { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.tb-title .crumb { font-size: 11.5px; color: var(--text-3); font-weight: 600; letter-spacing: .04em; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 9px; flex: none;
  display: grid; place-items: center; cursor: pointer;
  background: transparent; border: 1px solid transparent; color: var(--text-2);
  transition: background var(--fast), color var(--fast), border-color var(--fast);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); border-color: var(--border); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot { position: absolute; }

/* global AI command trigger */
.cmd-trigger {
  display: flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 12px 0 13px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  color: var(--text-3);
  font-size: 13px; cursor: pointer; min-width: 260px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
}
.cmd-trigger:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.cmd-trigger .spark { color: var(--accent); display: grid; place-items: center; }
.cmd-trigger .kbd { margin-left: auto; display: flex; gap: 3px; }
/* clear AI button (filled accent, no mac keys) */
.ai-btn { background: var(--accent) !important; border-color: var(--accent) !important; color: #fff !important; min-width: auto; box-shadow: 0 2px 10px -3px color-mix(in oklch, var(--accent) 60%, transparent); }
.ai-btn:hover { background: var(--accent-2) !important; box-shadow: 0 4px 14px -3px color-mix(in oklch, var(--accent) 60%, transparent); }
.ai-btn .spark { color: #fff; }
.ai-btn .cmd-label { font-weight: 600; }
.kbd b {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  background: var(--surface-3); color: var(--text-2);
  border: 1px solid var(--border); border-radius: 5px;
  padding: 1px 5px; line-height: 1.4;
}

/* ---- page content ---- */
.page { flex: 1; overflow-y: auto; overflow-x: hidden; }
.page-inner { padding: 24px 26px 60px; max-width: 1480px; margin: 0 auto; }
.page-inner.wide { max-width: none; }

/* ---------------- PRIMITIVES ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px;
  border-radius: 9px; font-family: var(--font-ui); font-size: 13.5px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent; white-space: nowrap;
  transition: background var(--fast), border-color var(--fast), color var(--fast), transform var(--fast), box-shadow var(--fast);
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.18); }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--border-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-2); }
.btn-soft { background: var(--surface-3); color: var(--text); }
.btn-soft:hover { background: var(--canvas-2); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn-icon-only { width: 38px; padding: 0; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px; border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2);
}
.badge .bdot { width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.badge-accent { background: var(--accent-soft); color: var(--accent-text); }
.badge-pos { background: color-mix(in oklch, var(--pos) 14%, var(--surface)); color: var(--pos); }
.badge-neg { background: color-mix(in oklch, var(--neg) 14%, var(--surface)); color: var(--neg); }

.avatar {
  border-radius: 99px; flex: none; display: grid; place-items: center;
  font-weight: 700; color: #fff; font-size: 12px; letter-spacing: .01em;
  background: var(--accent); overflow: hidden;
}

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px; border-radius: var(--r-full);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border-2); color: var(--text-2);
  transition: all var(--fast);
}
.chip:hover { border-color: var(--text-3); color: var(--text); }
.chip.on { background: var(--text); color: var(--surface); border-color: var(--text); }

.input {
  height: 38px; padding: 0 12px; border-radius: 9px;
  border: 1px solid var(--border-2); background: var(--surface); color: var(--text);
  font-family: var(--font-ui); font-size: 13.5px; width: 100%;
  transition: border-color var(--fast), box-shadow var(--fast);
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.input::placeholder { color: var(--text-3); }

.section-title { font-family: var(--font-display); font-size: 15px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }

/* ---------------- STAT CARDS ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px,1fr)); gap: 14px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 16px 17px; position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.stat .s-label { font-size: 12px; color: var(--text-2); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.stat .s-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.stat .s-val { font-family: var(--font-display); font-size: 28px; font-weight: 600; letter-spacing: -.02em; margin: 11px 0 3px; }
.stat .s-sub { font-size: 12px; display: flex; align-items: center; gap: 5px; }
.trend-up { color: var(--pos); font-weight: 700; }
.trend-down { color: var(--neg); font-weight: 700; }
/* компактные карточки (ниже по высоте) */
.stat-compact .stat { padding: 9px 14px; }
.stat-compact .stat .s-val { font-size: 21px; margin: 4px 0 1px; }
.stat-compact .stat .s-sub { font-size: 11px; }
.stat-compact .stat .s-ico { width: 24px; height: 24px; }

/* ---------------- STAGE CELLS (Офис-контроль) ---------------- */
.stage-cell {
  position: relative; height: 46px; border-radius: 8px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: center; gap: 1px;
  padding: 0 10px; overflow: hidden;
  border: 1px solid transparent;
  transition: transform var(--fast), box-shadow var(--fast), filter var(--fast);
}
.stage-cell:hover { transform: translateY(-1px); box-shadow: var(--shadow); filter: brightness(1.02); z-index: 2; }
.stage-cell .sc-top { font-size: 11.5px; font-weight: 700; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-cell .sc-sub { font-size: 10px; font-weight: 600; opacity: .82; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-cell .sc-amt { font-family: var(--font-mono); }

.st-gray   { background: color-mix(in oklch, var(--stage-gray) 16%, var(--surface)); color: color-mix(in oklch, var(--stage-gray) 75%, var(--text)); border-color: color-mix(in oklch, var(--stage-gray) 26%, transparent); }
.st-yellow { background: color-mix(in oklch, var(--stage-yellow) 20%, var(--surface)); color: color-mix(in oklch, var(--stage-yellow) 62%, var(--text)); border-color: color-mix(in oklch, var(--stage-yellow) 36%, transparent); }
.st-orange { background: color-mix(in oklch, var(--stage-orange) 20%, var(--surface)); color: color-mix(in oklch, var(--stage-orange) 72%, var(--text)); border-color: color-mix(in oklch, var(--stage-orange) 38%, transparent); }
.st-blue   { background: color-mix(in oklch, var(--stage-blue) 20%, var(--surface)); color: color-mix(in oklch, var(--stage-blue) 72%, var(--text)); border-color: color-mix(in oklch, var(--stage-blue) 38%, transparent); }
.st-green  { background: color-mix(in oklch, var(--stage-green) 20%, var(--surface)); color: color-mix(in oklch, var(--stage-green) 70%, var(--text)); border-color: color-mix(in oklch, var(--stage-green) 40%, transparent); }
.stage-cell .sc-flag { position: absolute; top: 5px; right: 6px; width: 5px; height: 5px; border-radius: 99px; background: currentColor; }
.stage-cell .sc-chev { position: absolute; bottom: 4px; right: 5px; opacity: .4; transition: opacity var(--fast); color: currentColor; }
.stage-cell:hover .sc-chev { opacity: 1; }
.stage-cell .sc-top { padding-right: 12px; }

.stage-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.leg { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); font-weight: 500; }
.leg i { width: 11px; height: 11px; border-radius: 4px; display: inline-block; }

/* ---------------- TABLE ---------------- */
.oc-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.oc-scroll { overflow-x: auto; }
table.oc { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 880px; }
table.oc th {
  font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3);
  font-weight: 700; text-align: left; padding: 12px 12px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 3; white-space: nowrap;
}
table.oc td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.oc tbody tr { transition: background var(--fast); }
table.oc tbody tr:hover { background: var(--surface-2); }
table.oc tbody tr:last-child td { border-bottom: none; }
.oc-stage-col { width: 124px; max-width: 124px; }
table.oc.oc-fixed { table-layout: fixed; }
.oc-obj { display: flex; align-items: center; gap: 11px; }
.oc-obj .oc-name { font-weight: 600; font-size: 13.5px; }
.oc-obj .oc-sub { font-size: 11.5px; color: var(--text-3); }
.col-sticky { position: sticky; left: 0; background: var(--surface); z-index: 2; }
table.oc tbody tr:hover .col-sticky { background: var(--surface-2); }

/* ---------------- KANBAN ---------------- */
.kanban { display: flex; gap: 13px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.kcol { flex: none; width: 268px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg); display: flex; flex-direction: column; max-height: 100%; }
.kcol-head { display: flex; align-items: center; gap: 8px; padding: 12px 13px 9px; }
.kcol-head .kc-dot { width: 9px; height: 9px; border-radius: 99px; flex: none; }
.kcol-head b { font-size: 12.5px; font-weight: 700; }
.kcol-head .kc-count { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--text-3); background: var(--surface-3); border-radius: 99px; padding: 1px 8px; }
.kcol-body { display: flex; flex-direction: column; gap: 9px; padding: 4px 10px 12px; overflow-y: auto; }
.kcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 12px;
  cursor: grab; box-shadow: var(--shadow-sm); transition: transform var(--fast), box-shadow var(--fast), border-color var(--fast);
}
.kcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-2); }
.kcard:active { cursor: grabbing; }
.kcard .kc-name { font-weight: 600; font-size: 13.5px; }
.kcard .kc-meta { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.kcard .kc-foot { display: flex; align-items: center; gap: 7px; margin-top: 10px; }
.kcard .kc-amt { margin-left: auto; font-family: var(--font-mono); font-size: 12px; font-weight: 700; }

/* ---- temperature tags ---- */
.temp { display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:700; padding:2px 8px; border-radius:99px; }
.temp-hot  { background: color-mix(in oklch, var(--stage-orange) 16%, var(--surface)); color: var(--stage-orange); }
.temp-warm { background: color-mix(in oklch, var(--stage-yellow) 18%, var(--surface)); color: color-mix(in oklch, var(--stage-yellow) 60%, var(--text)); }
.temp-cold { background: color-mix(in oklch, var(--stage-blue) 16%, var(--surface)); color: var(--stage-blue); }

/* ---------------- AI command modal ---------------- */
.cmd-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(12,16,24,.42); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding-top: 11vh; animation: fadeIn .16s var(--ease); }
.cmd-modal { width: min(680px, 92vw); background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); overflow: hidden; animation: popIn .2s var(--ease-out); }
.cmd-inputrow { display: flex; align-items: center; gap: 12px; padding: 17px 19px; border-bottom: 1px solid var(--border); }
.cmd-inputrow .spark { color: var(--accent); flex: none; }
.cmd-input { border: none; outline: none; background: none; font-family: var(--font-ui); font-size: 17px; color: var(--text); width: 100%; }
.cmd-input::placeholder { color: var(--text-3); }
.cmd-body { max-height: 52vh; overflow-y: auto; padding: 9px; }
.cmd-grouplabel { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); font-weight: 700; padding: 11px 11px 5px; }
.cmd-item { display: flex; align-items: center; gap: 12px; padding: 10px 11px; border-radius: 10px; cursor: pointer; }
.cmd-item.sel, .cmd-item:hover { background: var(--accent-soft); }
.cmd-item .ci-ico { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); flex: none; }
.cmd-item.sel .ci-ico { background: var(--accent); color: #fff; }
.cmd-item .ci-txt b { font-size: 13.5px; font-weight: 600; display: block; }
.cmd-item .ci-txt span { font-size: 11.5px; color: var(--text-3); }
.cmd-item .ci-hint { margin-left: auto; font-size: 11px; color: var(--text-3); font-weight: 600; }
.cmd-foot { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 11.5px; color: var(--text-3); }
.cmd-foot .ff { display: flex; align-items: center; gap: 6px; }

/* AI result bubble inside cmd */
.ai-think { display: flex; align-items: center; gap: 10px; padding: 14px 16px; color: var(--text-2); font-size: 13.5px; }
.ai-dots { display: inline-flex; gap: 4px; }
.ai-dots i { width: 6px; height: 6px; border-radius: 99px; background: var(--accent); animation: pulseDot 1s infinite; }
.ai-dots i:nth-child(2){ animation-delay: .16s; } .ai-dots i:nth-child(3){ animation-delay: .32s; }
.ai-result { padding: 16px 18px; animation: fadeUp .24s var(--ease-out); }
.ai-card { border: 1px solid var(--border-2); border-radius: var(--r); padding: 14px; background: var(--surface-2); }
.ai-row { display: flex; gap: 10px; padding: 6px 0; font-size: 13px; }
.ai-row .k { color: var(--text-3); width: 130px; flex: none; font-weight: 600; }
.ai-row .v { font-weight: 600; }

/* drawer — открывается по центру (модальная карточка) */
.drawer-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(12,16,24,.46); backdrop-filter: blur(3px); animation: fadeIn .16s; }
.drawer { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); width: min(620px, 96vw); max-height: 88vh; background: var(--surface); border: 1px solid var(--border-2); border-radius: 20px; box-shadow: var(--shadow-lg); z-index: 91; display: flex; flex-direction: column; overflow: hidden; animation: drawerPop .24s var(--ease-out); }
@keyframes drawerPop { from { opacity: .6; transform: translate(-50%,-47%) scale(.98); } to { opacity: 1; transform: translate(-50%,-50%) scale(1); } }
@keyframes slideIn { from { transform: translate(-50%,-47%); } to { transform: translate(-50%,-50%); } }
.drawer-head { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; gap: 12px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }

/* progress / bars */
.bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }

/* mini sparkline columns */
.spark-cols { display: flex; align-items: flex-end; gap: 4px; height: 56px; }
.spark-cols > i { flex: 1; background: var(--accent-soft); border-radius: 4px 4px 0 0; transition: height var(--med) var(--ease-out); transform-origin: bottom; }
.spark-cols > i.hi { background: var(--accent); }

/* segmented */
.seg { display: inline-flex; background: var(--surface-3); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: none; background: none; font-family: var(--font-ui); font-size: 12.5px; font-weight: 600; color: var(--text-2); padding: 6px 13px; border-radius: 7px; cursor: pointer; transition: all var(--fast); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* density */
[data-density="compact"] { --gap: 12px; }
[data-density="compact"] .stat { padding: 12px 13px; }
[data-density="compact"] .stat .s-val { font-size: 24px; margin: 8px 0 2px; }
[data-density="compact"] table.oc td { padding: 6px 11px; }
[data-density="compact"] .stage-cell { height: 40px; }
[data-density="compact"] .card-pad { padding: 14px; }
[data-density="compact"] .page-inner { padding: 18px 20px 50px; }
[data-density="comfy"] { --gap: 20px; }
[data-density="comfy"] .stat { padding: 20px 21px; }
[data-density="comfy"] table.oc td { padding: 13px 14px; }
[data-density="comfy"] .stage-cell { height: 52px; }
[data-density="comfy"] .card-pad { padding: 22px; }
[data-density="comfy"] .page-inner { padding: 30px 32px 70px; }

/* 2-col layouts collapse */
@media (max-width: 1080px) {
  .dash-2col { grid-template-columns: 1fr !important; }
  .crm-2col { grid-template-columns: 1fr !important; }
}

/* ---------------- UI KIT ---------------- */
/* modal */
.mk-overlay { position: fixed; inset: 0; z-index: 110; background: rgba(12,16,24,.46); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 7vh 16px 40px; overflow-y: auto; animation: fadeIn .16s var(--ease); }
.mk-modal { width: min(640px, 100%); background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); animation: popIn .2s var(--ease-out); display: flex; flex-direction: column; max-height: 86vh; }
.mk-modal.wide { width: min(900px, 100%); }
.mk-head { display: flex; align-items: flex-start; gap: 13px; padding: 19px 22px; border-bottom: 1px solid var(--border); flex: none; }
.mk-head .mk-ico { width: 40px; height: 40px; border-radius: 11px; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.mk-head h3 { font-family: var(--font-display); font-size: 17px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.mk-head .mk-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.mk-body { padding: 22px; overflow-y: auto; flex: 1; }
.mk-foot { display: flex; align-items: center; gap: 10px; padding: 15px 22px; border-top: 1px solid var(--border); background: var(--surface-2); flex: none; border-radius: 0 0 var(--r-xl) var(--r-xl); }

/* field */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: 12px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.field > label .req { color: var(--neg); }
.field .hint { font-size: 11.5px; color: var(--text-3); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
textarea.input { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; font-family: var(--font-ui); }
select.input { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238c939e' stroke-width='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: 32px; }

/* toggle */
.toggle { width: 40px; height: 23px; border-radius: 99px; border: none; background: var(--border-2); position: relative; cursor: pointer; flex: none; transition: background var(--fast); padding: 0; }
.toggle.on { background: var(--accent); }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 99px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform var(--fast) var(--ease); }
.toggle.on::after { transform: translateX(17px); }
.toggle-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: none; }
.toggle-row .tr-txt { flex: 1; }
.toggle-row .tr-txt b { font-size: 13.5px; font-weight: 600; display: block; }
.toggle-row .tr-txt span { font-size: 12px; color: var(--text-3); }

/* custom dropdown (select with rich rows) */
.dd { position: relative; display: inline-block; }
.dd-btn { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 9px 0 10px; border-radius: 8px; border: 1px solid transparent; background: transparent; cursor: pointer; font-family: var(--font-ui); font-size: 13px; font-weight: 600; color: var(--text); transition: background var(--fast), border-color var(--fast); max-width: 100%; }
.dd-btn:hover { background: var(--surface-3); }
.dd-btn.bordered { border-color: var(--border-2); background: var(--surface); }
.dd-btn .dd-chev { margin-left: auto; color: var(--text-3); flex: none; }
.dd-menu { position: absolute; top: calc(100% + 5px); left: 0; z-index: 60; min-width: 220px; max-height: 320px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border-2); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; animation: popIn .15s var(--ease-out); }
.dd-menu.right { left: auto; right: 0; }
.dd-opt { display: flex; align-items: center; gap: 10px; padding: 8px 9px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500; }
.dd-opt:hover { background: var(--surface-3); }
.dd-opt.sel { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.dd-opt .dd-check { margin-left: auto; color: var(--accent); }

/* toast */
.toaster { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 9px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 11px; padding: 12px 16px 12px 13px; border-radius: 12px; background: var(--text); color: var(--surface); box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 600; min-width: 260px; max-width: 420px; animation: toastIn .3s var(--ease-out); pointer-events: auto; }
.toast .t-ico { width: 26px; height: 26px; border-radius: 7px; flex: none; display: grid; place-items: center; }
.toast.ok .t-ico { background: var(--pos); color: #fff; }
.toast.info .t-ico { background: var(--accent); color: #fff; }
.toast.warn .t-ico { background: var(--stage-orange); color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
.toast.out { animation: toastOut .25s var(--ease) forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.97); } }

/* tabs (underline style) */
.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: none; background: none; font-family: var(--font-ui); font-size: 13.5px; font-weight: 600; color: var(--text-2); padding: 10px 13px; cursor: pointer; position: relative; white-space: nowrap; transition: color var(--fast); }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--accent-text); }
.tabs button.on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: var(--accent); }

/* stepper (договор wizard) */
.stepper { display: flex; align-items: center; margin-bottom: 4px; }
.stepper .st-node { display: flex; align-items: center; gap: 8px; }
.stepper .st-num { width: 26px; height: 26px; border-radius: 99px; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; background: var(--surface-3); color: var(--text-3); transition: all var(--fast); }
.stepper .st-num.on { background: var(--accent); color: #fff; }
.stepper .st-num.done { background: var(--pos); color: #fff; }
.stepper .st-label { font-size: 12.5px; font-weight: 600; color: var(--text-3); white-space: nowrap; }
.stepper .st-label.on { color: var(--text); }
.stepper .st-line { flex: 1; height: 2px; margin: 0 10px; background: var(--border); min-width: 14px; }
.stepper .st-line.done { background: var(--pos); }

/* data key/value list (HR view+edit) */
.kv { display: grid; grid-template-columns: 150px 1fr; }
.kv > dt { font-size: 12.5px; color: var(--text-3); font-weight: 600; padding: 11px 0; border-bottom: 1px solid var(--border); }
.kv > dd { font-size: 13.5px; font-weight: 600; padding: 11px 0; border-bottom: 1px solid var(--border); margin: 0; }
.kv > dt:last-of-type, .kv > dd:last-of-type { border-bottom: none; }

/* segmented (for income/expense) reuse .seg */

/* ---------------- CRM layout ---------------- */
.crm-wrap { display: flex; flex-direction: column; height: 100%; padding: 22px 26px 0; }
.crm-kanban { flex: 1; min-height: 0; }
.crm-kanban .kcol { max-height: 100%; }

/* chat-style client list */
.crm-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; padding: 2px 2px 16px; margin: 0 -2px; }
.crm-dialog { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); cursor: pointer; font-family: var(--font-ui); transition: border-color var(--fast), box-shadow var(--fast), transform var(--fast); }
.crm-dialog:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.crm-dialog.unread { border-left: 3px solid var(--accent); }
.crm-dialog.done { opacity: .62; background: var(--surface-2); }
.crm-dialog.done:hover { opacity: 1; }
.cd-av { position: relative; flex: none; }
.cd-av .cd-dot { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 99px; border: 2px solid var(--surface); }
.cd-id { width: 250px; flex: none; min-width: 0; }
.cd-name { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-sub { display: flex; align-items: center; gap: 7px; margin-top: 3px; font-size: 11.5px; color: var(--text-3); min-width: 0; }
.cd-apt { flex: none; font-weight: 600; color: var(--text-2); padding: 1px 7px; background: var(--surface-3); border-radius: 6px; }
.cd-msg { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.cd-msg-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-meta { width: 168px; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; text-align: right; }
.cd-time { font-size: 11px; color: var(--text-3); font-weight: 600; }
.cd-stage { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.crm-divider { display: flex; align-items: center; gap: 11px; margin: 14px 2px 4px; color: var(--text-3); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.crm-divider::before, .crm-divider::after { content: ''; height: 1px; background: var(--border); flex: 1; }
@media (max-width: 980px) { .cd-msg { display: none; } .cd-id { flex: 1; width: auto; } }
@media (max-width: 620px) { .cd-meta { width: auto; } .cd-stage { display: none; } }

/* bottom-docked AI assistant */
.crm-asst { flex: none; margin: 0 -26px; border-top: 1px solid var(--border); background: var(--surface); box-shadow: 0 -8px 24px -16px rgba(0,0,0,.2); }
.crm-asst .asst-head { display: flex; align-items: center; gap: 10px; padding: 10px 26px; cursor: pointer; }
.crm-asst.collapsed .asst-head { padding: 11px 26px; }
.asst-body { padding: 0 26px 14px; }
.asst-stream { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0 12px; align-items: flex-start; }
.asst-bubble { flex: none; max-width: 420px; padding: 10px 13px; border-radius: 12px; font-size: 12.5px; line-height: 1.45; }
.asst-bubble.ai { background: var(--surface-3); color: var(--text); border-bottom-left-radius: 4px; }
.asst-bubble.me { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.asst-input { display: flex; flex-direction: column; }

/* deal modal stage strip */
.deal-stages { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.deal-stage { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text-2); font-family: var(--font-ui); font-size: 12px; font-weight: 600; cursor: pointer; transition: all var(--fast); }
.deal-stage:hover { border-color: var(--accent); color: var(--text); }
.deal-stage .ds-dot { width: 8px; height: 8px; border-radius: 99px; }
.deal-stage.done { background: var(--surface-2); color: var(--text-3); }
.deal-stage.on { background: var(--text); color: var(--surface); border-color: var(--text); }

/* ---- data-agnostic robustness utilities ---- */
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
table.oc td .truncate, table.oc td.tcell { max-width: 280px; }
.wrap-anywhere { overflow-wrap: anywhere; word-break: break-word; }
.num-fixed { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* state boxes */
.state-box { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 46px 24px; }
.state-ico { width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-3); margin-bottom: 14px; }
.state-ico.err { background: color-mix(in oklch, var(--neg) 13%, var(--surface)); color: var(--neg); }
.state-title { font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.state-sub { font-size: 13px; color: var(--text-3); margin-top: 5px; max-width: 320px; line-height: 1.5; }

/* skeleton shimmer */
.sk { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 37%, var(--surface-3) 63%); background-size: 200% 100%; border-radius: 6px; animation: shimmer 1.3s infinite linear; }
.sv-sec { font-family: var(--font-display); font-size: 14px; font-weight: 600; color: var(--text-2); margin: 24px 2px 11px; }

/* ---------------- RESPONSIVE PASS (планшет/мобайл) ---------------- */
/* планшет */
@media (max-width: 1080px) {
  .page-inner { padding: 18px 16px 56px; }
  .dash-2col, .crm-2col { grid-template-columns: 1fr !important; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); }
}
/* узкий планшет / большой телефон */
@media (max-width: 760px) {
  .topbar { height: 56px; padding: 0 14px; gap: 10px; }
  .tb-title h1 { font-size: 16px; }
  .tb-title .crumb { font-size: 10.5px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 11px; }
  .stat .s-val { font-size: 23px; }
  .page-inner { padding: 16px 13px 56px; }
  /* модалки и drawer на всю ширину снизу */
  .mk-overlay { padding: 0; align-items: flex-end; }
  .mk-modal, .mk-modal.wide { width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; animation: sheetUp .3s var(--ease-out); }
  .drawer { width: 96%; max-height: 90vh; }
  .field-row, .field-row-3 { grid-template-columns: 1fr; }
  .cmd-modal { width: 96vw; }
  .deal-stages { gap: 5px; }
  .deal-stage { height: 28px; padding: 0 10px; font-size: 11px; }
  /* секции с прилипшей правой колонкой -> в один столбец */
  .oc-stage-col { min-width: 116px; }
}
/* телефон */
@media (max-width: 520px) {
  .stat-grid { grid-template-columns: 1fr; }
  .seg { flex-wrap: wrap; }
  .tabs { gap: 0; }
  .tabs button { padding: 10px 10px; font-size: 12.5px; }
  .page-inner.wide { padding: 14px 12px 56px; }
  .card-pad { padding: 14px; }
  /* прячем декоративный крамб на самых узких */
  .tb-title .crumb { display: none; }
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }

/* ---------------- apps hub grid ---------------- */
.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 14px; }
.app-tile { position: relative; display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); cursor: pointer; text-align: left; font-family: var(--font-ui); transition: transform var(--fast), box-shadow var(--fast), border-color var(--fast); }
.app-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-2); }
.app-ico { width: 52px; height: 52px; border-radius: 14px; flex: none; display: grid; place-items: center; }
.app-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.app-meta b { font-size: 14.5px; font-weight: 600; }
.app-meta span { font-size: 12px; color: var(--text-3); line-height: 1.35; }
.app-tile-add { border-style: dashed; box-shadow: none; background: var(--surface-2); }
.app-tile-add:hover { border-color: var(--accent); }

/* editable avatar */
.editable-avatar { position: relative; border-radius: 99px; cursor: pointer; outline: none; flex: none; }
.editable-avatar .ea-overlay { position: absolute; inset: 0; border-radius: 99px; display: grid; place-items: center; background: rgba(12,16,24,.45); color: #fff; opacity: 0; transition: opacity var(--fast); }
.editable-avatar:hover .ea-overlay, .editable-avatar:focus-visible .ea-overlay { opacity: 1; }
.editable-avatar:focus-visible { box-shadow: 0 0 0 3px var(--ring); }
.editable-avatar .ea-clear { position: absolute; top: -3px; right: -3px; width: 20px; height: 20px; border-radius: 99px; border: 2px solid var(--surface); background: var(--neg); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }

/* ---------------- nomenclature catalog ---------------- */
.nm-layout { display: grid; grid-template-columns: 264px minmax(0,1fr); gap: 18px; align-items: start; }
.nm-nav { position: sticky; top: 16px; overflow: hidden; }
.nm-nav-scroll { max-height: calc(100vh - 200px); overflow-y: auto; padding: 8px; }
.nm-phase { margin-bottom: 6px; }
.nm-phase-head { display: flex; align-items: center; gap: 9px; padding: 9px 10px 7px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.nm-phase-num { width: 20px; height: 20px; border-radius: 6px; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-size: 11px; font-weight: 800; }
.nm-stage { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 8px 10px; border: none; background: none; border-radius: 9px; cursor: pointer; font-family: var(--font-ui); color: var(--text-2); transition: background var(--fast), color var(--fast); }
.nm-stage:hover { background: var(--surface-3); color: var(--text); }
.nm-stage.on { background: var(--accent); color: #fff; }
.nm-stage-t { flex: 1; font-size: 12.5px; font-weight: 500; }
.nm-stage.on .nm-stage-t { font-weight: 600; }
.nm-stage-c { font-size: 11px; font-weight: 700; opacity: .7; }

.nm-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.nm-title { font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -.01em; margin: 2px 0 0; }
.nm-search { display: flex; align-items: center; gap: 8px; width: 300px; max-width: 100%; }
.nm-search input { border: none; outline: none; background: none; width: 100%; font-family: var(--font-ui); font-size: 13.5px; color: var(--text); }
.nm-filters { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 16px; }

.nm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(184px,1fr)); gap: 14px; }
.nm-card { display: flex; flex-direction: column; padding: 0; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm); cursor: pointer; overflow: hidden; text-align: left; font-family: var(--font-ui); transition: transform var(--fast), box-shadow var(--fast), border-color var(--fast); }
.nm-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-2); }
.nm-card-img { position: relative; height: 150px; flex: none; background: #fff; border-bottom: 1px solid var(--border); }
.nm-sku { position: absolute; bottom: 8px; left: 8px; font-family: var(--font-mono); font-size: 10px; font-weight: 600; background: color-mix(in oklch, var(--surface) 85%, transparent); backdrop-filter: blur(4px); color: var(--text-2); border-radius: 6px; padding: 2px 6px; }
.nm-card-body { padding: 11px 12px 12px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.nm-card-name { font-size: 12.5px; font-weight: 600; line-height: 1.35; flex: 1; }
.nm-card-foot { display: flex; align-items: center; gap: 8px; }
.nm-price { font-family: var(--font-display); font-size: 15px; font-weight: 700; }
.nm-add { margin-left: auto; width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); transition: background var(--fast), color var(--fast); }
.nm-add:hover { background: var(--accent); color: #fff; }

@media (max-width: 880px) {
  .nm-layout { grid-template-columns: 1fr; }
  .nm-nav { position: static; }
  .nm-nav-scroll { max-height: 260px; }
  .nm-card-modal { grid-template-columns: 1fr !important; }
}
.nm-step { width: 26px; height: 26px; border-radius: 8px; flex: none; display: grid; place-items: center; background: var(--accent); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 14px; }
.nm-stage-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 0; }
.nm-stage-row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border: none; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); background: none; cursor: pointer; text-align: left; font-family: var(--font-ui); transition: background var(--fast); }
.nm-stage-row:hover { background: var(--surface-2); }
.pack-veh-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 9px; margin-bottom: 14px; }
.pack-veh { padding: 12px 13px; border-radius: 12px; border: 1px solid var(--border-2); cursor: pointer; text-align: left; font-family: var(--font-ui); transition: border-color var(--fast), background var(--fast); }
.exp-item { display: flex; align-items: center; gap: 9px; padding: 8px 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.exp-trip { display: flex; align-items: center; gap: 13px; width: 100%; text-align: left; padding: 13px 16px; cursor: pointer; border: 1px solid var(--border); background: var(--surface); font-family: var(--font-ui); transition: border-color var(--fast), box-shadow var(--fast); }
.exp-trip:hover { border-color: var(--accent); box-shadow: var(--shadow); }
/* номенклатура — строки выбора */
.nm-bar { display: flex; align-items: flex-start; gap: 12px; padding: 11px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); margin-bottom: 10px; box-shadow: var(--shadow-sm); }
.nm-bar-label { flex: none; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding-top: 7px; width: 64px; }
.nm-bar-chips { display: flex; gap: 7px; flex-wrap: wrap; flex: 1; }
.nm-tab { display: inline-flex; align-items: center; gap: 9px; padding: 7px 12px 7px 11px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface); cursor: pointer; font-family: var(--font-ui); color: var(--text-2); transition: all var(--fast); }
.nm-tab:hover { border-color: var(--accent); color: var(--text); }
.nm-tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.nm-tab span { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.nm-tab span b { font-size: 13px; font-weight: 600; }
.nm-tab span i { font-size: 10.5px; font-style: normal; opacity: .7; }
.nm-tab .nm-tab-n { font-size: 11px; font-weight: 700; background: var(--surface-3); color: var(--text-2); border-radius: 99px; padding: 1px 7px; min-width: 18px; text-align: center; }
.nm-tab.on .nm-tab-n { background: rgba(255,255,255,.25); color: #fff; }
/* закупщик — 2 колонки: заявки + сводка закупленного */
.buyer-2col { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 16px; align-items: start; }
@media (max-width: 1080px) { .buyer-2col { grid-template-columns: 1fr; } .buyer-side .card { position: static !important; } }
/* калькулятор ЗП — чип выбора специалиста */
.spec-chip { display: inline-flex; align-items: center; gap: 9px; padding: 6px 13px 6px 7px; border-radius: 99px; border: 1px solid var(--border-2); cursor: pointer; font-family: var(--font-ui); flex: none; transition: all var(--fast); }
.spec-chip:hover { border-color: var(--accent); }

/* responsive shell */
.sb-toggle-mobile { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 248px; transform: translateX(-100%); transition: transform var(--med) var(--ease); box-shadow: var(--shadow-lg); }
  .app.mobile-open .sidebar { transform: none; }
  .cmd-trigger { min-width: 0; width: 38px; padding: 0; justify-content: center; }
  .cmd-trigger .cmd-label, .cmd-trigger .kbd { display: none; }
  .sb-toggle-mobile { display: grid; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 25; }
}
