/* rs-tracker — светлая тема: строгая, технологичная, без скруглений.
   Единая шкала: высота контролов 30px, углы прямые, шаг отступов 4px.
   Два шрифта с разделением ролей: Inter — текст, JetBrains Mono — данные.
   Цвет несёт смысл, а не украшает: фиолетовым говорит действие и выбор,
   статусными цветами — состояние срока. Всё остальное — нейтральный серый.
   Палитра — Radix Colors, роли шагов и проверенные пары описаны в блоке токенов ниже. */


/* --- Шрифт -------------------------------------------------------------- */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/static/vendor/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/static/vendor/fonts/inter-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}


/* Моноширинный — только для данных: дат, времени, счётчиков, идентификаторов.
   Цифры встают в колонку, и число читается как значение, а не как слово в предложении. */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/static/vendor/fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/static/vendor/fonts/jetbrains-mono-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}


/* --- Токены ------------------------------------------------------------- */

/* Цвета взяты из Radix Colors — шкалы, где у каждого из 12 шагов закреплённая роль,
   а пары «подложка — текст» выверены по контрасту. Номер шага указан у каждого токена:
   2-3 — фон, 4 — подложка элемента, 6 — разделитель, 7 — граница поля,
   9 — сплошная заливка, 10 — тусклый, 11 — текст, 12 — заголовки.
   Нейтральная шкала — gray, акцентная — violet, статусные — red / amber / green / blue.
   Ранее (2026-08-25) нейтралью была тёплая sand, а акцентом графит. Заменено 2026-08-27
   по образцу оформления, которое выбрал пользователь: чистый серый без подмеса читается
   как белый лист, фиолетовый отделяет действие от данных. Gray, а не slate: slate синит,
   и это уже отвергалось раньше.
   Ранее (2026-08-25 — 2026-08-27) блоки держались тоном на сером поле, без контуров.
   Отменено 2026-08-27: пользователь заметил, что доска вышла серой и на образец не похожа.
   Разбор подтвердил — серость давали две вещи: тонированное поле под белыми карточками
   и серая плашка у каждого чипа. Теперь лист белый, карточка отделяется волосяной линией
   (как в образце), а подложку получают только сигнальные метки. */
:root {
  /* Нейтраль — Radix gray: чистая шкала без подмеса. Именно gray, а не slate: slate синит.
     Лист белый целиком — и панели, и поле доски; отделяет элементы линия, а не тон. */
  --bg: #ffffff;            /* белый    — лист приложения */
  --surface: #ffffff;       /* белый    — панели, карточки, всплывающее */
  --surface-2: #f9f9f9;     /* gray 2   — наведение на карточку, блоки кода */
  --surface-3: #e8e8e8;     /* gray 4   — подложка мелких элементов: чипы, бейджи */
  --hover: #f0f0f0;         /* gray 3   — наведение на элемент, лежащий на белом */
  --border: #d9d9d9;        /* gray 6   — разделители и рамки элементов на белом */
  --border-strong: #cecece; /* gray 7   — границы полей ввода */
  --rule: #cecece;          /* gray 7   — разлиновка доски: заметнее обычного разделителя */

  --text: #202020;          /* gray 12  — основной текст и заголовки */
  --text-2: #646464;        /* gray 11  — вторичный текст: даты, подписи, подсказки */
  --text-3: #838383;        /* gray 10  — только плейсхолдеры, неактивное и иконки */

  /* Акцент — Radix violet: шаг 9 под сплошную заливку, 11 под текст на белом.
     Цветом говорит только действие и выбор; смысл задачи по-прежнему несут статусы. */
  --accent: #6e56cf;        /* violet 9  — кнопки, активное, фокус */
  --accent-hover: #654dc4;  /* violet 10 */
  --accent-text: #6550b9;   /* violet 11 — ссылки и мелкий текст акцентом: 5.3:1 к белому */
  --accent-soft: #f4f0fe;   /* violet 3  — подложка выбранного и активного */

  /* Фокус — сам акцент: рамка violet 9 даёт 4.9:1 к белому и читается как часть системы,
     а не как отдельный серый обвод. Ореол тонкий, цветной, 20% — без тёмного свечения. */
  --focus: #6e56cf;
  --accent-ring: rgba(110, 86, 207, .20);

  /* Статусы: подложка — шаг 3, текст на ней и на белом — шаг 11 */
  --danger: #ce2c31;        /* red 11   */
  --danger-soft: #feebec;   /* red 3    */
  --danger-hover: #b8272c;  /* заливка кнопки удаления при наведении */
  --warn: #a46003;          /* amber 11, на 8% к шагу 12 — ради 4.5:1 на своей подложке */
  --warn-soft: #fff7c2;     /* amber 3  */
  --ok: #207d55;            /* green 11, тот же сдвиг */
  --ok-soft: #e6f6eb;       /* green 3  */
  --info: #0d6fc6;          /* blue 11, тот же сдвиг */
  --info-soft: #e6f4fe;     /* blue 3   */

  /* Прямые углы: токены оставлены, чтобы шкала переключалась в одном месте */
  --radius-sm: 0;
  --radius: 0;
  --radius-lg: 0;
  /* Плоские поверхности: тень только у всплывающего — модалок, меню, календаря */
  --shadow-sm: none;
  --shadow-md: 0 8px 24px rgba(32, 32, 32, .14);
  --shadow-lg: 0 16px 40px rgba(32, 32, 32, .18);

  /* Два шрифта с разделением ролей: Inter — текст, JetBrains Mono — данные.
     Всё, что раньше просило tabular-nums, теперь просит --font-mono. */
  --font-text: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  --topbar-h: 52px;
  --control-h: 30px;
  --sidebar-w: 260px;

  /* Ритм доски: одно поле вокруг карточек со всех сторон, шаг между ними меньше поля.
     --scrollbar-w должен совпадать с шириной ::-webkit-scrollbar, иначе бока разъедутся. */
  --column-pad: 12px;
  --card-gap: 8px;
  --card-pad-x: 11px;
  --scrollbar-w: 10px;
}


