/* ===== Доска БТР — дизайн-токены (спокойный минимализм, Linear/Notion) ===== */

:root {
  --bg: #f6f6f8;
  --sidebar-bg: #fbfbfc;
  --surface-alt: #f4f5f9;   /* шапки блоков проектов */
  --text: #17181c;
  --muted: #5a5c64;
  --muted-2: #7a7c84;
  --muted-3: #9b9da3;
  --muted-4: #7a7c84;
  --muted-5: #b4b6bd;
  --panel: #ffffff;
  --line: #e9e9ee;
  --line-2: #f0f0f3;
  --line-3: #f0f0f3;
  --line-4: #e2e2e8;
  --line-5: #e2e2e8;
  --line-6: #d5d6dc;
  --line-7: #f5f5f8;
  --accent: #4a5fcb;
  --accent-strong: #3d51b8;
  --accent-text: #4a5fcb;
  --chip-blue-bg: #edeffb;
  --col-bg: #efeff2;

  --prio-high: #d64545;
  --prio-med: #d9822b;
  --prio-low: #8b8d95;
  --prio-quick: #7c5cd6;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d5d6dc; border-radius: 999px; }

.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ===== боковое меню ===== */

.app { display: flex; align-items: flex-start; min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 232px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  z-index: 70;
}
.sidebar .brand { display: flex; align-items: center; font-weight: 750; font-size: 15px; padding: 4px 8px 20px; }
.brand-logo { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: #fff; font-weight: 800; font-size: 14px; margin-right: 9px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 8px 11px;
  border-radius: 8px;
}
.nav-item .nav-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-5); flex-shrink: 0; }
.nav-item .nav-label { flex: 1; }
.nav-item .nav-count { font-size: 11px; font-weight: 700; color: var(--muted-3); font-variant-numeric: tabular-nums; }
.nav-item:hover { background: #f0f0f4; color: var(--text); }
.nav-item.active { background: var(--chip-blue-bg); color: var(--accent); font-weight: 650; }
.nav-item.active .nav-dot { background: var(--accent); }
.nav-item.active .nav-count { color: var(--accent); }
.side-user {
  margin-top: auto;
  padding: 14px 6px 2px;
  border-top: 1px solid var(--line-3);
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--chip-blue-bg);
  color: var(--accent);
  font-size: 11px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-name { font-size: 14px; font-weight: 600; background: none; border: none; cursor: pointer; color: var(--text); font-family: inherit; }
.logout { font-size: 13px; color: var(--muted-3); background: none; border: none; cursor: pointer; font-family: inherit; }
.nav-toggle { display: none; }
.nav-backdrop { display: none; }

.content { flex: 1; min-width: 0; }

/* ===== контейнер ===== */

.container {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 28px) clamp(16px, 4vw, 28px) 64px;
}

h1.screen-title { font-size: clamp(24px, 4vw, 32px); font-weight: 800; line-height: 1.05; letter-spacing: -0.01em; margin: 0; }
.screen-sub { font-size: 14px; color: var(--muted); font-weight: 500; margin-top: 7px; }
.overline { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); font-weight: 700; }

