/* Рабочее место ГКК — общий стиль. Системные шрифты, без внешних ресурсов.
 *
 * Два визуальных языка (по референсам заказчика):
 * 1. Общий — «стекло»: полупрозрачные панели на размытом фоне, крупные скругления,
 *    кнопки-«таблетки»; акцент — изумрудный в светлой теме, оранжевый #F15922 в тёмной.
 * 2. Процесс — карточки с цветной линией сверху и номером шага (доски, этапы, диаграммы).
 *
 * Две темы (выбор — кнопка в шапке, хранится в cookie gkk_theme): светлая — матовое «стекло» на тёплом фоне, чёрные кнопки (референс «Glassy Dashboard», 11.11.2026);
 * тёмная — всё в тёмно-синих тонах «процесса». Цвета задаются только переменными ниже, в правилах —
 * var(--…), чтобы тема переключалась целиком.
 */

/* ---------- Светлая тема (по умолчанию) ---------- */
:root {
  color-scheme: light;

  /* Цвета: изумрудный акцент и чёрные «таблетки» — по референсу «Glassy Dashboard» */
  --accent: #12876A;
  --accent-dark: #0B6A52;
  --accent-soft: rgba(18, 135, 106, .14);
  --graphite: #5F6A68;
  --graphite-dark: #3C4644;
  --text: #1A1F1E;
  --muted: #4E5856;
  --ink: #141312;          /* тёмные кнопки-«таблетки», аватар, сообщение внизу */
  --ink-hover: #000;
  --on-ink: #fff;

  /* Фон страницы: холодное серо-зелёное «стекло» (свет и тёмные пятна; тёплых тонов нет — на мониторах они отдают розовым) — только градиенты, без картинок */
  --page-bg: #C9D1CF;
  --page-image: 
    radial-gradient(760px 520px at 4% -4%, rgba(255, 255, 255, .98), transparent 60%),
    radial-gradient(420px 720px at 24% 58%, rgba(54, 70, 66, .36), transparent 64%),
    radial-gradient(620px 560px at 100% 0%, rgba(44, 60, 58, .58), transparent 62%),
    radial-gradient(560px 460px at 58% 34%, rgba(255, 255, 255, .78), transparent 66%),
    radial-gradient(380px 640px at 78% 70%, rgba(60, 78, 74, .32), transparent 64%),
    radial-gradient(760px 600px at -4% 104%, rgba(40, 56, 54, .54), transparent 62%),
    radial-gradient(640px 480px at 96% 100%, rgba(150, 196, 206, .55), transparent 62%),
    radial-gradient(560px 440px at 44% 92%, rgba(18, 135, 106, .26), transparent 66%),
    linear-gradient(155deg, #EDF1F0 0%, #D3DAD8 48%, #A9B5B2 100%);

  /* Стекло и поверхности */
  --glass: linear-gradient(135deg, rgba(255, 255, 255, .36) 0%, rgba(255, 255, 255, .12) 100%);
  --glass-strong: linear-gradient(135deg, rgba(255, 255, 255, .50) 0%, rgba(255, 255, 255, .24) 100%);
  --glass-solid: rgba(246, 249, 248, .97);
  --glass-border: rgba(255, 255, 255, .85);
  --glass-blur: blur(36px) saturate(1.8);
  --surface: rgba(255, 255, 255, .28);        /* вложенные плашки: подформы, история, подзадачи */
  --surface-hover: rgba(255, 255, 255, .50);  /* наведение: пункт меню, вкладка, строка таблицы */
  --surface-active: #fff;                      /* активная вкладка и пункт меню */
  /* Вкладки: серая дорожка, активная — белая с заметной тенью (на белом «стекле» иначе не видно) */
  --tabs-bg: rgba(36, 46, 44, .10);
  --tabs-border: rgba(255, 255, 255, .40);
  --tab-text: #3A4442;
  --tab-hover: rgba(255, 255, 255, .70);
  --tab-active-shadow: 0 1px 2px rgba(24, 34, 32, .18), 0 3px 10px rgba(24, 34, 32, .14);
  --field-bg: rgba(255, 255, 255, .62);
  --field-bg-focus: #fff;
  --field-bg-error: #FFF8F5;
  --btn-bg: rgba(255, 255, 255, .50);
  --btn-bg-hover: #fff;
  --drawer-bg: rgba(244, 248, 247, .86);
  --sticky-bg: rgba(244, 248, 247, .95);      /* фон закреплённых кнопок формы */
  --overlay: rgba(18, 26, 24, .30);
  --line: rgba(36, 46, 44, .11);
  --line-strong: rgba(36, 46, 44, .22);
  --field-border: rgba(36, 46, 44, .20);
  --shadow: 0 22px 54px rgba(24, 34, 32, .22), inset 0 1px 0 rgba(255, 255, 255, .95), inset 1px 0 0 rgba(255, 255, 255, .45), inset 0 -1px 0 rgba(255, 255, 255, .30);
  --shadow-sm: 0 6px 18px rgba(24, 34, 32, .10), inset 0 1px 0 rgba(255, 255, 255, .85);
  --tile-accent: linear-gradient(135deg, #0F7E62, #2BB08B);
  --ring-track: rgba(36, 46, 44, .13);

  /* Смысловые цвета */
  --danger: #B42318;
  --danger-solid: #B42318;   /* заливка под белым текстом */
  --danger-bg: rgba(253, 236, 234, .92);
  --danger-border: #F4C7C2;
  --warning: #8A5300;
  --warning-bg: rgba(255, 243, 220, .92);
  --warning-border: #EBC98A;
  --success: #2E7048;
  --success-bg: rgba(230, 243, 235, .92);
  --success-border: #C4E2CF;
  --info: #35658F;
  --info-bg: rgba(231, 239, 246, .92);
  --info-border: #C9DAE9;
  --neutral-bg: rgba(36, 46, 44, .08);

  /* Статусы — цвет точки «• В работе» */
  --st-gray: #6B7680;
  --st-violet: #6D5BD0;
  --st-teal: #12876A;
  --st-amber: #A15C00;
  --st-blue: #2F6CA3;
  --st-green: #2E7048;
  --st-green-deep: #1F6B3A;
  --st-red: #B42318;
  --st-light: #8A949C;

  /* Процесс: доски и диаграммы. В светлой теме — белые карточки с цветной линией. */
  --proc-bg: #F2F5F4;                 /* непрозрачный: на нём закреплённые подписи диаграммы */
  --proc-glow: rgba(18, 135, 106, .06);
  --proc-card: #FFFFFF;
  --proc-card-2: #FCFEFD;
  --proc-card-shadow: 0 1px 3px rgba(24, 34, 32, .10);
  --proc-border: rgba(36, 46, 44, .14);
  --proc-border-hover: rgba(36, 46, 44, .32);
  --proc-text: #1F2524;
  --proc-muted: #56605E;
  --proc-chip-bg: #E6ECEA;
  --proc-col-bg: rgba(36, 46, 44, .035);
  --proc-col-over: rgba(36, 46, 44, .08);
  --proc-grid: rgba(36, 46, 44, .07);
  --proc-grid-strong: rgba(36, 46, 44, .12);
  --proc-off: rgba(36, 46, 44, .05);
  --proc-hover-ring: rgba(36, 46, 44, .38);
  --proc-teal: #12876A;
  --proc-violet: #6F5FD6;
  --proc-amber: #C17A00;
  --proc-pink: #C8467F;
  --proc-green: #2C8F52;
  --proc-orange: #E0561F;
  --proc-red: #D93A2B;
  --proc-red-text: #B42318;
  --proc-blue: #3A78C2;
  --proc-slate: #7D8A96;
  --proc-violet-soft: rgba(111, 95, 214, .12);


  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius: 16px;
  --radius-sm: 10px;
  --gap: 16px;
  --font: Tahoma, Arial, "Helvetica Neue", sans-serif;
}

/* ---------- Тёмная тема: всё как на досках и диаграммах ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;

  --accent: #F15922;
  --accent-dark: #FF8B5E;
  --accent-soft: rgba(241, 89, 34, .20);
  --graphite: #8C9DAD;
  --graphite-dark: #B4C2CF;
  --text: #E4EBF2;
  --muted: #9CAFC2;
  --ink: #E4EBF2;
  --ink-hover: #FFFFFF;
  --on-ink: #0F1A28;

  --page-bg: #0B1521;
  --page-image:
    radial-gradient(1000px 600px at 0% -5%, rgba(69, 205, 185, .09), transparent 60%),
    radial-gradient(900px 700px at 105% 0%, rgba(161, 147, 255, .08), transparent 60%),
    radial-gradient(800px 600px at 90% 105%, rgba(241, 89, 34, .07), transparent 60%),
    linear-gradient(160deg, #0F1A28 0%, #0B1521 60%, #09111B 100%);

  --glass: rgba(18, 31, 47, .66);
  --glass-strong: rgba(20, 34, 51, .88);
  --glass-solid: rgba(17, 29, 44, .97);
  --glass-border: rgba(150, 180, 210, .16);
  --glass-blur: blur(18px) saturate(1.35);
  --surface: rgba(150, 180, 210, .06);
  --surface-hover: rgba(150, 180, 210, .10);
  --surface-active: #22374F;
  --tabs-bg: rgba(10, 19, 30, .55);
  --tabs-border: rgba(150, 180, 210, .16);
  --tab-text: #C3D0DC;
  --tab-hover: rgba(150, 180, 210, .10);
  --tab-active-shadow: 0 2px 10px rgba(0, 0, 0, .28), 0 0 0 1px rgba(150, 180, 210, .18);
  --field-bg: #0C1622;
  --field-bg-focus: #0E1A28;
  --field-bg-error: rgba(255, 107, 91, .08);
  --btn-bg: rgba(150, 180, 210, .08);
  --btn-bg-hover: rgba(150, 180, 210, .16);
  --drawer-bg: rgba(15, 26, 40, .95);
  --sticky-bg: rgba(15, 26, 40, .97);
  --overlay: rgba(0, 0, 0, .5);
  --line: rgba(150, 180, 210, .14);
  --line-strong: rgba(150, 180, 210, .26);
  --field-border: rgba(150, 180, 210, .28);
  --shadow: 0 12px 36px rgba(0, 0, 0, .40);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .28);
  --tile-accent: linear-gradient(135deg, #F15922, #F5814D);
  --ring-track: rgba(150, 180, 210, .18);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius: 14px;

  --danger: #FF8A7E;
  --danger-solid: #D9443A;
  --danger-bg: rgba(255, 107, 91, .14);
  --danger-border: rgba(255, 107, 91, .40);
  --warning: #F4B850;
  --warning-bg: rgba(244, 184, 80, .13);
  --warning-border: rgba(244, 184, 80, .40);
  --success: #6AD597;
  --success-bg: rgba(106, 213, 151, .13);
  --success-border: rgba(106, 213, 151, .38);
  --info: #8EBBEA;
  --info-bg: rgba(111, 168, 255, .13);
  --info-border: rgba(111, 168, 255, .38);
  --neutral-bg: rgba(150, 180, 210, .12);

  --st-gray: #9CAFC2;
  --st-violet: #A193FF;
  --st-teal: #45CDB9;
  --st-amber: #F4B850;
  --st-blue: #6FA8FF;
  --st-green: #6AD597;
  --st-green-deep: #4FC07F;
  --st-red: #FF8A7E;
  --st-light: #7F8E9C;

  --proc-bg: #0F1A28;
  --proc-glow: rgba(69, 205, 185, .08);
  --proc-card: #142233;
  --proc-card-2: #101C2B;
  --proc-card-shadow: 0 0 0 transparent;  /* не none: значение стоит в списке теней */
  --proc-border: rgba(150, 180, 210, .22);
  --proc-border-hover: rgba(200, 220, 240, .45);
  --proc-text: #E4EBF2;
  --proc-muted: #9CAFC2;
  --proc-chip-bg: #0C1622;
  --proc-col-bg: rgba(255, 255, 255, .03);
  --proc-col-over: rgba(255, 255, 255, .08);
  --proc-grid: rgba(150, 180, 210, .10);
  --proc-grid-strong: rgba(150, 180, 210, .15);
  --proc-off: rgba(255, 255, 255, .045);
  --proc-hover-ring: rgba(255, 255, 255, .5);
  --proc-teal: #45CDB9;
  --proc-violet: #A193FF;
  --proc-amber: #F4B850;
  --proc-pink: #EE7AB8;
  --proc-green: #6AD597;
  --proc-orange: #FF8B5E;
  --proc-red: #FF6B5B;
  --proc-red-text: #FF8A7E;
  --proc-blue: #6FA8FF;
  --proc-slate: #8496A8;
  --proc-violet-soft: rgba(161, 147, 255, .18);

}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 14px/1.45 var(--font);
  /* Размытый фон без картинки — только градиенты (свои в каждой теме). */
  background-color: var(--page-bg);
  background-image: var(--page-image);
  background-attachment: fixed;
}