/* --- База -------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, figure { margin: 0; }
ul { list-style: none; padding: 0; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
code, pre { font-family: var(--font-mono); }

/* Данные набираются моноширинным: даты, время, счётчики, номера, клетки контрольного листа.
   Список ровно тот, где раньше стоял tabular-nums, — моно даёт то же выравнивание цифр
   и вдобавок отделяет значение от текста интонацией.
   Граница проходит по смыслу, а не по элементу: моно получает значение, но не фраза вокруг него.
   Поэтому в подписи под карточкой размечен только <time>: «Создана» и «Срок переносился» —
   предложение, и моно делает его и шире, и хуже читаемым. */
.chip, .column__count, .column__auto, .comment__time, .entry__time,
.modal__stamp time, .task__side-count, .calendar__day, .input--time,
.date-field .input, .ctl-seg, .ctl__col, .ctl__plan, .ctl-period .input--sm, .key__prefix {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}

/* Пробел у моноширинного шрифта равен по ширине цифре. Внутри короткой метки это провал:
   «19 дн» распадается на два токена. Лечится не word-spacing — он бы заодно склеил дату
   со временем в «2026-08-30 09:30», — а узким неразрывным пробелом U+202F в самой метке.
   Ставится только между числом и единицей, где пробел служит связкой, а не разделителем. */

/* Кегль моношириных элементов — 11px против 11.5px у соседнего Inter: у JetBrains Mono
   крупнее очко, и при равном размере цифры выглядели бы тяжелее подписей рядом.
   Размер задан у каждого элемента по месту, а не здесь: иначе правило пришлось бы
   держать ниже всех компонентов, чтобы оно не проигрывало им по порядку. */

.icon-sprite { display: none; }

.icon {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #bbbbbb; border: 3px solid transparent; background-clip: padding-box; border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: #8d8d8d; background-clip: padding-box; }


/* --- Каркас ------------------------------------------------------------ */

.layout { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: var(--sidebar-w); flex: none;
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border);
}

.sidebar__head {
  height: var(--topbar-h); flex: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px 0 16px; border-bottom: 1px solid var(--border);
}

.brand { color: var(--text); font-size: 14px; font-weight: 650; letter-spacing: -.015em; }
.brand:hover { text-decoration: none; color: var(--accent); }

/* Кнопка создания — единственный акцент в боковой панели */
.sidebar__head .icon-btn { width: 28px; height: 28px; background: var(--accent-soft); color: var(--accent); }
.sidebar__head .icon-btn:hover { background: var(--accent); color: #fff; }
.sidebar__head .icon-btn.is-open { background: var(--accent); color: #fff; }

.sidebar__tree { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 8px 10px; }

.sidebar__foot { flex: none; border-top: 1px solid var(--border); padding: 8px; display: flex; flex-direction: column; gap: 2px; }

.nav-link {
  display: flex; align-items: center; gap: 10px;
  height: var(--control-h); padding: 0 10px; border-radius: var(--radius);
  color: var(--text-2); font-size: 12.5px; font-weight: 450;
}
.nav-link:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.nav-link.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 550; }
.nav-link.is-active .icon { color: var(--accent); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h); flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--border);
}

.topbar__main { min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.topbar__title { font-size: 16px; font-weight: 650; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__actions { flex: none; display: flex; align-items: center; gap: 10px; }
.topbar__stat { color: var(--text-2); font-size: 12px; white-space: nowrap; }

.crumbs { display: flex; align-items: baseline; gap: 6px; color: var(--text-2); font-size: 12px; min-width: 0; }
.crumbs__item { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.crumbs__sep { color: var(--border-strong); }

.page { flex: 1; overflow-y: auto; padding: 20px; }
.page--center { display: grid; place-items: center; }

.stack { display: flex; flex-direction: column; gap: 16px; max-width: 880px; }


/* --- Дерево ------------------------------------------------------------ */

.tree--sub { margin: 0; }
.tree__item.is-collapsed > .tree--sub { display: none; }

.tree__row {
  display: grid; grid-template-columns: 18px 1fr 24px; align-items: center; gap: 4px;
  height: var(--control-h); border-radius: var(--radius);
  padding-left: calc(var(--depth, 0) * 14px);
  color: var(--text); cursor: default;
}
.tree__row:hover { background: var(--hover); }
/* Активная доска помечена чертой слева, а не одной заливкой: черта читается даже боковым
   зрением и не зависит от того, насколько подложка отличается от фона панели.
   inset-тень вместо рамки — не сдвигает содержимое строки на пиксель. */
.tree__row.is-active {
  background: var(--accent-soft);
  box-shadow: inset 2px 0 0 var(--accent);
}
.tree__row.is-active .tree__label, .tree__row.is-active .tree__kind { color: var(--accent-text); }
.tree__row.is-active .tree__text { font-weight: 550; }

.tree__toggle {
  width: 18px; height: 18px; display: grid; place-items: center;
  border: 0; background: transparent; padding: 0; border-radius: var(--radius-sm);
  color: var(--text-3); cursor: pointer;
}
.tree__toggle:hover { background: rgba(0, 0, 0, .06); color: var(--text); }
.tree__toggle .icon { width: 14px; height: 14px; transform: rotate(90deg); transition: transform .14s ease; }
.tree__item.is-collapsed > .tree__row .tree__toggle .icon { transform: rotate(0deg); }
.tree__toggle--empty { cursor: default; }

.tree__label { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--text); font-size: 12.5px; }
.tree__label--link:hover { text-decoration: none; }
.tree__kind { width: 15px; height: 15px; color: var(--text-3); }
.tree__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tree__menu { opacity: 0; }
.tree__row:hover .tree__menu, .tree__menu.is-open { opacity: 1; }

.tree__hint { padding: 10px 10px 0; color: var(--text-2); font-size: 12px; line-height: 1.5; }


/* --- Кнопки и поля ----------------------------------------------------- */

.btn {
  height: var(--control-h); padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font-size: 12.5px; font-weight: 500; cursor: pointer;
  white-space: nowrap; text-decoration: none;
  transition: background .12s ease, border-color .12s ease, box-shadow .12s ease;
}
/* Наведение отзывается акцентом, а не серым: у образца вторичные кнопки так и ведут себя —
   рамка и текст становятся фиолетовыми, подложка остаётся светлой */
.btn:hover {
  background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text);
  text-decoration: none;
}
.btn:active { transform: translateY(.5px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.btn .icon { width: 14px; height: 14px; }

.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 550; }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); }
.btn--danger-ghost { border-color: transparent; color: var(--danger); }
.btn--danger-ghost:hover { background: var(--danger-soft); }

