/* CRM ИНПРОМСЕРВИС: three themes by role (the interface concept v0.2).
   A · Чертёж — a neat technical document; B · Диспетчерская — a graphite control desk;
   C · Сервис — calm white cards. Functions are the same; colours, type, density and the
   navigation differ. */

:root {
  --font: 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --head: var(--font);
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --logo-blue: #13B7E1;
}

/* A · Чертёж: #EEF1F4 #FFFFFF #141B24 #2A3BA8 #A3461C #156B78 */
.theme-a {
  color-scheme: light;
  --bg: #EEF1F4; --surface: #FFFFFF; --surface-2: #F6F8FA; --ink: #141B24; --muted: #56616D; --faint: #8A949F;
  --line: #DDE2E8; --line-2: #C8D0D9; --hover: #F1F4F7;
  --accent: #2A3BA8; --accent-ink: #FFFFFF; --accent-soft: #E8EBF8;
  --warn: #A3461C; --warn-soft: #F7EAE2; --info: #156B78; --info-soft: #E1F0F2;
  --danger: #B3261E; --danger-soft: #FAE8E6; --ok: #1F7A4D; --ok-soft: #E2F2E9;
  --p-claim: #A3461C; --p-trip: #156B78; --p-contract: #2A3BA8; --p-mail: #5E7A1C; --p-request: #6B7480;
  --radius: 6px; --radius-s: 4px; --shadow: none; --row: 40px;
  --head: 'IBM Plex Sans', var(--font);
  --nav-bg: #FFFFFF; --nav-ink: var(--ink);
}

/* B · Диспетчерская: #11161C #171E25 #DCE3EA #E3A23B #5FC08C #EF6B62 */
.theme-b {
  color-scheme: dark;
  --bg: #11161C; --surface: #171E25; --surface-2: #1C242D; --ink: #DCE3EA; --muted: #97A3AF; --faint: #6C7885;
  --line: #252F39; --line-2: #33404D; --hover: #1E2731;
  --accent: #E3A23B; --accent-ink: #1A1206; --accent-soft: #2C2414;
  --warn: #E3A23B; --warn-soft: #2C2414; --info: #5DB7C6; --info-soft: #13262A;
  --danger: #EF6B62; --danger-soft: #34191A; --ok: #5FC08C; --ok-soft: #142A1F;
  --p-claim: #F08A4B; --p-trip: #5DB7C6; --p-contract: #8C9BF2; --p-mail: #9BC46A; --p-request: #97A3AF;
  --radius: 3px; --radius-s: 3px; --shadow: none; --row: 32px;
  --nav-bg: #0D1217; --nav-ink: var(--ink);
}

/* C · Сервис: #F2F5F4 #FFFFFF #17201E #0F7B6C #A86A12 #C2412D */
.theme-c {
  color-scheme: light;
  --bg: #F2F5F4; --surface: #FFFFFF; --surface-2: #F7F9F8; --ink: #17201E; --muted: #55635F; --faint: #889490;
  --line: #E2E8E5; --line-2: #D2DAD6; --hover: #F0F4F2;
  --accent: #0F7B6C; --accent-ink: #FFFFFF; --accent-soft: #E0F1EE;
  --warn: #A86A12; --warn-soft: #FBEFDC; --info: #2E6E9E; --info-soft: #E5EFF7;
  --danger: #C2412D; --danger-soft: #FAE7E3; --ok: #0F7B6C; --ok-soft: #E0F1EE;
  --p-claim: #B4561F; --p-trip: #1D7590; --p-contract: #3F55B8; --p-mail: #5E7A1C; --p-request: #6B7480;
  --radius: 14px; --radius-s: 10px; --row: 44px;
  --shadow: 0 1px 2px rgba(23, 32, 30, .05), 0 6px 18px rgba(23, 32, 30, .06);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --head: var(--font);
  --nav-bg: #FFFFFF; --nav-ink: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.theme-c body, body.theme-c { font-size: 15px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--head); margin: 0; letter-spacing: -0.01em; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.boot { padding: 40px; color: #8A949F; font: 14px system-ui, sans-serif; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Shell ---------- */
.shell { min-height: 100vh; display: grid; }
.theme-a .shell { grid-template-columns: 236px minmax(0, 1fr); }
.theme-b .shell { grid-template-columns: 72px minmax(0, 1fr); }
.theme-c .shell { grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1fr); }