a { color: var(--info); }
a:hover { color: var(--accent-dark); }

h1, h2, h3 { color: var(--text); line-height: 1.25; margin: 0 0 12px; }
h1 { font-size: 24px; letter-spacing: -.01em; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }

.muted { color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--glass-solid); }
}

/* ---------- Верхняя панель и меню ---------- */

.topbar {
  position: sticky;
  top: 12px;
  z-index: 50;
  max-width: 1440px;
  margin: 12px auto 0;
  padding: 0 16px;
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  padding: 6px 8px 6px 18px;
  border-radius: 999px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: bold;
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--text); }
.brand__mark {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--accent);
  box-shadow: 5px 5px 0 0 var(--graphite);
  margin-right: 6px;
}

.nav { display: flex; align-items: center; flex: 1; gap: 12px; }
.nav__list { display: flex; list-style: none; margin: 0; padding: 0; gap: 2px; flex: 1; justify-content: center; }
.nav__item { position: relative; }
.nav__link {
  display: block;
  padding: 8px 15px;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
}
.nav__link:hover { background: var(--surface-hover); color: var(--text); }
.nav__item.is-active > .nav__link { background: var(--surface-active); box-shadow: var(--tab-active-shadow); font-weight: bold; }

.nav__sub {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 250px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--glass-solid);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
/* Мостик, чтобы меню не закрывалось при переводе мыши. */
.nav__sub::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.nav__sub a { display: block; padding: 7px 12px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.nav__sub a:hover { background: var(--accent-soft); color: var(--text); }
.nav__item--group:hover > .nav__sub,
.nav__item--group:focus-within > .nav__sub { display: block; }

.userbox { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.avatar {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 12px;
  font-weight: bold;
  letter-spacing: .02em;
  flex: none;
}
.userbox__text { display: flex; flex-direction: column; line-height: 1.2; }
.userbox__name { font-weight: bold; }
.userbox__role { color: var(--muted); font-size: 12px; }
.userbox form { margin: 0; }

/* Переключатель темы: в светлой — луна, в тёмной — солнце. */
.theme-toggle svg { display: block; }
.theme-toggle__sun { display: none !important; }
[data-theme="dark"] .theme-toggle__sun { display: block !important; }
[data-theme="dark"] .theme-toggle__moon { display: none !important; }

.nav-toggle {
  display: none;
  margin-left: auto;
  padding: 7px 14px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

@media (max-width: 1100px) {
  .userbox__role { display: none; }
}

@media (max-width: 960px) {
  .topbar__inner { flex-wrap: wrap; gap: 0; border-radius: var(--radius-lg); padding: 8px 10px 8px 16px; }
  .nav-toggle { display: block; }
  .nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; padding: 8px 0 6px; }
  .nav.is-open { display: flex; }
  .nav__list { flex-direction: column; justify-content: flex-start; }
  .nav__link { padding: 9px 12px; border-radius: var(--radius-sm); }
  .nav__sub { display: block; position: static; box-shadow: none; border: 0; background: none; padding: 0 0 6px 14px; min-width: 0; }
  .nav__sub::before { display: none; }
  .nav__sub a { padding: 6px 10px; }
  .userbox { border-top: 1px solid var(--line); padding-top: 10px; flex-wrap: wrap; }
  .userbox__role { display: inline; }
}

/* ---------- Страница ---------- */

.page { max-width: 1440px; margin: 0 auto; padding: 16px 16px 40px; }

.shell {
  border-radius: var(--radius-xl);
  padding: 22px 22px 24px;
}
@media (max-width: 760px) {
  .shell { padding: 14px; border-radius: var(--radius-lg); }
}

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.page-head__sub { margin: 4px 0 0; color: var(--muted); }

.card {
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
  margin-bottom: var(--gap);
}
.card__title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.card__title h2 { margin: 0; }

.grid { display: grid; gap: var(--gap); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) {
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
}

/* Заголовок модуля: название, вкладки, кнопка «Добавить» справа сверху. */
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h1 { margin: 0; }

/* ---------- Вкладки-«таблетки» ---------- */

.tabs {
  display: inline-flex;
  max-width: 100%;
  gap: 2px;
  padding: 4px;
  margin-bottom: 18px;
  border-radius: 999px;
  background: var(--tabs-bg);
  border: 1px solid var(--tabs-border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs__item {
  padding: 7px 16px;
  border-radius: 999px;
  color: var(--tab-text);
  text-decoration: none;
  white-space: nowrap;
}
.tabs__item:hover { background: var(--tab-hover); color: var(--text); }
.tabs__item.is-active { background: var(--surface-active); box-shadow: var(--tab-active-shadow); color: var(--text); font-weight: bold; }

/* ---------- Сообщения ---------- */

.messages { margin-bottom: 14px; }
.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  margin-bottom: 8px;
}
.alert--info { background: var(--info-bg); border-color: var(--info-border); color: var(--info); }
.alert--success { background: var(--success-bg); border-color: var(--success-border); color: var(--success); }
.alert--warning { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning); }
.alert--error { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }

/* ---------- Формы ---------- */

.field { margin-bottom: 14px; }
.field__label { display: block; margin-bottom: 5px; font-weight: bold; }
.field__req { color: var(--accent-dark); }
.field__help { margin-top: 4px; color: var(--muted); font-size: 12px; }
.field__help ul { margin: 4px 0 0; padding-left: 18px; }
.field__error { margin-top: 5px; color: var(--danger); font-size: 13px; }

input[type="text"], input[type="password"], input[type="email"], input[type="number"],
input[type="search"], input[type="url"], input[type="date"], select, textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--field-border);
  border-radius: var(--radius-sm);
  background: var(--field-bg);
  color: var(--text);
  font: inherit;
}
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus { border-color: var(--graphite); outline: 3px solid var(--accent-soft); outline-offset: 0; background: var(--field-bg-focus); }
.field--error input, .field--error select, .field--error textarea { border-color: var(--danger); background: var(--field-bg-error); }