/* ===== чипы ===== */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 8px;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.chip.project .dot { width: 6px; height: 6px; }
.chip.tag { background: var(--line-3); color: var(--muted-2); }
.chip.deadline { background: var(--chip-blue-bg); color: var(--accent-text); }
.chip.deadline.overdue { background: #fbecec; color: #d64545; }
.chip.cat { color: #fff; font-weight: 700; }
.chip.project { background: var(--line-3); color: var(--muted-2); }

/* приоритет: текст = цвет приоритета, фон = тот же цвет с альфой ~10% */
.prio-high { background: #d6454516; color: #d64545; }
.prio-med { background: #d9822b16; color: #d9822b; }
.prio-low { background: #8b8d9518; color: #7a7c84; }
.prio-quick { background: #7c5cd616; color: #7c5cd6; }
.dot-high { background: var(--prio-high); }
.dot-med { background: var(--prio-med); }
.dot-low { background: var(--prio-low); }
.dot-quick { background: var(--prio-quick); }

/* ===== кнопки ===== */

.btn {
  border: none; border-radius: 12px; cursor: pointer; font-family: inherit;
  font-size: 15px; font-weight: 700; padding: 13px 18px;
  background: var(--accent); color: #fff;
}
.btn.outline { border: 1px solid var(--line-5); background: #fff; color: #46566f; font-weight: 600; }
.btn.add { background: var(--accent-strong); padding: 0 26px; }
.btn:disabled { opacity: 0.5; cursor: default; }

/* ===== Мой день ===== */

.myday-cols { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; margin-top: 8px; }
.myday-left { flex: 1 1 440px; min-width: 0; }
.myday-right { flex: 1 1 270px; max-width: 340px; min-width: 0; }
.myday-left .overline { display: block; margin: 20px 0 12px; }

.hero {
  background: var(--panel);
  border-radius: 20px;
  padding: clamp(20px, 4vw, 28px) clamp(20px, 4vw, 26px);
  border: 1px solid var(--line-2);
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 20px 44px -22px rgba(20,50,110,.32);
}
.hero-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.hero-title { font-size: clamp(22px, 4vw, 28px); font-weight: 800; line-height: 1.12; letter-spacing: -0.01em; cursor: pointer; }
.hero-progress { display: flex; align-items: center; gap: 14px; margin-top: 20px; }
.track { flex: 1; height: 10px; background: #e9eef6; border-radius: 999px; overflow: hidden; }
.track > div { height: 100%; background: var(--accent); border-radius: 999px; }
.hero-progress .pct { font-size: 14px; font-weight: 800; color: var(--accent); }
.hero-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.hero-actions .btn:first-child { flex: 1; min-width: 160px; padding: 13px; }

.hero-empty {
  background: var(--panel); border-radius: 20px; padding: 34px; text-align: center;
  border: 1px dashed var(--line-6);
}
.hero-empty h3 { font-size: 18px; font-weight: 700; margin: 0 0 6px; }
.hero-empty p { font-size: 14px; color: var(--muted); margin: 0; }

/* простой список дел на сегодня — строки-карточки с цветной меткой приоритета слева */
.today-list { display: flex; flex-direction: column; gap: 8px; }
.td-row { display: flex; align-items: center; gap: 12px; padding: 13px 15px; background: #eef0fb; border: 1px solid #dfe3f6; border-left: 3px solid var(--line-6); border-radius: 10px; }
.td-body { flex: 1; min-width: 0; }
.td-title { font-size: 15px; font-weight: 600; line-height: 1.3; cursor: pointer; }
.td-row.done .td-title { color: var(--muted-3); text-decoration: line-through; }
.td-chips { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.td-chips:empty { display: none; }
.td-defer { flex-shrink: 0; border: none; background: none; color: var(--muted-3); font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; }
.td-defer:hover { color: var(--text); }

/* «С чего начать» — предложение задач, когда на сегодня ничего не выбрано */
.suggest { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 4px 18px 10px; box-shadow: 0 1px 3px rgba(20,20,40,.04); }
.suggest-head { font-size: 13px; font-weight: 700; color: var(--muted); padding: 13px 0 4px; }
.sg-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line-2); }
.sg-body { flex: 1; min-width: 0; }
.sg-title { font-size: 15px; font-weight: 600; line-height: 1.3; cursor: pointer; }
.sg-chips { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.sg-take { flex-shrink: 0; border: 1px solid #cfd3ee; background: var(--chip-blue-bg); color: var(--accent); font-size: 12px; font-weight: 700; padding: 7px 14px; border-radius: 9px; cursor: pointer; font-family: inherit; }
.sg-take:hover { filter: brightness(0.97); }

.list-head { display: flex; justify-content: space-between; align-items: center; margin: 28px 2px 12px; }
.list-head .ttl { font-size: 14px; font-weight: 700; }
.list-head .cnt { font-size: 12px; font-weight: 700; color: var(--muted-2); }
.list-sub { font-size: 13px; color: var(--muted-2); margin: 0 2px 12px; }

.row-task {
  display: flex; align-items: center; gap: 13px;
  background: var(--panel); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px;
  border: 1px solid var(--line-3); box-shadow: 0 1px 2px rgba(0,0,0,.04);
  cursor: pointer;
}
.row-task .r-title { font-size: 15px; font-weight: 600; }
.row-task.done .r-title { color: var(--muted-3); text-decoration: line-through; }
.row-task .spacer { flex: 1; }
.row-task .r-deadline { font-size: 12px; font-weight: 700; color: var(--accent-text); white-space: nowrap; }
.row-task .r-prio { font-size: 12px; font-weight: 700; color: var(--muted-2); }

.checkbox {
  width: 19px; height: 19px; border-radius: 50%; cursor: pointer; flex-shrink: 0;
  border: 2px solid var(--line-6); background: #fff; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff;
}
.checkbox.checked { border: none; background: var(--accent); }

.week-link { margin-top: 20px; font-size: 14px; color: var(--muted-2); font-weight: 600; background: none; border: none; cursor: pointer; font-family: inherit; }

/* правая колонка */
.mini-card { background: var(--panel); border-radius: 18px; padding: 20px; border: 1px solid var(--line-2); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.mini-card + .mini-card { margin-top: 16px; }
.mini-card .overline { display: block; }
.numbers-row { display: flex; align-items: center; gap: 18px; margin-top: 14px; }
.ring-wrap { position: relative; width: 72px; height: 72px; flex-shrink: 0; }
.ring-wrap .ring-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 800; }
.numbers-list { flex: 1; display: flex; flex-direction: column; gap: 9px; }
.numbers-list .nr { display: flex; justify-content: space-between; align-items: center; }
.numbers-list .nr .lab { font-size: 13px; font-weight: 600; color: var(--muted); }
.numbers-list .nr .val { font-size: 15px; font-weight: 800; }

.week-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.week-all { font-size: 12px; font-weight: 700; color: var(--accent); background: none; border: none; cursor: pointer; font-family: inherit; }
.week-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line-7); }
.week-row .nm { font-size: 14px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-row .dy { font-size: 12px; font-weight: 700; color: var(--muted-2); }

/* ===== Фокус недели ===== */

.filters { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.filters label { font-size: 13px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
select {
  font-size: 14px; font-weight: 600; color: var(--text); padding: 8px 12px;
  border: 1px solid var(--line-5); border-radius: 10px; background: #fff; font-family: inherit;
}

.week-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.week-nav > span { font-weight: 700; font-size: 15px; min-width: 150px; }
.week-nav button { border: none; background: var(--line-7); border-radius: 8px; height: 32px; cursor: pointer; font-family: inherit; color: var(--muted); font-size: 15px; }
.week-nav #week-prev, .week-nav #week-next { width: 32px; font-size: 17px; }
.week-nav #week-today { padding: 0 14px; font-size: 13px; font-weight: 600; }
.week-nav button:hover { background: var(--line-6); color: var(--text); }
.week-legend { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.week-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.week-legend i { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.week-legend .lg-high { background: var(--prio-high); }
.week-legend .lg-med { background: var(--prio-med); }
.week-legend .lg-low { background: var(--prio-low); }
.week-legend .lg-quick { background: var(--prio-quick); }
/* чипы-фильтры приоритетов недели (клик прячет карточки этого приоритета) */
.prio-filter { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-4); background: #fff; color: var(--muted-3); cursor: pointer; font-family: inherit; }
.prio-filter i { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; opacity: .35; }
.prio-filter.active i { opacity: 1; }
.prio-filter.active[data-prio="high"] { color: var(--prio-high); border-color: #d6454540; background: #d6454516; }
.prio-filter.active[data-prio="med"] { color: var(--prio-med); border-color: #d9822b40; background: #d9822b16; }
.prio-filter.active[data-prio="low"] { color: #7a7c84; border-color: #8b8d9540; background: #8b8d9518; }
.prio-filter.active[data-prio="quick"] { color: var(--prio-quick); border-color: #7c5cd640; background: #7c5cd616; }

/* миниатюрные карточки на доске недели */
.kanban-card.mini { position: relative; padding: 10px 11px; }
.kanban-card.mini .kc-title { font-size: 13px; font-weight: 700; line-height: 1.25; padding-right: 14px; }
.kanban-card.mini .kc-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.kanban-card.mini .kc-meta:empty { display: none; }
.kanban-card.mini .chip { font-size: 11px; padding: 2px 8px; gap: 5px; }
.kanban-card.mini .mini-avatar { width: 18px; height: 18px; font-size: 8px; }
.kanban-card.mini .lbl-more { font-size: 11px; font-weight: 700; color: var(--muted-3); }
.kc-x {
  position: absolute; top: 5px; right: 6px;
  border: none; background: none; cursor: pointer;
  color: var(--muted-3); font-size: 11px; padding: 2px 4px; line-height: 1;
  opacity: 0; transition: opacity 0.15s;
}
.kanban-card.mini:hover .kc-x { opacity: 1; }
.kc-x:hover { color: #cc3a2f; }
.week-board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.day-col.col-today { outline: 2px solid var(--accent); outline-offset: -2px; }
.day-col.col-today h3 { color: var(--accent); }

/* метки: чипы + автокомплит */
.lbl-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.lbl-chip { padding-right: 6px; }
.lbl-x { border: none; background: none; cursor: pointer; color: currentColor; opacity: 0.6; font-size: 11px; padding: 0 0 0 4px; }
.lbl-x:hover { opacity: 1; }
.lbl-input-wrap { position: relative; }
#m-label-input { width: 100%; padding: 10px 12px; font-size: 15px; border: 1px solid var(--line-5); border-radius: 10px; font-family: inherit; color: var(--text); }
.lbl-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 10;
  background: #fff; border: 1px solid var(--line-3); border-radius: 10px; padding: 4px;
  box-shadow: 0 10px 30px rgba(20,40,90,.16); max-height: 240px; overflow-y: auto;
}
.lbl-suggest button {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  border: none; background: none; cursor: pointer; font-family: inherit; font-size: 14px;
  padding: 8px 10px; border-radius: 8px; color: var(--text);
}
.lbl-suggest button:hover { background: var(--line-7); }
.lbl-suggest .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.lbl-suggest .sug-stream { margin-left: auto; font-size: 12px; color: var(--muted-3); }

/* нижний ряд: компактный календарь + дедлайны рядом */
.week-bottom { display: flex; gap: 20px; align-items: flex-start; margin-top: 8px; }
.week-cal { flex: 0 0 340px; background: #fff; border: 1px solid var(--line-3); border-radius: 16px; padding: 16px; }
.week-side { flex: 1; min-width: 0; background: #fff; border: 1px solid var(--line-3); border-radius: 16px; padding: 16px; align-self: stretch; }
.week-side .cal-deadlines { margin-top: 0; border-top: none; padding-top: 0; }

/* десктоп: экран недели во всю высоту — доска 2/3, низ (календарь+дедлайны) 1/3 */
@media (min-width: 861px) {
  #screen-week { display: flex; flex-direction: column; height: calc(100vh - 90px); }
  #screen-week .filters,
  #screen-week .week-nav,
  #screen-week .board-note { flex-shrink: 0; }
  #screen-week .board-note { margin: 8px 0; }
  #screen-week .week-board { flex: 2 1 0; min-height: 0; }
  #screen-week .day-col { min-height: 0; height: 100%; overflow-y: auto; }
  #screen-week .week-bottom { flex: 1 1 0; min-height: 0; margin-top: 0; overflow: hidden; }
  #screen-week .week-cal,
  #screen-week .week-side { max-height: 100%; overflow-y: auto; }
}
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-head span { font-weight: 700; font-size: 15px; text-transform: capitalize; }
.cal-head button {
  border: none; background: var(--line-7); border-radius: 8px; width: 30px; height: 30px;
  cursor: pointer; font-size: 17px; color: var(--muted); line-height: 1; font-family: inherit;
}
.cal-head button:hover { background: var(--line-6); color: var(--text); }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 4px; }
.cal-weekdays span { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted-3); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-cell {
  min-height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; border-radius: 8px; cursor: pointer;
  position: relative; color: var(--text);
}
.cal-cell.other { color: var(--muted-3); }
.cal-cell:hover { background: var(--line-7); }
.cal-cell.today { color: var(--accent); font-weight: 800; outline: 1.5px solid var(--accent); }
.cal-cell.selected { background: var(--accent); color: #fff; outline: none; }
.cal-cell .cdot { position: absolute; bottom: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.cal-cell.overdue .cdot { background: #ec3b30; }
.cal-cell.selected .cdot { background: #fff; }
.cal-deadlines { margin-top: 14px; border-top: 1px solid var(--line-3); padding-top: 12px; }
.cal-deadlines h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-2); font-weight: 800; margin: 0 0 8px; }
.cal-empty { font-size: 13px; color: var(--muted-3); }
.cal-dl { display: flex; gap: 9px; padding: 8px 0; cursor: pointer; border-top: 1px solid var(--line-7); }
.cal-dl:first-of-type { border-top: none; }
.cal-dl:hover .cdl-title { color: var(--accent); }
.cal-dl .cdl-date { font-size: 12px; font-weight: 700; color: var(--accent-text); min-width: 46px; white-space: nowrap; }
.cal-dl.overdue .cdl-date { color: #cc3a2f; }
.cal-dl .cdl-title { font-size: 13px; line-height: 1.3; }
.day-col { flex: 1 0 210px; min-width: 210px; background: var(--col-bg); border-radius: 14px; padding: 12px; min-height: 240px; }
.day-col.drag-over { outline: 2px dashed var(--accent); outline-offset: -2px; }
.day-col h3 { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-4); font-weight: 800; margin: 4px 4px 12px; }
.col-add { width: 100%; margin-top: 4px; padding: 7px; border: 1px dashed var(--line-5); background: none; border-radius: 9px; color: var(--muted-3); font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.col-add:hover { border-color: var(--accent); color: var(--accent); background: #f2f6fe; }
.col-add-form { margin-top: 4px; }
.col-add-input { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--accent); border-radius: 9px; font-family: inherit; font-size: 13px; background: #fff; color: var(--text); }

.kanban-card {
  background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 10px;
  border-left: 4px solid var(--line-6);
  box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 18px -12px rgba(20,50,110,.3);
  cursor: grab;
}
.kanban-card.dragging { opacity: 0.5; }
.kanban-card .kc-title { font-size: 15px; font-weight: 700; line-height: 1.25; }
.kc-assignee { display: flex; align-items: center; gap: 7px; margin-top: 10px; flex-wrap: wrap; }
.mini-avatar { width: 20px; height: 20px; border-radius: 50%; background: var(--chip-blue-bg); color: var(--accent); font-size: 9px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.kc-assignee .nm { font-size: 12px; font-weight: 600; color: var(--muted); }
.kc-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.btn-back { margin-top: 12px; border: 1px solid var(--line-4); background: #f7f9fc; color: var(--muted); font-size: 12px; font-weight: 700; padding: 6px 11px; border-radius: 8px; cursor: pointer; font-family: inherit; }
.board-note { text-align: center; font-size: 13px; color: var(--muted-2); margin-top: 16px; }

/* ===== Бэклог / Идеи общее ===== */

.add-row { display: flex; gap: 12px; margin-bottom: 14px; }
.add-row input {
  flex: 1; min-width: 0; font-size: 15px; padding: 14px 16px;
  border: 1px solid var(--line-5); border-radius: 12px; background: #fff; font-family: inherit; color: var(--text);
}
input::placeholder { color: var(--muted-3); }
.day-add { margin-top: 6px; margin-bottom: 20px; max-width: 640px; }
.day-add input { padding: 12px 15px; font-size: 14px; }
.search {
  width: 100%; font-size: 14px; padding: 11px 15px; margin-bottom: 14px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; font-family: inherit;
}
.add-cat {
  font-size: 14px; font-weight: 600; color: var(--text); padding: 0 12px;
  border: 1px solid var(--line-5); border-radius: 12px; background: #fff; font-family: inherit;
  flex-shrink: 0; max-width: 190px;
}

/* статистика */
.stats-summary { font-size: 14px; color: var(--muted); font-weight: 600; margin: 6px 0 18px; }
.stat-row { margin-bottom: 16px; }
.stat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.stat-person { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text); }
.stat-nums { font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.stat-bar { height: 10px; background: var(--line-7); border-radius: 999px; overflow: hidden; }
.stat-bar > div { height: 100%; border-radius: 999px; min-width: 3px; transition: width 0.3s; }

.seg { display: inline-flex; background: var(--col-bg); border-radius: 10px; padding: 3px; }
.seg-btn { border: none; background: transparent; cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--muted); padding: 7px 14px; border-radius: 8px; }
.seg-btn.active { font-weight: 700; color: var(--text); background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.group { margin-bottom: 22px; }
.group > h3 { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2); font-weight: 800; margin: 0 0 10px; }
.group.drag-over { outline: 2px dashed var(--accent); outline-offset: 6px; border-radius: 14px; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px; }

.task-card {
  display: flex; align-items: flex-start; gap: 11px; background: #fff;
  border-radius: 12px; padding: 11px 13px; border: 1px solid var(--line-3);
  box-shadow: 0 1px 2px rgba(0,0,0,.04); cursor: grab;
}
.task-card .tc-body { flex: 1; min-width: 0; }
.tc-title { font-size: 14px; font-weight: 600; line-height: 1.3; cursor: pointer; }
.tc-title.done { color: var(--muted-3); text-decoration: line-through; }
.tc-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.task-card .chip { font-size: 11px; padding: 3px 8px; gap: 5px; }
.btn-today { border: 1px solid #cfe0fb; background: #f2f6fe; color: var(--accent); font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 8px; cursor: pointer; font-family: inherit; }
.board-note.center { text-align: center; }

/* По проектам — лёгкие панели */
.proj-panel { background: #fff; border: 1px solid var(--line-3); border-radius: 14px; padding: 4px 18px 10px; margin-bottom: 14px; }
.proj-head { display: flex; align-items: center; gap: 9px; padding: 13px 0 11px; flex-wrap: wrap; }
.proj-head .pdot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.proj-head .pname { font-size: 15px; font-weight: 800; letter-spacing: -0.005em; }
.proj-head .pcount { font-size: 13px; font-weight: 700; color: var(--muted-5); }
.proj-head .spacer { flex: 1; }
.proj-head .pstream { font-size: 13px; font-weight: 600; color: var(--muted); }
.proj-row { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-top: 1px solid var(--line-7); cursor: grab; }
.proj-row .pr-title { font-size: 16px; font-weight: 600; line-height: 1.3; flex: 1; cursor: pointer; }
.proj-row .pr-title.done { color: var(--muted-3); text-decoration: line-through; }
.proj-row .pr-deadline { font-size: 12px; font-weight: 700; color: var(--accent-text); white-space: nowrap; }
.proj-row .pr-prio { font-size: 12px; font-weight: 700; color: var(--muted-3); min-width: 52px; text-align: right; }
.proj-row .pr-today { border: none; background: none; color: var(--accent); font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit; }

/* ===== Светофор проектов ===== */

.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.dash-head .btn.add { padding: 9px 16px; font-size: 14px; }
.dash-actions { display: flex; gap: 8px; }
.dash-actions .btn.outline { padding: 9px 16px; font-size: 14px; }
.leg-dot { width: 13px; height: 13px; border-radius: 50%; }
.st-green { background: #2e9e6b; }
.st-yellow { background: #d9822b; }
.st-red { background: #d64545; }
.st-white { background: #fff; border: 1px solid #d5d6dc; }

/* переключатель досок + легенда статусов сверху */
#dash-boards { margin-bottom: 12px; }
.status-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 2px 6px; font-size: 12.5px; color: var(--muted-2); }
.status-legend span { display: inline-flex; align-items: center; gap: 6px; }
.status-legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* проект = блок с явной шапкой (фон #F4F5F9), строки стримов ниже */
.proj-block { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; overflow: hidden; box-shadow: 0 1px 3px rgba(20,20,40,.04); }
.proj-block-head { display: flex; align-items: center; gap: 9px; background: var(--surface-alt); padding: 12px 16px; font-size: 17px; font-weight: 750; letter-spacing: -0.01em; border-bottom: 1px solid var(--line); }
.proj-block-head .pb-count { font-size: 13px; font-weight: 700; color: var(--muted-3); font-variant-numeric: tabular-nums; }

/* статус в строке — цветной значок с мягким ореолом (клик открывает выбор) */
.status-dot-btn { width: 13px; height: 13px; border-radius: 50%; border: none; padding: 0; flex-shrink: 0; cursor: pointer; }
.status-dot-btn.st-green { box-shadow: 0 0 0 3px #2e9e6b22; }
.status-dot-btn.st-yellow { box-shadow: 0 0 0 3px #d9822b22; }
.status-dot-btn.st-red { box-shadow: 0 0 0 3px #d6454522; }
.status-dot-btn.st-white { box-shadow: 0 0 0 3px #9b9da322; }

/* смена статуса и добавление задачи в карточке проекта (drawer) */
.drawer-statuspick { margin: 6px 0 14px; }
.status-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 7px; }
.stp-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 6px 11px; border: 1px solid var(--line-5); border-radius: 999px; background: #fff; color: var(--muted); cursor: pointer; font-family: inherit; }
.stp-btn:hover { border-color: var(--accent); }
.stp-btn.active { border-color: var(--accent); background: #f2f6fe; color: var(--accent-text); font-weight: 700; }
.stp-btn .leg-dot { width: 11px; height: 11px; }
.drawer-add { display: flex; gap: 8px; margin-bottom: 16px; }
.drawer-add input { flex: 1; min-width: 0; font-size: 14px; padding: 10px 12px; border: 1px solid var(--line-5); border-radius: 10px; font-family: inherit; background: #fff; color: var(--text); }
.drawer-add .btn.add { padding: 0 16px; }

/* просроченные — заметный блок первым в «Моём дне» */
.overdue-block { background: #fdeceb; border: 1px solid #f6c9c4; border-radius: 14px; padding: 12px 15px; margin-bottom: 16px; }
.overdue-block.hidden { display: none; }
.overdue-block .ov-head { font-size: 13px; font-weight: 800; color: #cc3a2f; letter-spacing: .02em; margin-bottom: 4px; }
.ov-row { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-top: 1px solid #f6d4cf; cursor: pointer; }
.ov-row:first-of-type { border-top: none; }
.ov-row .r-title { font-size: 14px; font-weight: 600; }
.ov-row .spacer { flex: 1; }

/* прогресс дня (goal gradient) */
.day-progress { margin: 2px 0 12px; }
.day-progress.hidden { display: none; }
.dp-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--muted-2); }
.dp-nums { color: var(--accent); }
.dp-bar { height: 8px; background: var(--line-7); border-radius: 999px; overflow: hidden; margin: 6px 0 4px; }
.dp-bar > div { height: 100%; background: linear-gradient(90deg, #2e9e6b, #278a5d); border-radius: 999px; transition: width .4s ease; }
.dp-label { font-size: 12px; color: var(--muted-3); }

/* празднование при закрытии задачи */
.celebrate { position: fixed; left: 50%; top: 42%; transform: translate(-50%,-50%); font-size: 72px; z-index: 200; pointer-events: none; animation: pop-celebrate .9s ease forwards; }
@keyframes pop-celebrate {
  0% { transform: translate(-50%,-50%) scale(.3); opacity: 0; }
  25% { transform: translate(-50%,-50%) scale(1.2); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(-50%,-62%) scale(1); opacity: 0; }
}

/* попап времени — «Пропустить» отдельной заметной кнопкой */
.time-sub { font-size: 13px; color: var(--muted-2); margin: -2px 0 6px; }
.time-skip { width: 100%; margin-top: 4px; padding: 11px; border: 1px solid var(--line-5); background: #fff; border-radius: 10px; font-family: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.time-skip:hover { background: var(--line-7); }

/* подзадачи (чек-лист) */
.check-progress { font-size: 12px; font-weight: 700; color: var(--accent); margin-left: 4px; }
.checklist { display: flex; flex-direction: column; gap: 1px; margin: 6px 0; }
.check-item { display: flex; align-items: center; gap: 9px; padding: 4px 2px; }
.check-item.done .check-text { color: var(--muted-3); text-decoration: line-through; }
.check-box { width: 18px; height: 18px; flex-shrink: 0; border-radius: 5px; border: 2px solid var(--line-5); background: #fff; cursor: pointer; font-size: 11px; font-weight: 800; color: #fff; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.check-box.checked { border: none; background: var(--accent); }
.check-text { flex: 1; font-size: 14px; }
.check-del { border: none; background: none; color: var(--muted-3); cursor: pointer; font-size: 13px; opacity: 0; }
.check-item:hover .check-del { opacity: 1; }
.check-add input { width: 100%; box-sizing: border-box; font-size: 13px; padding: 8px 10px; border: 1px solid var(--line-5); border-radius: 9px; font-family: inherit; background: #fff; color: var(--text); }
.check-chip.full { background: #e6f5ee; color: #2f9e6b; }

/* базовый «+N» для меток на карточках (не только на неделе) */
.lbl-more { font-size: 11px; font-weight: 700; color: var(--muted-3); align-self: center; }
.task-card .mini-avatar { margin-left: 1px; }

/* честность статистики */
.stats-note { font-size: 12.5px; color: #b67408; background: #fdf2e0; border-radius: 8px; padding: 7px 11px; margin: -8px 0 16px; }

/* онбординг-чеклист */
.onboard { background: #eef4ff; border: 1px solid #d3e2fb; border-radius: 14px; padding: 12px 15px; margin-bottom: 16px; }
.onboard.hidden { display: none; }
.ob-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 800; color: var(--accent-text); margin-bottom: 6px; }
.ob-x { border: none; background: none; color: var(--muted-3); cursor: pointer; font-size: 13px; }
.ob-step { display: flex; align-items: center; gap: 9px; padding: 4px 0; font-size: 14px; color: var(--text); }
.ob-step.done { color: var(--muted-3); }
.ob-check { width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--line-5); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: #fff; }
.ob-step.done .ob-check { background: #2e9e6b; border: none; }

/* вчерашняя активность команды */
#yesterday-card .yr-line { font-size: 14px; color: var(--text); margin: 4px 0; }
#yesterday-card .yr-line b { color: var(--accent); }
#yesterday-card .yr-who { font-size: 12.5px; color: var(--muted-3); margin-top: 6px; }
.stream-rows { background: var(--panel); padding: 0 16px; }
.dash-row { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line-2); cursor: pointer; }
.dash-row:first-child { border-top: none; }
.dash-row:hover { background: #fafbfe; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  min-width: 102px;
  flex-shrink: 0;
}
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pill-green { background: #e6f5ee; color: #18794e; }
.pill-green .dot { background: #2e9e6b; }
.pill-yellow { background: #fdf2e0; color: #b67408; }
.pill-yellow .dot { background: #f2b21a; }
.pill-red { background: #fdeceb; color: #cc3a2f; }
.pill-red .dot { background: #ec3b30; }
.pill-white { background: #eef1f6; color: #5b6b82; }
.pill-white .dot { background: #fff; border: 1px solid #b9c4d4; }

.status-dot { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; border: none; padding: 0; display: inline-block; }
.status-dot.st-white { background: #fff; border: 1px solid #cdd8e8; }

.dr-main { flex: 1; min-width: 0; }
.dr-name { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.dr-count { font-size: 11px; font-weight: 700; color: var(--accent); background: var(--chip-blue-bg); border-radius: 999px; padding: 2px 8px; }
.dr-stale { font-size: 11px; font-weight: 700; color: #b4691e; background: #fbf3e4; border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.dr-last { font-size: 13px; color: var(--muted-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-row .dr-lead {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  min-width: 110px;
  max-width: 220px;
  text-align: right;
  cursor: text;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pop {
  position: absolute;
  z-index: 130;
  background: #fff;
  border: 1px solid var(--line-3);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(20, 40, 90, .18);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.status-pop button {
  display: flex;
  align-items: center;
  gap: 9px;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  text-align: left;
  color: var(--text);
  white-space: nowrap;
}
.status-pop button:hover { background: var(--line-7); }
.dash-row .dr-lead:empty::before { content: '—'; color: var(--muted-3); }
.dash-row .dr-del {
  border: none;
  background: none;
  color: var(--muted-3);
  cursor: pointer;
  font-size: 15px;
  padding: 0 2px;
  opacity: 0;
  transition: opacity 0.15s;
}
.dash-row:hover .dr-del { opacity: 1; }
.dash-row .dr-del:hover { color: #cc3a2f; }
.stream-cap { width: 100%; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-3); margin-top: 8px; }
.stream-cap:first-child { margin-top: 0; }
.lead-input { font-family: inherit; font-size: 14px; border: 1px solid var(--accent); border-radius: 6px; padding: 4px 6px; width: 150px; }

/* выезжающая панель */
.drawer-overlay { position: fixed; inset: 0; background: rgba(20,30,45,.4); z-index: 110; display: flex; justify-content: flex-end; }
.drawer { background: var(--bg); width: min(460px, 100%); height: 100%; overflow-y: auto; padding: 22px; box-shadow: -8px 0 30px rgba(20,40,90,.18); }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.drawer-title { font-size: 19px; font-weight: 800; display: flex; align-items: center; gap: 9px; }
.drawer-section h4 { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2); font-weight: 800; margin: 18px 0 8px; }
.drawer-card { background: #fff; border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; border: 1px solid var(--line-3); border-left: 4px solid var(--line-6); cursor: pointer; }
.drawer-card .dc-title { font-size: 15px; font-weight: 600; line-height: 1.3; }
.drawer-card.done .dc-title { color: var(--muted-3); text-decoration: line-through; }
.drawer-card .dc-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* статус-апдейты проекта */
.drawer-status { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.drawer-status textarea {
  padding: 10px 12px; font-size: 14px; border: 1px solid var(--line-5);
  border-radius: 10px; font-family: inherit; color: var(--text); resize: vertical;
}
.drawer-status .btn { align-self: flex-end; padding: 9px 16px; font-size: 14px; }
.upd-item { background: #fff; border-radius: 10px; padding: 10px 12px; margin-bottom: 6px; border: 1px solid var(--line-3); }
.upd-meta { font-size: 12px; color: var(--muted-2); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.upd-del { border: none; background: none; color: var(--muted-3); cursor: pointer; font-size: 12px; margin-left: auto; }
.upd-del:hover { color: #cc3a2f; }
.upd-text { font-size: 14px; line-height: 1.45; margin-top: 4px; white-space: pre-wrap; }

/* попап времени */
.time-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.time-chips button {
  border: 1px solid var(--line-5); background: #fff; border-radius: 10px;
  padding: 10px 14px; font-size: 14px; font-weight: 600; cursor: pointer;
  font-family: inherit; color: var(--text);
}
.time-chips button:hover { border-color: var(--accent); color: var(--accent); }
.time-chips button.skip { color: var(--muted-3); border-style: dashed; }
#summary-text { width: 100%; border: 1px solid var(--line-5); border-radius: 10px; padding: 12px; font-family: inherit; }

/* ===== Идеи ===== */

.ideas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.idea-card { display: flex; align-items: center; gap: 14px; background: #fff; border-radius: 12px; padding: 15px 16px; border: 1px solid var(--line); box-shadow: 0 1px 3px rgba(20,20,40,.04); }
.idea-card .idot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.idea-card .itext { font-size: 15px; font-weight: 600; flex: 1; cursor: pointer; }
.idea-vote { border: 1px solid var(--line-5); background: #fff; border-radius: 9px; padding: 6px 10px; font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit; white-space: nowrap; color: var(--muted); }
.idea-vote.voted { border-color: var(--accent); background: var(--chip-blue-bg); color: var(--accent-text); }
.idea-promote { border: 1px solid #cfe0fb; background: #f2f6fe; color: var(--accent); font-size: 12px; font-weight: 700; padding: 7px 13px; border-radius: 9px; cursor: pointer; font-family: inherit; white-space: nowrap; }

.empty { background: #fff; border-radius: 14px; padding: 34px; text-align: center; color: var(--muted); border: 1px solid var(--line-3); }

/* ===== модалки ===== */

.modal-overlay { position: fixed; inset: 0; background: rgba(23,24,28,.42); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 100; }
.modal { background: #fff; border-radius: 14px; padding: 22px; width: 100%; max-width: 500px; max-height: 92vh; overflow-y: auto; display: flex; flex-direction: column; gap: 13px; box-shadow: 0 20px 60px rgba(20,20,40,.25); }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { margin: 0; font-size: 19px; font-weight: 800; }
.modal label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.modal input, .modal textarea, .modal select { padding: 10px 12px; font-size: 14px; border: 1px solid var(--line-4); border-radius: 8px; background: #fff; color: var(--text); font-family: inherit; }
.modal input:focus, .modal textarea:focus, .modal select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74,95,203,.12); }
.modal .row { display: flex; gap: 12px; }
.modal .row > label { flex: 1; }
.x-btn { border: none; background: none; cursor: pointer; font-size: 18px; color: var(--muted-3); }
.field-name { font-size: 13px; color: var(--muted); font-weight: 600; }

/* модалка карточки — две колонки (контент / свойства) */
.modal.modal-2col { max-width: 820px; padding: 0; gap: 0; }
.modal-2col .modal-head { padding: 15px 20px; border-bottom: 1px solid var(--line); }
.m-crumb { font-size: 13px; font-weight: 700; color: var(--muted-2); }
.m-crumb #m-crumb-proj { color: var(--muted-3); font-weight: 600; }
.modal-body { display: grid; grid-template-columns: 1fr 252px; }
.m-left { padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.m-right { background: var(--sidebar-bg); border-left: 1px solid var(--line); padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 13px; border-radius: 0 0 14px 0; }
.m-title-input { font-size: 19px; font-weight: 700; border: none !important; padding: 4px 2px !important; }
.m-title-input:focus { box-shadow: none !important; }
.m-desc { border: 1px solid transparent !important; background: transparent !important; resize: vertical; padding: 8px 10px !important; }
.m-desc:hover { border-color: var(--line-4) !important; }
.m-desc:focus { border-color: var(--accent) !important; background: #fff !important; }
.m-check-bar { height: 4px; background: var(--line-2); border-radius: 999px; overflow: hidden; margin: 4px 0 8px; }
.m-check-bar.hidden { display: none; }
.m-check-bar > div { height: 100%; background: #2e9e6b; border-radius: 999px; transition: width .3s ease; width: 0; }
.m-left-actions { display: flex; gap: 18px; padding-top: 10px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.btn-text { border: none; background: none; cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--muted); padding: 2px 0; }
.btn-text:hover { color: var(--text); }
.btn-text.danger { color: #d64545; }
.btn-text.hidden { display: none; }
.m-prop { display: flex; flex-direction: column; gap: 5px; }
.m-prop-label { font-size: 11px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted-3); }
.m-prop select, .m-prop input { width: 100%; }
.chips-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.pick { cursor: pointer; }
.pick input { display: none; }
.pick .chip { opacity: 0.45; }
.pick input:checked + .chip { opacity: 1; outline: 2px solid currentColor; }
.modal-actions { display: flex; gap: 8px; margin-top: 4px; }
.modal-actions .btn { flex: 1; }
.btn.danger { background: #fdeceb; color: #cc3a2f; }
.bucket-action { display: flex; gap: 8px; }
.bucket-action .btn { flex: 1; background: #eef2f9; color: var(--text); font-weight: 600; }
.bucket-action select { padding: 10px; border: 1px solid var(--line-5); border-radius: 10px; font-family: inherit; }
.link-code { font-size: 22px; font-weight: 800; letter-spacing: 0.18em; text-align: center; background: #f0f3f9; padding: 14px; border-radius: 12px; cursor: pointer; }
.link-code:hover { background: #e6ebf4; }
#link-instructions code { background: #f0f3f9; padding: 2px 6px; border-radius: 6px; }

/* ===== тосты ===== */

.toast-box { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; pointer-events: none; width: max-content; max-width: 90vw; }
.toast { background: #16233b; color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 15px; box-shadow: 0 6px 20px rgba(20,25,40,.28); opacity: 0; transform: translateY(12px); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: #18794e; }
.toast.error { background: #c0392b; }

/* ===== вход ===== */

.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: #fff; padding: 34px 30px; border-radius: 18px; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 20px 44px -22px rgba(20,50,110,.32); width: 100%; max-width: 360px; text-align: center; margin: 16px; }
.login-box h1 { margin: 0 0 4px; font-size: 24px; font-weight: 800; }
.login-box form { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.login-box input { padding: 13px 15px; font-size: 15px; border: 1px solid var(--line-5); border-radius: 12px; font-family: inherit; }
.login-box .btn { width: 100%; }
.error { color: #cc3a2f; font-size: 14px; }

/* ===== адаптив ===== */

@media (max-width: 760px) {
  .week-bottom { flex-direction: column; }
  .week-cal { flex-basis: auto; width: 100%; max-width: 400px; }
  .week-side { width: 100%; }
}

@media (max-width: 860px) {
  .nav-toggle {
    display: flex; align-items: center; justify-content: center;
    position: fixed; top: 12px; left: 12px; z-index: 80;
    width: 42px; height: 42px; border-radius: 10px;
    border: 1px solid var(--line); background: #fff; cursor: pointer;
    font-size: 20px; box-shadow: 0 2px 8px rgba(20,40,90,.12);
  }
  body.nav-open .nav-toggle { display: none; }
  .sidebar {
    position: fixed; left: 0; top: 0; height: 100vh;
    transform: translateX(-100%); transition: transform 0.25s ease;
    box-shadow: 6px 0 28px rgba(20,40,90,.18);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(20,30,45,.4); z-index: 65; }
  .content .container { padding-top: 64px; }
}

@media (max-width: 700px) {
  .kanban-card.mini .kc-x { opacity: 1; }
  .week-legend { flex-basis: 100%; margin-left: 0; }
  .myday-right { max-width: none; flex-basis: 100%; }
  .cards-grid, .ideas-grid { grid-template-columns: 1fr; }
  .modal .row { flex-direction: column; }
  .modal-body { grid-template-columns: 1fr; }
  .m-right { border-left: none; border-top: 1px solid var(--line); border-radius: 0 0 14px 14px; }
  .add-row .btn.add { padding: 0 18px; }
  .stream-rows { padding: 2px 6px; }
  .dash-row { flex-wrap: wrap; gap: 8px 10px; padding: 12px 6px; }
  .dash-row .dr-main { flex-basis: 100%; order: -1; }
  .dr-name { font-size: 14px; }
  .dash-row .dr-lead { min-width: 0; text-align: left; margin-left: auto; }
  .dash-row .dr-del { opacity: 1; }
  .drawer { width: 100%; }
  /* проектные строки: заголовок на строку 1, мета (срок/приоритет/«В день») переносится на строку 2 */
  .proj-row { flex-wrap: wrap; row-gap: 3px; }
  .proj-row .pr-title { flex: 1 1 auto; min-width: 55%; font-size: 15px; }
  .proj-row .pr-prio { min-width: 0; text-align: left; }
  .proj-row .pr-today { margin-left: auto; padding: 2px 4px; }
}

/* видимый фокус для клавиатуры */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ========== Матрица важно / срочно ========== */

.mx-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 18px; align-items: start; }
.mx-plot { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.mx-svg { width: 100%; height: auto; display: block; }
.mx-empty { margin: 4px 10px 10px; color: var(--muted); font-size: 13px; }

/* квадранты: цвет закрепляет прочтение — что делаем, что разгружаем */
.mx-q { opacity: .5; }
.mx-q.q-do { fill: #eef0fb; }
.mx-q.q-drop { fill: #fdf3e7; }
.mx-q.q-keep { fill: #ecf7f1; }
.mx-q.q-kill { fill: #f4f4f6; }
.mx-qt { font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.mx-qt.do { fill: #4a5fcb; } .mx-qt.drop { fill: #b9741f; }
.mx-qt.keep { fill: #2e9e6b; } .mx-qt.kill { fill: #9b9da3; }
.mx-grid { stroke: #e6e8ef; stroke-width: 1; }
.mx-split { stroke: #c9ccd8; stroke-width: 1.5; stroke-dasharray: 5 4; }
.mx-tick { font-size: 11px; fill: var(--muted); }
.mx-axis { font-size: 11px; fill: var(--muted); }

.mx-bub { cursor: pointer; }
.mx-c { fill: #4a5fcb; fill-opacity: .22; stroke: #4a5fcb; stroke-width: 1.5; }
.mx-bub.q-drop .mx-c { fill: #d9822b; stroke: #d9822b; }
.mx-bub.q-keep .mx-c { fill: #2e9e6b; stroke: #2e9e6b; }
.mx-bub.q-kill .mx-c { fill: #9b9da3; stroke: #9b9da3; }
.mx-c.no-eff { stroke-dasharray: 3 3; }          /* объём не задан */
.mx-bub:hover .mx-c { fill-opacity: .42; }
.mx-bn { font-size: 11px; font-weight: 600; fill: var(--text); }
.mx-bo { font-size: 10px; fill: var(--muted); }

.mx-alert { background: #fdf3e7; border: 1px solid #f0d7b4; color: #8a5a12;
  border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 10px; }
.mx-alert.warn { background: #fdecec; border-color: #f2c9c9; color: #a33; }
.mx-owner { color: var(--muted); font-size: 13px; }

.mx-side { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.mx-h3 { font-size: 13px; font-weight: 700; margin: 0 0 4px; }
.mx-note { color: var(--muted); font-size: 11.5px; margin: 0 0 10px; line-height: 1.4; }
.mx-load-row { display: grid; grid-template-columns: 74px 1fr 30px; gap: 6px; align-items: center;
  font-size: 12px; padding: 3px 0; }
.ml-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-bar { background: #eef0f4; border-radius: 4px; height: 7px; overflow: hidden; }
.ml-bar i { display: block; height: 100%; background: #4a5fcb; }
.ml-num { text-align: right; color: var(--muted); }
.mx-load-row.over .ml-bar i { background: #d64545; }
.mx-load-row.over .ml-num { color: #d64545; font-weight: 700; }

.mx-rate { display: flex; flex-direction: column; gap: 6px; }
.mx-row { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.mx-row.unrated { border-left: 3px solid #d9822b; }
.mx-row-head { display: flex; gap: 8px; align-items: baseline; cursor: pointer; }
.mx-row-name { font-weight: 600; font-size: 13px; }
.mx-row-sub { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-row-ctl { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 6px; }
.mx-seg { display: inline-flex; align-items: center; gap: 3px; }
.mx-lab { color: var(--muted); font-size: 11px; font-style: normal; margin-right: 3px; }
.mx-mini { border: 1px solid var(--line); background: var(--card); border-radius: 6px;
  min-width: 24px; height: 24px; font-size: 11.5px; cursor: pointer; padding: 0 5px; }
.mx-mini:hover { border-color: var(--accent); }
.mx-mini.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.mx-sel, .mx-date { border: 1px solid var(--line); border-radius: 6px; height: 24px;
  font-size: 11.5px; background: var(--card); color: var(--text); padding: 0 4px; }
.mx-urg { color: var(--muted); font-size: 11.5px; margin-left: auto; }

@media (max-width: 900px) {
  .mx-wrap { grid-template-columns: 1fr; }
  .mx-urg { margin-left: 0; }
}

.mx-bn.sm { font-size: 10px; }
.mx-add { margin-top: 8px; }
.mx-add .mx-sel { height: 28px; min-width: 320px; }
.mx-off { border: none; background: none; color: var(--muted); font-size: 11.5px;
  cursor: pointer; text-decoration: underline; padding: 0; }
.mx-off:hover { color: #d64545; }
.mx-bub { cursor: grab; touch-action: none; }
.mx-bub.dragging { cursor: grabbing; }
.mx-bub.dragging .mx-c { fill-opacity: .55; stroke-width: 2.5; }

/* ========== Дэшборд эффектов ========== */

.ef-mvp { display: inline-block; vertical-align: middle; margin-left: 8px; padding: 2px 8px;
  border-radius: 999px; background: #eef0fb; color: var(--accent);
  font-size: 11px; font-weight: 700; letter-spacing: .05em; }
.ef-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px;
  align-items: start; }
.ef-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; }
.ef-h3 { font-size: 14px; font-weight: 700; margin: 0 0 10px; }
.ef-num { font-size: 34px; font-weight: 700; line-height: 1.1; margin-bottom: 12px; }
.ef-num i { display: block; font-size: 12px; font-weight: 400; font-style: normal;
  color: var(--muted); margin-top: 2px; }
.ef-note { color: var(--muted); font-size: 12.5px; line-height: 1.5; margin: 8px 0 0; }
.ef-wip { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #fdf3e7;
  border: 1px solid #f0d7b4; color: #8a5a12; font-size: 11.5px; font-weight: 600; }

.ef-bar-row { display: grid; grid-template-columns: minmax(90px, 150px) 1fr 34px; gap: 8px;
  align-items: center; font-size: 12px; padding: 3px 0; }
.ef-bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ef-bar { background: #eef0f4; border-radius: 4px; height: 8px; overflow: hidden; }
.ef-bar i { display: block; height: 100%; background: var(--accent); }
.ef-bar-num { text-align: right; color: var(--muted); }

.ef-ms { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line);
  display: flex; flex-direction: column; gap: 6px; }
.ef-ms-row { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.ef-ms-row .ef-bar-name { flex: 0 1 150px; }
.ef-add { margin-top: 10px; height: 28px; max-width: 100%; }

.ef-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; margin-bottom: 12px; }
.ef-legend .status-dot { width: 9px; height: 9px; margin-right: 4px; }
.ef-agencies { display: flex; flex-direction: column; gap: 4px; }
.ef-agency { display: flex; align-items: center; gap: 7px; font-size: 12.5px; }
.ef-agency .status-dot { width: 9px; height: 9px; flex: none; }
.ef-agency-n { color: var(--muted); font-size: 11px; margin-left: auto; }

/* ========== Телефон: матрица и эффекты ========== */

@media (max-width: 700px) {
  .screen-title { font-size: 24px; }
  .screen-sub { font-size: 13px; }

  /* График не сжимаем: при 375px подписи стали бы нечитаемыми.
     Даём ему прокрутку внутри карточки — страница вбок не едет. */
  .mx-plot { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 8px 0; }
  .mx-svg { min-width: 620px; }
  .mx-empty { padding: 0 12px; }

  /* строка оценки: имя на своей строке, контролы ниже крупными кнопками */
  .mx-row { padding: 10px 12px; }
  .mx-row-head { flex-direction: column; gap: 2px; }
  .mx-row-sub { white-space: normal; }
  .mx-row-ctl { gap: 8px 12px; margin-top: 8px; }
  .mx-seg { flex-wrap: wrap; }
  .mx-mini { min-width: 34px; height: 34px; font-size: 13px; }   /* палец, а не курсор */
  .mx-sel, .mx-date { height: 34px; font-size: 13px; }
  .mx-sel { max-width: 100%; }
  .mx-urg { flex-basis: 100%; margin-left: 0; }
  .mx-off { flex-basis: 100%; text-align: left; padding: 4px 0; }
  .mx-add .mx-sel { min-width: 0; width: 100%; height: 34px; }

  /* эффекты: карточки в одну колонку, вехи переносятся */
  .ef-grid { grid-template-columns: 1fr; gap: 12px; }
  .ef-card { padding: 14px 15px; }
  .ef-num { font-size: 28px; }
  .ef-bar-row { grid-template-columns: minmax(0, 1fr) 70px 30px; }
  .ef-ms-row { flex-wrap: wrap; row-gap: 4px; }
  .ef-ms-row .ef-bar-name { flex: 1 1 100%; font-weight: 600; }
  .ef-ms-row .mx-date { height: 34px; flex: 1 1 40%; }
  .ef-add { width: 100%; }
  .ef-agency { font-size: 13px; }
}

/* очень узкие экраны (iPhone SE и подобные) */
@media (max-width: 380px) {
  .ef-legend { gap: 4px 10px; font-size: 11.5px; }
  .mx-lab { flex-basis: 100%; }
}

/* ========== Телефон: чинится горизонтальная прокрутка страницы ========== */

@media (max-width: 700px) {
  /* просроченные и подсказки: чипы проекта переносятся, а не выталкивают строку */
  .ov-row, .sg-row { flex-wrap: wrap; row-gap: 4px; }
  .ov-row .r-title, .sg-row .r-title { flex: 1 1 100%; }
  .ov-row .spacer, .sg-row .spacer { display: none; }

  /* формы добавления: поле на всю ширину, кнопка под ним */
  .add-row { flex-wrap: wrap; gap: 8px; }
  .add-row input { flex: 1 1 100%; min-width: 0; }
  .add-row select, .add-row label { max-width: 100%; }

  /* шапка недели: легенда уходит на свою строку */
  .week-nav { flex-wrap: wrap; row-gap: 8px; }
  .week-nav > span { min-width: 0; flex: 1 1 auto; }
  .week-legend { margin-left: 0; flex-basis: 100%; }
  .prio-filter { flex-wrap: wrap; }

  /* чипы проектов/меток не растягивают строку шире экрана */
  .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
}

/* страховка: никакой контент не уводит страницу вбок */
html, body { max-width: 100%; overflow-x: hidden; }

/* ========== Телефон: попасть пальцем ==========
   Вид не меняем — расширяем невидимую область нажатия вокруг мелких контролов. */

@media (max-width: 700px) {
  .status-dot-btn, .checkbox, .dr-del, .kc-x, .add-cat, .mx-off, .btn.add,
  .pr-today, .ov-row .r-del {
    position: relative;
  }
  .status-dot-btn::after, .checkbox::after, .dr-del::after, .kc-x::after,
  .add-cat::after, .pr-today::after {
    content: ''; position: absolute; left: 50%; top: 50%;
    width: 44px; height: 44px; transform: translate(-50%, -50%);
  }
  .mx-off { padding: 8px 0; }
  .btn.add { min-height: 34px; }
  .day-add .btn.add, .backlog-add .btn.add { min-height: 38px; }
  /* точка статуса чуть крупнее — по ней целятся чаще всего */
  .status-dot-btn { width: 16px; height: 16px; }
  .checkbox { width: 24px; height: 24px; }
}

/* ========== История и причины ========== */

.reason-back { position: fixed; inset: 0; background: rgba(20,30,45,.45); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 16px; }
.reason-box { background: var(--card); border-radius: 14px; padding: 20px 22px;
  max-width: 420px; width: 100%; box-shadow: 0 18px 50px rgba(20,40,90,.25); }
.reason-box h3 { margin: 0 0 4px; font-size: 16px; }
.reason-box p { margin: 0 0 14px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.reason-list { display: flex; flex-direction: column; gap: 6px; }
.reason-list button { text-align: left; padding: 10px 12px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--card); font-family: inherit;
  font-size: 14px; cursor: pointer; color: var(--text); }
.reason-list button:hover { border-color: var(--accent); background: #f7f8fe; }
.reason-skip { margin-top: 12px; border: none; background: none; color: var(--muted);
  font-size: 13px; cursor: pointer; font-family: inherit; padding: 4px 0; }
.reason-skip:hover { color: var(--text); }

.drawer-h3 { font-size: 13px; font-weight: 700; margin: 18px 0 8px; }
.ev-row { display: grid; grid-template-columns: 74px 1fr auto; gap: 8px;
  font-size: 12px; padding: 5px 0; border-top: 1px solid var(--line-2); align-items: baseline; }
.ev-when { color: var(--muted); }
.ev-what { color: var(--text); }
.ev-why { color: #b9741f; font-style: normal; }
.ev-why::before { content: '· '; }
.ev-who { color: var(--muted); }

#done-extra { margin-top: 14px; text-align: left; }
.done-lab { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
#done-result, #done-proj { width: 100%; height: 36px; border: 1px solid var(--line);
  border-radius: 8px; padding: 0 10px; font-family: inherit; font-size: 14px;
  background: var(--card); color: var(--text); }