.icon-btn {
  width: 24px; height: 24px; flex: none;
  display: grid; place-items: center; padding: 0;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-3); cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.icon-btn:hover { background: rgba(0, 0, 0, .06); color: var(--text); }
.icon-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }

.input {
  height: var(--control-h); width: 100%; padding: 0 10px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 13px;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.input::placeholder { color: var(--text-3); }
.input:hover { border-color: var(--border-strong); }
.input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 2px var(--accent-ring); }
.input--sm { height: 28px; font-size: 12.5px; width: auto; }

.textarea { height: auto; padding: 8px 10px; line-height: 1.5; resize: vertical; min-height: 60px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
/* display у класса перебивает штатное [hidden] { display: none } — возвращаем атрибуту силу */
.field[hidden] { display: none; }
/* Подпись поля — капитель в разрядку: иерархия строится размером и трекингом,
   а не жирностью и не рамкой. Тот же приём, что в шапках столбцов доски. */
.field__label {
  color: var(--text-2); font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .07em;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.hint { color: var(--text-2); font-size: 11.5px; }
.hint--block { line-height: 1.55; }


/* --- Выпадающий список -------------------------------------------------- */

.dropdown { position: relative; display: block; min-width: 0; }
.dropdown select { position: absolute; inset: 0; width: 100%; opacity: 0; pointer-events: none; }

.dropdown__trigger {
  display: flex; align-items: center; gap: 8px;
  text-align: left; cursor: pointer;
}
.dropdown__trigger .dropdown__value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown__trigger .icon { width: 14px; height: 14px; color: var(--text-3); transform: rotate(90deg); }
.dropdown__trigger.is-open { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }

.dropdown__panel {
  position: fixed; z-index: 80; min-width: 180px; max-width: 340px; padding: 6px;
  display: flex; flex-direction: column; max-height: 320px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  animation: pop-in .12s ease-out;
}

.dropdown__search {
  height: 30px; margin-bottom: 4px; padding: 0 10px; flex: none;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text); font-family: inherit; font-size: 12.5px;
}
.dropdown__search:focus { outline: none; border-color: var(--focus); background: var(--surface); }

.dropdown__list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }

.dropdown__option {
  display: flex; align-items: center; gap: 8px;
  min-height: var(--control-h); padding: 5px 8px;
  border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--text); font-family: inherit; font-size: 12.5px; text-align: left; cursor: pointer;
}
.dropdown__option span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown__option .icon { width: 14px; height: 14px; color: var(--accent); opacity: 0; }
.dropdown__option.is-active { background: var(--hover); }
.dropdown__option.is-selected { color: var(--accent); font-weight: 550; }
.dropdown__option.is-selected .icon { opacity: 1; }
.dropdown__empty { padding: 8px; color: var(--text-2); font-size: 12px; text-align: center; }

@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }


/* --- Поле даты и календарь ---------------------------------------------- */

/* Дата и необязательное время в одной строке: дата тянется, время — узкое фиксированное поле */
.due-field { display: flex; gap: 8px; min-width: 0; }
.due-field .date-field { flex: 1; min-width: 0; }
/* Выравнивание по левому краю, а не по центру — и ширина под содержимое.
   «ЧЧ:ММ» занимает 45px, в поле шириной 68px оставалось 11px пустоты, и центрирование
   отодвигало курсор пустого поля на середину — визуально прямо между часами и минутами,
   будто ввод начинается с минут. Слева курсор стоит там, где и начнётся набор,
   и поле встаёт в один строй с датой рядом: она тоже прижата влево. */
.input--time {
  width: 60px; flex: none; text-align: left;
  font-variant-numeric: tabular-nums; padding: 0 6px;
}

.date-field { position: relative; display: block; }
.date-field .input { padding-right: 34px; font-variant-numeric: tabular-nums; }
.date-field__pick { position: absolute; right: 3px; top: 3px; }
.date-field__pick .icon { width: 15px; height: 15px; }
.date-field__pick.is-open { background: var(--accent-soft); color: var(--accent); }

