/* ═══════════════════════════════════════════════════════════════════════
   Планировщик задач — тёмная тема
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --bg-0: #02050e;
  --bg-1: #050a1c;

  --shell: rgba(7, 12, 30, .78);
  --panel: rgba(11, 18, 40, .55);
  --panel-2: rgba(14, 22, 48, .72);
  --card: rgba(19, 28, 58, .72);
  --card-hover: rgba(26, 38, 76, .88);

  --line: rgba(104, 140, 235, .14);
  --line-2: rgba(104, 140, 235, .22);
  --line-soft: rgba(104, 140, 235, .08);

  --text: #e7ecff;
  --text-2: #9fadd8;
  --text-3: #6b789f;

  --accent: #2f6bff;
  --accent-hi: #4b83ff;
  --accent-lo: #1b4fd8;
  --accent-soft: rgba(47, 107, 255, .16);

  --c-blue: #3b82f6;
  --c-indigo: #6366f1;
  --c-purple: #8b5cf6;
  --c-green: #22c55e;
  --c-amber: #f59e0b;
  --c-cyan: #06b6d4;
  --c-red: #ef4444;

  --sidebar-w: 296px;
  --r-lg: 20px;
  --r-md: 13px;
  --r-sm: 9px;

  --shadow-card: 0 4px 18px rgba(0, 0, 0, .35);
  --shadow-pop: 0 18px 50px rgba(0, 0, 0, .55);
  --ease: cubic-bezier(.22, .8, .3, 1);

  /* Тёмные системные контролы: выпадающие списки, выбор даты, скроллбары */
  color-scheme: dark;
}

/* ── Базовое ─────────────────────────────────────────────────────────── */

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

html, body { height: 100%; }

body {
  margin: 0;
  font-family: 'Segoe UI Variable Display', 'Segoe UI', system-ui, -apple-system, 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* Фоновое свечение */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(90% 70% at 100% 18%, rgba(29, 92, 255, .30), transparent 62%),
    radial-gradient(70% 60% at 96% 96%, rgba(20, 70, 220, .26), transparent 60%),
    radial-gradient(60% 55% at 2% 6%, rgba(24, 72, 200, .14), transparent 65%),
    linear-gradient(160deg, #030713 0%, #040a1e 45%, #02050f 100%);
}

.icon-sprite { display: none; }

.ico {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button { font: inherit; color: inherit; cursor: pointer; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(120, 155, 240, .16);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(120, 155, 240, .3); }

/* ── Оболочка ────────────────────────────────────────────────────────── */

.page {
  height: 100%;
  padding: 22px;
  display: flex;
}

.app {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--shell);
  backdrop-filter: blur(30px) saturate(140%);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .04);
  overflow: hidden;
}

/* ── Шапка ───────────────────────────────────────────────────────────── */

.topbar {
  display: grid;
  grid-template-columns: calc(var(--sidebar-w) + 22px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 15px 22px;
  border-bottom: 1px solid var(--line-soft);
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.logo {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--accent-hi), var(--accent-lo));
  box-shadow: 0 4px 14px rgba(47, 107, 255, .5);
}
.logo .ico { width: 16px; height: 16px; stroke-width: 2.6; color: #fff; }

.brand-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
  transition: background .16s, color .16s;
}
.icon-btn:hover { background: rgba(120, 160, 255, .1); color: var(--text); }
.icon-btn:active { transform: scale(.94); }

.topbar__brand .icon-btn { margin-left: auto; }

/* Поиск */
.searchbox {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 340px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(9, 15, 34, .7);
  transition: border-color .18s, box-shadow .18s;
}
.searchbox:focus-within {
  border-color: rgba(72, 128, 255, .55);
  box-shadow: 0 0 0 3px rgba(47, 107, 255, .12);
}
.searchbox__icon { color: var(--text-3); }
.searchbox__input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
}
.searchbox__input::placeholder { color: var(--text-3); }
.searchbox__kbd {
  flex: none;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(120, 160, 255, .06);
  font-family: inherit;
  font-size: 10.5px;
  color: var(--text-3);
}
.searchbox__clear {
  border: 0;
  background: transparent;
  color: var(--text-3);
  display: grid;
  place-items: center;
  padding: 2px;
}
.searchbox__clear:hover { color: var(--text); }
.searchbox__clear .ico { width: 15px; height: 15px; }

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: transparent;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .16s, border-color .16s, transform .12s, box-shadow .16s;
}
.btn:active { transform: translateY(1px); }
.btn .ico { width: 17px; height: 17px; }

