/* KDV_rillweb — тема оформления.
   Шрифт Golos Text раздаётся локально (public/fonts), поэтому интерфейс
   одинаково выглядит и без доступа в интернет. */

@font-face {
  font-family: 'Golos Text';
  font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/golos-400.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Golos Text';
  font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/golos-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Golos Text';
  font-style: normal; font-weight: 500; font-display: swap;
  src: url('/fonts/golos-500.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Golos Text';
  font-style: normal; font-weight: 500; font-display: swap;
  src: url('/fonts/golos-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Golos Text';
  font-style: normal; font-weight: 600; font-display: swap;
  src: url('/fonts/golos-600.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Golos Text';
  font-style: normal; font-weight: 600; font-display: swap;
  src: url('/fonts/golos-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}

:root {
  --fill: #e9edf3;          /* мягкая заливка вторичных кнопок */
  --fill-hover: #dde4ee;
  --font: 'Golos Text', 'Inter', 'PT Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --bg: #f2f4f8;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --line: #e4e7ec;
  --line-soft: #f0f2f5;

  --brand: #2f6bd8;
  --brand-dark: #2154ad;
  --brand-soft: #eaf1fd;
  --brand-ring: rgba(47, 107, 216, .18);

  --critical: #d0453f;
  --critical-soft: #fdeceb;
  --warn: #b54708;
  --warn-soft: #fdf3e7;
  --ok: #047857;
  --ok-soft: #e8f6f0;

  --bar: #5b8fd6;
  --bar-summary: #344054;
  --bar-done: #12805c;

  --sidebar: #101828;
  --sidebar-2: #1a2436;
  --sidebar-ink: #cfd8e3;
  --sidebar-muted: #8a97a8;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 8px 24px rgba(16, 24, 40, .06);
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.spacer { flex: 1; }
h1, h2, h3 { font-weight: 600; letter-spacing: -.01em; }

/* ---------- вход ---------- */
.login-wrap { display: grid; place-items: center; height: 100%; background: radial-gradient(1100px 700px at 15% -10%, #2b4f8f 0%, #101828 60%); }
.login-card { width: 356px; background: #fff; padding: 28px; border-radius: 16px; box-shadow: 0 24px 60px rgba(8, 15, 30, .45); display: grid; gap: 12px; }
.login-card h1 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.login-card p { margin: 0; }
.login-card label { display: grid; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 500; }
.login-error { color: var(--critical); font-size: 12px; min-height: 16px; }

/* ---------- каркас ---------- */
.app { display: grid; grid-template-columns: 272px minmax(0, 1fr); height: 100vh; overflow: hidden; }
.sidebar { background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%); color: var(--sidebar-ink); display: flex; flex-direction: column; overflow: hidden; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px; font-weight: 600; font-size: 15px; letter-spacing: .01em; color: #fff; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.logo { width: 20px; height: 20px; border-radius: 6px; background: linear-gradient(135deg, #7fb0ff, #2f6bd8); box-shadow: 0 0 0 3px rgba(127, 176, 255, .14); }
.sidebar nav { display: grid; padding: 10px 10px 4px; gap: 2px; }
.nav-item {
  text-align: left; background: transparent; border: 0; color: var(--sidebar-ink);
  padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; font-family: inherit; font-size: 13px;
  transition: background .12s ease, color .12s ease;
}
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item.active { background: rgba(127, 176, 255, .16); color: #fff; font-weight: 600; box-shadow: inset 2px 0 0 #7fb0ff; }
.folders { overflow: auto; padding: 4px 10px 12px; flex: 1; }
.section-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--sidebar-muted); margin: 16px 8px 6px; font-weight: 600; }
.tree-folder { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #a9b4c4; padding: 4px 8px; font-weight: 500; }
.tree-project {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; margin: 1px 0;
  border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; color: var(--sidebar-ink);
  transition: background .12s ease, color .12s ease; min-width: 0;
}
.tree-project:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.tree-project.active { background: rgba(127, 176, 255, .18); color: #fff; font-weight: 500; }
.tree-project .tree-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-project .tree-dot { width: 6px; height: 6px; border-radius: 50%; background: #7fb0ff; flex: 0 0 6px; }
.tree-project .tree-dot.planning { background: #f0b357; }
.tree-project .tree-dot.finished { background: #4ec38a; }
.tree-project .lock { font-size: 11px; color: #f0c674; margin-left: auto; }
.tree-project .tree-count { margin-left: auto; font-size: 10.5px; color: var(--sidebar-muted); }
.sidebar-foot { border-top: 1px solid rgba(255, 255, 255, .07); padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; }
.who { display: grid; min-width: 0; }
.who b { font-weight: 500; color: #fff; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .muted { color: var(--sidebar-muted); }

/* ---------- верхняя панель ---------- */
.main { display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 15.5px; margin: 0; font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; position: relative; }
.presence { display: flex; gap: 4px; align-items: center; }
.presence .dot {
  width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark);
  display: grid; place-items: center; font-size: 10.5px; font-weight: 600; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line);
}
/* соединение закрыто, но сессия ещё активна — контур вместо заливки */
.presence .dot-idle { background: #fff; color: var(--muted); border-style: dashed; }
.presence .dot-more { background: var(--fill); color: var(--ink-2); }
.view { overflow: auto; padding: 18px 20px 48px; flex: 1; min-width: 0; }

/* ---------- элементы управления ---------- */
button, select, input, textarea { font-family: inherit; font-size: 13px; color: inherit; }
button { cursor: pointer; }
/* мягкие кнопки: та же форма, что у «＋ Работа», но светло-серые с заливкой */
.btn, button, button.ghost {
  border: 0; background: var(--fill, #edf0f4); border-radius: 8px;
  padding: 6px 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 500;
  color: var(--ink-2); line-height: 1.15; box-shadow: inset 0 0 0 1px rgba(16, 24, 40, .07);
  transition: background .12s ease, color .12s ease, box-shadow .12s ease;
}
.btn:hover:not([disabled]), button:hover:not([disabled]), button.ghost:hover:not([disabled]) { background: var(--fill-hover, #e2e8ef); color: var(--ink); }
button.primary { background: var(--brand); color: #fff; font-weight: 600; box-shadow: 0 1px 2px rgba(47, 107, 216, .35); }
button.primary:hover:not([disabled]) { background: var(--brand-dark); color: #fff; }
button.danger { background: var(--critical-soft); color: var(--critical); }
button.danger:hover:not([disabled]) { background: #fbdad6; color: var(--critical); }
button.icon { background: transparent; padding: 6px 8px; position: relative; }
button.icon:hover:not([disabled]) { background: var(--fill-hover, #e2e8ef); }
button.link { background: transparent; border: 0; color: #9ec2f0; padding: 0; font-size: 12.5px; }
button.link:hover { color: #fff; }
button[disabled] { opacity: .45; cursor: not-allowed; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--brand-ring); outline-offset: 1px; }

input, select, textarea { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 9px; background: #fff; }
input:hover, select:hover { border-color: #d3d8e0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
input[type=checkbox] { width: auto; accent-color: var(--brand); }

.badge { position: absolute; top: 2px; right: 2px; background: var(--critical); color: #fff; border-radius: 10px; font-size: 9px; padding: 0 5px; font-weight: 600; }

/* ---------- карточки и сетки ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.card + .card { margin-top: 14px; }
/* внутри сеток и строк отступ даёт gap, иначе карточки уезжают вниз */
.grid > .card + .card, .row > .card + .card, .grid > .card, .row > .card { margin-top: 0; }
.card h2 { font-size: 13.5px; margin: 0; padding: 0 16px; min-height: 46px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 10px; }
.card h2 button, .card h2 .btn { padding: 4px 10px; font-size: 12px; }
.card h2 .spacer { flex: 1; }
.card .body { padding: 14px 16px; }
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid.kpi-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid.kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { display: grid; grid-template-rows: auto auto auto; gap: 2px; min-width: 0; align-content: start; height: 100%; }
.kpi span { font-size: 11.5px; color: var(--muted); line-height: 1.25; overflow-wrap: anywhere; }
.kpi b { font-size: 19px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; line-height: 1.15; }
/* подпись занимает одинаковую высоту в 1–2 строки: числа во всех карточках стоят на одной линии */
.kpi > span:first-child, .kpi .kpi-label { min-height: 30px; }
.kpi .small, .kpi .kpi-note { font-size: 11px; line-height: 1.3; }
.kpi .kpi-value { font-size: 19px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; line-height: 1.15; }
/* пояснение прижимаем к низу карточки — во всех карточках оно начинается на одной линии */
.kpi > :nth-child(3) { align-self: end; }

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; vertical-align: middle; }
th { color: var(--muted); font-weight: 600; background: var(--panel-2); position: sticky; top: 0; z-index: 1; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; }
tbody tr:hover { background: #fafbfd; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 500; background: var(--line-soft); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--critical-soft); color: var(--critical); }
.pill.brand { background: var(--brand-soft); color: var(--brand-dark); }

/* ---------- рабочая область проекта ---------- */
.project { display: grid; grid-template-columns: 1fr; gap: 10px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding-bottom: 0; flex-wrap: wrap; margin: 4px 0 10px; }
.tabs button { border: 0; background: transparent; padding: 8px 12px; border-radius: 0; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; }
.tabs button:hover { color: var(--ink-2); }
.tabs button.active { color: var(--brand); font-weight: 600; border-bottom-color: var(--brand); background: transparent; }
.toolbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.toolbar .sep { width: 1px; height: 22px; background: var(--line); margin: 0 3px; }
.toolbar select, .toolbar input { padding: 5px 8px; font-size: 12.5px; }

/* сгруппированные кнопки: один «сегмент» на логическую группу действий */
.toolbar { gap: 10px; padding: 7px 8px 9px; border-bottom: 1px solid var(--line-soft); }
.view > .card > .body > .toolbar:last-child, .toolbar:last-child { border-bottom: 0; }
.btn-group { display: inline-flex; align-items: center; gap: 4px; padding: 0; background: transparent; border: 0; border-radius: 10px; }
.btn-group > button, .btn-group > .menu-wrap > button {
  border: 0; background: var(--fill, #edf0f4); border-radius: 8px; height: 28px; padding: 0 11px; font-size: 12.5px; font-weight: 500;
  color: var(--ink-2); box-shadow: inset 0 0 0 1px rgba(16, 24, 40, .07); display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  white-space: nowrap; line-height: 1; cursor: pointer;
}
.btn-group > button:hover:not([disabled]), .btn-group > .menu-wrap > button:hover:not([disabled]) { background: var(--fill-hover, #e2e8ef); color: var(--ink); }
.btn-group > button.primary { background: var(--brand); color: #fff; padding: 0 13px; margin-right: 0; font-weight: 600; box-shadow: 0 1px 2px rgba(47, 107, 216, .35); }
.btn-group > button.active { box-shadow: inset 0 0 0 1px rgba(47, 107, 216, .25); }
.btn-group > button.primary:hover:not([disabled]) { background: var(--brand-dark); color: #fff; }
.btn-group > button.active { background: var(--brand-soft); color: var(--brand-dark); }
.btn-group > button.danger { background: #fdeceb; color: var(--critical); }
.btn-group > button.danger:hover:not([disabled]) { background: #fbdad6; color: var(--critical); }
.btn-group > button[disabled] { opacity: .38; }
.btn-group select { border: 0; background: var(--fill, #edf0f4); height: 28px; padding: 0 6px; font-size: 12.5px; box-shadow: none; color: var(--ink-2); align-self: center; border-radius: 8px; }
.btn-group select:hover { background: var(--fill-hover, #e2e8ef); }
.btn-group input:not([type=checkbox]) { border: 0; background: var(--fill, #edf0f4); box-shadow: none; height: 28px; border-radius: 8px; padding: 0 10px; font-size: 12.5px; }
.btn-group input:not([type=checkbox]):focus { background: #fff; box-shadow: inset 0 0 0 1px var(--brand); }
.btn-group .hint { padding: 0 8px; line-height: 28px; }

/* отпуска: годовой календарь (ФИО и должность слева, месяцы или дни) */
.vc-wrap { overflow: auto; max-height: 68vh; }
.vc-table { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.vc-table th, .vc-table td { padding: 3px 6px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.vc-table thead th { background: var(--panel-2); position: sticky; top: 0; z-index: 2; }
.vc-table thead tr.vc-months th { top: 0; }
.vc-table thead tr:last-child th { top: 26px; }
.vc-table .vc-person { position: sticky; left: 0; z-index: 1; background: #fff; text-align: left; min-width: 230px; box-shadow: 1px 0 0 var(--line-soft); }
.vc-table thead .vc-person { z-index: 3; background: var(--panel-2); }
.vc-table .vc-name { font-weight: 600; color: var(--ink); }
.vc-table .vc-role { color: var(--muted); font-size: 11px; }
.vc-table .vc-month { text-align: center; min-width: 42px; }
.vc-table .vc-monthhead { text-align: center; font-size: 11px; color: var(--muted); border-left: 1px solid var(--line-soft); }
.vc-table.vc-days td.vc-day { width: 15px; min-width: 15px; max-width: 15px; padding: 0; height: 20px; border-right: 1px solid #f2f4f7; }
.vc-table.vc-days th.vc-day { width: 15px; min-width: 15px; font-size: 9.5px; padding: 2px 0; text-align: center; font-weight: 500; }
.vc-table tbody tr.summary td { background: #f7f9fc; font-weight: 600; }
.vc-weekend { background: #f4f6f9 !important; }
.vc-vac { background: #bcd4f6 !important; color: #16325c; font-weight: 600; }
.vc-req { background: #ffe9a8 !important; color: #7a5300; }
.vc-sick { background: #f8c4c0 !important; color: #7d1f18; }
.vc-trip { background: #d8cdf2 !important; color: #3f2b7a; }
.vc-study { background: #c6e8cd !important; color: #1c5230; }
.vc-legend { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 8px; }
.vc-key { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.vc-key::before { content: ''; width: 14px; height: 12px; border-radius: 3px; border: 1px solid var(--line); display: inline-block; }

/* персонал: дерево структуры и загрузка по неделям */
.pl-wrap { overflow: auto; max-height: 66vh; }
.pl-table { font-size: 12.5px; }
.pl-table th, .pl-table td { padding: 4px 8px; white-space: nowrap; border-bottom: 1px solid var(--line-soft); }
.pl-table tr.pl-group > td { background: #f7f9fc; font-weight: 600; }
.pl-table tr.pl-group:hover > td { background: #f1f5fb; }
.pl-table tr.pl-detail > td { color: var(--muted); font-size: 12px; background: #fcfdff; }
.pl-table td.pl-name { max-width: 520px; overflow: hidden; text-overflow: ellipsis; }
.pl-week { min-width: 34px; text-align: right; }
.pl-daycol { min-width: 22px; text-align: center; padding: 2px 3px !important; }
.pl-table.pl-days td.pl-name { min-width: 220px; }
.pl-monthhead { text-align: center; font-size: 11px; color: var(--muted); border-left: 1px solid var(--line-soft); }
.pl-table thead tr.pl-months th { top: 0; }
/* дневной режим персонала — та же сетка, что в календаре отпусков */
.pl-table.pl-days { border-collapse: separate; border-spacing: 0; }
.pl-table.pl-days thead th { position: sticky; top: 0; z-index: 2; background: var(--panel-2); }
.pl-table.pl-days thead tr.vc-months th { top: 0; }
.pl-table.pl-days thead tr:last-child th { top: 26px; }
.pl-table.pl-days tbody td.pl-name { position: sticky; left: 0; z-index: 1; background: #fff; box-shadow: 1px 0 0 var(--line-soft); }
.pl-table.pl-days thead th:first-child { position: sticky; left: 0; z-index: 3; background: var(--panel-2); }
.pl-table.pl-days tbody tr.pl-detail td.pl-name { background: #fcfdff; }
.pl-table.pl-days td.vc-day, .pl-table.pl-days th.vc-day { width: 16px; min-width: 16px; max-width: 16px; padding: 0; height: 20px; text-align: center; font-size: 10.5px; border-right: 1px solid #f2f4f7; }
.pl-table.pl-days tr.summary td.vc-day { background: #eef2f8; }
.pl-table.pl-days td.pl-week { padding: 4px 8px; }
.pl-over { background: var(--critical-soft); color: var(--critical); font-weight: 600; }
.pl-high { background: var(--warn-soft); color: var(--warn); }
.pl-mid { background: #f2f7ff; }
.pl-low { color: var(--ink-2); }

/* список галочек в диалогах (роли, права) — вместо нативного <select multiple> */
.pick-list { display: grid; gap: 2px; max-height: 190px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: var(--panel); }
.pick { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; font-size: 12.5px; cursor: pointer; }
.pick:hover { background: var(--panel-2); }
.pick input { margin: 0; }
.toolbar > .hint { padding: 0 8px; line-height: 28px; }
.toolbar > .hint:last-child { padding-right: 4px; }
.btn-group > button.icon { padding: 0 8px; min-width: 30px; font-size: 13px; }
.btn-group > button.icon.active { background: #eef3fd; color: var(--brand-dark); }
.btn-group select:focus { border: 0; box-shadow: none; }
.menu-wrap { position: relative; }
.menu-wrap .dropdown { top: 32px; }
.grow-1 { flex: 1; }

/* выпадающая панель выбора столбцов */
.dropdown { position: absolute; top: 34px; right: 0; z-index: 40; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; min-width: 230px; }
.dropdown .dd-title { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 4px 6px 6px; font-weight: 600; }
.dropdown label.dd-item { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; font-size: 12.5px; }
.dropdown label.dd-item:hover { background: var(--panel-2); }
.dropdown .dd-foot { display: flex; gap: 6px; padding: 6px 6px 2px; border-top: 1px solid var(--line-soft); margin-top: 6px; }

/* ---------- Гантт ---------- */
.gantt-wrap { display: grid; grid-template-columns: minmax(260px, var(--table-w, 46%)) 6px minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow-sm); }
.gantt-wrap.table-collapsed { grid-template-columns: minmax(0, 1fr); }
.gantt-wrap.table-collapsed .gantt-table, .gantt-wrap.table-collapsed .gantt-splitter { display: none; }
.gantt-wrap.canvas-collapsed { grid-template-columns: minmax(0, 1fr); }
.gantt-wrap.canvas-collapsed .gantt-canvas, .gantt-wrap.canvas-collapsed .gantt-splitter { display: none; }
.gantt-splitter { background: var(--line-soft); cursor: col-resize; position: relative; }
.gantt-splitter:hover, .gantt-splitter.active { background: var(--brand-soft); }
.gantt-splitter::after { content: ''; position: absolute; left: 2px; top: 50%; width: 2px; height: 28px; margin-top: -14px; background: #c8cfd8; border-radius: 2px; }
.gantt-table { border-right: 1px solid var(--line); overflow: auto; height: 62vh; min-width: 0; }
.gantt-table table { font-size: 12.5px; }
.gantt-table th, .gantt-table td { padding: 4px 8px; white-space: nowrap; border-bottom: 1px solid var(--line-soft); }
.gantt-table th { background: var(--panel-2); }
.gantt-table tbody tr.summary { background: #fbfcfe; }
.gantt-table tbody tr.summary td { font-weight: 600; }
.gantt-table td.name { max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.gantt-table td.res { max-width: 200px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.gantt-table td.wbs { color: var(--muted); font-variant-numeric: tabular-nums; }
.gantt-table tr.selected { background: var(--brand-soft) !important; }
.gantt-table tr.hit td { background: #fff7d6; }
.gantt-table tr.hit.selected td { background: var(--brand-soft); }
.gantt-table tr.critical td.wbs { color: var(--critical); font-weight: 600; }
.gantt-table tr.near td.num { color: var(--warn); }
.gantt-table td.date { padding: 0 4px; }
.tree-toggle { border: 0; background: transparent; padding: 0 4px 0 0; color: var(--muted); font-size: 11px; cursor: pointer; width: 14px; }
.tree-toggle:hover { color: var(--brand); }
input.inline-date { border: 1px solid transparent; background: transparent; padding: 2px 4px; font-size: 12px; width: 122px; border-radius: 6px; }
input.inline-date:hover { border-color: var(--line); background: #fff; }
input.inline-date:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-ring); }

.gantt-canvas { overflow: auto; height: 62vh; position: relative; min-width: 0; }
.gantt-canvas svg { display: block; }
.gantt-canvas .bar { cursor: move; }
.gantt-canvas .bar:hover { filter: brightness(1.05); }
.link-path { fill: none; stroke: #94a3b8; stroke-width: 1.2; marker-end: url(#arrow); }
.link-path.critical { stroke: var(--critical); }

.hist td, .hist th { font-size: 11.5px; padding: 3px 5px; }
.hist .cell { min-width: 24px; text-align: center; font-variant-numeric: tabular-nums; }
.hist .over { background: var(--critical-soft); color: var(--critical); font-weight: 600; }
.hist .busy { background: #eef4fd; }
.hist .free { background: #fafbfd; color: #b6bfca; }
.hist .weekend { background: repeating-linear-gradient(45deg, #f1f3f6, #f1f3f6 4px, #e9edf1 4px, #e9edf1 8px); }

/* ---------- прочее ---------- */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #101828; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 50; box-shadow: var(--shadow); max-width: 70vw; font-size: 12.5px; }
.toast.err { background: var(--critical); }
.modal { position: fixed; inset: 0; background: rgba(16, 24, 40, .5); display: grid; place-items: center; z-index: 60; backdrop-filter: blur(1px); }
.modal-box { background: #fff; border-radius: 14px; width: min(780px, 94vw); max-height: 88vh; overflow: auto; box-shadow: 0 24px 60px rgba(8, 15, 30, .3); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.modal-head h2 { font-size: 14.5px; margin: 0; }
#modal-body { padding: 18px; }
.notif { padding: 9px 10px; border-radius: var(--radius-sm); border-bottom: 1px solid var(--line-soft); }
.notif:last-child { border-bottom: 0; }
.notif.unread { background: var(--brand-soft); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.form-grid label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; }
.form-grid label.row { display: flex; font-weight: 400; color: var(--ink-2); }
.hint { font-size: 11.5px; color: var(--muted); }
.timeline-bar { background: var(--line-soft); border-radius: 4px; height: 8px; position: relative; overflow: hidden; min-width: 60px; }
.timeline-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #6fa2ea, #2f6bd8); }
.empty { padding: 34px; text-align: center; color: var(--muted); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.drop-zone { border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 24px; text-align: center; color: var(--muted); background: var(--panel-2); cursor: pointer; transition: border-color .12s, background .12s; }
.drop-zone:hover { border-color: var(--brand); color: var(--brand-dark); }
.drop-zone.over { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }

/* полноэкранный Гантт */
.gantt-full .sidebar, .gantt-full .topbar { display: none !important; }
.gantt-full .app { grid-template-columns: minmax(0, 1fr); }
.gantt-full .view { padding: 8px 10px; overflow: hidden; }
.gantt-full .gantt-table, .gantt-full .gantt-canvas { height: calc(100vh - 200px); }

@media print { .sidebar, .topbar, .tabs, .toolbar { display: none !important; } .view { overflow: visible; } }