/* Время в календаре: отдельная строка между сеткой дней и кнопками */
.calendar__time {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border);
  color: var(--text-3);
}
.calendar__time .icon { width: 14px; height: 14px; flex: none; }
.calendar__time .input--time { height: 28px; }

.calendar {
  position: fixed; z-index: 80; width: 262px; padding: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  animation: pop-in .12s ease-out;
}

.calendar__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }

.calendar__title {
  display: inline-flex; align-items: center; gap: 4px;
  height: 26px; padding: 0 8px; border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--text); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.calendar__title:hover { background: var(--hover); }
.calendar__title .icon { width: 13px; height: 13px; color: var(--text-3); transform: rotate(90deg); }

.calendar__nav { display: flex; gap: 2px; }
.calendar__nav .icon { width: 14px; height: 14px; }
.calendar__prev { transform: rotate(180deg); }

.calendar__weekdays, .calendar__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.calendar__weekdays { margin-bottom: 2px; }
.calendar__weekdays span { height: 22px; display: grid; place-items: center; color: var(--text-2); font-size: 11px; font-weight: 500; }

.calendar__day, .calendar__month {
  display: grid; place-items: center;
  border: 0; border-radius: var(--radius); background: transparent;
  color: var(--text); font-family: inherit; font-size: 12.5px;
  font-variant-numeric: tabular-nums; cursor: pointer;
  transition: background .1s ease;
}
.calendar__day { height: 30px; }
.calendar__month { height: 34px; }
.calendar__day:hover, .calendar__month:hover { background: var(--hover); }
.calendar__day:focus-visible, .calendar__month:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent-ring); }
.calendar__day.is-weekend { color: var(--text-2); }
.calendar__day.is-outside { color: var(--text-3); }
.calendar__day.is-today, .calendar__month.is-today { color: var(--accent); font-weight: 650; }
.calendar__day.is-selected, .calendar__month.is-selected { background: var(--accent); color: #fff; font-weight: 550; }
.calendar__day.is-selected:hover, .calendar__month.is-selected:hover { background: var(--accent-hover); }

.calendar__months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }

.calendar__foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border);
}
.calendar__action {
  height: 24px; padding: 0 8px; border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--accent); font-family: inherit; font-size: 12px; font-weight: 500; cursor: pointer;
}
.calendar__action:hover { background: var(--accent-soft); }
.calendar__action--muted { color: var(--text-2); }
.calendar__action--muted:hover { background: var(--danger-soft); color: var(--danger); }


/* --- Доска ------------------------------------------------------------- */

/* Доска — одно сплошное поле: столбцы не карточки, а полосы, разделённые вертикальной чертой */
.board { flex: 1; min-height: 0; overflow-x: auto; overflow-y: hidden; }

/* align-items не трогаем: столбцы тянутся на всю высоту доски (stretch по умолчанию),
   чтобы бросать карточку можно было в любое место столбца, а не только под последнюю.
   gap нулевой: расстояние между столбцами задаётся их симметричными полями, а не зазором,
   иначе черта не окажется ровно посередине промежутка. */
.columns { display: flex; gap: 0; height: 100%; }
.columns > * + * { border-left: 1px solid var(--rule); }

/* Столбец без собственных полей: отступы задаёт список задач, и тогда линия под шапкой
   сама идёт во всю ширину — отрицательные поля не нужны */
.column {
  width: 296px; flex: none; height: 100%;
  display: flex; flex-direction: column;
  background: transparent;
}

.column__head {
  height: 44px; flex: none; padding: 0 var(--column-pad);
  border-bottom: 1px solid var(--rule);
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto 24px; align-items: center; gap: 8px;
}
.column__title {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  font-size: 12px; font-weight: 650; color: var(--text-2); letter-spacing: .04em; text-transform: uppercase;
}
.column__title-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.column__flag { width: 13px; height: 13px; color: var(--ok); }

/* Срок автоархивации в шапке: настройка не должна быть спрятана только в диалоге.
   Обе метки — одной высоты и одного кегля: иначе их боксы центрируются каждый по себе
   и числа встают на разных уровнях, а иконка уезжает относительно текста. */
.column__auto, .column__count {
  height: 18px; display: inline-flex; align-items: center;
  color: var(--text-2); font-size: 11px; font-variant-numeric: tabular-nums;
}
.column__auto { gap: 4px; white-space: nowrap; }
.column__auto .icon { width: 12px; height: 12px; }
/* Без подложки: на тонированном поле она почти сливалась с ним, а число читается и так */
.column__count { min-width: 14px; justify-content: flex-end; font-weight: 550; }
.column__menu { opacity: 0; margin-right: -5px; }
.column:hover .column__menu, .column__menu.is-open { opacity: 1; }

/* min-height — чтобы в пустой столбец было куда бросить карточку.
   scrollbar-gutter both-edges — поля списка остаются симметричными и когда прокрутки нет,
   и когда она появилась: карточки не съезжают влево. */
/* Поле у карточек одно со всех четырёх сторон — --column-pad. Боковое складывается
   из собственного отступа и зарезервированной полосы прокрутки, поэтому здесь вычитание:
   иначе бока получаются вдвое шире верха, как и было. */
.column__list {
  flex: 1; min-height: 56px; overflow-y: auto;
  scrollbar-gutter: stable both-edges;
  display: flex; flex-direction: column; gap: var(--card-gap);
  padding: var(--column-pad) calc(var(--column-pad) - var(--scrollbar-w));
}