.btn--primary {
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  color: #fff;
  box-shadow: 0 6px 20px rgba(47, 107, 255, .38);
}
.btn--primary:hover { background: linear-gradient(180deg, #5b8fff, #3573ff); }

.btn--ghost {
  border-color: var(--line);
  background: rgba(120, 160, 255, .05);
  color: var(--text-2);
  font-weight: 500;
}
.btn--ghost:hover { background: rgba(120, 160, 255, .11); color: var(--text); }

.btn--danger {
  border-color: rgba(239, 68, 68, .3);
  background: rgba(239, 68, 68, .12);
  color: #ff8b8b;
}
.btn--danger:hover { background: rgba(239, 68, 68, .2); }

.split-btn { position: relative; display: flex; }
.split-btn .btn--primary { border-radius: var(--r-md) 0 0 var(--r-md); padding-right: 14px; }
.btn--split {
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 0 9px;
  margin-left: 1px;
}
.btn--split .ico { width: 16px; height: 16px; }

/* ── Всплывающие меню ────────────────────────────────────────────────── */

.menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  min-width: 216px;
  padding: 6px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: rgba(12, 19, 42, .97);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-pop);
  animation: pop .14s var(--ease);
}
.menu--floating { position: fixed; top: 0; left: 0; right: auto; }

.menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  text-align: left;
  transition: background .14s, color .14s;
}
.menu__item:hover { background: rgba(120, 160, 255, .1); color: var(--text); }
.menu__item .ico { width: 16px; height: 16px; color: var(--text-3); }
.menu__item:hover .ico { color: var(--accent-hi); }
.menu__item--danger:hover { background: rgba(239, 68, 68, .14); color: #ff9b9b; }
.menu__item--danger:hover .ico { color: #ff9b9b; }
.menu__sep { height: 1px; margin: 5px 8px; background: var(--line); }

@keyframes pop {
  from { opacity: 0; transform: translateY(-6px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

/* ── Рабочая область ─────────────────────────────────────────────────── */

.workspace {
  flex: 1;
  min-height: 0;
  display: flex;
}

/* ── Боковая панель ──────────────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-w);
  flex: none;
  display: flex;
  flex-direction: column;
  padding: 16px 18px 16px 22px;
  border-right: 1px solid var(--line-soft);
  overflow: hidden;
  transition: width .28s var(--ease), padding .28s var(--ease), opacity .2s;
}
.app.sidebar-hidden .sidebar {
  width: 0;
  padding-left: 0;
  padding-right: 0;
  opacity: 0;
  pointer-events: none;
}
.app.sidebar-hidden .topbar { grid-template-columns: auto minmax(0, 1fr) auto; }

.sidebar__divider {
  height: 1px;
  margin: 14px 2px 4px;
  background: var(--line-soft);
}

/* Календарь */
.calendar { flex: none; }

.calendar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.calendar__title {
  border: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  transition: background .16s;
}
.calendar__title:hover { background: rgba(120, 160, 255, .1); }

.calendar__weekdays,
.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar__weekdays {
  margin-bottom: 4px;
}
.calendar__weekdays span {
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
}

.calendar__grid { row-gap: 2px; }

.day {
  position: relative;
  height: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  background: transparent;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 12.5px;
  transition: background .15s, color .15s;
}
.day:hover { background: rgba(120, 160, 255, .1); color: var(--text); }
.day--muted { color: var(--text-3); opacity: .5; }
.day--today > .day__num {
  color: var(--accent-hi);
  font-weight: 700;
}
.day--selected {
  background: linear-gradient(160deg, var(--accent-hi), var(--accent-lo));
  color: #fff;
  box-shadow: 0 4px 14px rgba(47, 107, 255, .45);
}
.day--selected:hover { background: linear-gradient(160deg, #5b8fff, #2258e0); color: #fff; }
.day--selected > .day__num { color: #fff; font-weight: 600; }

.day__num { line-height: 1; }
.day__dots { display: flex; gap: 2px; height: 4px; align-items: center; }
.day__dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.day--selected .day__dot { background: rgba(255, 255, 255, .9); }

/* Расписание */
.agenda {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0 -6px;
  padding: 0 6px;
  overflow-y: auto;
}

.agenda__group { padding: 10px 0 2px; }

.agenda__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px 8px;
}
.agenda__bullet {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(47, 107, 255, .8);
}
.agenda__title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agenda__group--today .agenda__title { color: #cddaff; }
.agenda__count {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-3);
}

.agenda__item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 6px 6px 6px 4px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  text-align: left;
  transition: background .14s;
}
.agenda__item:hover { background: rgba(120, 160, 255, .07); }
.agenda__item:hover .agenda__del { opacity: 1; }

.agenda__time {
  width: 38px;
  flex: none;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
}
.agenda__name {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agenda__item--done .agenda__name { color: var(--text-3); text-decoration: line-through; }
.agenda__dot { width: 7px; height: 7px; flex: none; border-radius: 50%; }
.agenda__del {
  flex: none;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-3);
  opacity: 0;
  transition: opacity .14s, color .14s, background .14s;
}
.agenda__del:hover { background: rgba(239, 68, 68, .16); color: #ff8b8b; }
.agenda__del .ico { width: 13px; height: 13px; }

/* Чекбокс */
.check {
  width: 16px;
  height: 16px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1.5px solid rgba(130, 160, 230, .38);
  border-radius: 5px;
  background: transparent;
  color: transparent;
  transition: background .15s, border-color .15s, color .15s, transform .12s;
}
.check:hover { border-color: var(--accent-hi); }
.check:active { transform: scale(.88); }
.check .ico { width: 11px; height: 11px; stroke-width: 3.2; }
.check--on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.show-more {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(120, 160, 255, .04);
  color: var(--text-2);
  font-size: 13px;
  transition: background .16s, color .16s, border-color .16s;
}
.show-more:hover { background: rgba(120, 160, 255, .1); color: var(--text); border-color: var(--line-2); }
.show-more .ico { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.show-more.is-open .ico { transform: rotate(180deg); }

/* ── Доска ───────────────────────────────────────────────────────────── */

.board {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 16px;
  padding: 16px 22px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
}

.column {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 306px;
  max-width: 460px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: var(--panel);
  scroll-snap-align: start;
  transition: background .18s, border-color .18s;
}
.column.is-over {
  border-color: rgba(72, 128, 255, .45);
  background: rgba(20, 34, 74, .55);
}

.column__head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 15px 16px 13px;
}
.column__title {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.column__count {
  flex: none;
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 7px;
  background: rgba(120, 160, 255, .1);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  color: var(--text-2);
}
.column__head .icon-btn { margin-left: auto; width: 28px; height: 28px; }
.column__head .icon-btn .ico { width: 16px; height: 16px; }

.column__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 2px 12px 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.column__add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 8px 12px 12px;
  padding: 11px;
  border: 1px dashed transparent;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  transition: background .16s, color .16s, border-color .16s;
}
.column__add:hover {
  background: rgba(120, 160, 255, .07);
  border-color: var(--line);
  color: var(--accent-hi);
}
.column__add .ico { width: 16px; height: 16px; }

/* ── Карточка задачи ─────────────────────────────────────────────────── */

.card {
  position: relative;
  padding: 14px 15px 14px 17px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--shadow-card);
  cursor: grab;
  transition: background .16s, border-color .16s, transform .16s var(--ease), box-shadow .16s;
}
.card:hover {
  background: var(--card-hover);
  border-color: var(--line-2);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .42);
}
.card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent-color, var(--c-blue));
  box-shadow: 0 0 12px -2px var(--accent-color, var(--c-blue));
}
.card.dragging { opacity: .35; cursor: grabbing; }
.card:hover .card__menu { opacity: 1; }

.card__top { display: flex; align-items: flex-start; gap: 8px; }

.card__badge {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: var(--text-3);
}
.card__badge .ico { width: 16px; height: 16px; }

.card__title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -.005em;
  color: var(--text);
  overflow-wrap: anywhere;
}

.card__done {
  flex: none;
  width: 20px;
  height: 20px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--c-green);
  filter: drop-shadow(0 0 6px rgba(34, 197, 94, .5));
  transition: transform .14s;
}
.card__done:hover { transform: scale(1.12); }
.card__done .ico { width: 20px; height: 20px; stroke-width: 2; }

.card__menu {
  flex: none;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-3);
  opacity: 0;
  transition: opacity .14s, background .14s, color .14s;
}
.card__menu:hover { background: rgba(120, 160, 255, .12); color: var(--text); }
.card__menu .ico { width: 15px; height: 15px; }

