/* ───────────── ИИ-задачник МСПП (стиль Пульта АХО, фирменный синий) ───────────── */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --surface-3: #f1f2f5;
  --border: #e6e8ec;
  --border-strong: #d5d8de;
  --text: #11131a;
  --text-2: #4a4f5c;
  --muted: #8a8f9c;
  --accent: #2887c0;
  --accent-2: #1f73a6;
  --accent-soft: #e6f2fa;
  --accent-text: #ffffff;
  --success: #16a36a;
  --success-soft: #e3f6ed;
  --warning: #e08a00;
  --warning-soft: #fff3df;
  --danger: #e5484d;
  --danger-soft: #fdeceb;
  --info: #0b8fd6;
  --info-soft: #e3f3fc;
  --note: #fff8db;
  --note-border: #f1df9b;
  --shadow-sm: 0 1px 2px rgba(16, 19, 30, .05);
  --shadow: 0 1px 2px rgba(16, 19, 30, .04), 0 4px 16px rgba(16, 19, 30, .06);
  --shadow-lg: 0 10px 40px rgba(16, 19, 30, .16), 0 2px 8px rgba(16, 19, 30, .06);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --sidebar: 248px;
  --st-new: #2887c0;
  --st-taken: #e08a00;
  --st-done: #16a36a;
  --st-cancelled: #9097a3;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0d0f14;
  --surface: #15181f;
  --surface-2: #1a1d25;
  --surface-3: #20242d;
  --border: #262a34;
  --border-strong: #333845;
  --text: #eef0f4;
  --text-2: #b7bcc8;
  --muted: #7d8391;
  --accent: #4aa8e0;
  --accent-2: #6bbbea;
  --accent-soft: #0f2a3c;
  --success: #34c785;
  --success-soft: #12301f;
  --warning: #f5a524;
  --warning-soft: #33260c;
  --danger: #ff6369;
  --danger-soft: #3a1518;
  --info: #38b2f0;
  --info-soft: #0e2a3a;
  --note: #2e2810;
  --note-border: #4d4318;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  --shadow-lg: 0 16px 50px rgba(0, 0, 0, .55);
  --st-new: #4aa8e0;
  --st-taken: #f5a524;
  --st-done: #34c785;
  --st-cancelled: #6e7480;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01", "tnum";
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ───── Layout ───── */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; height: 100vh; }
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 16px 12px;
  gap: 4px;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #1a5f8c);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; letter-spacing: -.02em;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent);
}
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.brand-sub { color: var(--muted); font-size: 12px; }
.nav-label { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 14px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); cursor: pointer; user-select: none;
  transition: background .12s, color .12s;
  font-weight: 500;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-item .count { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 600; }
.nav-item.active .count { color: var(--accent); }
.nav-item .pill-count { margin-left: auto; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 20px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.sidebar-foot { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.me {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface-2); cursor: pointer;
}
.me:hover { border-color: var(--border-strong); }
.me .who { min-width: 0; flex: 1; }
.me .who b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who span { color: var(--muted); font-size: 12px; }
.foot-row { display: flex; gap: 6px; }
.demo-badge { font-size: 11.5px; color: var(--warning); background: var(--warning-soft); padding: 8px 10px; border-radius: var(--radius-sm); line-height: 1.35; }

.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 24px; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 5;
  min-height: 60px;
}
.page-title { font-size: 18px; font-weight: 700; letter-spacing: -.015em; margin: 0; white-space: nowrap; }
.page-sub { color: var(--muted); font-size: 13px; white-space: nowrap; }
.search {
  margin-left: auto; position: relative; width: min(380px, 40vw);
}
.search input {
  width: 100%; height: 36px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); padding: 0 64px 0 34px; outline: none; transition: border-color .12s, box-shadow .12s;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.search > .i { position: absolute; left: 11px; top: 10px; color: var(--muted); }