@media (max-width: 760px) {
  /* 16px — чтобы телефон не увеличивал страницу при вводе. */
  input, select, textarea { font-size: 16px; }
}

.form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--field-border);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--text);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: var(--graphite); background: var(--btn-bg-hover); color: var(--text); }
.btn--primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); font-weight: bold; }
.btn--primary:hover { background: var(--ink-hover); border-color: var(--ink-hover); color: var(--on-ink); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: bold; }
.btn--accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn--danger { color: var(--danger); border-color: var(--danger-border); }
.btn--danger:hover { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.btn--link { border: 0; background: none; padding: 0; color: var(--info); text-decoration: underline; font-weight: normal; }
.btn--link:hover { background: none; color: var(--accent-dark); }
.btn--block { width: 100%; }
.btn--small { padding: 4px 11px; font-size: 13px; }
.btn--icon { width: 34px; height: 34px; padding: 0; font-size: 18px; line-height: 1; }
.btn__plus {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-left: -4px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  line-height: 1;
}

/* ---------- Таблицы ---------- */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { color: var(--muted); font-weight: bold; font-size: 12px; white-space: nowrap; border-bottom-color: var(--line-strong); }
.table tbody tr:hover { background: var(--surface-hover); }
.table--compact th, .table--compact td { padding: 6px 9px; }

/* ---------- Плитки, кольца, статусы (для сводок и списков) ---------- */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: var(--gap); }
.tile {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}
.tile__label { color: var(--muted); font-size: 12px; }
.tile__value { font-size: 26px; font-weight: bold; line-height: 1.2; margin-top: 4px; }
.tile--accent { background: var(--tile-accent); border-color: transparent; color: #fff; }
.tile--accent .tile__label { color: rgba(255, 255, 255, .85); }

/* Кольцо-прогресс: style="--p: 64" — процент. */
.ring {
  --p: 0;
  display: inline-grid;
  place-items: center;
  width: 76px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--ring-track) 0);
}
.ring__value {
  display: grid;
  place-items: center;
  width: 78%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--glass-solid);
  font-weight: bold;
}

.badge {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 19px;
  white-space: nowrap;
  background: var(--neutral-bg);
  color: var(--graphite-dark);
}
/* Статус точкой, как в референсе: «• Выполнено». */
.dot { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }

.sig--overdue { background: var(--danger-solid); color: #fff; }
.sig--soon { background: var(--warning-bg); color: var(--warning); box-shadow: inset 0 0 0 1px var(--warning-border); }
.sig--no_date { background: var(--info-bg); color: var(--info); }
.sig--on_time { background: var(--success-bg); color: var(--success); }
.sig--not_sent { background: var(--neutral-bg); color: var(--graphite-dark); }
.sig--done { background: var(--success-bg); color: var(--success); }
.sig--withdrawn { background: var(--neutral-bg); color: var(--muted); text-decoration: line-through; }

/* ---------- Процесс: карточки с цветной линией и номером шага ---------- */

.process {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: radial-gradient(900px 300px at 0% 0%, var(--proc-glow), transparent 60%), var(--proc-bg);
  border: 1px solid var(--proc-border);
  color: var(--proc-text);
  box-shadow: var(--shadow-sm);
}
.process__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.process__title { margin: 0; color: var(--proc-text); font-size: 16px; }
.process__note { color: var(--proc-muted); font-size: 13px; }
.process__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }

.proc-card {
  --c: var(--proc-teal);
  position: relative;
  padding: 14px 16px 16px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--proc-card), var(--proc-card-2));
  border: 1px solid var(--proc-border);
  box-shadow: inset 0 2px 0 var(--c), 0 -6px 18px -12px var(--c);
}
.proc-card__num {
  display: inline-block;
  min-width: 32px;
  padding: 2px 6px;
  border: 1px solid var(--c);
  border-radius: 7px;
  color: var(--c);
  font-size: 13px;
  font-weight: bold;
  text-align: center;
}
.proc-card__title { margin: 10px 0 6px; color: var(--c); font-size: 15px; font-weight: bold; }
.proc-card__text { margin: 0; color: var(--proc-text); opacity: .88; font-size: 13px; }

/* Плашка со счётчиком: «В работе  7». */
.proc-chip {
  --c: var(--proc-teal);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 11px;
  border: 1px solid var(--proc-border);
  border-radius: 9px;
  background: var(--proc-chip-bg);
  color: var(--proc-text);
  font-weight: bold;
}
.proc-chip__count { color: var(--c); }

.c-teal { --c: var(--proc-teal); }
.c-violet { --c: var(--proc-violet); }
.c-amber { --c: var(--proc-amber); }
.c-pink { --c: var(--proc-pink); }
.c-green { --c: var(--proc-green); }
.c-orange { --c: var(--proc-orange); }
.c-slate { --c: var(--proc-slate); }

/* ---------- Боковая панель справа (треть экрана) ---------- */

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.drawer-overlay.is-open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  width: clamp(380px, 33.333vw, 680px);
  max-width: calc(100vw - 24px);
  border-radius: var(--radius-xl);
  background: var(--drawer-bg);
  transform: translateX(calc(100% + 24px));
  visibility: hidden;
  transition: transform .25s ease, visibility 0s linear .25s;
}
.drawer.is-open { transform: none; visibility: visible; transition: transform .25s ease; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer__title { margin: 0; font-size: 18px; }
.drawer__body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.drawer__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); }