.nav { background: var(--nav-bg); color: var(--nav-ink); display: flex; position: sticky; top: 0; z-index: 30; }
.theme-a .nav, .theme-b .nav { height: 100vh; flex-direction: column; border-right: 1px solid var(--line); }
.theme-a .nav { padding: 18px 12px 12px; gap: 2px; overflow-y: auto; }
.theme-b .nav { padding: 12px 6px; gap: 2px; align-items: stretch; overflow-y: auto; }
.theme-c .nav { height: 64px; align-items: center; gap: 2px; padding: 0 24px; border-bottom: 1px solid var(--line); min-width: 0; }
.theme-c .nav-item.minor { display: none; }

.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none !important; }
.brand img.logo { height: 34px; width: auto; display: block; }
.brand .crm { font: 600 12px/1 var(--mono); letter-spacing: .12em; color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line-2); }
.brand img.mark { width: 36px; height: 36px; display: block; }
.theme-a .brand { padding: 0 6px 18px; }
.theme-b .brand { justify-content: center; padding: 4px 0 14px; }
.theme-c .brand { margin-right: 18px; }
.theme-c .brand img.logo { height: 30px; }

.nav-group { font: 600 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--faint); padding: 16px 10px 6px; }
.theme-b .nav-group, .theme-c .nav-group { display: none; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius);
  color: var(--nav-ink); text-decoration: none !important; position: relative; white-space: nowrap; cursor: pointer;
  border: 0; background: none; text-align: left;
}
.nav-item:hover { background: var(--hover); }
.nav-item .label { flex: 1; }
.nav-item .count { font: 500 12px var(--mono); color: var(--faint); }
.nav-item .badge { font: 600 11px/1 var(--mono); background: var(--accent); color: var(--accent-ink); padding: 3px 6px; border-radius: 9px; }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.theme-a .nav-item.active .count { color: var(--accent); }
.theme-b .nav-item { flex-direction: column; gap: 3px; padding: 8px 2px 6px; font-size: 10px; text-align: center; color: var(--muted); }
.theme-b .nav-item svg.i { width: 20px; height: 20px; }
.theme-b .nav-item .label { flex: none; letter-spacing: .01em; }
.theme-b .nav-item .count { display: none; }
.theme-b .nav-item .badge { position: absolute; top: 3px; right: 9px; padding: 2px 4px; font-size: 9.5px; }
.theme-b .nav-item.active { background: var(--accent); color: var(--accent-ink); }
.theme-b .nav-item.active .badge { background: var(--accent-ink); color: var(--accent); }
.theme-c .nav-item { padding: 8px 13px; border-radius: 999px; font-weight: 600; font-size: 14.5px; }
.theme-c .nav-item svg.i { display: none; }
.theme-c .nav-item .count { display: none; }
.theme-c .nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.theme-c .nav-item .badge { padding: 3px 7px; }
.theme-c .nav-item .short, .theme-a .nav-item .short { display: none; }
.theme-b .nav-item .full { display: none; }
.nav-spacer { flex: 1; }

.me-block { display: flex; gap: 10px; align-items: center; padding: 12px 8px 4px; border-top: 1px solid var(--line); margin-top: 10px; cursor: pointer; border-radius: var(--radius); }
.me-block:hover { background: var(--hover); }
.me-block .who { min-width: 0; }
.me-block .name { font-weight: 600; font-size: 13px; }
.me-block .sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.theme-b .me-block { justify-content: center; border-top: 0; padding: 8px 0; }
.theme-b .me-block .who { display: none; }
.theme-c .me-block { display: none; }