.card__desc {
  margin: 7px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 11px;
  flex-wrap: wrap;
}
.card__date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
}
.card__date .ico { width: 14px; height: 14px; color: var(--text-3); }
.card__date--overdue { color: #ff9b9b; }
.card__date--overdue .ico { color: #ff9b9b; }

.chip {
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  background: var(--chip-bg, rgba(59, 130, 246, .14));
  color: var(--chip-fg, #93b4ff);
}

.card__checks {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 11px;
}
.subrow {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 3px 0;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
}
.subrow__label {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text-2);
  overflow-wrap: anywhere;
  transition: color .15s;
}
.subrow:hover .subrow__label { color: var(--text); }
.subrow--done .subrow__label { color: var(--text-3); }

/* Плейсхолдер при перетаскивании */
.drop-line {
  height: 2px;
  margin: -6px 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-hi), transparent);
  box-shadow: 0 0 10px rgba(75, 131, 255, .8);
}

/* Пустые состояния */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 30px 16px;
  color: var(--text-3);
  text-align: center;
  font-size: 12.5px;
}
.empty .ico { width: 26px; height: 26px; opacity: .6; }

.board__empty {
  margin: auto;
  text-align: center;
  color: var(--text-3);
}

/* Скелетон загрузки */
.skeleton {
  height: 120px;
  border-radius: var(--r-md);
  background: linear-gradient(100deg, rgba(255, 255, 255, .03) 30%, rgba(255, 255, 255, .07) 50%, rgba(255, 255, 255, .03) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.3s infinite linear;
}
@keyframes shimmer {
  from { background-position: 160% 0; }
  to   { background-position: -60% 0; }
}

/* ── Модальное окно ──────────────────────────────────────────────────── */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 5, 14, .68);
  backdrop-filter: blur(6px);
  animation: fade .16s var(--ease);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%;
  max-width: 620px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-2);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(16, 25, 52, .98), rgba(10, 17, 38, .98));
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  animation: rise .2s var(--ease);
}
.modal--sm { max-width: 420px; }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