.field-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.field-list li { padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface); border: 1px dashed var(--line-strong); color: var(--muted); }

@media (max-width: 760px) {
  .drawer { top: 0; right: 0; bottom: 0; width: 100vw; max-width: 100vw; border-radius: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .drawer, .drawer.is-open, .drawer-overlay { transition: none; }
}

/* ---------- Общие мелочи для страниц модулей ---------- */

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.js [data-collapsed] { display: none; }
.text-danger { color: var(--danger); font-weight: bold; }
.text-warning { color: var(--warning); font-weight: bold; }
.empty-state { text-align: center; padding: 28px 18px; }
.card--narrow { max-width: 760px; }
.card--table { padding: 6px 8px; }
.card--danger { border-color: var(--danger-border); }
.page-head__title { margin: 0; font-size: 19px; }
.tabs--small { margin-bottom: 14px; }
.tabs__count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--neutral-bg); font-size: 12px; text-align: center; }

/* Сетка полей формы: короткие поля в две колонки, многострочные — на всю ширину. */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 14px; }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid > .field--wide { grid-column: 1 / -1; }
@media (max-width: 760px) {
  .form-grid, .form-grid--3, .form-grid--4 { grid-template-columns: 1fr; }
}
.drawer .form-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.form-actions--sticky {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 8px -4px 0;
  padding: 10px 4px;
  background: linear-gradient(to top, var(--sticky-bg) 70%, transparent);
}
.drawer .form-actions--sticky { bottom: -16px; margin: 8px -20px -16px; padding: 12px 20px 16px; }
.drawer__hint { font-size: 13px; }

.subform {
  margin: 0 0 14px;
  padding: 12px 14px 2px;
  border-radius: var(--radius);
  border: 1px dashed var(--line-strong);
  background: var(--surface);
}
.subform__title { margin-bottom: 10px; font-weight: bold; }
.inspection-choice > .btn--link { display: inline-block; margin: -6px 0 12px; }

/* Поле даты: текст ДД.ММ.ГГГГ + кнопка календаря. */
.date-field { position: relative; display: block; }
.date-field input.js-date { padding-right: 40px; }
.date-field__btn {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 32px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.date-field__btn:hover { background: var(--accent-soft); color: var(--accent-dark); }
.date-field__picker { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }

/* «Сроки» задачи: одна кнопка «начало – окончание» (app.js, [data-period]); без JS — два поля через тире. */
.period-inputs { display: flex; align-items: center; gap: 6px; }
.period-inputs__part { flex: 1; min-width: 0; }
.period-inputs__dash { color: var(--muted); }
.period-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 3px 4px 3px 11px;
  border: 1px solid var(--field-border);
  border-radius: var(--radius-sm);
  background: var(--field-bg);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.period-btn:focus-visible { border-color: var(--graphite); outline: 3px solid var(--accent-soft); outline-offset: 0; background: var(--field-bg-focus); }
.period-btn__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.period-btn__text.is-empty { color: var(--muted); }
.period-btn__icon { flex: none; display: grid; place-items: center; width: 32px; height: 30px; border-radius: 8px; color: var(--muted); }
.period-btn:hover .period-btn__icon { background: var(--accent-soft); color: var(--accent-dark); }
.field--error .period-btn { border-color: var(--danger); background: var(--field-bg-error); }

/* Статусы рекомендаций — цвет точки. */
.st--to_send { color: var(--st-gray); }
.st--waiting { color: var(--st-violet); }
.st--in_work { color: var(--st-teal); }
.st--paused { color: var(--st-amber); }
.st--acceptance { color: var(--st-blue); }
.st--done { color: var(--st-green); }
.st--effect_ok { color: var(--st-green-deep); }
.st--effect_fail { color: var(--st-red); }
.st--withdrawn { color: var(--st-light); }

/* ---------- Реестр ---------- */

.filters { padding: 14px 16px; }
.filters__search { display: flex; gap: 8px; margin-bottom: 12px; }
.filters__search input { flex: 1; }
.filters__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 12px; }
.filters__item { display: flex; flex-direction: column; gap: 4px; }
.filters__label { color: var(--muted); font-size: 12px; font-weight: bold; }
.filters__item select { padding: 6px 9px; }

/* Фильтр с множественным выбором: кнопка как у списка + выпадающий список галочек (app.js). */
.multi { position: relative; }
.multi__button {
  position: relative;
  display: block;
  width: 100%;
  min-height: 34px;
  padding: 6px 28px 6px 9px;
  border: 1px solid var(--field-border);
  border-radius: var(--radius-sm);
  background: var(--field-bg);
  color: var(--text);
  font: inherit;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.multi__button::after { content: "▾"; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.multi__button:hover { border-color: var(--graphite); }
.multi__button.has-value { border-color: var(--accent); font-weight: bold; }
.multi__button[aria-expanded="true"] { border-color: var(--graphite); outline: 3px solid var(--accent-soft); outline-offset: 0; }
.multi__panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  min-width: 100%;
  width: max-content;
  max-width: min(380px, calc(100vw - 32px));
  max-height: 340px;
  padding: 8px;
  border-radius: var(--radius);
  background: var(--glass-solid);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}
.multi__search { margin-bottom: 6px; padding: 6px 9px; }
.multi__list { overflow-y: auto; min-height: 0; }
.multi__group { padding: 8px 8px 2px; color: var(--muted); font-size: 11px; font-weight: bold; }
.multi__option { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.multi__option:hover { background: var(--accent-soft); }
.multi__option input { margin: 0; flex: none; accent-color: var(--accent); }
.multi__foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
@media (max-width: 760px) { .multi__panel { width: 100%; max-width: none; } }

.filters__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }

.sort-link { color: inherit; text-decoration: none; white-space: nowrap; }
.sort-link:hover { color: var(--accent-dark); }
.sort-link.asc::after { content: " ↑"; color: var(--accent-dark); }
.sort-link.desc::after { content: " ↓"; color: var(--accent-dark); }

.table--registry td { font-size: 13px; }
.table--registry tr.is-overdue td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.rec-code { font-weight: bold; color: var(--text); text-decoration: none; white-space: nowrap; }
.rec-code:hover { color: var(--accent-dark); }
.rec-text-cell { min-width: 260px; max-width: 520px; }
.rec-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
}
.rec-text:hover { color: var(--accent-dark); }
.rec-meta { margin-top: 2px; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 520px; }

/* На телефоне строки таблицы превращаются в карточки. */
@media (max-width: 760px) {
  .table--cards thead { display: none; }
  .table--cards, .table--cards tbody, .table--cards tr, .table--cards td { display: block; width: 100%; }
  .table--cards tr { padding: 10px 6px; border-bottom: 1px solid var(--line-strong); }
  .table--cards td { display: grid; grid-template-columns: 120px 1fr; gap: 8px; padding: 3px 4px; border: 0; }
  .table--cards td::before { content: attr(data-label); color: var(--muted); font-size: 12px; }
  .table--cards td.num { text-align: left; }
  .table--cards .rec-text-cell { max-width: none; min-width: 0; }
  .table--cards .rec-meta { grid-column: 2; max-width: none; white-space: normal; }
  .table--cards .dot { white-space: normal; }
  .table--registry tr.is-overdue td:first-child { box-shadow: none; }
  .table--registry tr.is-overdue { box-shadow: inset 3px 0 0 var(--danger); }
}

/* ---------- Карточка рекомендации ---------- */

.rec-head__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.rec-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rec-head__title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 8px; }
.rec-head__code { margin: 0; font-size: 22px; }
.rec-head__text { font-size: 15px; line-height: 1.5; margin-bottom: 10px; }
.rec-head__meta { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 13px; }
.rec-footer { margin-top: 4px; font-size: 12px; }

.blocks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.blocks > .card { margin-bottom: 0; }
.block--wide { grid-column: 1 / -1; }
.block__title { margin: 0 0 10px; font-size: 15px; color: var(--graphite-dark); }
fieldset.block, fieldset.card { min-width: 0; }
fieldset.card { border: 1px solid var(--glass-border); }
fieldset.card > legend.block__title { float: left; width: 100%; padding: 0; }
fieldset.card > legend.block__title + * { clear: both; }
legend.package-item__num { float: left; }
legend.package-item__num + * { clear: both; }
@media (max-width: 900px) {
  .blocks { grid-template-columns: 1fr; }
}