.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: var(--accent); color: var(--accent-ink); font: 600 11.5px var(--font); letter-spacing: .02em;
}
.avatar.sm { width: 26px; height: 26px; font-size: 10px; }
.avatar.gray { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.theme-b .avatar.gray { background: #26303A; color: var(--ink); border: 0; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  display: flex; align-items: center; gap: 14px; padding: 12px 24px; min-height: 64px;
  background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.theme-b .top { background: var(--surface); min-height: 56px; padding: 8px 18px; }
.theme-c .top { background: transparent; border: 0; position: static; padding: 26px 32px 6px; min-height: 0; }
.top .titles { min-width: 0; flex: 1; }
.top h1 { font-size: 18px; font-weight: 700; line-height: 1.2; }
.theme-b .top h1 { font-size: 16px; }
.theme-c .top h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; display: inline; margin-right: 12px; }
.top .subtitle { font-size: 12px; color: var(--muted); }
.theme-c .top .subtitle { display: inline; font-size: 14px; }
.tools { display: flex; align-items: center; gap: 10px; }
.theme-c .nav .tools { margin-left: auto; }
.icon-btn.menu-btn { display: none; }

.search { position: relative; }
.search input {
  width: 340px; padding: 8px 12px 8px 34px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface-2); outline: none;
}
.search input:focus { border-color: var(--accent); background: var(--surface); }
.search > svg.i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 16px; height: 16px; }
.theme-c .search input { width: 260px; border-radius: 999px; }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; width: 460px; max-height: 70vh; overflow: auto; z-index: 50;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: 0 12px 30px rgba(0, 0, 0, .18); padding: 6px;
}
.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: var(--radius); border: 1px solid transparent;
  background: none; cursor: pointer; color: var(--muted); position: relative;
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.theme-c .icon-btn { border-radius: 50%; background: var(--surface-2); }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--surface); }

.page { padding: 20px 24px 40px; min-width: 0; flex: 1; }
.theme-b .page { padding: 14px 18px 30px; }
.theme-c .page { padding: 14px 32px 48px; }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: var(--radius);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); cursor: pointer; font-weight: 500; white-space: nowrap;
  text-decoration: none !important; line-height: 1.2;
}
.btn:hover { background: var(--hover); }
.btn svg.i { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: none; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn[disabled] { opacity: .55; cursor: default; }
.theme-c .btn { border-radius: 999px; padding: 9px 18px; }
.theme-c .btn.sm { padding: 6px 12px; }
.theme-b .btn { padding: 6px 12px; }

.input, select.input, textarea.input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: var(--radius-s); background: var(--surface); outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.theme-b .input { background: var(--bg); }
textarea.input { min-height: 72px; resize: vertical; }
.field { display: grid; gap: 5px; margin-bottom: 12px; }
.field > label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.field > label .req { color: var(--danger); }
.checks { display: grid; gap: 4px; max-height: 240px; overflow: auto; padding: 8px; border: 1px solid var(--line-2); border-radius: var(--radius-s); background: var(--surface); }
.theme-b .checks { background: var(--bg); }
.checks label { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; cursor: pointer; }
.checks input { margin-top: 3px; accent-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 6px 12px; cursor: pointer; color: var(--muted); font-size: 13px; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.theme-b .seg button.on { background: var(--accent); color: var(--accent-ink); }
.theme-c .seg { border-radius: 999px; }
.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); cursor: pointer; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); }
.toggle.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.theme-c .toggle { border-radius: 999px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.theme-c .panel { border-color: transparent; }
.panel-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel-b { padding: 14px 16px; }
.cap { font: 600 10.5px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--faint); margin: 18px 0 8px; }
.cap:first-child { margin-top: 0; }
.theme-c .cap { font-family: var(--font); text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 700; color: var(--ink); }