.column__add, .column-add {
  height: var(--control-h);
  display: flex; align-items: center; gap: 8px;
  border: 0; background: transparent; border-radius: var(--radius);
  color: var(--text-2); font-size: 12.5px; font-weight: 500; cursor: pointer; text-align: left;
}
/* Кнопка стоит в общем потоке списка сразу под карточками, и её подложка при наведении
   совпадает с ними по краям. Padding как у карточки — тогда «плюс» встаёт ровно
   на ось текста карточки, а не сам по себе. */
/* Прозрачная рамка как у карточки: без неё «плюс» встаёт на пиксель левее её текста */
.column__add { flex: none; padding: 0 var(--card-pad-x); border: 1px solid transparent; }
.column__add:hover { background: var(--accent-soft); color: var(--accent-text); }
.column__add .icon, .column-add .icon { width: 14px; height: 14px; }

/* Кнопка нового столбца — такая же полоса поля, как столбец: та же высота шапки, та же черта слева */
.column-add {
  width: 168px; height: 44px; flex: none; align-self: flex-start; padding: 0 var(--column-pad);
  border: 0; border-bottom: 1px solid var(--rule); background: transparent;
}
.column-add:hover { color: var(--text); }

/* Карточка держится тоном: белая на тонированном поле отделяется сама.
   Рамка прозрачная, а не убрана совсем, — чтобы геометрия не поехала и было чем показать фокус. */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 9px var(--card-pad-x); cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.card:hover { background: var(--surface-2); border-color: var(--border-strong); }
.card:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 2px var(--accent-ring); }
/* Длинное название не раздувает карточку: три строки и многоточие, полный текст — в задаче */
.card__title {
  font-size: 13px; font-weight: 500; line-height: 1.4; word-break: break-word;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.card__meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

/* Нейтральный чип — значение с иконкой, без подложки. Двадцать карточек с серой плашкой
   на каждой и создают ощущение серости; плашку получают только сигналы (ниже),
   и тогда взгляд цепляется именно за них. */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-2);
  font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums;
}
/* Сигнальным чипам подложка нужна: просрочка, сегодня, залежалось, переносы, завершено */
.chip--overdue, .chip--today, .chip--done, .chip--postpone, .chip--age.is-stale { padding: 0 6px; }
.chip .icon { width: 12px; height: 12px; }
.chip--overdue { background: var(--danger-soft); color: var(--danger); }
.chip--today { background: var(--warn-soft); color: var(--warn); }

/* Срок правится с карточки: сам чип — кнопка, пустой виден бледной иконкой */
.chip--due { border: 0; font-family: inherit; cursor: pointer; transition: background .12s ease, color .12s ease; }
/* Подсветка при наведении даётся ореолом, а не полями: у чипа без подложки поля сдвинули бы
   дату относительно текста карточки, а ореол растёт наружу и выравнивание не трогает */
.chip--due:not(.chip--overdue):not(.chip--today):hover {
  background: var(--accent-soft); color: var(--accent-text);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.chip--due:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent-ring); }
.chip--overdue:hover { background: #ffdbdc; color: var(--danger); }
.chip--today:hover { background: #ffee9c; color: var(--warn); }
.chip--due.is-empty { background: transparent; color: var(--text-3); padding: 0; }
.chip--due.is-empty .chip__text { display: none; }
.chip--due.is-empty:hover { color: var(--accent-text); }

/* Завершённая задача: спокойная зелёная метка вместо тревожных — сколько шла до готового */
.chip--done { background: var(--ok-soft); color: var(--ok); }

/* Возраст карточки и переносы срока: сигнал жёлтым, красный оставлен просрочке */
.chip--age { color: var(--text-2); }
.chip--age.is-stale { background: var(--warn-soft); color: var(--warn); }
.chip--postpone { background: var(--warn-soft); color: var(--warn); }

/* Место будущей вставки видно рамкой, а не полупрозрачной копией — на плоском поле это точнее */
.sortable-ghost { opacity: 1; background: var(--accent-soft); border-color: var(--border-strong); }
.sortable-ghost > * { visibility: hidden; }
.sortable-chosen { cursor: grabbing; }
.card.sortable-drag { box-shadow: var(--shadow-md); border-color: var(--border-strong); }


/* --- Модальные окна ---------------------------------------------------- */

.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(20, 22, 30, .36);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 48px 16px; overflow-y: auto;
  animation: overlay-in .12s ease-out;
}
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%; max-width: 580px;
  display: flex; flex-direction: column; max-height: calc(100vh - 96px);
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  animation: modal-in .14s ease-out;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(-8px) scale(.99); } to { opacity: 1; transform: none; } }

.modal__head {
  height: 52px; flex: none;
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px 0 16px; border-bottom: 1px solid var(--border);
}
.modal__title { font-size: 14px; font-weight: 650; flex: 1; }
.modal__title-input {
  flex: 1; min-width: 0; height: 32px; padding: 0 8px;
  border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent;
  font-family: inherit; font-size: 14.5px; font-weight: 650; color: var(--text); letter-spacing: -.01em;
}
.modal__title-input:hover { background: var(--surface-2); }
.modal__title-input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 2px var(--accent-ring); background: var(--surface); }

.saved-flag {
  flex: none; color: var(--ok); font-size: 11.5px; font-weight: 500; white-space: nowrap;
  opacity: 0; transition: opacity .18s ease;
}
.saved-flag.is-visible { opacity: 1; }

.modal__body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }

.modal__foot {
  height: 52px; flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 12px 0 16px; border-top: 1px solid var(--border);
}
/* Полоса метаданных: факты разделены волосяной чертой, а не точкой.
   Черта строит структуру — глаз видит три поля, а не строку с пунктуацией.
   Разделитель — тот же элемент, что был точкой: текст гасится, остаётся линия,
   поэтому разметку и скрипт, который прячет ненужный разделитель, трогать не пришлось. */
.modal__stamp {
  display: flex; align-items: center; gap: 10px; min-width: 0; overflow: hidden; white-space: nowrap;
  color: var(--text-2); font-size: 11px;
}
.modal__stamp-dot {
  flex: none; width: 1px; height: 12px; background: var(--border-strong);
  font-size: 0; overflow: hidden; text-indent: -99px;
}
.modal__stamp [hidden] { display: none; }
.modal__stamp .is-alert { color: var(--warn); font-weight: 500; }

.modal--dialog { max-width: 420px; }
.modal--dialog .modal__body { gap: 10px; }
.modal--dialog .modal__foot { justify-content: flex-end; }
.dialog__text { color: var(--text-2); font-size: 12.5px; line-height: 1.5; }


/* --- Карточка задачи: поля слева, лента комментариев справа ------------- */

.modal--task { max-width: 960px; height: min(640px, calc(100vh - 96px)); }

/* Половины равны; minmax(0,…) в строке и колонках — иначе лента растягивает окно по своему содержимому */
.task {
  flex: 1; min-height: 0; display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
}

.task__main {
  min-width: 0; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 16px; padding: 16px;
}
/* Описание занимает остаток колонки — иначе под ним пустое поле в половину окна */
.field--description { flex: 1; min-height: 0; }
.field--description .textarea { flex: 1; min-height: 140px; }

.task__side {
  min-width: 0; min-height: 0; display: flex; flex-direction: column;
  background: var(--surface-2); border-left: 1px solid var(--border);
}

/* Подпись колонки выровнена с подписями полей слева — обе половины начинаются одинаково */
.task__side-head {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 16px 16px 0;
}
.task__side-title { color: var(--text-2); font-size: 11.5px; font-weight: 550; }
.task__side-count {
  min-width: 18px; height: 16px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-3); border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums;
}


/* --- Комментарии ------------------------------------------------------- */

.comments {
  flex: 1; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 16px 14px; border-top: 1px solid var(--border);
}
.comments__empty { color: var(--text-2); font-size: 12px; text-align: center; margin: auto 0; }

