/* ЕНОТ: первая версия компонентов. Базовый файл остается совместим с проверкой Excel.
   Переменные задают единый стиль; рабочие статусы по-прежнему подписаны словами. */
:root {
  --ink: #17393e;
  --nav: #102f35;
  --blue: #096c70;
  --teal: #15765c;
  --muted: #586f76;
  --line: #d6e3df;
  --bg: #f3f7f4;
  --radius: 14px;
}
/* Таблица ЕНОТ: знакомая широкая сетка, без уменьшения шрифта до нечитаемого.
   На телефоне прокручивается только таблица; первые колонки не закрывают экран. */
.enot-table-toolbar, .enot-table-summary { display: flex; align-items: center; gap: 16px; justify-content: space-between; flex-wrap: wrap; margin: 18px 0; }
.enot-table-toolbar .planning-tabs { margin: 0; }
.enot-table-toolbar .choice-row { margin: 0; }
.enot-table-filter { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; margin: 22px 0; }
.enot-table-filter label { display: grid; gap: 6px; flex: 1 1 160px; color: var(--muted); font-size: 12px; }
.enot-table-filter label:first-child { flex-basis: 240px; }
.enot-table-filter input, .enot-table-filter select { width: 100%; min-height: 44px; }
.enot-table-filter button { min-height: 44px; }
.enot-table-summary { font-size: 13px; }
.enot-table-summary > span:first-child { font-weight: 700; }
.enot-table-scroll { overflow: auto; max-height: 72vh; border: 1px solid #c6d9d1; border-radius: 12px; background: white; overscroll-behavior: contain; }
.enot-table-scroll:focus-visible { outline: 3px solid #14756d; outline-offset: 3px; }
.enot-grid { table-layout: fixed; width: 1790px; border-collapse: separate; border-spacing: 0; }
.enot-grid th, .enot-grid td { padding: 16px; vertical-align: top; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); overflow-wrap: anywhere; white-space: normal; }
.enot-grid th { position: sticky; top: 0; z-index: 3; background: #e3eee7; color: #214b45; font-size: 12px; letter-spacing: .2px; text-transform: none; }
.enot-grid td { background: white; line-height: 1.5; font-size: 13px; }
.enot-grid tr:nth-child(even) td { background: #f8faf7; }
.enot-grid th:nth-child(1), .enot-grid td:nth-child(1) { width: 170px; position: sticky; left: 0; z-index: 1; }
.enot-grid th:nth-child(2), .enot-grid td:nth-child(2) { width: 330px; position: sticky; left: 170px; z-index: 1; box-shadow: 3px 0 5px #204b4010; }
.enot-grid th:nth-child(1), .enot-grid th:nth-child(2) { z-index: 4; }
.enot-grid th:nth-child(3) { width: 300px; }
.enot-grid th:nth-child(4) { width: 250px; }
.enot-grid th:nth-child(5) { width: 230px; }
.enot-grid th:nth-child(6) { width: 260px; }
.enot-grid th:nth-child(7) { width: 250px; }
.enot-grid .enot-row-title { display: block; font-size: 14px; font-weight: 700; text-align: left; line-height: 1.5; padding: 0; }
.enot-grid .row-meta { margin: 5px 0; }
.enot-grid details { margin: 10px 0; }
.enot-grid summary { cursor: pointer; color: #226963; padding: 5px 0; font-size: 12px; }
.enot-grid details .source-text { margin-top: 8px; }
.enot-step-label { display: block; color: var(--muted); font-size: 11px; margin-bottom: 7px; }
.enot-deadline { display: block; font-size: 13px; margin-bottom: 5px; font-variant-numeric: tabular-nums; }
.enot-effort { margin: 10px 0 0; font-weight: 700; }
.enot-row-warning { color: #86551b; margin: 12px 0 0; font-size: 12px; }
.enot-row-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.enot-row-actions .text-button { text-align: left; min-height: 32px; }
.enot-document { margin-top: 12px; overflow-wrap: anywhere; }
.enot-document small { display: block; color: var(--muted); }
.enot-select-title { display: flex; gap: 10px; align-items: flex-start; }
.enot-select-title input { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 3px; accent-color: #15765c; }
.enot-related { border-left: 3px solid #14756d; padding-left: 12px; }
.enot-table-scroll.compact td { padding-top: 9px; padding-bottom: 9px; }
.enot-table-scroll.compact .row-meta { margin: 2px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 850px) {
  .enot-grid td:nth-child(1), .enot-grid td:nth-child(2) { position: static; }
  .enot-grid th:nth-child(1), .enot-grid th:nth-child(2) { left: auto; z-index: 3; }
  .enot-table-toolbar { align-items: flex-start; }
  .enot-table-filter label { flex-basis: 100%; }
}
.brand-mark { border: 0; background: transparent; }
.brand-mark img { width: 44px; height: 44px; display: block; }
.brand small { letter-spacing: .3px; font-size: 11px; }
/* Слоган занимает отдельную строку, переносится на узком экране и не уменьшает
   шрифт рабочего списка. На странице входа используем обычный контраст текста. */
.brand-slogan { margin: -12px 8px 22px; font-size: 12px; line-height: 1.5; color: #dcebe5; }
.login-card .brand-slogan { margin: 12px 0 22px; color: var(--ink); font-size: 16px; font-weight: 600; }
.login-card .brand-mark { width: 58px; height: 58px; background: transparent; }
.login-card .brand-mark img { width: 58px; height: 58px; }
nav { overflow-y: auto; }
nav .nav-divider { border-top: 1px solid #315056; margin: 12px 8px 6px; }
nav button.active { background: #24534f; color: #fff; }
button.primary,button.secondary { min-height: 44px; }
.icon-button { min-width: 40px; min-height: 40px; }
.table-wrap { border-radius: 10px; }
.table-wrap th { background: #edf4f0; color: #284b50; }
.plan-process { display: flex; gap: 18px; flex-wrap: wrap; margin: 16px 0 24px; color: var(--muted); }
.plan-process span { display: flex; gap: 9px; align-items: center; }
.plan-process b { display: grid; place-items: center; border: 1px solid #aac9bc; border-radius: 50%; width: 26px; height: 26px; color: var(--ink); }
.plan-cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.plan-card h2 { overflow-wrap: anywhere; }
.plan-card { margin: 0; display: flex; flex-direction: column; align-items: stretch; }
.plan-card .secondary { margin-top: auto; align-self: flex-start; }
.plan-title { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.empty-state { grid-column: 1 / -1; padding: 32px; }
.empty-state p { max-width: 650px; margin-bottom: 0; }
.plan-day-summary { display: flex; gap: 14px; align-items: baseline; margin: 22px 0; }
.plan-day-summary strong { font-size: 27px; }
.plan-day-summary span { color: var(--muted); }
.day-list { display: grid; gap: 12px; }
.day-card { display: grid; grid-template-columns: 160px 1fr auto; align-items: center; gap: 24px; padding: 24px; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.day-card h2 { font-size: 17px; margin-bottom: 7px; }
.day-card p { margin-bottom: 7px; }
.day-time { display: grid; gap: 9px; }
.day-time strong { font-size: 19px; font-variant-numeric: tabular-nums; }
#assignment-editor fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 18px; min-width: 0; }
#assignment-editor .calendar-row { grid-template-columns: 1fr 1fr auto; }
.planning-details { display: grid; grid-template-columns: 150px 1fr; gap: 9px 16px; line-height: 1.5; }
.planning-details dt { color: var(--muted); }
.planning-details dd { margin: 0; overflow-wrap: anywhere; }
/* Гант занимает отдельное широкое окно. Подписи остаются на месте при прокрутке. */
dialog.gantt-dialog { width: calc(100vw - 36px); max-width: 1500px; }
.gantt-top { display: flex; gap: 20px; justify-content: space-between; align-items: start; }
.gantt-top h2 { margin: 0 0 6px; }
.gantt-legend { display: flex; flex-wrap: wrap; gap: 10px 18px; font-size: 12px; margin: 18px 0; color: #155c59; }
.reserve-key { color: #965b13; }
.deadline-key { color: #a2314d; }
.gantt-paging { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.gantt-paging span { margin-right: auto; }
.gantt-scroll { max-height: 60vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; overscroll-behavior: contain; }
.gantt-sheet { width: max-content; display: flex; align-items: start; background: #eff3f2; }
.gantt-labels { width: 240px; flex-shrink: 0; position: sticky; left: 0; z-index: 3; background: white; box-shadow: 2px 0 6px #153b3510; }
.gantt-label-head { height: 52px; display: flex; align-items: center; padding: 0 14px; background: #e9f2ed; font-weight: 700; border-right: 1px solid var(--line); }
.gantt-label { height: 88px; padding: 8px 12px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; box-sizing: border-box; }
.gantt-label strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt-label small { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt-label .text-button { padding: 3px 0; min-height: 32px; align-self: start; }
.gantt-axis { position: sticky; top: 0; z-index: 2; height: 52px; background: #e9f2ed; }
.gantt-axis text { font: 12px system-ui,sans-serif; fill: #244d52; }
.gantt-axis .gantt-hour { font-size: 9px; fill: #586f76; }
.gantt-body { display: block; }
.gantt-grid { stroke: #d3dfdc; stroke-width: 1; }
.gantt-bar { fill: #13756d; touch-action: none; outline: none; }
.gantt-bar.reserve { fill: #aa6a23; }
.gantt-bar.conflict { stroke: #be3251; stroke-width: 3; }
.gantt-bar:focus { stroke: #1859a3; stroke-width: 4; }
.gantt-baseline { fill: none; stroke: #657d78; stroke-width: 1.5; stroke-dasharray: 4 2; }
.gantt-deadline { stroke: #ba3455; fill: #ba3455; stroke-width: 1.5; stroke-dasharray: 3 2; pointer-events: none; }
.gantt-dependency { fill: none; stroke: #507b91; stroke-width: 1.5; opacity: .8; pointer-events: none; }
.change-card { border-left: 3px solid #9bbeb0; margin: 15px 0; padding: 4px 15px; }
.change-card p { overflow-wrap: anywhere; }
/* Движение не несет делового смысла; настройка устройства всегда важнее украшений. */
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior: auto !important; transition: none !important; } }
@media(max-width:760px) {
  .brand-mark img { width: 36px; height: 36px; }
  .plan-cards { grid-template-columns: 1fr; }
  .plan-process { gap: 12px; font-size: 12px; }
  .day-card { grid-template-columns: 1fr; gap: 12px; padding: 18px; }
  .day-card .text-button { justify-self: start; }
  .day-time { display: flex; justify-content: space-between; flex-wrap: wrap; }
  .plan-day-summary { flex-wrap: wrap; gap: 6px; }
  .planning-details { grid-template-columns: 1fr; gap: 4px; }
  .planning-details dd { margin-bottom: 9px; }
  #assignment-editor .calendar-row { grid-template-columns: 1fr; }
  nav .nav-divider { display: none; }
}

.gantt-chart { flex-shrink: 0; }
.gantt-bar[data-gantt-movable="true"] { cursor: grab; }
/* Быстрые запросы заполняются сверху вниз. На узком экране поля становятся
   одной колонкой, а широкая таблица сохраняет собственную прокрутку. */
.quick-filters { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.quick-filters .planning-row-actions { align-self:end; flex-wrap:wrap; }
.quick-calendar-row { display:grid; grid-template-columns:1fr 1fr 2fr auto; align-items:end; gap:10px; margin-bottom:12px; }
.quick-calendar-row input,.quick-calendar-row select { min-width:0; }
#quick-report { margin-top:16px; }
@media(max-width:640px) {
  .quick-filters,.quick-calendar-row { grid-template-columns:minmax(0,1fr); }
}

/* Вопросы и встречи: две смысловые зоны вместо широкой технической таблицы.
   На телефоне дата идет под вопросом; закрытый вопрос читаем, но видим зачеркивание. */
.coord-week {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:20px 0;}
.coord-week .panel {margin:0;}
.coord-list {display:grid;gap:12px;}
.coord-card {display:grid;grid-template-columns:minmax(0,1fr) minmax(160px,230px);gap:20px;padding:18px;border:1px solid var(--line,#dce3e8);border-radius:12px;}
.coord-card h3,.coord-card p,.coord-agenda p {margin:0 0 8px;overflow-wrap:anywhere;}
.coord-card .text-button {text-align:left;white-space:normal;font-size:inherit;}
.coord-agenda {display:block;padding:16px;border:1px solid var(--line,#dce3e8);border-radius:10px;margin:12px 0;overflow-wrap:anywhere;}
.coord-agenda input[type=checkbox] {margin-right:10px;}
.coord-resolved h3,.coord-resolved h4 {text-decoration:line-through;color:#586672;}
#co-people [hidden] {display:none;}
@media(max-width:740px){.coord-week,.coord-card {grid-template-columns:minmax(0,1fr);}.coord-card {gap:8px;}}
/* Портфель: короткая строка решения остается читаемой и на узком экране. */
.register-card { display:grid; grid-template-columns:minmax(0,1fr) minmax(180px,260px); gap:24px; padding:22px 0; border-bottom:1px solid var(--line,#dce4e2); }
.register-card h3 { margin:10px 0; }
.register-card p { white-space:pre-wrap; overflow-wrap:anywhere; }
.register-side { display:flex; flex-direction:column; align-items:flex-start; gap:8px; }
.register-loss { margin:16px 0; padding:16px; border:1px solid var(--line,#dce4e2); border-radius:12px; }
@media(max-width:700px) { .register-card { grid-template-columns:1fr; gap:12px; } }

/* Факт, план и остаток различаются подписью; сетка перестраивается на телефоне. */
.progress-totals { display: grid; grid-template-columns: repeat(auto-fit,minmax(145px,1fr)); gap: 12px; }
.progress-totals > div { padding: 12px; border: 1px solid #d5e2de; border-radius: 10px; }
.progress-totals dt { font-size: .85rem; }
.progress-totals dd { margin: 8px 0 0; font-weight: 700; font-size: 1.2rem; }
.progress-interval { margin: 12px 0; padding: 12px; border: 1px solid #d5e2de; border-radius: 10px; min-width: 0; }
.progress-interval input { min-width: 0; max-width: 100%; }

/* Пункты шаблона раскрываются отдельно: большой исходный список легче просмотреть. */
.template-step { margin: 12px 0; padding: 14px 16px; border: 1px solid #d6dedb; border-radius: 12px; background: #fff; }
.template-step > summary { font-weight: 600; cursor: pointer; overflow-wrap: anywhere; }
.template-step[open] > summary { margin-bottom: 14px; }
.template-step select[multiple] { min-height: 108px; }

/* Обзор руководителя: карточка целиком является доступной кнопкой фильтра.
   Узкие экраны получают одну колонку; большие таблицы прокручиваются внутри. */
.dashboard-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:22px 0; }
.dashboard-metric { text-align:left; display:flex; flex-direction:column; gap:9px; padding:20px; border:1px solid var(--line,#dce4e8); border-radius:16px; background:white; color:var(--ink,#203b42); }
.dashboard-metric strong { font-size:36px; line-height:1; }
.dashboard-metric small,.dashboard-note { color:var(--muted,#5c7079); font-size:13px; line-height:1.6; }
.dashboard-metric.selected { border-color:#248273; box-shadow:inset 0 0 0 1px #248273; }
.dashboard-metric:focus-visible { outline:3px solid #248273; outline-offset:3px; }
.dashboard-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; align-items:start; }
.dashboard-grid .panel { min-width:0; margin:0; }
.dashboard-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr)); gap:16px; }
.dashboard-cards article,.dashboard-item { border-top:1px solid var(--line,#dce4e8); padding:16px 0; overflow-wrap:anywhere; }
.dashboard-badges { display:flex; flex-wrap:wrap; gap:5px; margin-top:8px; }
small.dashboard-note { display:block; }
#dashboard-filters label { display:flex; flex-direction:column; gap:5px; }
@media(max-width:1000px) { .dashboard-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); } .dashboard-grid { grid-template-columns:1fr; } }
@media(max-width:560px) { .dashboard-metrics { grid-template-columns:1fr; } .dashboard-metric { padding:16px; } }

/* Оценка ресурса: причины раскрываются внутри строки, неизвестное не похоже на ноль. */
.dashboard-capacity-totals { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:18px 0; }
.dashboard-capacity-totals>div { padding:14px; background:#f2f7f5; border-radius:12px; }
.dashboard-capacity-totals strong { display:block; font-size:22px; margin-top:8px; }
.dashboard-capacity-detail { min-width:180px; max-width:500px; }
.dashboard-capacity-detail summary { cursor:pointer; color:#17675d; padding:6px 0; }
.dashboard-capacity-detail article { border-top:1px solid #dce4e8; padding:10px 0; overflow-wrap:anywhere; }
.dashboard-capacity-issue { border-left:3px solid #d69a35; padding-left:10px; }
.dashboard-queue-grid { margin-bottom:20px; }
@media(max-width:800px) { .dashboard-capacity-totals { grid-template-columns:1fr; } }

/* История: три независимые шкалы, подписи и числа читаются без различения цветов.
   meter рисует длину сам: нет встроенного style, который блокирует защита сайта.
   Поля и полосы перестраиваются на узком экране, таблица прокручивается внутри. */
.history-filters { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,190px),1fr)); gap:14px; align-items:end; margin:20px 0; }
.history-filters .field { display:flex; flex-direction:column; min-width:0; }
.history-filters small { color:var(--muted); font-size:12px; }
.history-chart-month { display:grid; grid-template-columns:160px minmax(0,1fr); gap:16px; padding:14px 0; border-bottom:1px solid var(--line); }
.history-chart-month:last-child { border-bottom:0; }
.history-chart-month h3 { margin:8px 0; font-size:16px; }
.history-chart-month h3 small { display:block; color:var(--muted); font-size:12px; margin-top:6px; font-weight:400; }
.history-bar { display:grid; grid-template-columns:100px minmax(40px,1fr) 145px; align-items:center; gap:12px; width:100%; min-height:44px; padding:6px 10px; border:0; border-radius:8px; background:transparent; text-align:left; color:var(--ink); }
.history-bar:hover { background:var(--surface-soft); }
.history-bar strong { font-size:13px; text-align:right; font-variant-numeric:tabular-nums; }
.history-bar-label { font-size:13px; }
.history-bar-meter { display:block; width:100%; height:14px; border:0; border-radius:7px; background:var(--surface-soft); }
.history-bar-meter::-webkit-meter-bar { background:var(--surface-soft); border:0; border-radius:7px; }
.history-bar-meter::-webkit-meter-optimum-value { background:#7b9394; border-radius:7px; }
.history-bar-meter.scheduled::-webkit-meter-optimum-value { background:#197c83; }
.history-bar-meter.actual::-webkit-meter-optimum-value { background:#a66f28; }
.history-bar-meter::-moz-meter-bar { background:#7b9394; border-radius:7px; }
.history-bar-meter.scheduled::-moz-meter-bar { background:#197c83; }
.history-bar-meter.actual::-moz-meter-bar { background:#a66f28; }
.history-bar-unknown { height:14px; border:1px dashed var(--muted); border-radius:7px; background:repeating-linear-gradient(135deg,var(--surface-soft),var(--surface-soft) 4px,var(--surface) 4px,var(--surface) 8px); }
.history-intervals { padding-left:22px; color:var(--muted); line-height:1.6; }
@media(max-width:850px) { .history-chart-month { grid-template-columns:1fr; gap:2px; } }
@media(max-width:480px) { .history-bar { grid-template-columns:80px minmax(25px,1fr); gap:6px; } .history-bar strong { grid-column:2; font-size:12px; } }