.kbd { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--surface-2); font-family: inherit; }
.search .kbd { position: absolute; right: 9px; top: 8px; }
.live { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.live .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 60%, transparent); animation: pulse 2s infinite; }
.live.off .pulse { background: var(--danger); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 50%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.content { flex: 1; overflow: auto; padding: 22px 24px 40px; }
.content-inner { max-width: 1480px; margin: 0 auto; }

/* ───── Buttons & inputs ───── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; font-weight: 600; font-size: 13.5px;
  transition: background .12s, border-color .12s, transform .06s, box-shadow .12s;
  white-space: nowrap; box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.primary:hover { background: var(--accent-2); }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.success:hover { filter: brightness(1.05); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }

.input, .select, .textarea {
  width: 100%; height: 36px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); outline: none; transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; min-height: 80px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.select { padding-right: 30px; appearance: none; cursor: pointer;
  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='%238a8f9c' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.input.dirty, .select.dirty, .textarea.dirty { border-color: var(--warning); background: color-mix(in srgb, var(--warning-soft) 50%, var(--surface)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 12px; color: var(--muted); font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; color: var(--text-2); }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

/* ───── Cards ───── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px 6px; }
.card-h h3 { margin: 0; font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; }
.card-h .sub { color: var(--muted); font-size: 12.5px; }
.card-h .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-b { padding: 12px 18px 18px; }

.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { padding: 16px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; cursor: default; transition: transform .15s, box-shadow .15s; }
.kpi.link { cursor: pointer; }
.kpi.link:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi .k-label { color: var(--muted); font-size: 12.5px; font-weight: 600; padding-right: 34px; min-height: 28px; display: flex; align-items: center; line-height: 1.25; }
.kpi .k-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; position: absolute; top: 14px; right: 14px; }
.kpi .k-ico .i { width: 14px; height: 14px; }
.kpi .k-val { font-size: 28px; font-weight: 750; letter-spacing: -.03em; line-height: 1.1; }
.kpi .k-val small { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 2px; }
.kpi .k-foot { font-size: 12px; color: var(--muted); }

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

/* ───── Status / chips ───── */
.status {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 8px;
  border-radius: 20px; font-size: 12px; font-weight: 650; white-space: nowrap;
  background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c);
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.new { --c: var(--st-new); }
.status.taken { --c: var(--st-taken); }
.status.done { --c: var(--st-done); }
.status.cancelled { --c: var(--st-cancelled); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: color-mix(in srgb, var(--c, var(--muted)) 12%, transparent); color: color-mix(in srgb, var(--c, var(--muted)) 85%, var(--text));
}
.num { font-family: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace; font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: -.02em; }
.flag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 650; padding: 1px 7px; border-radius: 6px; white-space: nowrap; }
.flag.overdue { color: var(--danger); background: var(--danger-soft); }
.flag.stale { color: var(--warning); background: var(--warning-soft); }
.flag.unread { color: #fff; background: var(--accent); }
.flag .i { width: 12px; height: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #fff;
  background: var(--c, var(--accent)); letter-spacing: -.02em;
}
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.avatar.xl { width: 76px; height: 76px; font-size: 26px; box-shadow: 0 6px 20px color-mix(in srgb, var(--c) 40%, transparent); }

/* ───── Tabs / filters ───── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer;
  color: var(--text-2); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
  transition: color .12s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab .cnt { font-size: 11.5px; padding: 0 7px; border-radius: 20px; background: var(--surface-3); color: var(--muted); font-weight: 700; line-height: 19px; }
.tab.active .cnt { background: var(--accent-soft); color: var(--accent); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filters .select, .filters .input { width: auto; height: 32px; font-size: 13px; }
.filters input[type=date] { width: 138px; padding: 0 8px; }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; height: 26px; padding: 0 10px; border-radius: 7px; cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.toggle-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: 9px; cursor: pointer;
  border: 1px dashed var(--border-strong); color: var(--text-2); font-size: 13px; font-weight: 600; background: transparent;
}
.toggle-chip.on { border-style: solid; border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.spacer { flex: 1; }

/* ───── Table ───── */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; }
.t th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  font-weight: 650; padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  white-space: nowrap; position: sticky; top: 0;
}
.t td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.t tbody tr { cursor: pointer; transition: background .08s; }
.t tbody tr:hover { background: var(--surface-2); }
.t tbody tr.sel { background: var(--accent-soft); }
.t tbody tr:last-child td { border-bottom: 0; }
.t .who b { display: block; font-weight: 600; max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t .who > span { display: block; color: var(--muted); font-size: 12.5px; max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t .when { white-space: nowrap; color: var(--text-2); font-size: 13px; }
.t .when span { display: block; color: var(--muted); font-size: 12px; }
.exec-cell { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.pager { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 12px 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }

.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty .i { width: 36px; height: 36px; stroke-width: 1.4; margin-bottom: 8px; color: var(--border-strong); }
.empty b { display: block; color: var(--text-2); font-size: 15px; margin-bottom: 4px; }

/* ───── Lists ───── */
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 18px; cursor: pointer; border-top: 1px solid var(--border); transition: background .08s; }
.list-row:hover { background: var(--surface-2); }
.list-row .body { flex: 1; min-width: 0; }
.list-row .body b { display: block; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .body span { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.time-badge { font-weight: 700; font-size: 13px; min-width: 48px; text-align: center; padding: 4px 0; border-radius: 8px; background: var(--surface-3); }
.time-badge.now { background: var(--accent); color: #fff; }

.dir-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 10px 0; border-top: 1px solid var(--border); cursor: pointer; }
.dir-row:first-child { border-top: 0; }
.dir-row .name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.dir-row .nums { font-size: 12.5px; color: var(--muted); }
.dir-row .nums b { color: var(--text); }
.bar { grid-column: 1 / -1; height: 6px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: var(--c); transition: width .5s cubic-bezier(.2, .8, .2, 1); }

/* ───── Charts ───── */
.chart { width: 100%; height: 220px; display: block; }
.chart .gl { stroke: var(--border); stroke-dasharray: 3 4; }
.chart .ax { fill: var(--muted); font-size: 11px; }
.chart .b1 { fill: color-mix(in srgb, var(--accent) 30%, transparent); }
.chart .b2 { fill: var(--success); }
.chart rect { transition: opacity .12s; }
.chart g.col:hover rect { opacity: .75; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }


/* ───── Kanban ───── */
.board { display: grid; grid-template-columns: repeat(4, minmax(260px, 1fr)); gap: 14px; align-items: start; }
.col-k { background: var(--surface-3); border-radius: var(--radius-lg); padding: 10px; min-height: 200px; border: 1px solid transparent; transition: border-color .12s, background .12s; }
.col-k.drop { border-color: var(--accent); background: var(--accent-soft); }
.col-k-h { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-weight: 700; }
.col-k-h .cnt { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.col-k-list { display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 240px); overflow-y: auto; padding: 2px; }
.kcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 11px 12px;
  cursor: grab; box-shadow: var(--shadow-sm); transition: box-shadow .12s, transform .12s, border-color .12s;
  border-left: 3px solid var(--c);
}
.kcard:hover { box-shadow: var(--shadow); border-color: var(--border-strong); border-left-color: var(--c); }
.kcard.dragging { opacity: .4; }
.kcard .top { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.kcard .title { font-weight: 600; font-size: 13.5px; margin-bottom: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kcard .meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; margin-top: 8px; }
.kcard .meta .avatar { margin-left: auto; }

/* ───── Schedule ───── */
.sched-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.sched-range { font-weight: 700; font-size: 15px; margin: 0 6px; }
.sched { display: grid; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.sched .hcell { padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); }
.sched .hcell:first-child { border-left: 0; }
.sched .hcell .wd { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.sched .hcell .dd { font-size: 18px; font-weight: 750; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; }
.sched .hcell.today .dd span.today-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.sched .hcell.today { background: var(--accent-soft); }
.sched .hcell .load { height: 4px; border-radius: 4px; background: var(--surface-3); margin-top: 8px; overflow: hidden; }
.sched .hcell .load i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.sched .tcell { padding: 10px 8px; font-size: 12.5px; font-weight: 700; color: var(--muted); text-align: right; border-top: 1px solid var(--border); background: var(--surface-2); }
.sched .cell { border-top: 1px solid var(--border); border-left: 1px solid var(--border); padding: 5px; min-height: 64px; transition: background .1s; position: relative; }
.sched .cell.past { background: repeating-linear-gradient(-45deg, transparent 0 8px, color-mix(in srgb, var(--surface-3) 60%, transparent) 8px 9px); }
.sched .cell.free:hover { background: var(--surface-2); cursor: pointer; }
.sched .cell.free:hover::after { content: "+ записать"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; font-weight: 600; }
.sched .cell.drop { background: var(--accent-soft); outline: 2px dashed var(--accent); outline-offset: -4px; }
.sched .cell.lunch { background: repeating-linear-gradient(45deg, var(--surface-2) 0 6px, var(--surface-3) 6px 12px); display: grid; place-items: center; color: var(--muted); font-size: 12px; font-weight: 600; }
.appt {
  border-radius: 9px; padding: 7px 9px; font-size: 12.5px; cursor: pointer; height: 100%;
  background: color-mix(in srgb, var(--c) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
  border-left: 3px solid var(--c); transition: transform .1s, box-shadow .1s;
}
.appt + .appt { margin-top: 4px; }
.appt:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.appt b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt span { display: block; color: var(--text-2); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt.done { opacity: .6; }
.appt.done b { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--text) 40%, transparent); }
.appt.cancelled { opacity: .45; border-style: dashed; }
.appt .st { float: right; margin-left: 4px; }

/* ───── Executors ───── */
.exec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.exec-card { padding: 18px; cursor: pointer; transition: transform .15s, box-shadow .15s; display: flex; flex-direction: column; gap: 14px; }
.exec-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.exec-card.inactive { opacity: .6; }
.exec-head { display: flex; gap: 12px; align-items: center; }
.exec-head .nm { font-weight: 700; font-size: 15px; }
.exec-head .ps { color: var(--muted); font-size: 12.5px; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini-stats div { background: var(--surface-2); border-radius: 10px; padding: 9px 10px; }
.mini-stats b { display: block; white-space: nowrap; font-size: 16px; font-weight: 750; letter-spacing: -.02em; }
.mini-stats span { font-size: 11.5px; color: var(--muted); }
.ring { --p: 0; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; margin-left: auto;
  background: conic-gradient(var(--c, var(--success)) calc(var(--p) * 1%), var(--surface-3) 0); }
.ring span { width: 34px; height: 34px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 11px; font-weight: 700; }

.profile-head { display: flex; gap: 18px; align-items: center; padding: 22px; margin-bottom: 16px; position: relative; overflow: hidden; }
.profile-head::before { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 200px at 0% 0%, color-mix(in srgb, var(--c) 14%, transparent), transparent); pointer-events: none; }
.profile-head h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.profile-head .contacts { display: flex; gap: 16px; flex-wrap: wrap; color: var(--text-2); font-size: 13px; margin-top: 6px; }
.profile-head .contacts span { display: inline-flex; gap: 6px; align-items: center; }
.profile-head .actions { margin-left: auto; display: flex; gap: 8px; position: relative; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; cursor: pointer; margin-bottom: 12px; font-size: 13px; }
.back:hover { color: var(--text); }
.prof-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; }

/* ───── Drawer ───── */
.overlay { position: fixed; inset: 0; background: rgba(10, 12, 20, .32); z-index: 40; opacity: 0; transition: opacity .2s; backdrop-filter: blur(1px); }
.overlay.show { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); z-index: 41;
  background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .26s cubic-bezier(.2, .8, .2, 1);
}
.drawer.show { transform: none; }
.dr-head { padding: 16px 20px 0; border-bottom: 1px solid var(--border); }
.dr-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dr-title { font-size: 19px; font-weight: 750; letter-spacing: -.02em; margin: 2px 0 4px; }
.dr-sub { color: var(--muted); font-size: 13px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.dr-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.dr-head .tabs { margin-bottom: 0; border-bottom: 0; }
.dr-body { flex: 1; overflow-y: auto; padding: 18px 20px 24px; }
.dr-section { margin-bottom: 20px; }
.dr-section h4 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.savebar {
  position: sticky; bottom: -24px; margin: 16px -20px -24px; padding: 12px 20px; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(6px); border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: center;
  animation: slideup .18s ease-out;
}
@keyframes slideup { from { transform: translateY(100%); opacity: 0; } to { transform: none; opacity: 1; } }

.timeline { display: flex; gap: 0; margin-bottom: 4px; }
.tl-step { flex: 1; position: relative; padding-top: 18px; }
.tl-step::before { content: ""; position: absolute; top: 6px; left: 0; right: 0; height: 2px; background: var(--border); }
.tl-step:first-child::before { left: 7px; }
.tl-step:last-child::before { right: auto; width: 7px; }
.tl-step.on::before { background: var(--success); }
.tl-step .pt { position: absolute; top: 0; left: 0; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); }
.tl-step.on .pt { border-color: var(--success); background: var(--success); box-shadow: inset 0 0 0 2px var(--surface); }
.tl-step.cancel .pt { border-color: var(--st-cancelled); background: var(--st-cancelled); }
.tl-step b { display: block; font-size: 12.5px; }
.tl-step span { display: block; font-size: 12px; color: var(--muted); }
.tl-step em { display: inline-block; font-style: normal; font-size: 11px; font-weight: 650; color: var(--success); background: var(--success-soft); border-radius: 5px; padding: 0 5px; margin-top: 3px; }

.info-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: flex; align-items: center; gap: 12px; background: var(--surface-2); }
.info-card .body { flex: 1; min-width: 0; }
.info-card b { display: block; }
.info-card span { color: var(--muted); font-size: 12.5px; }

.slot-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.slot {
  height: 30px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; font-weight: 650; font-size: 12.5px; transition: all .1s;
}
.slot:hover { border-color: var(--accent); color: var(--accent); }
.slot.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.slot.busy { color: var(--muted); background: var(--surface-3); text-decoration: line-through; cursor: not-allowed; border-color: transparent; }

/* chat */
.chat { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 82%; display: flex; flex-direction: column; gap: 3px; }
.msg .bubble { padding: 9px 12px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.45; }
.msg .meta { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.msg .meta .i { width: 13px; height: 13px; }
.msg.out { align-self: flex-end; align-items: flex-end; }
.msg.out .bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 5px; }
.msg.out.failed .bubble { background: var(--danger); }
.msg.in { align-self: flex-start; }
.msg.in .bubble { background: var(--surface-3); border-bottom-left-radius: 5px; }
.msg.note { align-self: stretch; max-width: 100%; }
.msg.note .bubble { background: var(--note); border: 1px solid var(--note-border); border-radius: 10px; }
.msg.note .meta::before { content: "Внутренняя заметка ·"; font-weight: 650; }
.day-sep { text-align: center; color: var(--muted); font-size: 11.5px; font-weight: 600; margin: 6px 0; }
.composer { border-top: 1px solid var(--border); padding: 12px 20px 14px; background: var(--surface); }
.composer .textarea { min-height: 70px; max-height: 220px; border-radius: 12px; }
.composer.note .textarea { background: var(--note); border-color: var(--note-border); }
.composer-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.tpl-list { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.tpl { border: 1px solid var(--border); background: var(--surface-2); border-radius: 20px; padding: 3px 10px; font-size: 12px; cursor: pointer; font-weight: 600; color: var(--text-2); display: inline-flex; gap: 4px; align-items: center; }
.tpl:hover { border-color: var(--accent); color: var(--accent); }
.tpl .x { opacity: 0; margin-left: 2px; color: var(--muted); }
.tpl:hover .x { opacity: 1; }
.tpl .x:hover { color: var(--danger); }

.hist { position: relative; padding-left: 22px; }
.hist::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.hist-item { position: relative; padding-bottom: 14px; }
.hist-item::before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.hist-item .when { font-size: 12px; color: var(--muted); }
.hist-item .what { font-size: 13.5px; }
.hist-item .diff { font-size: 12.5px; margin-top: 3px; color: var(--text-2); }
.hist-item .diff s { color: var(--muted); }

/* ───── Modal ───── */
.modal-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(10, 12, 20, .38); animation: fade .15s; backdrop-filter: blur(2px); }
.modal { width: min(520px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); animation: pop .18s cubic-bezier(.2, .9, .3, 1.2); border: 1px solid var(--border); }
.modal.wide { width: min(680px, 100%); }
.modal-h { padding: 18px 20px 4px; display: flex; align-items: center; gap: 10px; }
.modal-h h3 { margin: 0; font-size: 17px; letter-spacing: -.01em; }
.modal-b { padding: 12px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-f { padding: 12px 20px 18px; display: flex; gap: 8px; justify-content: flex-end; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.96) translateY(6px); opacity: 0; } }


/* ───── Toasts ───── */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 420px; padding: 11px 14px;
  background: var(--text); color: var(--bg); border-radius: 12px; box-shadow: var(--shadow-lg);
  animation: toastIn .25s cubic-bezier(.2, .9, .3, 1.2); font-weight: 500; cursor: default;
}
.toast.click { cursor: pointer; }
.toast.err { background: var(--danger); color: #fff; }
.toast.new { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-left: 4px solid var(--accent); }
.toast .t-b { flex: 1; min-width: 0; }
.toast .t-b b { display: block; }
.toast .t-b span { font-size: 12.5px; opacity: .75; }
@keyframes toastIn { from { transform: translateY(12px) scale(.96); opacity: 0; } }

.skeleton { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }
.fade-in { animation: fadeUp .25s ease-out; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } }

.menu { position: absolute; z-index: 70; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 220px; animation: pop .12s; }
.menu .m-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.menu .m-item:hover { background: var(--surface-3); }
.menu .m-item.on { color: var(--accent); font-weight: 600; }

/* ───── Responsive ───── */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .dash, .prof-grid { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(4, 280px); overflow-x: auto; }
}
@media (max-width: 860px) {
  :root { --sidebar: 64px; }
  .sidebar { padding: 12px 8px; align-items: center; }
  .brand-name, .brand-sub, .nav-label, .nav-item span.lbl, .nav-item .count, .me .who, .demo-badge, .dir-nav { display: none; }
  .nav-item { justify-content: center; position: relative; }
  .nav-item .pill-count { position: absolute; top: 0; right: 0; font-size: 10px; padding: 0 5px; }
  .brand { padding: 4px 0 14px; }
  .foot-row { flex-direction: column; }
  .topbar { padding: 10px 14px; }
  .content { padding: 16px 14px 32px; }
  .live, .page-sub { display: none; }
  .t .hide-sm { display: none; }
}
@media (max-width: 600px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
  .topbar .btn .lbl { display: none; }
}

/* ───── Вход ───── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(900px 500px at 15% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent), var(--bg); }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow-lg); padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.login-card h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.login-card p { margin: -4px 0 6px; font-size: 13.5px; }
.input.lg, .btn.lg { height: 44px; font-size: 15px; border-radius: 12px; }
.input.code { text-align: center; font-size: 26px; font-weight: 750; letter-spacing: .5em; padding-left: .5em; font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; }
.login-links { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; }
.login-links a { display: inline-flex; align-items: center; gap: 5px; }
.login-links a.off { color: var(--muted); pointer-events: none; font-weight: 500; }
.login-err { color: var(--danger); font-size: 13px; font-weight: 600; display: flex; gap: 6px; align-items: center; min-height: 18px; }

/* ───── Задачи отдела ───── */
.task-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.tstats { display: flex; gap: 10px; flex-wrap: wrap; }
.tstat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 14px; display: flex; align-items: baseline; gap: 8px; box-shadow: var(--shadow-sm); }
.tstat b { font-size: 20px; font-weight: 750; letter-spacing: -.02em; }
.tstat span { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.tsearch { margin-left: 0; width: 240px; }
.tsearch input { padding-right: 12px; }
.people { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; padding-bottom: 2px; }
.person { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px 0 6px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13px; white-space: nowrap; color: var(--text-2); transition: all .12s; }
.person:hover { border-color: var(--border-strong); color: var(--text); }
.person.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.person b { font-size: 12px; background: var(--surface-3); color: var(--text-2); border-radius: 10px; padding: 0 7px; line-height: 19px; }
.person.on b { background: var(--accent); color: #fff; }
.person i { font-style: normal; font-size: 11px; font-weight: 700; color: #fff; border-radius: 10px; padding: 0 6px; line-height: 18px; }
.person i.od { background: var(--danger); }
.person i.rv { background: var(--info); }

.tboard { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 14px; align-items: start; }
.tcol { background: var(--surface-3); border-radius: var(--radius-lg); padding: 10px; border: 2px dashed transparent; transition: border-color .12s, background .12s; min-height: 220px; }
.tcol.drop { border-color: var(--accent); background: var(--accent-soft); }
.tcol.nodrop { opacity: .55; }
.tcol-h { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; }
.tcol-h .cnt { color: var(--muted); font-weight: 700; font-size: 12.5px; }
.tcol-list { display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 290px); overflow-y: auto; padding: 2px; }
.tempty { color: var(--muted); font-size: 12.5px; text-align: center; padding: 24px 8px; }
.tcard { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 11px 12px; cursor: grab; position: relative;
  box-shadow: var(--shadow-sm); transition: box-shadow .12s, transform .12s, border-color .12s; }
.tcard:hover { box-shadow: var(--shadow); border-color: var(--border-strong); transform: translateY(-1px); }
.tcard.dragging { opacity: .4; }
.tcard.prio-urgent { border-left: 3px solid var(--danger); }
.tcard.prio-high { border-left: 3px solid var(--warning); }
.prio { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; color: var(--warning); }
.prio-urgent .prio, .prio.p-urgent { color: var(--danger); }
.prio .i { width: 12px; height: 12px; }
.ttitle { font-weight: 650; font-size: 13.5px; line-height: 1.35; }
.tdesc { color: var(--muted); font-size: 12.5px; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tmeta { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.tico { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 12px; font-weight: 600; }
.tico.ok { color: var(--success); }
.tico .i { width: 13px; height: 13px; }
.due { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 650; padding: 2px 8px; border-radius: 7px; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.due .i { width: 12px; height: 12px; }
.due.overdue { background: var(--danger-soft); color: var(--danger); }
.due.today { background: var(--warning-soft); color: var(--warning); }
.due.soon { background: var(--info-soft); color: var(--info); }
.due.ok { background: var(--success-soft); color: var(--success); }
.due.late { background: var(--danger-soft); color: var(--danger); }
.due.none { background: transparent; color: var(--muted); font-weight: 500; padding: 0; }

.tstage { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 20px; font-size: 12px; font-weight: 700;
  background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); }
.tsteps { display: flex; gap: 6px; margin: 14px 0 4px; }
.tstep { flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.tstep i { height: 4px; border-radius: 4px; background: var(--surface-3); }
.tstep.past i { background: color-mix(in srgb, var(--success) 55%, transparent); }
.tstep.cur i { background: var(--accent); }
.tstep.cur { color: var(--text); }
.tdesc-full { white-space: pre-wrap; line-height: 1.5; }

.dz { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 14px; border: 1.5px dashed var(--border-strong);
  border-radius: 12px; cursor: pointer; color: var(--text-2); font-weight: 600; font-size: 13px; text-align: center; transition: all .12s; background: var(--surface-2); }
.dz small { color: var(--muted); font-weight: 500; font-size: 11.5px; }
.dz:hover, .dz.over { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.dz.busy { opacity: .6; pointer-events: none; }
.dz.busy span::after { content: " — загрузка…"; }
.frow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 6px; background: var(--surface); }
.fext { min-width: 38px; height: 28px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-size: 10.5px; font-weight: 800; display: grid; place-items: center; }
.fname { font-weight: 600; color: var(--text); min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fname:hover { color: var(--accent); }
.frow .muted { white-space: nowrap; }
.tfeed { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.tev.sys { font-size: 12.5px; color: var(--text-2); padding-left: 10px; border-left: 2px solid var(--border); }
.tev-note { color: var(--text); margin-top: 3px; white-space: pre-wrap; }
.tev.comment { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 9px 12px; }
.tev-h { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 13px; }
.tev-b { white-space: pre-wrap; line-height: 1.45; }
.tcomposer { display: flex; gap: 8px; align-items: flex-end; }
.tcomposer .textarea { min-height: 44px; }
.warn { display: flex; gap: 8px; align-items: center; background: var(--warning-soft); color: var(--warning); border-radius: 10px; padding: 10px 12px; font-weight: 600; font-size: 13px; }

@media (max-width: 1100px) { .tboard { grid-template-columns: repeat(4, 270px); overflow-x: auto; } }

/* ───── Бумага, картриджи, склад ───── */
.pill-count.warn { background: var(--danger); }
.sup-head { display: flex; gap: 16px; align-items: stretch; margin-bottom: 16px; }
.sup-head .kpis { flex: 1; margin-bottom: 0; }
.kpis.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi.low { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); background: color-mix(in srgb, var(--danger-soft) 45%, var(--surface)); }
.kpi .k-foot { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sup-actions { display: flex; flex-direction: column; gap: 8px; justify-content: center; min-width: 210px; }
.btn.lg { height: 48px; font-size: 15px; border-radius: 12px; }

.mx-wrap { overflow-x: auto; padding: 0 6px 12px; }
.mxt { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.mxt th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; padding: 8px 6px; text-align: center; border-bottom: 1px solid var(--border); }
.mxt th.dep, .mxt td.dep { text-align: left; padding-left: 12px; min-width: 260px; max-width: 360px; }
.mxt td { padding: 7px 6px; text-align: center; border-bottom: 1px solid var(--border); }
.mxt td.dep b { display: block; font-weight: 600; font-size: 13px; }
.mxt td.dep span { display: block; color: var(--muted); font-size: 12px; }
.mxt td.mx { color: var(--border-strong); cursor: pointer; font-weight: 600; min-width: 42px; position: relative; }
.mxt td.mx.has { color: var(--text); background: color-mix(in srgb, var(--accent) calc(var(--v) * 22% + 4%), transparent); }
.mxt td.mx:hover { outline: 2px solid var(--accent); outline-offset: -3px; border-radius: 6px; }
.mxt .cur { background-color: color-mix(in srgb, var(--accent) 6%, transparent); }
.mxt th.cur { color: var(--accent); }
.mxt td.tot, .mxt th.tot { font-weight: 750; color: var(--text); cursor: pointer; }
.mxt tfoot td { font-weight: 750; color: var(--text); background: var(--surface-2); border-bottom: 0; }
.mxt tbody tr:hover td { background-color: var(--surface-2); }
.mxt tbody tr:hover td.mx.has { background: color-mix(in srgb, var(--accent) calc(var(--v) * 22% + 8%), transparent); }

.hlist { padding: 6px 0 4px; max-height: 640px; overflow-y: auto; }
.hrow { display: flex; align-items: center; gap: 14px; padding: 10px 18px; border-top: 1px solid var(--border); }
.hrow:first-child { border-top: 0; }
.hrow .body { flex: 1; min-width: 0; }
.hrow .body > b { display: block; font-weight: 600; }
.hrow .body > span { display: block; color: var(--text-2); font-size: 12.5px; }
.hrow .body > span.muted { color: var(--muted); font-size: 12px; margin-top: 2px; }
.hdate { font-weight: 700; font-size: 12.5px; background: var(--surface-3); border-radius: 8px; padding: 5px 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.qty { font-weight: 750; white-space: nowrap; font-size: 14px; }
.qty.in { color: var(--success); }
.hrow.cancelled { opacity: .55; }
.hrow.cancelled .body > b, .hrow.cancelled .qty { text-decoration: line-through; }

.dpick { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.dpick .input { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; height: 40px; }
.dpick .input:focus { box-shadow: none; }
.dlist { max-height: 236px; overflow-y: auto; padding: 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.dopt { text-align: left; border: 1px solid transparent; background: transparent; border-radius: 9px; padding: 7px 10px; cursor: pointer; }
.dopt:hover { background: var(--surface-3); }
.dopt.on { background: var(--accent-soft); border-color: var(--accent); }
.dopt b { display: block; font-size: 13px; font-weight: 600; line-height: 1.3; }
.dopt span { display: block; font-size: 11.5px; color: var(--muted); }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; display: grid; place-items: center; flex: none; }
.stepper button:hover { border-color: var(--accent); color: var(--accent); }
.stepper .input { text-align: center; font-size: 17px; font-weight: 700; width: 90px; }
.stockline { display: flex; align-items: center; gap: 6px; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; }

.stock-top { display: flex; gap: 16px; margin-bottom: 16px; }
.paper-card { flex: 1; display: flex; align-items: center; gap: 18px; padding: 20px 22px; }
.paper-card.low { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.pc-ico { width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.pc-ico .i { width: 28px; height: 28px; }
.paper-card.low .pc-ico { background: var(--danger-soft); color: var(--danger); }
.pc-body { flex: 1; }
.pc-num { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.pc-num small { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.items { padding: 6px 12px 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 10px; }
.item { display: flex; align-items: center; gap: 14px; border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; background: var(--surface); }
.item .body { flex: 1; min-width: 0; }
.item .body > b { font-weight: 650; }
.item .body > span { display: block; font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item.low { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); background: color-mix(in srgb, var(--danger-soft) 35%, var(--surface)); }
.item.off { opacity: .55; }
.it-stock { width: 58px; height: 58px; border-radius: 14px; background: var(--success-soft); color: var(--success); display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; }
.it-stock b { font-size: 22px; font-weight: 800; line-height: 1; }
.it-stock span { font-size: 11px; font-weight: 600; }
.item.low .it-stock { background: var(--danger-soft); color: var(--danger); }

@media (max-width: 1280px) { .kpis.kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .sup-head, .stock-top { flex-direction: column; } .dlist { grid-template-columns: 1fr; } }

/* ───── Форма ───── */
.resbar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; margin: 2px 0; }
.resbar i { display: block; height: 100%; background: var(--info); border-radius: 6px; }
.ut th.sortable { cursor: pointer; user-select: none; }
.ut th.sortable:hover, .ut th.sortable.on { color: var(--accent); }
.ut .num-r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ut tfoot td { padding: 12px 14px; background: var(--surface-2); border-top: 1px solid var(--border); }
.ut tr.expired td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.ut tr.soon td:first-child { box-shadow: inset 3px 0 0 var(--warning); }
.ut tr.written_off { opacity: .55; }
.wear { display: flex; align-items: center; gap: 8px; }
.wbar { flex: 1; height: 7px; background: var(--surface-3); border-radius: 7px; overflow: hidden; min-width: 70px; }
.wbar i { display: block; height: 100%; border-radius: 7px; background: var(--c); }
.wear span { font-weight: 700; font-size: 12.5px; min-width: 34px; text-align: right; }
.amort { display: flex; gap: 10px; align-items: center; background: var(--accent-soft); color: var(--text); border-radius: 12px; padding: 11px 14px; font-size: 13.5px; }
.amort .i { color: var(--accent); flex: none; }
.ut .who b { max-width: 230px; }
.ut .who > span { max-width: 230px; }
.ut td { padding: 10px 12px; }
.ut th { padding: 11px 12px; }
.ut .ustat { display: flex !important; align-items: center; gap: 6px; margin-top: 3px; }
.ut .ustat .status { height: 20px; font-size: 11px; }
.ut tr.paused td { background: color-mix(in srgb, #9b5cf6 7%, transparent); }
.ut tr.paused td:first-child { box-shadow: inset 3px 0 0 #9b5cf6; }
.waiting { display: flex; align-items: center; gap: 10px; }
.waiting > div { min-width: 0; }
.waiting b { display: flex; align-items: center; gap: 5px; color: #9b5cf6; font-weight: 700; font-size: 13px; }
.waiting b .i { width: 13px; height: 13px; }
.waiting span { display: block; font-size: 12px; color: var(--text-2); max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.waiting .btn { flex: none; }
.waiting.stock { justify-content: space-between; }
.ut td.res b { display: block; font-size: 14.5px; }
.ut td.res .muted { display: block; }
.asof { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 11.5px; font-weight: 650; color: var(--muted); white-space: nowrap; }
.asof .i { width: 12px; height: 12px; }
.asof.frozen { color: #fff; background: #9b5cf6; border-radius: 6px; padding: 1px 7px; }
.asof.frozen.writeoff { background: var(--st-cancelled); }
.wbar.paused { background: repeating-linear-gradient(-45deg, var(--surface-3) 0 5px, color-mix(in srgb, #9b5cf6 12%, var(--surface-3)) 5px 10px); }
.ucard-top { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; flex-wrap: wrap; }
.ucard-top b { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.sect-title { display: flex; align-items: center; gap: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin-top: 4px; }
.uhist { display: flex; flex-direction: column; gap: 2px; border-left: 2px solid var(--border); margin-left: 6px; padding-left: 14px; }
.uh { display: flex; align-items: center; gap: 10px; padding: 6px 0; position: relative; }
.uh > i { position: absolute; left: -21px; top: 12px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); }
.uh.cur > i { border-color: var(--success); background: var(--success); }
.uh > div { flex: 1; }
.uh span { display: block; font-size: 12.5px; color: var(--text-2); }
.check.rall { align-items: flex-start; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.check.rall span { display: block; margin-top: 2px; }
.ut { table-layout: fixed; }
.ut td, .ut th { overflow: hidden; }
.ut td.when { white-space: normal; }
.ut .who b, .ut .who > span, .waiting span { max-width: 100%; }
.ut .exec-cell { min-width: 0; }
.ut .exec-cell .who { min-width: 0; overflow: hidden; }
.waiting { flex-wrap: wrap; gap: 6px; }
.waiting > div { flex: 1 1 140px; }
.ut td.res { white-space: normal; }
.asof { white-space: normal; text-align: right; }
.ut th { white-space: normal; line-height: 1.25; }
.asof.frozen { white-space: nowrap; font-size: 11px; padding: 1px 6px; }
.asof.frozen { white-space: normal; display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; line-height: 1.25; text-align: left; border-radius: 8px; }
.asof.frozen > span { font-weight: 650; }
.waiting.expired b { color: var(--danger); }

/* ───── Группы (форма, планшеты) ───── */
.glist { display: flex; flex-direction: column; gap: 10px; }
.gcard { display: grid; grid-template-columns: minmax(220px, 1.3fr) 80px minmax(220px, 1.4fr) 170px 24px; gap: 18px; align-items: center; padding: 14px 18px; cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s; }
.gcard:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.gname { display: flex; align-items: center; gap: 12px; min-width: 0; }
.gname b { display: block; font-size: 15px; font-weight: 700; }
.gname span { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gname > div { min-width: 0; }
.gico { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.gico .i { width: 22px; height: 22px; }
.gico.lg { width: 60px; height: 60px; border-radius: 16px; }
.gico.lg .i { width: 30px; height: 30px; }
.gcount b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.gcount span { font-size: 12px; color: var(--muted); }
.gmoney { text-align: right; }
.gmoney b { display: block; font-size: 15px; font-weight: 750; }
.gmoney span { font-size: 12px; color: var(--muted); }
.garrow { color: var(--muted); }
.dist { display: flex; height: 8px; border-radius: 8px; overflow: hidden; gap: 2px; background: var(--surface-3); }
.dist i { display: block; height: 100%; }
.dist-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--text-2); }
.dist-legend b { font-weight: 750; }
.ghead { display: flex; align-items: center; gap: 18px; padding: 20px 22px; margin-bottom: 14px; }
.ghead-body { flex: 1; min-width: 0; }
.ghead h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.02em; }
.waiting.repair b { color: var(--warning); }
.ut tr.t-repair td:first-child { box-shadow: inset 3px 0 0 var(--warning); }
.ut tr.t-written_off { opacity: .55; }
@media (max-width: 1100px) { .gcard { grid-template-columns: 1fr 70px; } .gdist, .gmoney, .garrow { grid-column: 1 / -1; text-align: left; } }

/* ═══════════════ ИИ-задачник ═══════════════ */
[hidden] { display: none !important; }
.brand-logo { width: 36px; height: 36px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; flex: none;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent); }
.brand-logo img { width: 26px; height: 26px; filter: brightness(0) invert(1); }
.brand-name { text-transform: uppercase; letter-spacing: .02em; font-weight: 800; color: var(--accent); }
.brand-sub { line-height: 1.25; }
.model-badge { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; cursor: pointer; line-height: 1.3; }
.model-badge .i { width: 15px; height: 15px; }
.model-badge span { color: var(--text-2); font-weight: 500; display: block; }
.model-badge.busy { background: var(--warning-soft); color: var(--warning); }
@media (max-width: 860px) { .model-badge div { display: none; } .model-badge { justify-content: center; } }

.ai-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.ai-tag .i { width: 11px; height: 11px; }
.src { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 1px 6px; border-radius: 5px; background: var(--surface-3); color: var(--muted); }
.src.ai { background: var(--accent-soft); color: var(--accent); }

/* Чат постановки */
.ai-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; height: calc(100vh - 60px - 62px); }
.ai-main { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.ai-feed { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; scroll-behavior: smooth; }
.ai-composer { border-top: 1px solid var(--border); padding: 14px 16px; background: var(--surface); }
.ai-composer .row { display: flex; gap: 10px; align-items: flex-end; }
.ai-composer .textarea { min-height: 52px; max-height: 200px; border-radius: 14px; font-size: 14.5px; padding: 13px 14px; }
.ai-composer .btn.primary { height: 52px; padding: 0 20px; border-radius: 14px; }
.ai-hint { font-size: 12px; color: var(--muted); margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.u-msg { align-self: flex-end; max-width: 78%; background: var(--accent); color: #fff; padding: 11px 14px; border-radius: 16px 16px 4px 16px; white-space: pre-wrap; line-height: 1.45; box-shadow: var(--shadow-sm); }
.u-meta { align-self: flex-end; font-size: 11.5px; color: var(--muted); margin-top: -10px; }
.ai-row { display: flex; gap: 10px; align-items: flex-start; }
.ai-ava { width: 32px; height: 32px; border-radius: 10px; background: var(--accent); flex: none; display: grid; place-items: center; }
.ai-ava img { width: 22px; height: 22px; filter: brightness(0) invert(1); }
.ai-ava.think { animation: think 1.2s ease-in-out infinite; }
@keyframes think { 50% { transform: scale(.88); opacity: .7; } }
.ai-bubble { background: var(--surface-3); border-radius: 4px 16px 16px 16px; padding: 11px 14px; max-width: 78%; line-height: 1.5; }
.dots i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); margin: 0 2px; animation: dot 1s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 50% { transform: translateY(-4px); opacity: .5; } }

.prop { flex: 1; min-width: 0; max-width: 860px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.prop-h { padding: 14px 18px 12px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent); }
.prop-h .top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.prop-h .top b { color: var(--accent); }
.prop-title { width: 100%; border: 1px solid transparent; background: transparent; font-size: 17px; font-weight: 750; letter-spacing: -.015em; padding: 4px 6px; margin: 0 -6px; border-radius: 8px; outline: none; }
.prop-title:hover { border-color: var(--border); }
.prop-title:focus { border-color: var(--accent); background: var(--surface); }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.fact { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; min-width: 0; }
.fact label { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; }
.fact .v { font-weight: 650; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fact .conf { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.fact select, .fact input { width: 100%; border: 0; background: transparent; font-weight: 650; font-size: 13.5px; padding: 0; outline: none; cursor: pointer; color: var(--text); }
.fact select option { color: initial; }
.prop-b { padding: 6px 10px 4px; }
.prop-sect { font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 10px 8px 6px; display: flex; gap: 8px; align-items: center; }
.cand { display: grid; grid-template-columns: 22px 40px minmax(0, 1fr) 150px; gap: 12px; align-items: center; padding: 10px 8px; border-radius: 12px; cursor: pointer; border: 1.5px solid transparent; transition: background .1s, border-color .1s; }
.cand:hover { background: var(--surface-2); }
.cand.sel { border-color: var(--accent); background: var(--accent-soft); }
.cand.off { opacity: .5; cursor: not-allowed; }
.cand .rk { font-weight: 800; color: var(--muted); font-size: 13px; text-align: center; }
.cand.sel .rk { color: var(--accent); }
.cand .nm { font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cand .ps { color: var(--muted); font-size: 12.5px; }
.why { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 6px; }
.why span { font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); }
.why span.plus { background: var(--success-soft); color: var(--success); }
.why span.minus { background: var(--warning-soft); color: var(--warning); }
.match { text-align: right; }
.match b { font-size: 22px; font-weight: 800; letter-spacing: -.03em; color: var(--accent); }
.match b small { font-size: 13px; }
.match .bar { margin-top: 4px; height: 6px; }
.match .lbl { font-size: 11px; color: var(--muted); font-weight: 600; }
.cand-more { display: flex; justify-content: center; padding: 4px 0 8px; }
.prop-f { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); flex-wrap: wrap; }
.prop-f .resp { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); min-width: 0; }
.prop-f .resp select { max-width: 260px; height: 32px; }
.prop-f .acts { margin-left: auto; display: flex; gap: 8px; }
.prop.done .prop-b, .prop.done .prop-f, .prop.cancelled .prop-b, .prop.cancelled .prop-f { display: none; }
.prop-result { display: none; padding: 12px 18px; align-items: center; gap: 12px; font-size: 13.5px; flex-wrap: wrap; }
.prop.done .prop-result, .prop.cancelled .prop-result { display: flex; }
.prop.cancelled { opacity: .65; }
.prop-result .r-ok { color: var(--success); font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }
.prop-result .r-alt { color: var(--warning); font-weight: 600; font-size: 12.5px; }

.ai-side { display: flex; flex-direction: column; gap: 16px; overflow-y: auto; min-height: 0; }
.how { display: flex; flex-direction: column; gap: 12px; padding: 4px 18px 18px; }
.how-step { display: flex; gap: 10px; font-size: 13px; color: var(--text-2); line-height: 1.4; }
.how-step i { flex: none; width: 24px; height: 24px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-style: normal; font-weight: 800; font-size: 12px; display: grid; place-items: center; }
.how-step b { color: var(--text); display: block; }
.examples { display: flex; flex-direction: column; gap: 6px; padding: 4px 14px 16px; }
.example { text-align: left; border: 1px solid var(--border); background: var(--surface-2); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; cursor: pointer; color: var(--text-2); line-height: 1.35; }
.example:hover { border-color: var(--accent); color: var(--accent); }
.ai-empty { margin: auto; text-align: center; max-width: 460px; color: var(--muted); padding: 30px 10px; }
.ai-empty img { width: 64px; height: 64px; margin-bottom: 12px; }
.ai-empty h2 { color: var(--text); margin: 0 0 6px; font-size: 20px; letter-spacing: -.02em; }
@media (max-width: 1100px) { .ai-layout { grid-template-columns: 1fr; height: auto; } .ai-main { height: calc(100vh - 140px); } .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .cand { grid-template-columns: 40px minmax(0, 1fr); } .cand .rk { display: none; } .cand .match { grid-column: 1 / -1; text-align: left; } }

/* Сотрудники и структура */
.dept-block { margin-bottom: 22px; }
.dept-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.dept-head h3 { margin: 0; font-size: 16px; letter-spacing: -.01em; }
.dept-head .lead { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.lead-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); font-size: 12.5px; cursor: pointer; }
.lead-chip:hover { border-color: var(--border-strong); }
.lead-chip span { color: var(--muted); }
.emp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.emp-card { padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; transition: transform .15s, box-shadow .15s; }
.emp-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.emp-card.away { background: color-mix(in srgb, var(--surface-3) 50%, var(--surface)); }
.emp-top { display: flex; gap: 10px; align-items: center; min-width: 0; }
.emp-top .nm { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emp-top .ps { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-b { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 2px 6px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.away-b { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--warning-soft); color: var(--warning); white-space: nowrap; }
.skills { display: flex; flex-wrap: wrap; gap: 4px; }
.skills span { font-size: 11.5px; padding: 2px 7px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); font-weight: 600; }
.loadbar { display: flex; gap: 3px; }
.loadbar i { flex: 1; height: 5px; border-radius: 3px; background: var(--surface-3); }
.loadbar i.on { background: var(--accent); }
.loadbar i.hot { background: var(--warning); }

/* Модель */
.m-hero { display: flex; gap: 18px; align-items: center; padding: 20px; margin-bottom: 16px; flex-wrap: wrap;
  background: radial-gradient(600px 200px at 0% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent), var(--surface); }
.m-hero .ver { font-size: 30px; font-weight: 800; letter-spacing: -.03em; color: var(--accent); }
.m-hero .sub { color: var(--muted); font-size: 13px; }
.m-hero .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.progress { height: 8px; border-radius: 8px; background: var(--surface-3); overflow: hidden; margin-top: 8px; width: min(420px, 100%); }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #5fc0f0); border-radius: 8px; transition: width .4s; }
.arch { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; align-items: stretch; padding: 8px 18px 18px; }
.arch-box { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); font-size: 12.5px; color: var(--text-2); position: relative; line-height: 1.4; }
.arch-box b { display: block; color: var(--text); font-size: 13px; margin-bottom: 3px; }
.arch-box.nn { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: var(--accent-soft); }
.arch-box:not(:last-child)::after { content: "→"; position: absolute; right: -10px; top: 50%; transform: translate(50%, -50%); color: var(--muted); font-weight: 700; }
@media (max-width: 1100px) { .arch { grid-template-columns: 1fr 1fr; } .arch-box::after { display: none; } }
.cmp { display: flex; flex-direction: column; gap: 12px; padding: 6px 18px 18px; }
.cmp-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 70px; gap: 12px; align-items: center; font-size: 13px; }
.cmp-row .bar { height: 10px; }
.cmp-row b { text-align: right; font-weight: 750; }
.cmp-row.best b, .cmp-row.best .nm { color: var(--accent); }
.conf { border-collapse: separate; border-spacing: 3px; font-size: 12px; margin: 0 auto; }
.conf td, .conf th { text-align: center; min-width: 46px; height: 34px; border-radius: 6px; font-weight: 650; }
.conf th { color: var(--muted); font-weight: 700; font-size: 11px; }
.conf th.rl { text-align: right; padding-right: 6px; }
.metric-note { font-size: 12px; color: var(--muted); line-height: 1.45; padding: 0 18px 16px; }
.line-chart { width: 100%; height: 200px; display: block; }
.line-chart .gl { stroke: var(--border); stroke-dasharray: 3 4; }
.line-chart .ax { fill: var(--muted); font-size: 10.5px; }
.line-chart path { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }

.stars { display: flex; gap: 6px; justify-content: center; }
.stars button { width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-size: 18px; font-weight: 800; cursor: pointer; color: var(--muted); transition: all .1s; }
.stars button:hover, .stars button.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Вход */
.login-card.wide { width: min(520px, 100%); }
.login-logo { width: 100%; max-width: 330px; display: block; margin: 0 auto 6px; }
:root[data-theme="dark"] .login-logo.light, :root:not([data-theme="dark"]) .login-logo.dark { display: none; }
.who-list { max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -8px; }
.who-group { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 10px 8px 4px; }
.who-item { display: flex; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 10px; cursor: pointer; }
.who-item:hover { background: var(--accent-soft); }
.who-item b { display: block; font-size: 13.5px; }
.who-item span { color: var(--muted); font-size: 12px; }
.demo-note { font-size: 12px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; line-height: 1.4; }
.fact label { flex-wrap: wrap; row-gap: 2px; }
textarea.prop-title { resize: none; overflow: hidden; line-height: 1.3; display: block; font-family: inherit; }
.content.ai-page { padding: 16px 24px 0; }
@media (max-width: 860px) { .content.ai-page { padding: 10px 10px 0; } }
@media (max-width: 700px) {
  .ai-row > .ai-ava { display: none; }
  .prop-sect .muted { display: none; }
  .ai-feed { padding: 12px; gap: 12px; }
  .u-msg, .ai-bubble { max-width: 92%; }
  .prop-h { padding: 12px 12px 10px; }
  .prop-b { padding: 4px 4px 2px; }
  .prop-f { padding: 10px 12px; }
  .prop-f .resp { width: 100%; }
  .prop-f .resp select { max-width: none; flex: 1; min-width: 0; }
  .prop-f .acts { margin-left: 0; width: 100%; }
  .prop-f .acts .btn { flex: 1; }
  .ai-composer { padding: 10px; }
  .ai-composer .btn.primary .lbl { display: none; }
  .ai-composer .btn.primary { padding: 0 16px; }
}
.content { overflow-x: hidden; }