.modal__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.modal__title { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.modal__head .icon-btn { margin-left: auto; }

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

.modal__foot {
  display: flex;
  gap: 10px;
  padding: 15px 20px;
  border-top: 1px solid var(--line-soft);
}
.modal__foot .spacer { flex: 1; }

.modal__text { font-size: 13.5px; line-height: 1.6; color: var(--text-2); }

/* Форма */
.field { display: flex; flex-direction: column; gap: 7px; }
.field__label { font-size: 12px; font-weight: 500; color: var(--text-2); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.input, .textarea, .select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(8, 14, 32, .8);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  outline: 0;
  transition: border-color .16s, box-shadow .16s;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: rgba(72, 128, 255, .6);
  box-shadow: 0 0 0 3px rgba(47, 107, 255, .12);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.textarea { resize: vertical; min-height: 78px; line-height: 1.55; }
.select { appearance: none; cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b789f' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 15px;
}
.select option { background: #0d1530; color: var(--text); }

/* Переключатель приоритета */
.priority { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.priority__opt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(8, 14, 32, .6);
  color: var(--text-2);
  font-size: 12.5px;
  transition: border-color .16s, background .16s, color .16s;
}
.priority__opt i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot);
  box-shadow: 0 0 8px -1px var(--dot);
}
.priority__opt:hover { background: rgba(120, 160, 255, .08); color: var(--text); }
.priority__opt.is-active {
  border-color: rgba(72, 128, 255, .5);
  background: var(--accent-soft);
  color: var(--text);
}

/* Редактор подзадач */
.subtasks { display: flex; flex-direction: column; gap: 6px; }
.subtask-edit {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: rgba(8, 14, 32, .55);
}
.subtask-edit:focus-within { border-color: var(--line-2); }
.subtask-edit__input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.subtask-edit--done .subtask-edit__input { color: var(--text-3); }
.subtask-edit__del {
  flex: none;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-3);
  transition: background .14s, color .14s;
}
.subtask-edit__del:hover { background: rgba(239, 68, 68, .16); color: #ff8b8b; }
.subtask-edit__del .ico { width: 14px; height: 14px; }

.subtask-add {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px;
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
  font-size: 12.5px;
  justify-content: center;
  transition: background .14s, color .14s;
}
.subtask-add:hover { background: rgba(120, 160, 255, .08); color: var(--accent-hi); }
.subtask-add .ico { width: 15px; height: 15px; }

/* ── Уведомления ─────────────────────────────────────────────────────── */

.toasts {
  position: fixed;
  right: 26px;
  bottom: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 230px;
  max-width: 360px;
  padding: 12px 15px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: rgba(14, 22, 48, .97);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-pop);
  font-size: 13px;
  color: var(--text);
  pointer-events: auto;
  animation: toast-in .22s var(--ease);
}
.toast.is-out { animation: toast-out .2s var(--ease) forwards; }
.toast__dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--accent); }
.toast--ok .toast__dot { background: var(--c-green); box-shadow: 0 0 10px rgba(34, 197, 94, .8); }
.toast--err .toast__dot { background: var(--c-red); box-shadow: 0 0 10px rgba(239, 68, 68, .8); }
.toast__undo {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--accent-hi);
  font-size: 12.5px;
  font-weight: 600;
}
.toast__undo:hover { text-decoration: underline; }

@keyframes toast-in  { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }

/* ── Утилиты цветов ──────────────────────────────────────────────────── */

.c-blue   { --dot: var(--c-blue); }
.c-indigo { --dot: var(--c-indigo); }
.c-purple { --dot: var(--c-purple); }
.c-green  { --dot: var(--c-green); }
.c-amber  { --dot: var(--c-amber); }
.c-cyan   { --dot: var(--c-cyan); }
.c-red    { --dot: var(--c-red); }

[hidden] { display: none !important; }

/* ── Адаптив ─────────────────────────────────────────────────────────── */

@media (max-width: 1180px) {
  .searchbox__kbd { display: none; }
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto; }
}

@media (max-width: 980px) {
  .page { padding: 0; }
  .app { border: 0; border-radius: 0; }
  .sidebar {
    position: absolute;
    z-index: 50;
    top: 73px;
    bottom: 0;
    left: 0;
    background: rgba(7, 12, 30, .98);
    backdrop-filter: blur(24px);
    box-shadow: var(--shadow-pop);
  }
  .app:not(.sidebar-hidden) .sidebar { width: var(--sidebar-w); }
  .board { padding: 14px; }
  .column { min-width: 84vw; }
  .brand-title { display: none; }
}

@media (max-width: 560px) {
  .topbar { gap: 10px; padding: 12px 14px; }
  .btn--primary span { display: none; }
  .split-btn .btn--primary { padding: 0 12px; }
  .row { grid-template-columns: 1fr; }
  .priority { grid-template-columns: repeat(2, 1fr); }
  .toasts { right: 14px; left: 14px; bottom: 14px; }
}