.kv-list { margin: 0; display: grid; gap: 0; }
.kv-list--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
@media (max-width: 760px) { .kv-list--2 { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: minmax(130px, 42%) 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv-list--full .kv { grid-template-columns: minmax(130px, calc(21% - 5px)) 1fr; border-top: 1px solid var(--line); }
@media (max-width: 760px) { .kv-list--full .kv { grid-template-columns: minmax(130px, 42%) 1fr; } }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv__hint { margin-top: 2px; color: var(--muted); font-size: 12px; }

/* ---------- История ---------- */

.history { display: grid; gap: 12px; }
.history__group {
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--accent);
}
.history__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 6px; }
.history__when { font-weight: bold; }
.history__who { color: var(--graphite-dark); }
.history__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.history__item { font-size: 13px; overflow-wrap: anywhere; }
.history__item--created { color: var(--success); font-weight: bold; }
.history__field { color: var(--muted); }
.history__old { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.history__arrow { color: var(--accent-dark); padding: 0 4px; }
.history__new { font-weight: bold; }
.history__reason { margin-top: 2px; padding-left: 12px; color: var(--warning); }
.history__long { display: grid; gap: 6px; margin-top: 6px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface); }
.history summary { cursor: pointer; }

/* ---------- Пакет ---------- */

.package-items { display: grid; gap: 12px; margin-bottom: 4px; }
.package-item { position: relative; margin-bottom: 0; padding-top: 14px; }
.package-item__num {
  display: inline-block;
  min-width: 34px;
  margin-bottom: 8px;
  padding: 2px 8px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  color: var(--accent-dark);
  font-weight: bold;
  text-align: center;
}

/* ---------- Компактные фильтры, переключатели, всплывающее сообщение ---------- */

.filters__actions { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.filters--compact { padding: 10px 14px; }
.filters__row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.filters__row .filters__item { flex: 1 1 150px; min-width: 140px; max-width: 260px; }
.filters__row .filters__item--search { flex: 2 1 220px; max-width: none; }
.filters__row .filters__item--actions { flex: 0 0 auto; min-width: 0; flex-direction: row; gap: 6px; }
@media (max-width: 760px) {
  .filters__row .filters__item { flex-basis: 100%; max-width: none; }
  .filters__row .filters__item--actions { flex-basis: auto; }
}
.inline-form { margin: 0; min-width: 220px; }

.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--proc-col-over); border: 1px solid var(--proc-border); }
.seg__item { padding: 4px 12px; border-radius: 999px; color: var(--proc-muted); font-size: 13px; text-decoration: none; white-space: nowrap; }
.seg__item:hover { color: var(--proc-text); }
.seg__item.is-active { background: var(--proc-text); color: var(--proc-bg); font-weight: bold; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 120;
  transform: translateX(-50%);
  max-width: min(560px, calc(100vw - 32px));
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--on-ink);
  box-shadow: var(--shadow);
}

/* ---------- Доска (стиль «процесс») ---------- */

.board { padding: 14px; }
.board__hint { max-width: 560px; }
.board__hint--touch { display: none; }
.board__scroll { overflow-x: auto; padding-bottom: 6px; }
.board__columns { display: flex; gap: 10px; align-items: flex-start; min-height: 320px; }
.board__divider { flex: 0 0 1px; align-self: stretch; background: var(--proc-border); margin: 0 2px; }
.board-col {
  flex: 0 0 248px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 260px);
  min-height: 220px;
  border-radius: 12px;
  background: var(--proc-col-bg);
  border: 1px solid var(--proc-border);
  transition: background .15s ease, border-color .15s ease;
}
.board-col.is-over { background: var(--proc-col-over); border-color: var(--proc-border-hover); }
.board-col__head { padding: 10px 10px 8px; }
/* Заголовок колонки — спокойный: название и число, без цветной линии и плашки (11.11.2026). */
.board-col .proc-chip { padding: 2px 4px; border: 0; background: none; }
.board-col .proc-chip__count { color: var(--proc-muted); font-weight: normal; }
.board-col__group { display: block; margin-bottom: 6px; color: var(--proc-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.board-col__list { flex: 1; overflow-y: auto; padding: 2px 8px 10px; display: flex; flex-direction: column; gap: 8px; }
.board-col__empty { margin: 8px 2px; color: var(--proc-muted); font-size: 12px; text-align: center; }

.board-card {
  position: relative;
  padding: 10px 11px;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--proc-card), var(--proc-card-2));
  border: 1px solid var(--proc-border);
  box-shadow: var(--proc-card-shadow);
  color: var(--proc-text);
  cursor: grab;
  font-size: 13px;
}
.board-card:hover { border-color: var(--proc-border-hover); }
.board-card.is-dragging { opacity: .4; }
.board-card.is-saving { opacity: .6; pointer-events: none; }
.board-card__top { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.board-card__code { color: var(--proc-text); font-weight: bold; text-decoration: none; }
.board-card__code:hover, .board-card__text:hover { color: var(--accent-dark); }
.board-card__text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--proc-text);
  opacity: .9;
  text-decoration: none;
  line-height: 1.4;
}
.board-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; color: var(--proc-muted); font-size: 12px; }
.board-card__date { margin-left: auto; }
.board-card__select { display: none; margin-top: 8px; }
.board-card__select select { padding: 5px 8px; font-size: 14px; background: var(--proc-chip-bg); color: var(--proc-text); border-color: var(--proc-border); }
.avatar--xs { width: 22px; height: 22px; font-size: 10px; background: var(--proc-text); color: var(--proc-bg); }

/* Сенсорный экран или узкое окно: вместо перетаскивания — список статусов в карточке. */
@media (hover: none), (max-width: 760px) {
  .board-card { cursor: default; }
  .board-card__select { display: block; }
  .board__hint--drag { display: none; }
  .board__hint--touch { display: inline; }
  .board__columns { flex-direction: column; }
  .board-col { flex: 1 1 auto; width: 100%; max-height: none; min-height: 0; }
  .board__divider { display: none; }
}

/* ---------- Диаграмма Ганта (стиль «процесс») ---------- */