.comment { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px 10px; }
.comment__head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.comment__author { font-size: 12px; font-weight: 650; color: var(--text); }
.comment__time { color: var(--text-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.comment__delete { margin-left: auto; opacity: 0; }
.comment:hover .comment__delete { opacity: 1; }
.comment__body { font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }

.comment-form {
  flex: none; display: flex; flex-direction: column; gap: 8px;
  padding: 8px 16px 12px;
}
.comment-form__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* Узкое окно: комментарии уходят под поля, прокрутка становится общей */
@media (max-width: 900px) {
  .modal--task { height: auto; }
  .task { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; overflow-y: auto; }
  .task__main { overflow: visible; }
  .task__side { border-left: 0; border-top: 1px solid var(--border); border-radius: 0; }
  /* в стопке описание не тянется на остаток — иначе схлопывается и обрезает текст */
  .field--description { flex: none; }
  .field--description .textarea { flex: none; min-height: 110px; }
  .comments { max-height: 320px; }
}



/* --- Периодические задачи ----------------------------------------------- */

/* Расписание — выдвижная панель у правого края: доска остаётся видна,
   а списку правил не тесно по высоте. Механика overlay (Esc, клик мимо) общая с модалками. */
.overlay--drawer { justify-content: flex-end; align-items: stretch; padding: 0; }
.overlay--drawer .modal {
  max-width: 460px; max-height: none; height: 100%;
  border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
  animation: drawer-in .16s ease-out;
}
.overlay--drawer .modal__body { flex: 1; overflow-y: auto; }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

.rules { display: flex; flex-direction: column; gap: 8px; }

.rule {
  display: grid; grid-template-columns: 18px minmax(0, 1fr) 24px 24px; gap: 8px; align-items: center;
  padding: 10px 8px 10px 8px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
}
.rule__grip { display: grid; place-items: center; color: var(--border-strong); cursor: grab; }
.rule:hover .rule__grip { color: var(--text-3); }
.rule.sortable-chosen { cursor: grabbing; }
.rule__main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rule__title { font-size: 12.5px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rule__meta { color: var(--text-2); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rule__remove:hover { background: var(--danger-soft); color: var(--danger); }

.segmented {
  display: inline-flex; padding: 2px; gap: 2px;
  background: var(--surface-3); border-radius: var(--radius); width: fit-content;
}
.segmented__item {
  height: 26px; padding: 0 12px; border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--text-2); font-family: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer;
}
.segmented__item:hover { color: var(--text); }
.segmented__item.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.daypick { display: flex; flex-wrap: wrap; gap: 6px; }
.daypick--month { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }

.daypick__day {
  min-width: 38px; height: 30px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); font-family: inherit; font-size: 12.5px; font-variant-numeric: tabular-nums; cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.daypick--month .daypick__day { min-width: 0; padding: 0; }
.daypick__day:hover { border-color: var(--accent); color: var(--accent); }
.daypick__day.is-active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 550; }
.daypick__day:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }

/* --- Журнал ------------------------------------------------------------ */

.entries { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }

/* Колонке изменений задан реальный минимум: иначе сумма фиксированных ширин съедала её
   до нуля и текст переносился по одной букве. Соседние колонки при нехватке места ужимаются. */
.entry {
  display: grid;
  grid-template-columns: 128px minmax(0, 128px) minmax(0, 176px) minmax(220px, 1fr);
  gap: 14px; align-items: baseline;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
}

/* Узкое окно: метаданные строкой, изменения — под ними во всю ширину */
@media (max-width: 1180px) {
  .entry {
    grid-template-columns: 128px minmax(0, 1fr) auto;
    gap: 6px 14px;
  }
  .entry__body { grid-column: 1 / -1; }
}
.entry:last-child { border-bottom: 0; }
.entry:hover { background: var(--surface-2); }

.entry__time { color: var(--text-2); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.entry__actor { color: var(--text-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry__actor--key { color: var(--accent-text); }
.entry__body { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.entry__object { font-size: 12.5px; font-weight: 550; }

.badge {
  display: inline-flex; align-items: center; justify-self: start; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis;
  height: 20px; padding: 0 7px; border-radius: var(--radius-sm);
  background: var(--surface-3); color: var(--text-2);
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.badge--task { background: var(--accent-soft); color: var(--text); }
.badge--board, .badge--folder { background: var(--info-soft); color: var(--info); }
.badge--column { background: var(--ok-soft); color: var(--ok); }
.badge--comment { background: var(--warn-soft); color: var(--warn); }
.badge--api_key { background: var(--ok-soft); color: var(--ok); }
.badge--user { background: var(--surface-3); color: var(--text-2); }
/* Пометка режима чтения в карточке задачи: спокойная, но сразу заметная */
.badge--archived { flex: none; background: var(--surface-3); color: var(--text-2); }

.diff { display: inline-flex; align-items: baseline; gap: 5px; font-size: 12px; min-width: 0; }
.diff__field { color: var(--text-2); }
.diff__old { color: var(--text-2); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.diff__arrow { color: var(--text-2); }
.diff__new { color: var(--text); }

.entries__more { display: flex; justify-content: center; padding: 16px 0 4px; }


/* --- Панели, строки, ключи --------------------------------------------- */

/* Панель, как и карточка, лежит на тонированном поле и держится тоном:
   внешнего контура нет, внутренние разделители остаются */
.panel { background: var(--surface); border: 0; border-radius: var(--radius-lg); overflow: hidden; }

.panel__head {
  min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 16px; border-bottom: 1px solid var(--border);
}
.panel__title { font-size: 13.5px; font-weight: 650; letter-spacing: -.01em; }
.panel__body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.panel__actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.row { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 12px; align-items: center; min-height: var(--control-h); margin: 0; }
.row__label { color: var(--text-2); font-size: 12.5px; }
.row__value { font-size: 12.5px; }
.row .btn { justify-self: start; }

.keys { display: flex; flex-direction: column; gap: 8px; }
.keys__empty { color: var(--text-2); font-size: 12px; }

.key {
  display: grid; grid-template-columns: 16px minmax(80px, 1fr) auto auto 24px;
  gap: 12px; align-items: center;
  height: 40px; padding: 0 8px 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
}
.key__icon { color: var(--text-3); }
.key__name { font-size: 12.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.key__prefix { font-size: 11.5px; color: var(--text-2); background: var(--surface-3); padding: 3px 7px; border-radius: var(--radius-sm); }
.key__used { color: var(--text-2); font-size: 11.5px; white-space: nowrap; }
.key__revoke:hover { color: var(--danger); background: var(--danger-soft); }

/* Логин — всегда моноширинным: его вводят точно, как API-ключ */
.login {
  font-size: 11.5px; color: var(--text-2);
  background: var(--surface-3); padding: 3px 7px; border-radius: var(--radius-sm);
}

.users { display: flex; flex-direction: column; gap: 8px; }

/* Сетка повторяет .key: строки в настройках выглядят одинаково */
.user {
  display: grid; grid-template-columns: 16px minmax(80px, 1fr) auto auto 24px;
  gap: 12px; align-items: center;
  height: 40px; padding: 0 8px 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
}
.user__icon { color: var(--text-3); }
.user__name { font-size: 12.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Рядом с логином-чипом сплошная заливка спорила бы с ним: метка тоже мягкая */
.badge--self { background: var(--accent-soft); color: var(--text); }

.key-value {
  display: flex; align-items: center; gap: 8px;
  background: var(--ok-soft); border: 1px solid #adddc0; border-radius: var(--radius); padding: 10px 10px 10px 12px;
}
.key-value code { flex: 1; min-width: 0; font-size: 12px; word-break: break-all; color: var(--ok); }


/* --- Контрольный лист ---------------------------------------------------- */

.ctl { display: flex; flex-direction: column; gap: 16px; max-width: none; }
.ctl__scroll { overflow-x: auto; }

.ctl__table { border-collapse: collapse; width: 100%; font-size: 12px; }
.ctl__table th, .ctl__table td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; }
.ctl__table thead th {
  background: var(--surface-2); color: var(--text-2);
  font-size: 11px; font-weight: 650; letter-spacing: .03em; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ctl__col { text-align: center; }
.ctl__rule-head { min-width: 220px; }
.ctl__rule { max-width: 320px; font-weight: 550; }
.ctl__gone { color: var(--text-3); font-weight: 450; }
.ctl__plan { color: var(--text-2); white-space: nowrap; }
/* Текущий период выделен подложкой: взгляд сразу находит «где мы сейчас» */
.ctl__table .is-current { background: var(--surface-2); }

/* Клетка — полоска сегментов, по одному на срабатывание: частота видна плотностью */
.ctl-segs { display: flex; gap: 3px; justify-content: center; }
.ctl-seg {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 22px; padding: 0 6px; flex: 1;
  font-size: 11px; font-weight: 550; white-space: nowrap;
}
.ctl-seg--done { background: var(--ok-soft); color: var(--ok); }
.ctl-seg--late { background: var(--warn-soft); color: var(--warn); }
.ctl-seg--missed { background: var(--danger-soft); color: var(--danger); }
.ctl-seg--pending, .ctl-seg--future { background: transparent; border: 1px dashed var(--border-strong); color: var(--text-3); }
.ctl-seg--not_created { background: var(--surface-3); color: var(--text-3); }

.ctl-legend { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 11.5px; }
.ctl-legend .ctl-seg { flex: none; min-width: 26px; height: 18px; }

/* Клетка-ссылка ведёт в задачу: подчёркивания нет, отклик — затемнение и курсор */
a.ctl-seg { text-decoration: none; cursor: pointer; transition: filter .12s ease; }
a.ctl-seg:hover { filter: brightness(.94); text-decoration: none; }
a.ctl-seg:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent-ring); }

/* Выбор периода в шапке: пресеты слева, свои даты справа — одна высота с кнопками */
.ctl-period { display: flex; align-items: center; gap: 8px; }
.ctl-period__presets { display: inline-flex; }
.ctl-period__preset {
  height: var(--control-h); padding: 0 9px; margin-left: -1px;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text-2); font-family: inherit; font-size: 12px; cursor: pointer;
}
.ctl-period__preset:first-child { margin-left: 0; }
.ctl-period__preset:hover { background: var(--surface-2); color: var(--text); }
.ctl-period__field { display: inline-flex; align-items: center; gap: 5px; }
.ctl-period__label { color: var(--text-2); font-size: 12px; }
.ctl-period .input--sm { width: 118px; height: var(--control-h); text-align: center; font-variant-numeric: tabular-nums; }


/* --- Документация API --------------------------------------------------- */

.code {
  margin: 0; padding: 10px 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 12px; line-height: 1.55; color: var(--text-2);
  white-space: pre-wrap; word-break: break-word;
}
.code--inline { padding: 7px 10px; }

.endpoint { padding: 12px 0; border-top: 1px solid var(--border); }
.endpoint:first-child { padding-top: 0; border-top: 0; }
.endpoint:last-child { padding-bottom: 0; }

.endpoint__head { display: grid; grid-template-columns: 56px 236px minmax(0, 1fr); gap: 12px; align-items: baseline; }
.endpoint__path { font-size: 12px; color: var(--text); word-break: break-all; }
.endpoint__summary { color: var(--text-2); font-size: 12.5px; }

.endpoint__detail { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; margin-top: 8px; align-items: baseline; }
.endpoint__label { color: var(--text-2); font-size: 11px; text-align: right; }
.endpoint__note { color: var(--text-2); font-size: 12px; line-height: 1.5; }

.method {
  height: 20px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); font-size: 10px; font-weight: 700; letter-spacing: .03em;
}
.method--get { background: var(--info-soft); color: var(--info); }
.method--post { background: var(--ok-soft); color: var(--ok); }
.method--patch { background: var(--warn-soft); color: var(--warn); }
.method--delete { background: var(--danger-soft); color: var(--danger); }

.params { display: flex; flex-direction: column; gap: 4px; color: var(--text-2); font-size: 12px; }
.params code { color: var(--text); background: var(--surface-3); padding: 2px 6px; border-radius: var(--radius-sm); font-size: 11.5px; }


/* --- Меню, тосты, пустые состояния -------------------------------------- */

.menu {
  position: fixed; z-index: 60; min-width: 184px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  animation: pop-in .12s ease-out;
}
.menu__item {
  width: 100%; height: var(--control-h); padding: 0 10px;
  display: flex; align-items: center; gap: 10px;
  border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--text); font-size: 12.5px; text-align: left; cursor: pointer;
}
.menu__item:hover { background: var(--hover); }
.menu__item--danger { color: var(--danger); }
.menu__item--danger:hover { background: var(--danger-soft); }
.menu__item .icon { width: 15px; height: 15px; color: var(--text-3); }
.menu__item--danger .icon { color: var(--danger); }
.menu__sep { height: 1px; background: var(--border); margin: 5px 0; }

.toasts {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.toast {
  padding: 10px 16px; border-radius: var(--radius);
  background: var(--accent); color: #fff; font-size: 12.5px; font-weight: 450; box-shadow: var(--shadow-md);
  animation: toast-in .16s ease-out;
}
.toast--error { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.empty { max-width: 380px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty--inline { margin: 48px auto 0; }
.empty__icon { width: 52px; height: 52px; color: var(--border-strong); fill: none; stroke: currentColor; stroke-width: 2; }
.empty__title { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.empty__text { color: var(--text-2); font-size: 12.5px; line-height: 1.55; }
.empty .btn { margin-top: 6px; }


/* --- Вход и служебные страницы ------------------------------------------ */

.body--center { display: grid; place-items: center; min-height: 100vh; background: var(--bg); }

.auth {
  width: 340px; padding: 28px;
  display: flex; flex-direction: column; gap: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.auth__brand { color: var(--text-2); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.auth__title { font-size: 18px; font-weight: 650; letter-spacing: -.02em; }
.auth__text { color: var(--text-2); font-size: 12.5px; line-height: 1.5; }
.auth__error { color: var(--danger); font-size: 12px; margin-top: -6px; }
.auth__submit { height: 34px; justify-content: center; }