.chip {
  --c: var(--p-request); display: inline-flex; align-items: center; font: 600 11px/1 var(--mono); padding: 4px 6px; border-radius: var(--radius-s);
  color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); border: 1px solid color-mix(in srgb, var(--c) 28%, transparent); white-space: nowrap;
}
.theme-c .chip { border-radius: 6px; }
.chip.claims { --c: var(--p-claim); } .chip.trips { --c: var(--p-trip); } .chip.contracts { --c: var(--p-contract); } .chip.mail { --c: var(--p-mail); } .chip.requests { --c: var(--p-request); }
.pill { display: inline-flex; align-items: center; gap: 5px; font: 600 11.5px/1 var(--mono); padding: 4px 7px; border-radius: var(--radius-s); background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.pill.warn { color: var(--warn); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.pill.danger { color: var(--danger); background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.pill.ok { color: var(--ok); background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.pill.accent { color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.pill svg.i { width: 13px; height: 13px; }
.stamp { display: inline-block; font: 700 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 4px 7px; border: 1.5px solid currentColor; border-radius: 3px; color: var(--accent); transform: rotate(-1.5deg); }
.stamp.rework { color: var(--warn); } .stamp.reject { color: var(--danger); } .stamp.ok { color: var(--ok); }
.theme-c .stamp { text-transform: none; transform: none; border-radius: 999px; border-width: 0; background: var(--ok-soft); color: var(--ok); font-family: var(--font); letter-spacing: 0; text-transform: none; }
.theme-c .stamp.rework { background: var(--warn-soft); color: var(--warn); } .theme-c .stamp.reject { background: var(--danger-soft); color: var(--danger); }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.note { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); }
.note svg.i { width: 15px; height: 15px; }
.err { color: var(--danger); font-size: 13px; margin-top: 8px; }

/* ---------- My tasks ---------- */
.split { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 0; align-items: start; }
.theme-a .split, .theme-b .split { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-height: calc(100vh - 120px); }
.theme-c .split { gap: 22px; }
.tasklist { border-right: 1px solid var(--line); min-height: 100%; }
.theme-c .tasklist { border: 0; }
.tl-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.theme-c .tl-head { border: 0; padding: 0 0 10px; }
.tl-group { display: flex; justify-content: space-between; font: 600 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--faint); padding: 14px 14px 8px; }
.tl-group.overdue { color: var(--danger); }
.theme-c .tl-group { padding: 12px 4px 8px; }
.task-item { display: block; padding: 11px 14px 12px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none !important; border-left: 3px solid transparent; cursor: pointer; }
.task-item:hover { background: var(--hover); }
.task-item.sel { border-left-color: var(--accent); background: var(--accent-soft); }
.theme-b .task-item { padding: 8px 12px 9px; }
.theme-b .task-item.sel { background: #2A2416; }
.theme-c .task-item { background: var(--surface); border: 1.5px solid transparent; border-radius: var(--radius-s); box-shadow: var(--shadow); margin-bottom: 10px; padding: 12px 14px; }
.theme-c .task-item.sel { border-color: var(--accent); background: var(--surface); }
.ti-top { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--faint); margin-bottom: 6px; }
.ti-top .stage { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ti-due { font: 600 11px var(--mono); color: var(--muted); white-space: nowrap; }
.ti-due.overdue { color: var(--danger); }
.ti-due.today { color: var(--warn); }
.theme-b .ti-due.overdue { border: 1px solid var(--danger); padding: 1px 4px; border-radius: 2px; }
.ti-title { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.theme-c .ti-title { font-size: 14.5px; font-weight: 700; }
.ti-line { font-size: 12px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.taskview { padding: 18px 26px 28px; min-width: 0; }
.theme-b .taskview { padding: 14px 20px; }
.theme-c .taskview { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 28px; }
.tv-top { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--faint); }
.tv-top .grow { flex: 1; }
.taskview h2 { font-size: 22px; font-weight: 700; margin: 12px 0 2px; line-height: 1.25; }
.theme-b .taskview h2 { font-size: 19px; }
.theme-c .taskview h2 { font-size: 23px; font-weight: 800; }
.tv-sub { color: var(--muted); font-size: 13px; }
.tv-info { margin: 0; max-width: 760px; }
.facts { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 6px 16px; font-size: 13px; max-width: 760px; }
.facts .k { color: var(--muted); }
.theme-b .facts { gap: 4px 16px; }
.files { display: flex; flex-wrap: wrap; gap: 8px; }
.file {
  display: inline-flex; align-items: center; gap: 9px; padding: 8px 12px 8px 8px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); text-decoration: none !important; max-width: 320px;
}
.file:hover { border-color: var(--accent); }
.file .ext { font: 700 9.5px/1 var(--mono); padding: 6px 4px; border-radius: 3px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); min-width: 34px; text-align: center; text-transform: uppercase; }
.file .ext.docx { color: #2B579A; } .file .ext.pdf { color: #C2412D; } .file .ext.png, .file .ext.jpg { color: var(--info); }
.theme-b .file .ext.docx { color: #7FA3E0; }
.file .fn { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file .fs { font-size: 11px; color: var(--faint); }
.file .x { margin-left: 4px; border: 0; background: none; cursor: pointer; color: var(--faint); padding: 0 2px; }
.members { display: grid; gap: 8px; max-width: 760px; }
.member { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.theme-c .member { background: var(--surface-2); border-color: transparent; }
.member .who { flex: 1; min-width: 0; }
.member .nm { font-weight: 600; font-size: 13px; }
.member .tt { font-size: 11.5px; color: var(--muted); }
.member .quote { font-size: 12.5px; color: var(--muted); font-style: italic; margin-top: 3px; }
.member .st { font: 600 11.5px var(--mono); white-space: nowrap; color: var(--muted); }
.member .st.done { color: var(--ok); } .member .st.neg { color: var(--warn); } .member .st.me { color: var(--accent); }
.decide { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); max-width: 760px; }
.theme-c .decide { background: var(--surface-2); border-color: transparent; }
.decide .buttons { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.decide .hint { font-size: 12px; color: var(--faint); margin-left: 6px; }
.done-box { margin-top: 18px; padding: 12px 14px; border-radius: var(--radius); background: var(--ok-soft); color: var(--ok); max-width: 760px; font-size: 13px; }
.back-link { display: none; margin-bottom: 10px; }

/* ---------- Sections: kanban and table ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.tabs { display: inline-flex; gap: 2px; border-bottom: 1px solid var(--line); }
.tab { padding: 8px 12px; border: 0; background: none; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tab .n { font: 500 11.5px var(--mono); color: var(--faint); margin-left: 4px; }
.tab.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.theme-c .tabs { border: 0; background: var(--surface); border-radius: 999px; padding: 4px; box-shadow: var(--shadow); }
.theme-c .tab { border-radius: 999px; border: 0; margin: 0; padding: 7px 14px; }
.theme-c .tab.on { background: var(--accent-soft); color: var(--accent); }
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.col { flex: 0 0 248px; background: color-mix(in srgb, var(--surface-2) 70%, var(--bg)); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 200px); }
.theme-b .col { flex-basis: 236px; background: #141A21; }
.theme-c .col { background: transparent; border: 0; }
.col-h { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.col-h .n { font: 500 12px var(--mono); color: var(--faint); }
.col-b { padding: 0 8px 8px; display: grid; gap: 8px; overflow-y: auto; }
.col.closed { flex-basis: 200px; opacity: .92; }
.col .auto { font-size: 12px; color: var(--faint); padding: 8px 6px; }
.kcard { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 11px; color: var(--ink); text-decoration: none !important; box-shadow: var(--shadow); }
.kcard:hover { border-color: var(--accent); }
.theme-b .kcard { background: var(--surface-2); padding: 8px 10px; }
.kc-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 6px; }
.kc-num { font: 600 11px var(--mono); color: var(--muted); }
.days { font: 600 10.5px/1 var(--mono); padding: 3px 5px; border-radius: 3px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.days.warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.days.late { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.kc-title { font-weight: 600; font-size: 13px; line-height: 1.3; }
.kc-co { font-size: 12px; color: var(--muted); margin-top: 3px; }
.kc-sub { font: 500 11px var(--mono); color: var(--faint); margin-top: 2px; }
.kc-wait { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line); }
.kc-wait .avatar { width: 20px; height: 20px; font-size: 8.5px; }
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th { text-align: left; font: 600 10.5px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 9px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; background: var(--surface); }
table.grid td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.theme-b table.grid td { padding: 6px 10px; }
table.grid tr.click { cursor: pointer; }
table.grid tr.click:hover td { background: var(--hover); }
.theme-c table.grid th { font-family: var(--font); text-transform: none; letter-spacing: 0; font-size: 12.5px; }

/* ---------- Card ---------- */
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.card-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.card-head .t { flex: 1; min-width: 280px; }
.card-head .meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--faint); }
.card-head h2 { font-size: 24px; font-weight: 700; margin: 8px 0 3px; line-height: 1.2; }
.theme-c .card-head h2 { font-size: 26px; font-weight: 800; }
.card-head .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.route { display: flex; gap: 3px; margin: 18px 0 12px; align-items: stretch; }
.route .steps { display: flex; gap: 3px; flex: 1; min-width: 0; }
.step { flex: 1; min-width: 0; padding: 8px 8px 7px; font-size: 11.5px; color: var(--faint); border-top: 3px solid var(--line-2); background: var(--surface); line-height: 1.25; }
.step.done { color: var(--muted); border-top-color: color-mix(in srgb, var(--accent) 45%, var(--line-2)); }
.step.current { color: var(--accent); border-top-color: var(--accent); font-weight: 700; background: var(--accent-soft); }
.step .cy { display: block; font: 500 10.5px var(--mono); }
.theme-b .step { background: var(--surface-2); }
.theme-b .step.current { background: var(--accent); color: var(--accent-ink); }
.theme-c .step { border-top: 0; border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); padding: 9px 10px; }
.theme-c .step.current { background: var(--accent); color: var(--accent-ink); }
.theme-c .step.done { background: var(--surface); color: var(--ink); }
.route .ends { display: grid; gap: 3px; flex: 0 0 150px; }
.end { font-size: 10.5px; color: var(--faint); padding: 4px 7px; border: 1px solid var(--line); background: var(--surface); line-height: 1.2; border-radius: var(--radius-s); }
.end.current { color: var(--ok); border-color: var(--ok); background: var(--ok-soft); font-weight: 700; }
.now-banner { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 1.5px solid color-mix(in srgb, var(--accent) 55%, transparent); background: var(--accent-soft); border-radius: var(--radius); margin-bottom: 10px; }
.now-banner .tx { flex: 1; min-width: 0; }
.now-banner .h { font-weight: 700; }
.now-banner .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.now-banner.closed { border-color: color-mix(in srgb, var(--ok) 55%, transparent); background: var(--ok-soft); }
.theme-c .now-banner { border: 0; }
.card-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; margin-top: 12px; }
.fgroup { margin-bottom: 14px; }
.fgroup .panel-b { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 7px 16px; font-size: 13px; }
.fgroup .k { color: var(--muted); }
.fgroup .v { white-space: pre-wrap; word-break: break-word; }
.fgroup .v.empty-v { color: var(--faint); }
.fgroup .v .files { gap: 6px; }
.fgroup.editing .panel-b { grid-template-columns: 1fr; }
.side .panel { margin-bottom: 14px; }
.plink { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); margin-bottom: 8px; color: inherit; text-decoration: none !important; }
a.plink:hover { border-color: var(--accent); }
.plink .who { min-width: 0; flex: 1; }
.plink .nm { font-weight: 600; font-size: 13px; }
.plink .tt { font-size: 11.5px; color: var(--muted); }
.theme-c .plink { border: 0; background: var(--surface-2); }
.timeline { display: grid; gap: 0; }
.tl-item { position: relative; padding: 0 0 14px 22px; border-left: 1.5px solid var(--line-2); margin-left: 5px; }
.tl-item:last-child { border-left-color: transparent; }
.tl-item::before { content: ""; position: absolute; left: -6px; top: 3px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--faint); }
.tl-item.decision::before { border-color: var(--accent); background: var(--accent); }
.tl-item.comment::before { border-color: var(--info); }
.tl-item.stage::before { border-color: var(--accent); }
.tl-item .h { font-size: 12.5px; }
.tl-item .h b { font-weight: 600; }
.tl-item .h .t { font: 500 11px var(--mono); color: var(--faint); margin-left: 6px; }
.tl-item .x { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.tl-item .q { font-size: 12.5px; font-style: italic; color: var(--muted); margin-top: 4px; padding-left: 8px; border-left: 2px solid var(--line-2); }
.tl-item .files { margin-top: 6px; }
.tl-item .file { padding: 4px 8px 4px 4px; }
.tl-item .file .ext { padding: 4px 3px; min-width: 30px; font-size: 8.5px; }
.comment-box { display: flex; gap: 8px; margin-bottom: 14px; align-items: flex-start; }
.comment-box textarea { min-height: 54px; height: 54px; }
.sheet-table td, .sheet-table th { font-size: 12px; }

/* ---------- Summary ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { padding: 14px 16px; }
.tile .n { font: 700 28px/1.1 var(--head); }
.theme-b .tile .n { font-family: var(--mono); font-weight: 600; }
.tile .l { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.tile.danger .n { color: var(--danger); } .tile.warn .n { color: var(--warn); } .tile.ok .n { color: var(--ok); }
.sum-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.bars { display: grid; gap: 5px; }
.bar { display: grid; grid-template-columns: 210px minmax(0, 1fr) 32px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar .name { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .track { height: 10px; background: var(--surface-2); border-radius: 3px; overflow: hidden; border: 1px solid var(--line); }
.bar .fill { height: 100%; background: var(--accent); border-radius: 2px; }
.bar.closed .fill { background: var(--ok); }
.bar .num { font: 600 12px var(--mono); text-align: right; }
.proc-block { padding: 12px 16px 14px; border-bottom: 1px solid var(--line); }
.proc-block:last-child { border-bottom: 0; }
.proc-block .ph { display: flex; justify-content: space-between; margin-bottom: 8px; font-weight: 600; }

/* ---------- Absences ---------- */
.gantt { overflow-x: auto; }
.gantt table { border-collapse: collapse; font-size: 12px; }
.gantt th, .gantt td { border-bottom: 1px solid var(--line); padding: 0; height: 30px; }
.gantt th.day { width: 26px; min-width: 26px; font: 500 10px/1.15 var(--mono); color: var(--faint); text-align: center; border-left: 1px solid var(--line); }
.gantt th.day.we, .gantt td.we { background: color-mix(in srgb, var(--surface-2) 75%, var(--bg)); }
.gantt th.day.today { color: var(--accent); font-weight: 700; }
.gantt td.today { box-shadow: inset 2px 0 0 var(--accent); }
.gantt td.pn { padding: 0 12px 0 4px; white-space: nowrap; min-width: 210px; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.gantt td.c { border-left: 1px solid var(--line); position: relative; }
.gantt .b { position: absolute; inset: 6px 0; }
.gantt .b.start { left: 3px; border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
.gantt .b.end { right: 3px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; }
.k-otpusk { background: color-mix(in srgb, var(--info) 55%, transparent); }
.k-bolnichny { background: color-mix(in srgb, var(--danger) 55%, transparent); }
.k-komandirovka { background: color-mix(in srgb, var(--warn) 60%, transparent); }
.k-otgul { background: color-mix(in srgb, var(--ok) 55%, transparent); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); align-items: center; flex-wrap: wrap; }
.legend i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* ---------- Popovers, modal, toast ---------- */
.pop {
  position: absolute; z-index: 60; min-width: 260px; max-width: 380px; background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--radius); box-shadow: 0 14px 34px rgba(0, 0, 0, .2); padding: 6px;
}
.pop .pi { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: var(--radius-s); border: 0; background: none; cursor: pointer; color: var(--ink); text-decoration: none !important; font-size: 13px; }
.pop .pi:hover { background: var(--hover); }
.pop .ph { padding: 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.pop .notice { padding: 8px 10px; font-size: 12.5px; border-bottom: 1px solid var(--line); }
.pop .notice.unread { background: var(--accent-soft); }
.pop .notice .t { font: 500 10.5px var(--mono); color: var(--faint); }
.modal-bg { position: fixed; inset: 0; background: rgba(10, 14, 18, .45); z-index: 80; display: grid; place-items: center; padding: 16px; }
.modal { width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal .panel-h h3 { font-size: 16px; flex: 1; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #141B24; color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 100; font-size: 13.5px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); max-width: calc(100vw - 32px); }
.toast.bad { background: #8F1D16; }

/* ---------- Demo sign-in ---------- */
.login { min-height: 100vh; background: #EEF1F4; color: #141B24; font-family: 'Golos Text', system-ui, sans-serif; padding: 40px 24px 60px; }
.login-in { max-width: 1180px; margin: 0 auto; }
.login-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 8px; }
.login-head img { height: 54px; }
.login-head .crm { font: 600 13px/1 'JetBrains Mono', monospace; letter-spacing: .14em; color: #56616D; border-left: 1px solid #C8D0D9; padding-left: 16px; }
.login h1 { font: 700 26px/1.2 'IBM Plex Sans', 'Golos Text', sans-serif; margin: 22px 0 6px; }
.login .lead { color: #56616D; max-width: 820px; margin: 0 0 22px; }
.login-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.lcol { border-radius: 10px; padding: 14px; }
.lcol.b { background: #11161C; color: #DCE3EA; }
.lcol.a { background: #FFFFFF; border: 1px solid #DDE2E8; }
.lcol.c { background: #F2F5F4; border: 1px solid #DDE5E2; }
.lcol h2 { font: 600 15px/1.3 'Golos Text', sans-serif; margin: 0 0 2px; }
.lcol.c h2 { font-family: 'Manrope', sans-serif; font-weight: 800; }
.lcol .who-for { font-size: 12px; opacity: .7; margin-bottom: 12px; }
.lperson { display: flex; width: 100%; gap: 10px; align-items: center; text-align: left; padding: 9px 10px; border-radius: 8px; border: 1px solid transparent; background: none; cursor: pointer; color: inherit; margin-bottom: 4px; }
.lcol.a .lperson:hover { background: #E8EBF8; border-color: #C9CFF0; }
.lcol.b .lperson:hover { background: #2C2414; border-color: #E3A23B; }
.lcol.c .lperson { background: #fff; box-shadow: 0 1px 2px rgba(23, 32, 30, .05); }
.lcol.c .lperson:hover { border-color: #0F7B6C; }
.lperson .avatar { width: 34px; height: 34px; }
.lcol.a .avatar { background: #2A3BA8; color: #fff; } .lcol.b .avatar { background: #E3A23B; color: #1A1206; } .lcol.c .avatar { background: #0F7B6C; color: #fff; }
.lperson .nm { font-weight: 600; font-size: 13.5px; }
.lperson .tt { font-size: 12px; opacity: .72; }
.lperson .grow { flex: 1; min-width: 0; }
.lperson .cnt { font: 600 11px 'JetBrains Mono', monospace; padding: 3px 6px; border-radius: 9px; background: rgba(127, 127, 127, .15); white-space: nowrap; }
.lperson .cnt.late { background: #FAE8E6; color: #B3261E; }
.lcol.b .lperson .cnt.late { background: #34191A; color: #EF6B62; }
.login-foot { margin-top: 22px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; color: #56616D; font-size: 13px; }

/* ---------- Narrow screens ---------- */
@media (max-width: 1100px) {
  .card-grid { grid-template-columns: 1fr; }
  .sum-grid { grid-template-columns: 1fr; }
  .search input { width: 220px; }
  .route { flex-direction: column; }
  .route .ends { flex: none; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .theme-a .shell, .theme-b .shell, .theme-c .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .theme-c .nav-item.minor { display: flex; }
  .nav, .theme-a .nav, .theme-b .nav, .theme-c .nav {
    position: fixed; top: 0; left: 0; bottom: 0; width: 264px; height: 100vh; flex-direction: column; align-items: stretch;
    padding: 16px 12px; transform: translateX(-105%); transition: transform .18s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .3); z-index: 70; overflow-y: auto;
  }
  body.nav-open .nav { transform: none; }
  .theme-b .nav-item, .theme-c .nav-item { flex-direction: row; gap: 10px; padding: 9px 10px; font-size: 14px; text-align: left; border-radius: var(--radius); }
  .theme-b .nav-item .full, .theme-c .nav-item svg.i { display: inline; }
  .theme-b .nav-item .short { display: none; }
  .theme-b .nav-item .badge { position: static; }
  .theme-b .brand, .theme-c .brand { justify-content: flex-start; margin: 0 0 12px; }
  .theme-c .nav .tools { margin: 12px 0 0; }
  .theme-c .me-block { display: flex; }
  .icon-btn.menu-btn { display: inline-grid; }
  .top, .theme-c .top { padding: 10px 14px; position: sticky; top: 0; background: var(--surface); border-bottom: 1px solid var(--line); }
  .theme-c .top h1 { font-size: 18px; display: block; }
  .theme-c .top .subtitle { display: block; font-size: 12px; }
  .search input { width: 100%; }
  .top .search { display: none; }
  .page, .theme-b .page, .theme-c .page { padding: 14px; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .split.has-detail .tasklist { display: none; }
  .split:not(.has-detail) .taskview { display: none; }
  .back-link { display: inline-flex; }
  .tasklist { border-right: 0; }
  .facts, .fgroup .panel-b { grid-template-columns: 1fr; gap: 2px 0; }
  .facts .k, .fgroup .k { margin-top: 6px; font-size: 12px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bar { grid-template-columns: 120px minmax(0, 1fr) 28px; }
  .login-cols { grid-template-columns: 1fr; }
  .search-results { width: calc(100vw - 28px); }
  .taskview, .theme-c .taskview { padding: 14px; }
  .btn .hide-sm { display: none; }
}