.gantt { --label-w: 300px; padding: 14px; }
.gantt__controls { display: flex; flex-wrap: wrap; gap: 8px; }
.gantt__legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 12px; color: var(--proc-muted); font-size: 12px; }
.gantt__key { display: inline-flex; align-items: center; gap: 6px; }
.gantt__key::before { content: ""; width: 18px; height: 8px; border-radius: 4px; background: var(--bar, var(--proc-teal)); }
.gantt__key--done-mark::before, .gantt__key--today::before { display: none; }
.gantt__key--today { border-left: 2px solid var(--proc-orange); padding-left: 6px; }
.gantt__scroll { overflow-x: auto; border-radius: 10px; border: 1px solid var(--proc-border); }
.gantt__grid { position: relative; width: calc(var(--label-w) + var(--track-w)); min-width: 100%; }
.gantt__row { display: flex; min-height: 34px; border-bottom: 1px solid var(--proc-grid); }
.gantt__label {
  position: sticky;
  left: 0;
  z-index: 3;
  flex: 0 0 var(--label-w);
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 10px;
  background: var(--proc-bg);
  border-right: 1px solid var(--proc-border);
  font-size: 13px;
}
.gantt__label--head { color: var(--proc-muted); font-size: 12px; }
.gantt__label--group { color: var(--proc-amber); font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; line-height: 22px; }
.gantt__count { color: var(--proc-muted); font-weight: normal; margin-left: 4px; }
.gantt__code { flex: none; color: var(--proc-text); font-weight: bold; text-decoration: none; }
.gantt__code:hover { color: var(--proc-orange); }
.gantt__text { color: var(--proc-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt__track { position: relative; flex: 0 0 var(--track-w); }
.gantt__row--head { position: sticky; top: 0; z-index: 4; min-height: 46px; background: var(--proc-bg); }
.gantt__track--head { height: 46px; }
.gantt__month { position: absolute; top: 4px; padding-left: 6px; color: var(--proc-text); font-size: 12px; font-weight: bold; white-space: nowrap; overflow: hidden; border-left: 1px solid var(--proc-border); }
.gantt__week { position: absolute; top: 26px; padding-left: 3px; color: var(--proc-muted); font-size: 11px; border-left: 1px solid var(--proc-grid-strong); }
.gantt__row--group { background: var(--proc-col-bg); }
.gantt__body { position: relative; }
.gantt__lines { position: absolute; top: 0; bottom: 0; left: var(--label-w); width: var(--track-w); pointer-events: none; z-index: 1; }
.gantt__line { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--proc-grid-strong); }
.gantt__today { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--proc-orange); box-shadow: 0 0 8px var(--proc-orange); }
.gantt-bar {
  --bar: var(--proc-teal);
  position: absolute;
  top: 9px;
  height: 16px;
  min-width: 6px;
  border-radius: 6px;
  background: var(--bar);
  z-index: 2;
}
.gantt-bar:hover { filter: brightness(1.15); outline: 2px solid var(--proc-hover-ring); }
.gantt-bar--milestone { width: 14px !important; margin-left: -7px; border-radius: 3px; transform: rotate(45deg) scale(.8); }
.gantt__done { position: absolute; top: 6px; z-index: 3; margin-left: -6px; color: #fff; font-size: 13px; text-shadow: 0 0 4px #000; }
.gantt-bar--overdue, .gantt__key.gantt-bar--overdue { --bar: var(--proc-red); }
.gantt-bar--soon, .gantt__key.gantt-bar--soon { --bar: var(--proc-amber); }
.gantt-bar--on_time, .gantt__key.gantt-bar--on_time { --bar: var(--proc-teal); }
.gantt-bar--not_sent, .gantt__key.gantt-bar--not_sent { --bar: var(--proc-violet); }
.gantt-bar--no_date, .gantt__key.gantt-bar--no_date { --bar: var(--proc-muted); }
.gantt-bar--done, .gantt__key.gantt-bar--done { --bar: var(--proc-green); }
.gantt-bar--withdrawn, .gantt__key.gantt-bar--withdrawn { --bar: var(--proc-slate); }
.gantt__key.gantt-bar--overdue, .gantt__key.gantt-bar--soon, .gantt__key.gantt-bar--on_time, .gantt__key.gantt-bar--not_sent,
.gantt__key.gantt-bar--done, .gantt__key.gantt-bar--withdrawn { position: static; height: auto; background: none; min-width: 0; }
.gantt__without { margin-top: 16px; }
.gantt__chips { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.gantt__chips a { text-decoration: none; font-weight: normal; font-size: 13px; }
@media (max-width: 760px) { .gantt { --label-w: 150px; } .gantt__text { display: none; } }

/* ---------- Мой контроль ---------- */

.control-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: var(--gap); }
.control-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  color: var(--muted);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}
.control-chip:hover { color: var(--text); background: var(--surface-active); }
.control-chip__count { font-size: 22px; font-weight: bold; color: var(--graphite); }
.control-chip.has-items .control-chip__count { color: var(--text); }
.control-chip--overdue.has-items .control-chip__count { color: var(--danger); }
.control-chip--soon.has-items .control-chip__count { color: var(--warning); }
.control-chip__label { font-size: 13px; line-height: 1.25; }
.control-group { scroll-margin-top: 90px; }
.control-group--overdue { border-left: 4px solid var(--danger); }
.control-group--soon { border-left: 4px solid var(--proc-amber); }

/* ---------- Сводка ---------- */

.tiles--6 { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.tile--link { display: flex; flex-direction: column; color: var(--text); text-decoration: none; transition: transform .15s ease; }
.tile--link:hover { transform: translateY(-2px); color: var(--text); }
.tile--accent.tile--link, .tile--accent.tile--link:hover { color: #fff; }
.tile__formula { margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.tile--accent .tile__formula { color: rgba(255, 255, 255, .85); }
.indicators { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.indicator { display: flex; gap: 14px; align-items: flex-start; padding: 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.indicator .ring { flex: none; }
.indicator__number { flex: none; display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: var(--neutral-bg); font-size: 26px; font-weight: bold; }
.indicator__title { margin: 2px 0 4px; font-size: 14px; }
.indicator__fact { margin: 0 0 4px; font-weight: bold; }
.indicator__formula { margin: 0; font-size: 12px; }
.ring__value--empty { font-size: 10px; font-weight: normal; color: var(--muted); text-align: center; line-height: 1.1; }
.table--matrix th[scope="row"] { color: var(--text); font-size: 13px; white-space: nowrap; }
.table--matrix thead th { white-space: normal; vertical-align: bottom; font-weight: normal; }
.table--matrix thead .dot { white-space: normal; font-size: 11px; }
.table--matrix tfoot td, .table--matrix tfoot th { border-top: 1px solid var(--line-strong); font-weight: bold; }
.table-note { margin-top: 8px; font-size: 12px; }

/* ---------- Сводка по сотрудникам ---------- */
.table--people td { font-size: 13px; vertical-align: middle; }
.table--people .table__groups th { text-align: center; border-bottom-color: var(--line); }
.table--people .table__groups th:first-child { text-align: left; vertical-align: bottom; }
.table--people th.num { white-space: normal; max-width: 110px; }
.table--people th.num, .table--people td.num { text-align: right; }
.table--people tfoot td, .table--people tfoot th { border-top: 1px solid var(--line-strong); font-weight: bold; text-align: right; }
.table--people tfoot th { text-align: left; }
.table--people tr.is-me .people__name { color: var(--accent-dark); }
.table--people tr.is-disabled td { color: var(--muted); }
.people__name { color: var(--text); font-weight: bold; text-decoration: none; margin-right: 6px; }
.people__name:hover { color: var(--accent-dark); text-decoration: underline; }
.table--people td.num a { font-weight: bold; }
@media (max-width: 760px) {
  .table--cards tfoot, .table--cards tfoot tr, .table--cards tfoot th, .table--cards tfoot td { display: block; width: 100%; }
  .table--cards tfoot td { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 3px 4px; border: 0; text-align: right; }
  .table--cards tfoot td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; }
  .table--people td.num { grid-template-columns: 1fr auto; }
}

/* ---------- Задачи ---------- */

/* Метка: цвет задаёт руководитель (--label), текст белый — цвета подобраны тёмными. */
.label-chip {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--label, var(--graphite));
  color: #fff;
  font-size: 12px;
  line-height: 19px;
  white-space: nowrap;
}
.label-chip--sm { padding: 0 7px; font-size: 11px; line-height: 17px; }
.label-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.label-check { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.label-check input { margin: 0; accent-color: var(--accent); }
.field--labels { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.field--labels legend { padding: 0; margin-bottom: 6px; }

.prio { font-size: 11px; color: var(--proc-muted); }
.prio--urgent { color: var(--proc-red-text); font-weight: bold; }
.prio--high { color: var(--proc-text); font-weight: bold; }
.prio-text--urgent { color: var(--danger); font-weight: bold; }
.prio-text--high { color: var(--accent-dark); font-weight: bold; }
.prio-text--low { color: var(--muted); }

.task-card { padding-top: 9px; }
.task-card__labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.task-card__parent { margin-bottom: 3px; color: var(--proc-muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-card__title { font-weight: bold; opacity: 1; }
.task-card.is-done .task-card__title { opacity: .7; text-decoration: line-through; text-decoration-color: var(--proc-muted); }
.task-card__rec { padding: 0 6px; border-radius: 6px; background: var(--proc-chip-bg); color: var(--proc-muted); font-size: 11px; line-height: 17px; }
.task-card__due { margin-left: auto; }
.due--overdue { color: var(--proc-red-text); font-weight: bold; }
.due--soon { color: var(--proc-amber); font-weight: bold; }
.task-card__due.due--overdue { padding: 0 8px; border-radius: 999px; background: var(--danger-bg); color: var(--danger); font-weight: normal; }
/* Метка на карточке доски — спокойная: цветная точка и название. */
.task-card .label-chip { padding: 0 7px 0 0; background: none; color: var(--proc-muted); }
.task-card .label-chip::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--label, var(--graphite)); }
.task-card.is-context .task-card__title { font-weight: normal; }

/* Подзадачи — строки внутри карточки задачи (вариант A, 11.11.2026): кружок слева отмечает готовой. */
.subs { list-style: none; margin: 8px 0 0; padding: 6px 0 0; border-top: 1px solid var(--proc-border); display: grid; gap: 1px; }
.subs__item { display: flex; align-items: baseline; gap: 7px; padding: 3px 4px; margin: 0 -4px; border-radius: 6px; font-size: 12px; cursor: pointer; }
.subs__item:hover { background: var(--proc-col-over); }
.subs__check {
  flex: none;
  align-self: center;
  width: 15px;
  height: 15px;
  padding: 0;
  border: 1.5px solid var(--proc-border-hover);
  border-radius: 50%;
  background: none;
  color: transparent;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
}
.subs__check::before { content: "✓"; }
.subs__check:hover { border-color: var(--accent); color: var(--accent); }
.subs__check:disabled { opacity: .5; cursor: default; }
.subs__item.is-done .subs__check { background: var(--accent); border-color: var(--accent); color: #fff; }
.subs__title { flex: 1; min-width: 0; color: var(--proc-text); text-decoration: none; overflow-wrap: anywhere; }
.subs__title:hover { color: var(--accent-dark); }
.subs__item.is-done .subs__title { color: var(--proc-muted); text-decoration: line-through; }
.subs__item.is-dim { opacity: .5; }
.subs__note { flex: none; color: var(--proc-muted); font-size: 11px; white-space: nowrap; }
.subs__note.due--overdue { color: var(--proc-red-text); font-weight: normal; }
.subs__note.due--soon { color: var(--proc-amber); font-weight: normal; }
.subs__more { padding: 2px 4px 0 22px; color: var(--proc-muted); font-size: 11px; }

/* Длинная колонка: видно первые 7 карточек, остальные — по кнопке (tasks.js). */
.board-col.is-collapsed .board-col__list > .board-card:nth-of-type(n+8) { display: none; }
.board-col__more { margin: 0 8px 10px; padding: 6px; border: 1px dashed var(--proc-border-hover); border-radius: 10px; background: none; color: var(--proc-muted); font: inherit; font-size: 12px; cursor: pointer; }
.board-col__more:hover { color: var(--proc-text); border-color: var(--proc-text); }

.board-col--task { flex: 1 0 230px; max-width: 360px; }
.board-col__foot { padding: 6px 10px 10px; font-size: 12px; color: var(--proc-muted); }
.board-col__foot a { color: var(--proc-text); }
.board-placeholder { height: 46px; border: 2px dashed var(--proc-border); border-radius: 10px; flex: none; }
.board--tasks .board__columns { min-height: 380px; }
.board--tasks .board-col { max-height: calc(100vh - 230px); }

.quick-filters { display: inline-flex; gap: 6px; }
.quick-filter {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--field-border);
  background: var(--btn-bg);
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}
.quick-filter:hover { border-color: var(--graphite); color: var(--text); }
.quick-filter.is-on { background: var(--ink); border-color: var(--ink); color: var(--on-ink); font-weight: bold; }
.quick-filter--danger.is-on { background: var(--danger-solid); border-color: var(--danger-solid); color: #fff; }
.filters__row .filters__item--quick { flex: 0 0 auto; min-width: 0; max-width: none; }

/* Список: задачи и подзадачи с отступом. */
.table--tasks td { font-size: 13px; vertical-align: middle; }
.task-row__title a { color: var(--text); font-weight: bold; text-decoration: none; }
.task-row__title a:hover { color: var(--accent-dark); }
.task-row--level1 .task-row__title { padding-left: 34px; }
.task-row--level1 .task-row__title a { font-weight: normal; }
.task-row__branch { margin-left: -18px; margin-right: 4px; color: var(--muted); }
.task-row__subs { margin-left: 6px; font-size: 12px; }
.task-row.is-context { opacity: .6; }
.task-row.is-done .task-row__title a { color: var(--muted); text-decoration: line-through; }
.task-row.is-overdue td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.due-text--overdue { color: var(--danger); font-weight: bold; }
.due-text--soon { color: var(--warning); font-weight: bold; }
.tst--new { color: var(--st-violet); }
.tst--in_work { color: var(--st-teal); }
.tst--review { color: var(--st-amber); }
.tst--done { color: var(--st-green); }
.tst--postponed { color: var(--st-gray); }
@media (max-width: 760px) {
  .task-row--level1 .task-row__title { padding-left: 4px; }
  .task-row__branch { margin-left: 0; }
}

/* Карточка задачи в панели. */
.task-title-field input { font-size: 16px; font-weight: bold; }
.task-info { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-strong); display: grid; gap: 14px; }
.task-info__rec { padding: 10px 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.task-info__rec-text { flex-basis: 100%; margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.task-info__parent { margin: 0; }
.subtask-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.subtask-list__item { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; padding: 7px 10px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); font-size: 13px; }
.subtask-list__item a { color: var(--text); font-weight: bold; text-decoration: none; }
.subtask-list__item a:hover { color: var(--accent-dark); }
.subtask-list__item.is-done a { color: var(--muted); text-decoration: line-through; }
.task-info__meta .kv { font-size: 13px; }
.task-info__delete { margin: 0; }
.task-page .task-info { margin-top: 10px; }
.fixed-parent { padding: 8px 11px; border-radius: var(--radius-sm); border: 1px dashed var(--line-strong); background: var(--surface); font-weight: bold; overflow-wrap: anywhere; }

/* Меню по правой кнопке мыши на карточке доски. */
.ctx-menu {
  position: fixed;
  z-index: 110;
  min-width: 220px;
  padding: 6px;
  border-radius: var(--radius);
  background: var(--glass-solid);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}
.ctx-menu button {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.ctx-menu button:hover, .ctx-menu button:focus-visible { background: var(--accent-soft); outline: none; }
.ctx-menu .ctx-menu__danger { color: var(--danger); }
.ctx-menu button:disabled { color: var(--muted); background: none; cursor: not-allowed; opacity: .7; }
.ctx-menu__sep { height: 1px; margin: 4px 6px; background: var(--line); }
.ctx-menu__note { margin: 0 12px 6px; color: var(--muted); font-size: 12px; }

/* Диаграмма задач. */
.gantt--tasks { --label-w: 280px; }
.gantt__task { color: var(--proc-text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.gantt__task:hover { color: var(--proc-orange); }
.gantt__row--sub .gantt__task { color: var(--proc-muted); }
.gantt__branch { color: var(--proc-muted); margin-left: 8px; }
.gantt__row.is-context { opacity: .55; }
.gantt__off { position: absolute; top: 0; bottom: 0; background: var(--proc-off); }
.gantt__key--off::before { background: var(--proc-border); }
.gantt__nodate { position: sticky; left: calc(var(--label-w) + 8px); display: inline-block; margin: 8px 0 0 8px; color: var(--proc-muted); font-size: 12px; }
.gantt-bar--new, .gantt__key.gantt-bar--new { --bar: var(--proc-violet); }
.gantt-bar--in_work, .gantt__key.gantt-bar--in_work { --bar: var(--proc-teal); }
.gantt-bar--review, .gantt__key.gantt-bar--review { --bar: var(--proc-blue); }
.gantt-bar--postponed, .gantt__key.gantt-bar--postponed { --bar: var(--proc-slate); }
.gantt__key.gantt-bar--new, .gantt__key.gantt-bar--in_work, .gantt__key.gantt-bar--review,
.gantt__key.gantt-bar--postponed { position: static; height: auto; background: none; min-width: 0; }

/* ---------- Вход и первый запуск ---------- */

.body--auth .page { display: flex; justify-content: center; padding-top: 8vh; }
.auth-card {
  width: 100%;
  max-width: 400px;
  border-radius: var(--radius-xl);
  padding: 28px;
}
.auth-card--wide { max-width: 480px; }
.auth-card__brand { display: flex; align-items: center; gap: 8px; font-weight: bold; color: var(--graphite-dark); margin-bottom: 18px; }
.auth-card__title { font-size: 22px; }
.auth-card__note { margin-top: 14px; color: var(--muted); font-size: 12px; }

/* ---------- Настройки: пользователи, метки, справочники ---------- */

.settings-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 12px; }
.settings-bar p { margin: 0; }
.settings-note { margin: 0 0 12px; font-size: 13px; }
.table tr.is-disabled td { color: var(--muted); }
.table--users td { vertical-align: middle; }

.color-input {
  width: 46px;
  height: 36px;
  padding: 3px;
  border: 1px solid var(--field-border);
  border-radius: var(--radius-sm);
  background: var(--field-bg);
  cursor: pointer;
}
.dict-line { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.dict-line:last-child { border-bottom: 0; }
.dict-line > form:first-child { flex: 1 1 420px; min-width: 0; }
.dict-line > form { margin: 0; }
.dict-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0; }
.dict-row__field--grow { flex: 1 1 200px; min-width: 0; }
.dict-row__usage { font-size: 12px; white-space: nowrap; }

.dict-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin: 0; }
.dict-form--row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.dict-form--row:last-child { border-bottom: 0; }
.dict-form--row.is-disabled input:not([type=checkbox]), .dict-form--row.is-disabled textarea { color: var(--muted); }
.dict-form__field { min-width: 0; }
.dict-form__field .field__label { font-size: 12px; color: var(--muted); }
.dict-form__field--name { flex: 1 1 220px; }
.dict-form__field--norm_term { flex: 0 1 170px; }
.dict-form__field--confirmation { flex: 2 1 260px; }
.dict-form__field--confirmation textarea { min-height: 38px; }
.dict-form__field--sort_order { flex: 0 0 90px; }
.dict-form__field--is_active { flex: 0 0 auto; padding-bottom: 8px; }
.dict-form__check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
.dict-form__check input { margin: 0; accent-color: var(--accent); }
.dict-form__actions { display: flex; align-items: center; gap: 10px; padding-bottom: 2px; }

/* ---------- Главная: «Мой день» ---------- */

.day { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--gap); align-items: start; }
.day > .card { margin-bottom: 0; }
@media (max-width: 900px) { .day { grid-template-columns: 1fr; } }
.day__hint { margin: -4px 0 12px; font-size: 13px; }
.day-group + .day-group { margin-top: 14px; }
.day-group__title { margin: 0 0 6px; font-size: 14px; color: var(--graphite-dark); }
.day-group--overdue .day-group__title { color: var(--danger); }
.day-group--soon .day-group__title { color: var(--warning); }
.day-group__empty { margin: 0; font-size: 13px; }
.day-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.day-task {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
}
.day-task__title { color: var(--text); font-weight: bold; text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
.day-task__title:hover { color: var(--accent-dark); }
.day-task__meta { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; color: var(--muted); }
.day-task__parent { color: var(--muted); font-weight: normal; }
.day-task__due { white-space: nowrap; }
.day-task__due.due-text--overdue { padding: 0 8px; border-radius: 999px; background: var(--danger-bg); }
.control-chips--day .control-chip { flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; }
.control-chips--day .control-chip__count { font-size: 26px; line-height: 1.1; }
.control-chips--day { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 0; }

/* Несколько ответственных: кружки с инициалами внахлёст, больше трёх — «+N». */
.avatars { display: inline-flex; align-items: center; }
.avatars .avatar + .avatar { margin-left: -5px; box-shadow: 0 0 0 2px var(--proc-card); }
.avatar--more { font-size: 9px; }

/* ---------- Календарь «начало — окончание» в одном окне (app.js, GKK.openRangePicker) ---------- */
.range {
  position: fixed;
  z-index: 115;
  width: 300px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--glass-solid);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  color: var(--text);
}
.range__fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.range__field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 6px 10px;
  border: 1px solid var(--field-border);
  border-radius: var(--radius-sm);
  background: var(--field-bg);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.range__field.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.range__caption { color: var(--muted); font-size: 11px; }
.range__value { font-weight: bold; font-variant-numeric: tabular-nums; }
.range__head { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.range__month { flex: 1; font-weight: bold; }
.range__nav { min-width: 28px; height: 28px; padding: 0 8px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 16px; cursor: pointer; }
.range__nav--today { font-size: 12px; color: var(--muted); }
.range__nav:hover { background: var(--accent-soft); }
.range__week, .range__days { display: grid; grid-template-columns: repeat(7, 1fr); }
.range__week span { padding: 4px 0; color: var(--muted); font-size: 11px; text-align: center; }
.range__day {
  height: 34px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.range__day:hover { background: var(--accent-soft); border-radius: 8px; }
.range__day.is-weekend { color: var(--accent-dark); }
.range__day.is-other { color: var(--muted); opacity: .55; }
.range__day.is-today { font-weight: bold; text-decoration: underline; text-underline-offset: 3px; }
.range__day.in-range { background: var(--accent-soft); border-radius: 0; }
.range__day.is-hover { box-shadow: inset 0 0 0 2px var(--accent); border-radius: 8px; } /* будущее окончание под мышью */
.range__day.is-start, .range__day.is-end { background: var(--accent); color: #fff; border-radius: 8px; opacity: 1; }
.range__day.is-start.in-range, .range__day.is-end.in-range { border-radius: 8px; }
.range__foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
@media (max-width: 760px) { .range { width: calc(100vw - 16px); } }

/* ---------- Список задач: правка в ячейке, порядок перетаскиванием ---------- */
.table--tasks .drag-col { width: 22px; padding-left: 4px; padding-right: 0; }
.drag-handle { display: inline-block; color: var(--muted); letter-spacing: -2px; cursor: grab; user-select: none; opacity: .45; }
.task-row:hover .drag-handle { opacity: 1; }
.task-row--level1 .drag-handle { margin-left: 10px; }
.task-row.is-dragging { opacity: .4; }
.task-row.drop-before td { box-shadow: inset 0 2px 0 var(--accent); }
.task-row.drop-after td { box-shadow: inset 0 -2px 0 var(--accent); }
.cell-edit { cursor: pointer; border-radius: 6px; }
.cell-edit:hover, .cell-edit:focus-visible { background: var(--accent-soft); outline: none; }
.cell-pop {
  position: fixed;
  z-index: 115;
  min-width: 200px;
  max-width: min(320px, calc(100vw - 16px));
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
  border-radius: var(--radius);
  background: var(--glass-solid);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}
.cell-pop__option { display: block; width: 100%; padding: 7px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.cell-pop__option:hover, .cell-pop__option:focus-visible { background: var(--accent-soft); outline: none; }
.cell-pop__option.is-current { font-weight: bold; }
.cell-pop__option.is-current::after { content: " ✓"; color: var(--accent-dark); }
.cell-pop__list { max-height: 240px; overflow-y: auto; }
@media (max-width: 760px) { .table--cards .drag-col { display: none; } }

/* ---------- Диаграмма Ганта: перетаскивание полос ---------- */
.gantt-bar[data-drag] { cursor: grab; touch-action: pan-x pan-y; }
.gantt-bar[data-drag="dates"]:not(.gantt-bar--milestone)::before,
.gantt-bar[data-drag="dates"]:not(.gantt-bar--milestone)::after { content: ""; position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; }
.gantt-bar[data-drag="dates"]::before { left: 0; }
.gantt-bar[data-drag="dates"]::after { right: 0; }
.gantt-bar[data-drag="end"]:not(.gantt-bar--milestone)::after { content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 7px; cursor: ew-resize; }
.gantt-tip {
  position: fixed;
  z-index: 120;
  padding: 4px 9px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 12px;
  font-weight: bold;
  pointer-events: none;
  white-space: nowrap;
}
.day__groupings { margin-bottom: 12px; }
.day-group--prio-urgent .day-group__title { color: var(--danger); }
.day-group--prio-high .day-group__title { color: var(--accent-dark); }
