/* ==========================================================================
   DESIGN SYSTEM — Планировщик
   ========================================================================== */

:root {
  /* палитра */
  --indigo-50:  #eef0ff;
  --indigo-100: #dfe3ff;
  --indigo-400: #818cf8;
  --indigo-500: #6366f1;
  --indigo-600: #4f46e5;
  --indigo-700: #4338ca;
  --violet-500: #8b5cf6;
  --pink-500:   #ec4899;
  --pink-400:   #f472b6;
  --teal-500:   #14b8a6;
  --emerald-500:#10b981;
  --amber-500:  #f59e0b;
  --red-500:    #ef4444;
  --blue-500:   #3b82f6;
  --orange-500: #f97316;

  /* нейтральные */
  --ink-950: #0a0d1a;
  --ink-900: #111528;
  --ink-800: #1a1f36;
  --ink-700: #2a2f4a;
  --ink-600: #3f4566;
  --ink-500: #5d6484;
  --ink-400: #8a92ae;
  --ink-300: #b5bacf;
  --ink-200: #dcdfeb;
  --ink-100: #edeff6;
  --ink-50:  #f6f7fb;

  /* фон/поверхности */
  --bg:           #f6f4ff;
  --bg-solid:     #fafafe;
  --surface:      #ffffff;
  --surface-2:    #fafbfd;
  --surface-elev: #ffffff;
  --border:       #e7e9f1;
  --border-soft:  #eff1f7;
  --ring:         rgba(99,102,241,.18);

  /* градиенты */
  --g-primary:  linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #ec4899 100%);
  --g-primary-soft: linear-gradient(135deg, #eef0ff 0%, #fce7f3 100%);
  --g-sidebar: linear-gradient(180deg, #0e1028 0%, #1a1433 55%, #271342 100%);
  --g-card-hover: linear-gradient(180deg, #fff 0%, #fafaff 100%);
  --g-hero: linear-gradient(135deg, #6366f1 0%, #8b5cf6 45%, #ec4899 100%);

  /* тени */
  --shadow-xs: 0 1px 2px rgba(15, 20, 40, .05);
  --shadow-sm: 0 2px 6px rgba(15, 20, 40, .06);
  --shadow-md: 0 8px 24px rgba(15, 20, 40, .08), 0 2px 6px rgba(15, 20, 40, .04);
  --shadow-lg: 0 20px 48px rgba(15, 20, 40, .14), 0 6px 18px rgba(15, 20, 40, .08);
  --shadow-glow: 0 12px 40px rgba(99, 102, 241, .22);

  /* радиусы */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 28px;
  --r-full: 999px;

  /* шрифты */
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, "Menlo", monospace;

  --sidebar-w: 272px;
  --topbar-h: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-900);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: 14px; color: var(--ink-900); }
input:focus, textarea:focus, select:focus { outline: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -0.02em; }
code { font-family: var(--font-mono); font-size: 12px; background: var(--ink-100); padding: 1px 6px; border-radius: 4px; }
kbd {
  display: inline-flex; align-items: center;
  background: var(--ink-100); border: 1px solid var(--ink-200);
  border-bottom-width: 2px;
  color: var(--ink-600);
  padding: 1px 6px; border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 500;
}
.kbd-hint { margin-left: 6px; opacity: .8; }
.kbd-hint.dark {
  background: rgba(255,255,255,.14); color: rgba(255,255,255,.9);
  border-color: rgba(255,255,255,.2);
}
.hidden { display: none !important; }

/* ---- декоративный фон ---- */
.bg-blobs {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
}
.blob {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55;
}
.blob-1 { width: 520px; height: 520px; top: -180px; left: -120px; background: radial-gradient(circle, #c7d2fe, transparent 70%); }
.blob-2 { width: 500px; height: 500px; top: 40%; right: -160px; background: radial-gradient(circle, #fbcfe8, transparent 70%); }
.blob-3 { width: 420px; height: 420px; bottom: -160px; left: 30%; background: radial-gradient(circle, #ccfbf1, transparent 70%); }

/* ==========================================================================
   TOPBAR
   ========================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  background: rgba(255,255,255,.72);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  display: grid; grid-template-columns: var(--sidebar-w) 1fr auto;
  align-items: center;
  padding: 0 18px 0 0;
}
.topbar-left { padding-left: 20px; display: flex; align-items: center; gap: 10px; }
/* Гамбургер — виден только на мобильном брейкпоинте (см. @media ниже). */
.menu-toggle {
  display: none;
  width: 40px; height: 40px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--ink-700);
  align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .14s, color .14s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.menu-toggle:hover { background: var(--ink-50); color: var(--ink-900); }
.menu-toggle:active { transform: scale(.94); }
.brand { display: flex; align-items: center; gap: 12px; }

/* Подложка под мобильным off-canvas drawer. По умолчанию скрыта;
   показывается, когда body.sidebar-open на мобильном. */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 39;
  background: rgba(15, 20, 40, .45);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .22s ease;
  -webkit-tap-highlight-color: transparent;
}
body.sidebar-open .sidebar-backdrop { opacity: 1; }
.brand-mark {
  width: 38px; height: 38px; border-radius: var(--r-md);
  background: var(--g-primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(99,102,241,.35);
}
.brand-title { font-weight: 800; font-size: 15px; letter-spacing: -0.01em; }
.brand-sub { font-size: 11px; color: var(--ink-500); margin-top: -1px; }

/* --- Apps switcher (бургер «Сервисы») --- */
.apps-menu-wrap { position: relative; margin-left: 4px; }
.apps-menu-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 10px 7px 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r-md);
  color: var(--ink-700);
  font-size: 12.5px; font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .08s;
}
.apps-menu-btn:hover { background: var(--surface-2); border-color: var(--ink-300, #cbd5e1); }
.apps-menu-btn:active { transform: scale(0.97); }
.apps-menu-btn[aria-expanded="true"] {
  background: var(--indigo-500); color: #fff; border-color: var(--indigo-500);
}
.apps-menu-label { line-height: 1; }
.apps-menu-chevron {
  font-size: 11px; opacity: .7;
  transition: transform .15s;
}
.apps-menu-btn[aria-expanded="true"] .apps-menu-chevron { transform: rotate(180deg); }

.apps-menu {
  position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 300px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg, 12px);
  box-shadow: 0 10px 30px rgba(15, 23, 42, .12), 0 2px 6px rgba(15, 23, 42, .06);
  padding: 6px;
  z-index: 1000;
  animation: appsMenuIn .14s ease-out;
}
@keyframes appsMenuIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.apps-menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--ink-800);
  transition: background .12s;
}
.apps-menu-item:hover { background: var(--surface-2); }
.apps-menu-item.active { background: rgba(99, 102, 241, .08); }
.apps-menu-item .ami-ico {
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  border-radius: var(--r-md);
  font-size: 19px;
}
.apps-menu-item.active .ami-ico {
  background: var(--indigo-500); color: #fff;
}
.apps-menu-item .ami-body {
  display: flex; flex-direction: column; flex: 1; min-width: 0;
}
.apps-menu-item .ami-title {
  font-size: 13.5px; font-weight: 700; color: var(--ink-800);
  line-height: 1.2;
}
.apps-menu-item .ami-sub {
  font-size: 11.5px; color: var(--ink-500);
  margin-top: 2px;
}
.apps-menu-item .ami-badge {
  font-size: 10.5px; font-weight: 700;
  color: var(--indigo-600, #4f46e5);
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(99, 102, 241, .12);
  text-transform: uppercase; letter-spacing: .04em;
}
.apps-menu-item .ami-ext {
  color: var(--ink-400);
  font-size: 15px;
}
.apps-menu-item:hover .ami-ext { color: var(--indigo-500); }

/* Мобайл: прячем текст кнопки, оставляем только иконку-бургер */
@media (max-width: 640px) {
  .apps-menu-label, .apps-menu-chevron { display: none; }
  .apps-menu-btn { padding: 7px; }
  .apps-menu { min-width: 260px; }
}

.topbar-center { display: flex; justify-content: center; padding: 0 24px; }
.search {
  width: 100%; max-width: 540px; display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 0 12px;
  color: var(--ink-400);
  transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--indigo-400); box-shadow: 0 0 0 4px var(--ring); }
.search input {
  flex: 1; border: 0; background: transparent; padding: 10px 0; font-size: 14px; color: var(--ink-900);
}
.search input::placeholder { color: var(--ink-400); }

.topbar-right { display: flex; align-items: center; gap: 8px; }

.icon-button {
  width: 38px; height: 38px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--ink-600);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.icon-button:hover { background: #fff; color: var(--ink-900); border-color: var(--ink-200); transform: translateY(-1px); }

.primary-button {
  background: var(--g-primary);
  color: #fff; font-weight: 700; font-size: 13.5px;
  padding: 10px 16px; border-radius: var(--r-md);
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 6px 14px rgba(99,102,241,.35);
  transition: transform .1s, box-shadow .15s, filter .15s;
}
.primary-button:hover { filter: brightness(1.07); box-shadow: 0 8px 18px rgba(99,102,241,.45); }
.primary-button:active { transform: translateY(1px); }

.ghost-button {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--ink-700); font-weight: 600; font-size: 13.5px;
  padding: 9px 16px; border-radius: var(--r-md);
}
.ghost-button:hover { background: var(--ink-50); }

.danger-button {
  background: var(--surface); border: 1px solid #fca5a5;
  color: #b91c1c; font-weight: 600; font-size: 13.5px;
  padding: 9px 16px; border-radius: var(--r-md);
}
.danger-button:hover { background: #fee2e2; }

/* ==========================================================================
   LAYOUT
   ========================================================================== */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - var(--topbar-h));
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.sidebar {
  background: var(--g-sidebar);
  color: var(--ink-300);
  padding: 22px 14px;
  display: flex; flex-direction: column; gap: 22px;
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,.05);
  position: relative;
}
.sidebar::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 140px;
  background: radial-gradient(ellipse at top left, rgba(139,92,246,.35), transparent 70%);
  pointer-events: none;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 3px; }

.side-section { display: flex; flex-direction: column; gap: 4px; position: relative; z-index: 1; }
.side-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; text-transform: uppercase; letter-spacing: .1em;
  font-weight: 700; color: rgba(255,255,255,.45);
  padding: 0 10px 6px;
}
/* Кнопка-раскрытие секции «Проекты» — выглядит как обычный заголовок,
   но кликабельна и с шевроном. */
.side-head-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 4px; margin: -2px -4px;
  border-radius: 6px;
  font: inherit; letter-spacing: inherit; text-transform: inherit;
  color: inherit;
  cursor: pointer;
  transition: background .14s, color .14s;
  -webkit-tap-highlight-color: transparent;
}
.side-head-toggle:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.85); }
.side-head-toggle .shc-chevron {
  font-size: 10px; line-height: 1;
  transition: transform .2s cubic-bezier(.2,.8,.2,1);
  opacity: .7;
}
.side-section.collapsed .side-head-toggle .shc-chevron {
  transform: rotate(-90deg);
}
/* Анимация сворачивания/раскрытия списка — только для секции «Проекты».
   Для других секций list не обёрнут лишним overflow:hidden, чтобы
   вложенные меню / мемберы не обрезались. */
#side-section-projects > .side-list {
  overflow: hidden;
  transition: max-height .28s cubic-bezier(.2,.8,.2,1), opacity .18s ease;
  max-height: 2000px;
  opacity: 1;
}
#side-section-projects.collapsed > .side-list {
  max-height: 0;
  opacity: 0;
  margin: 0;
  padding: 0;
  pointer-events: none;
}
.side-add {
  width: 24px; height: 24px; border-radius: var(--r-xs);
  color: rgba(255,255,255,.55);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.side-add:hover { background: rgba(255,255,255,.08); color: #fff; }

.side-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.side-list li { display: block; }
.side-list button {
  width: 100%; display: flex; align-items: center; gap: 12px;
  color: rgba(255,255,255,.78);
  padding: 9px 12px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 500; text-align: left;
  transition: background .15s, color .15s;
  position: relative;
}
.side-list button:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-list button.active {
  background: linear-gradient(90deg, rgba(139,92,246,.25), rgba(99,102,241,.12));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.side-list button.active::before {
  content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--g-primary);
  box-shadow: 0 0 12px rgba(139,92,246,.6);
}
.pill-ico { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }
.pill-txt { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-dot {
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,.06), 0 0 8px currentColor;
}
.count {
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.72);
  padding: 1px 8px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.side-list button.active .count { background: rgba(255,255,255,.22); color: #fff; }

.side-status {
  margin-top: auto; display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: rgba(255,255,255,.55);
  padding: 10px 12px; border-top: 1px solid rgba(255,255,255,.06);
}
.side-status .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--emerald-500);
  box-shadow: 0 0 8px var(--emerald-500);
}
.side-status.off .dot { background: #64748b; box-shadow: none; }

/* ==========================================================================
   MAIN
   ========================================================================== */
.main {
  padding: 28px 36px 120px;
  max-width: 1400px; width: 100%;
}

/* Двухколоночный layout: контент + правая колонка с календарём-виджетом */
.main-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  align-items: start;
}
.main-left { min-width: 0; }
.main-right {
  position: sticky; top: calc(var(--topbar-h) + 20px);
}
@media (max-width: 1180px) {
  .main-body { grid-template-columns: 1fr; }
  .main-right { position: static; }
}
/* Когда вид = календарь — прячем правый виджет, чтобы большой календарь занял всю ширину */
body.view-calendar .main-right { display: none; }
body.view-calendar .main-body { grid-template-columns: 1fr; }
body.view-calendar .quick-add { display: none; }
body.view-calendar .welcome { display: none; }

/* ---- HERO ---- */
.hero {
  position: relative;
  background: var(--g-hero);
  color: #fff;
  border-radius: var(--r-2xl);
  padding: 28px 32px;
  margin-bottom: 22px;
  display: grid; grid-template-columns: 1fr auto;
  gap: 20px; align-items: center;
  box-shadow: 0 20px 50px rgba(139, 92, 246, .25);
  overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 90% 120%, rgba(255,255,255,.28), transparent 50%),
    radial-gradient(circle at 0% 0%, rgba(255,255,255,.18), transparent 40%);
  pointer-events: none;
}
.hero::after {
  content: ''; position: absolute; right: -80px; top: -80px;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.18), transparent 60%);
  pointer-events: none;
}
.hero-left { position: relative; z-index: 1; }
.hero-greet { font-size: 13px; font-weight: 600; opacity: .85; letter-spacing: .02em; }
.hero-title { font-size: 34px; font-weight: 800; margin-top: 4px; letter-spacing: -0.03em; }
.hero-date { font-size: 13px; opacity: .8; margin-top: 4px; text-transform: capitalize; }

/* ---------- Слайдер дней в hero ---------- */
.day-slider {
  margin-top: 14px;
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
  position: relative; z-index: 1;
}
.ds-arrow {
  flex-shrink: 0;
  width: 34px; height: 58px;
  border-radius: 10px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.22);
  color: #fff;
  font-size: 22px; font-weight: 700; line-height: 1;
  cursor: pointer;
  transition: background .12s, transform .1s;
  backdrop-filter: blur(6px);
}
.ds-arrow:hover {
  background: rgba(255,255,255,.28);
  transform: scale(1.04);
}
.ds-arrow:active { transform: scale(.95); }

.ds-track {
  display: flex; gap: 6px;
  flex: 1; min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.ds-track::-webkit-scrollbar { display: none; }

.ds-cell {
  flex-shrink: 0;
  min-width: 56px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.16);
  color: #fff;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  cursor: pointer;
  transition: background .14s, transform .1s, border-color .14s;
  position: relative;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(6px);
}
.ds-cell:hover {
  background: rgba(255,255,255,.20);
  transform: translateY(-1px);
}
.ds-cell.past { opacity: .55; }
.ds-cell.today {
  border-color: rgba(255,255,255,.55);
  background: rgba(255,255,255,.18);
}
.ds-cell.today::after {
  content: ''; position: absolute;
  left: 50%; bottom: 4px; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%;
  background: #fde68a;
  box-shadow: 0 0 6px #fde68a;
}
.ds-cell.active {
  background: #fff;
  color: var(--ink-900);
  border-color: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
  transform: translateY(-1px);
}
.ds-cell.active .ds-wd,
.ds-cell.active .ds-mon { color: var(--ink-500); }
.ds-cell.active.today::after { background: #6366f1; box-shadow: 0 0 6px #a5b4fc; }
.ds-wd {
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
  opacity: .85;
}
.ds-day {
  font-size: 20px; font-weight: 800; line-height: 1;
}
.ds-mon {
  font-size: 10px; font-weight: 600; opacity: .8;
  text-transform: lowercase;
}
.ds-count {
  position: absolute;
  top: 2px; right: 4px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #f59e0b;
  color: #fff;
  font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.ds-cell.active .ds-count { background: #6366f1; }

.ds-today {
  flex-shrink: 0;
  padding: 6px 12px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  color: #4338ca;
  font-size: 12px; font-weight: 700;
  border: 1px solid #fff;
  cursor: pointer;
  transition: all .14s;
}
.ds-today:hover {
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,.15);
}

.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  position: relative; z-index: 1;
}
.hero-stat {
  background: rgba(255,255,255,.14);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--r-lg);
  padding: 14px 16px; min-width: 110px;
  display: flex; flex-direction: column; gap: 2px;
  transition: transform .15s;
}
.hero-stat:hover { transform: translateY(-2px); background: rgba(255,255,255,.2); }
.stat-ico { font-size: 18px; line-height: 1; margin-bottom: 4px; }
.stat-num { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 11px; opacity: .85; text-transform: lowercase; }

/* ---- QUICK ADD ---- */
.quick-add {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1.5px dashed var(--ink-200);
  border-radius: var(--r-lg);
  padding: 12px 16px;
  margin-bottom: 22px;
  transition: all .2s;
}
.quick-add:focus-within {
  border-style: solid; border-color: var(--indigo-500);
  box-shadow: 0 0 0 4px var(--ring), var(--shadow-md);
  background: #fff;
}
.quick-add-icon {
  width: 30px; height: 30px; border-radius: var(--r-sm);
  background: var(--g-primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(99,102,241,.3);
  border: 0;
  cursor: pointer;
  transition: transform .12s, box-shadow .16s, filter .12s;
}
.quick-add-icon:hover {
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 6px 16px rgba(99,102,241,.45);
  filter: brightness(1.05);
}
.quick-add-icon:active { transform: translateY(0) scale(1); }
.quick-add input {
  flex: 1; border: 0; background: transparent; padding: 6px 0;
  font-size: 14.5px; color: var(--ink-900);
}
.quick-add input::placeholder { color: var(--ink-400); }
.quick-add-hint { font-size: 11.5px; color: var(--ink-400); white-space: nowrap; }

/* ---- GROUPS ---- */
.group { margin-bottom: 26px; }
.group-head {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--ink-500);
  font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: 10px; padding: 0 4px;
}
.group-head .group-line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--border), transparent); }
.group-head .group-count {
  background: var(--ink-100); color: var(--ink-500);
  padding: 2px 8px; border-radius: var(--r-full);
  font-size: 10.5px; font-weight: 700;
}
.group-head .group-hint { color: var(--ink-400); font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 11.5px; }
.group-head .group-meta {
  color: var(--ink-500); font-weight: 600; font-size: 11px;
  text-transform: none; letter-spacing: 0; font-variant-numeric: tabular-nums;
}
/* Подсветка заголовка «🎯 Задачи на сегодня» */
.group.today-focus .group-head {
  font-size: 13px;
  color: #4338ca;
}
.group.today-focus .group-head .group-count {
  background: #eef2ff; color: #4338ca;
}

/* ---- TASK CARD ---- */
.task {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  margin-bottom: 8px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px; align-items: center;
  box-shadow: var(--shadow-xs);
  transition: transform .12s, box-shadow .15s, border-color .15s;
  position: relative;
  overflow: hidden;
}
.task::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--ink-100); transition: background .15s;
}
.task[data-type="call"]::before     { background: #0ea5e9; }
.task[data-type="meeting"]::before  { background: #6366f1; }
.task[data-type="text"]::before     { background: #f59e0b; }
.task[data-type="content"]::before  { background: #ec4899; }
.task[data-type="site"]::before     { background: #14b8a6; }
.task[data-type="funnel"]::before   { background: #8b5cf6; }
.task[data-type="strategy"]::before { background: #4f46e5; }
.task[data-type="sale"]::before     { background: #22c55e; }
.task[data-type="thinking"]::before { background: #64748b; }
.task[data-type="other"]::before    { background: #94a3b8; }
.task.imp-1 { box-shadow: 0 2px 10px rgba(239,68,68,.08), 0 0 0 1px rgba(239,68,68,.25) inset; }
.task.imp-1::before { width: 5px; background: linear-gradient(180deg, #ef4444, #f97316) !important; }

.task:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--ink-200);
  background: var(--g-card-hover);
}
.task:hover .task-actions { opacity: 1; transform: none; }
.task.done { opacity: .55; }
.task.done .task-title { text-decoration: line-through; }
.task.overdue { border-color: #fecaca; background: linear-gradient(90deg, #fff5f5 0%, #fff 20%); }

/* Статусные кнопки «В работе / Выполнено» — заменили галочку */
.task-status {
  display: flex; flex-direction: column; gap: 4px;
  flex-shrink: 0; align-self: stretch;
  justify-content: center;
}
.task-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 8px;
  font-size: 11.5px; font-weight: 700;
  border: 1px solid transparent; background: #fff;
  color: var(--ink-600); cursor: pointer;
  transition: all .15s; white-space: nowrap;
  line-height: 1.2;
  min-width: 100px; justify-content: center;
}
.task-btn .tb-ico { font-size: 12px; }
.task-btn.start {
  background: #eef0ff; color: #4338ca; border-color: #c7d2fe;
}
.task-btn.start:hover { background: #4f46e5; color: #fff; border-color: #4f46e5; box-shadow: 0 4px 12px rgba(79,70,229,.25); }
.task-btn.done {
  background: #f0fdf4; color: #166534; border-color: #bbf7d0;
}
.task-btn.done:hover { background: #16a34a; color: #fff; border-color: #16a34a; box-shadow: 0 4px 12px rgba(22,163,74,.28); }
.task-btn.pause {
  background: #fffbeb; color: #92400e; border-color: #fde68a;
}
.task-btn.pause:hover { background: #f59e0b; color: #fff; border-color: #f59e0b; }
.task-btn.reopen {
  background: var(--ink-50); color: var(--ink-600); border-color: var(--border);
}
.task-btn.reopen:hover { background: var(--ink-100); color: var(--ink-900); }

/* Индикатор «в работе» + живой таймер */
.task.in-progress {
  border-color: #c7d2fe;
  box-shadow: 0 0 0 3px rgba(99,102,241,.08), 0 4px 14px rgba(99,102,241,.15);
  background: linear-gradient(90deg, #f5f7ff 0%, #fff 40%);
}
.task.in-progress::before { background: linear-gradient(180deg, #6366f1, #8b5cf6) !important; width: 5px; }
.task-live-timer {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono); font-weight: 700; font-size: 11.5px;
  color: #4338ca;
  background: #eef0ff;
  padding: 3px 8px; border-radius: 999px;
  border: 1px solid #c7d2fe;
}
.task-live-timer .live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #ef4444;
  animation: blink-dot 1.2s infinite;
}
@keyframes blink-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Результат задачи */
.task-result {
  grid-column: 2 / span 2;
  margin-top: 6px;
  font-size: 12.5px;
  color: #166534;
  background: #f0fdf4;
  border-left: 3px solid #86efac;
  padding: 6px 10px;
  border-radius: 4px;
}
.task-result b { color: #14532d; font-weight: 700; }

/* Finish modal */
.finish-task-title {
  font-size: 16px; font-weight: 700; color: var(--ink-900);
  margin-bottom: 8px;
}
.finish-time {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--ink-600);
  background: var(--ink-50); padding: 8px 12px;
  border-radius: var(--r-md); margin-bottom: 14px;
  display: flex; gap: 16px; flex-wrap: wrap;
}
.finish-time b { color: var(--ink-900); }

.task-body { min-width: 0; cursor: pointer; }
.task-title {
  font-weight: 700; font-size: 14.5px; color: var(--ink-900);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: -0.01em;
}
.task-desc {
  font-size: 12.5px; color: var(--ink-500);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.task-meta {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 8px;
}

/* type-coloured chips */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 600;
  background: var(--ink-50); color: var(--ink-600);
  border: 1px solid transparent;
  line-height: 1.3;
}
.chip.project { color: #fff; font-weight: 700; box-shadow: 0 2px 6px rgba(0,0,0,.1); }
.chip.type-call       { background: #e0f2fe; color: #075985; }
.chip.type-meeting    { background: #e0e7ff; color: #3730a3; }
.chip.type-text       { background: #fef3c7; color: #92400e; }
.chip.type-content    { background: #fce7f3; color: #9d174d; }
.chip.type-site       { background: #ccfbf1; color: #115e59; }
.chip.type-funnel     { background: #ede9fe; color: #5b21b6; }
.chip.type-strategy   { background: #dbeafe; color: #1e40af; }
.chip.type-sale       { background: #dcfce7; color: #14532d; }
.chip.type-thinking   { background: #f1f5f9; color: #334155; }
.chip.type-other      { background: var(--ink-100); color: var(--ink-600); }
.chip.imp-1 { background: #fee2e2; color: #991b1b; font-weight: 700; }
.chip.imp-3 { background: #f1f5f9; color: #64748b; }

.chip.start    { background: #dbeafe; color: #1e40af; }
.chip.deadline { background: #fef3c7; color: #92400e; }
.chip.overdue-chip { background: #fee2e2; color: #991b1b; }
.chip.time {
  background: var(--ink-50); color: var(--ink-600);
  font-family: var(--font-mono); font-weight: 500;
}

.task-actions {
  display: flex; gap: 4px;
  opacity: 0; transform: translateX(4px);
  transition: all .15s;
}
.task-action {
  width: 32px; height: 32px; border-radius: var(--r-sm);
  background: transparent; color: var(--ink-500);
  border: 1px solid transparent;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.task-action:hover { background: var(--ink-50); border-color: var(--border); color: var(--ink-900); }
.task-action.pomo-launch:hover { color: #dc2626; border-color: #fecaca; background: #fff1f2; }

.task-progress {
  grid-column: 2 / span 2;
  height: 4px; background: var(--ink-100); border-radius: var(--r-full);
  overflow: hidden; margin-top: 8px;
}
.task-progress-fill {
  height: 100%; background: var(--g-primary); border-radius: var(--r-full);
  transition: width .4s cubic-bezier(.4, 0, .2, 1);
}
.task-progress-fill.over { background: linear-gradient(90deg, var(--amber-500), var(--red-500)); }

/* ---- EMPTY / WELCOME ---- */
.empty {
  text-align: center; padding: 70px 20px 40px;
  color: var(--ink-500);
}
.empty-illu { width: 96px; height: 96px; margin-bottom: 10px; }
.empty-title { font-size: 18px; font-weight: 700; color: var(--ink-700); margin-bottom: 4px; }
.empty-hint { font-size: 13.5px; }

.welcome {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: 32px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.welcome::before {
  content: ''; position: absolute; top: -80px; right: -80px;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(236,72,153,.14), transparent 70%);
}
.welcome-inner { display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: center; position: relative; }
.welcome-illu { width: 260px; max-width: 100%; flex-shrink: 0; }
.welcome-badge {
  display: inline-block;
  background: var(--g-primary-soft); color: var(--indigo-700);
  padding: 4px 10px; border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 700;
  margin-bottom: 10px;
}
.welcome h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.welcome p { color: var(--ink-500); font-size: 14px; margin: 8px 0 18px; max-width: 560px; }
.welcome-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.welcome-step {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: var(--r-md); padding: 10px 14px;
  font-size: 13px; color: var(--ink-700);
}
.welcome-step .num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--g-primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(99,102,241,.3);
}
.welcome-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ==========================================================================
   POMODORO
   ========================================================================== */
.pomodoro {
  position: fixed; right: 22px; bottom: 22px;
  width: 244px; z-index: 40;
  background: var(--g-sidebar); color: #fff;
  border-radius: var(--r-xl);
  padding: 16px 18px 14px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,.08);
  overflow: hidden;
}
.pomodoro::before {
  content: ''; position: absolute; top: -40px; right: -40px;
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(139,92,246,.4), transparent 70%);
  pointer-events: none;
}
.pomodoro.break { background: linear-gradient(180deg, #064e3b, #0f766e 100%); }
.pomodoro.break::before { background: radial-gradient(circle, rgba(16,185,129,.45), transparent 70%); }
.pomodoro.minimized { height: 56px; padding: 12px 16px; width: 180px; }
.pomodoro.minimized .pomo-ring-wrap,
.pomodoro.minimized .pomo-task,
.pomodoro.minimized .pomo-actions,
.pomodoro.minimized .pomo-foot { display: none; }
.pomodoro.minimized .pomo-mini { position: static; }

.pomo-top {
  display: flex; justify-content: space-between; align-items: center;
  position: relative; z-index: 1;
}
.pomo-mode {
  font-size: 11px; font-weight: 700;
  color: rgba(255,255,255,.75);
  text-transform: uppercase; letter-spacing: .1em;
}
.pomodoro.break .pomo-mode { color: #6ee7b7; }
.pomo-mini {
  width: 24px; height: 24px; border-radius: var(--r-xs);
  color: rgba(255,255,255,.6); font-size: 14px; line-height: 1;
}
.pomo-mini:hover { background: rgba(255,255,255,.1); color: #fff; }

.pomo-ring-wrap {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  margin: 8px 0 6px;
}
.pomo-ring {
  transform: rotate(-90deg);
}
.pomo-ring .ring-bg {
  fill: none; stroke: rgba(255,255,255,.1); stroke-width: 6;
}
.pomo-ring .ring-fg {
  fill: none; stroke: #a78bfa; stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 339.292;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke .3s;
  filter: drop-shadow(0 0 6px rgba(167, 139, 250, .55));
}
.pomodoro.break .pomo-ring .ring-fg {
  stroke: #6ee7b7;
  filter: drop-shadow(0 0 6px rgba(110, 231, 183, .5));
}
.pomo-time {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 28px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.pomo-task {
  font-size: 12px;
  color: rgba(255,255,255,.7); text-align: center;
  padding: 0 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  position: relative; z-index: 1;
}

.pomo-actions {
  display: flex; justify-content: center; gap: 6px;
  margin-top: 10px; position: relative; z-index: 1;
}
.pomo-btn {
  width: 40px; height: 34px; border-radius: var(--r-sm);
  background: rgba(255,255,255,.1); color: #fff;
  font-size: 13px; transition: all .15s;
}
.pomo-btn:hover { background: rgba(255,255,255,.2); }
.pomo-btn.primary {
  background: var(--g-primary);
  box-shadow: 0 4px 10px rgba(99,102,241,.4);
}
.pomo-btn.primary:hover { filter: brightness(1.1); }

.pomo-foot {
  display: flex; justify-content: space-between;
  margin-top: 10px; font-size: 10.5px; color: rgba(255,255,255,.55);
  position: relative; z-index: 1;
  text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
}
.pomo-foot b { color: #fff; font-family: var(--font-mono); font-size: 12px; }

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15,20,40,.55);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .16s ease-out;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.modal-card {
  background: #fff; border-radius: var(--r-xl);
  width: 100%; max-width: 620px;
  max-height: 92vh; display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: popIn .22s cubic-bezier(.16, 1, .3, 1);
}
.modal-card.small { max-width: 440px; }
@keyframes popIn { from { opacity: 0; transform: translateY(12px) scale(.96) } to { opacity: 1; transform: none } }

.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-head h2 { font-size: 18px; }
.modal-close {
  width: 30px; height: 30px; border-radius: var(--r-sm);
  color: var(--ink-500); font-size: 14px;
}
.modal-close:hover { background: var(--ink-50); color: var(--ink-900); }

.modal-body {
  padding: 24px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 16px;
}
.modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  display: flex; gap: 10px; align-items: center;
}
.spacer { flex: 1; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-label {
  font-size: 11.5px; font-weight: 700;
  color: var(--ink-500);
  text-transform: uppercase; letter-spacing: .06em;
}
.field-hint {
  font-weight: 500; text-transform: none; letter-spacing: 0;
  color: var(--ink-400); margin-left: 4px;
}
.field input, .field textarea, .field select {
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: #fff;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--indigo-500); box-shadow: 0 0 0 3px var(--ring);
}
.field textarea { resize: vertical; min-height: 64px; font-family: inherit; }

.info-block {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #78350f;
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: 12.5px; line-height: 1.5;
  border: 1px solid #fcd34d;
}

/* color picker */
.color-picker { display: flex; gap: 10px; flex-wrap: wrap; }
.color-swatch {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--border);
  transition: transform .12s, box-shadow .12s;
}
.color-swatch:hover { transform: scale(1.12); }
.color-swatch.selected { box-shadow: 0 0 0 2px var(--indigo-500); transform: scale(1.12); }

/* --- Кнопка "+" рядом с «Тип» в форме задачи и модалка создания типа --- */
.type-add-btn {
  margin-left: 6px;
  width: 18px; height: 18px;
  line-height: 16px; text-align: center;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink-600);
  font-size: 13px; font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  vertical-align: -3px;
  transition: background .15s, border-color .15s, color .15s, transform .08s;
}
.type-add-btn:hover {
  background: var(--indigo-500); color: #fff; border-color: var(--indigo-500);
}
.type-add-btn:active { transform: scale(0.92); }

.type-preview {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  font-size: 13px; color: var(--ink-700);
  align-self: flex-start;
}
.tm-prev-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: #94a3b8; color: #fff;
  font-size: 13px;
}
.tm-prev-label { font-weight: 600; }

.type-existing-wrap {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 2px;
}
.type-existing-title {
  font-size: 11.5px; font-weight: 700;
  color: var(--ink-500);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 8px;
}
.type-existing {
  display: flex; flex-wrap: wrap; gap: 6px;
  font-size: 13px; color: var(--ink-500);
}
.type-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12.5px; color: var(--ink-800);
}
.type-chip .tc-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #94a3b8;
}
.type-chip .tc-del {
  margin-left: 2px;
  width: 18px; height: 18px; line-height: 16px; text-align: center;
  border: 0; background: transparent;
  color: var(--ink-400); cursor: pointer;
  font-size: 13px; border-radius: 6px;
  padding: 0;
}
.type-chip .tc-del:hover { color: #b91c1c; background: #fee2e2; }

/* --- Теги: пикер в форме задачи + чипы на карточке + фильтр в шапке --- */
.tag-picker {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px; min-height: 40px;
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  background: #fff;
}
.tag-picker:empty::before {
  content: 'Пока нет тегов — создай первый →';
  color: var(--ink-400); font-size: 13px;
  align-self: center; padding: 4px 8px;
}
.tag-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--ink-700);
  font-size: 12.5px; font-weight: 600;
  cursor: pointer; user-select: none;
  transition: transform .08s, box-shadow .15s, background .15s, color .15s;
}
.tag-pill:hover { transform: translateY(-1px); }
.tag-pill.selected {
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.1);
}
.tag-pill .tp-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: currentColor;
}
.tag-pill.selected .tp-dot { background: rgba(255,255,255,.85); }
.tag-pill-add {
  background: #fff;
  border: 1px dashed var(--border);
  color: var(--ink-500);
  font-weight: 700;
}
.tag-pill-add:hover {
  background: var(--indigo-500); color: #fff; border-color: var(--indigo-500);
}

/* Чип тега на карточке задачи — компактнее, с цветной заливкой */
.task-meta .chip.tag {
  background: var(--surface-2);
  color: var(--ink-800);
  border: 1px solid var(--border);
}
.task-meta .chip.tag .tmg-dot {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  margin-right: 6px; vertical-align: 1px;
}

/* Фильтр по тегам: лента чипов в шапке */
.tag-filter-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: 0 1px 2px rgba(0,0,0,.02);
}
.tfb-ico { font-size: 16px; }
.tfb-label {
  font-size: 11.5px; font-weight: 700;
  color: var(--ink-500);
  text-transform: uppercase; letter-spacing: .06em;
}
.tfb-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  flex: 1;
}
.tfb-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-700);
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: background .15s, color .15s, transform .08s;
}
.tfb-chip:hover { transform: translateY(-1px); }
.tfb-chip.active {
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 5px rgba(0,0,0,.08);
}
.tfb-chip .tfb-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor;
}
.tfb-chip .tfb-count {
  font-size: 10.5px; font-weight: 700;
  opacity: .65;
  padding: 0 5px;
  background: rgba(0,0,0,.06);
  border-radius: 8px;
}
.tfb-chip.active .tfb-count { background: rgba(255,255,255,.2); opacity: .9; }
.tfb-clear {
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  color: var(--ink-500);
  cursor: pointer;
}
.tfb-clear:hover { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }

@media (max-width: 900px) {
  .tag-filter-bar { flex-wrap: wrap; padding: 8px 10px; }
  .tfb-chips { width: 100%; }
}

/* help */
.help-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-bottom: 18px;
}
.help-card {
  background: var(--surface-2);
  border-radius: var(--r-md); padding: 16px;
  border: 1px solid var(--border-soft);
}
.help-card b { display: block; margin: 8px 0 4px; font-size: 13.5px; color: var(--ink-900); }
.help-card p { margin: 0; font-size: 12.5px; color: var(--ink-500); line-height: 1.55; }
.help-ico { font-size: 22px; }
.shortcuts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  font-size: 13px; color: var(--ink-600);
}

/* summary */
.sum-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.sum-stat {
  background: var(--g-primary-soft);
  border-radius: var(--r-md); padding: 16px; text-align: center;
}
.sum-stat b {
  font-size: 24px; color: var(--indigo-700); display: block;
  font-weight: 800; letter-spacing: -0.02em;
}
.sum-stat span { font-size: 11.5px; color: var(--ink-500); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }

.sum-block {
  background: var(--surface-2); border-radius: var(--r-md);
  padding: 16px; border: 1px solid var(--border-soft);
}
.sum-block h3 {
  font-size: 11.5px; text-transform: uppercase; color: var(--ink-500);
  letter-spacing: .06em; font-weight: 700; margin-bottom: 10px;
}
.sum-row {
  display: flex; justify-content: space-between;
  padding: 6px 0; font-size: 13.5px;
}
.sum-row + .sum-row { border-top: 1px dashed var(--border-soft); }
.sum-bar { height: 6px; background: var(--ink-100); border-radius: var(--r-full); overflow: hidden; margin: 4px 0 6px; }
.sum-bar-fill { height: 100%; background: var(--g-primary); border-radius: inherit; }

/* toast */
.toast {
  position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%);
  background: var(--ink-900); color: #fff;
  padding: 12px 18px; border-radius: var(--r-md);
  font-size: 13px; font-weight: 500; z-index: 200;
  box-shadow: var(--shadow-lg);
  animation: toastIn .22s cubic-bezier(.16, 1, .3, 1);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 14px) } to { opacity: 1; transform: translateX(-50%) } }

/* responsive */
@media (max-width: 1060px) {
  .welcome-inner { grid-template-columns: 1fr; }
  .welcome-illu { width: 180px; margin: 0 auto; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
}
/* ==========================================================================
   MOBILE / TABLET (<= 900px): off-canvas сайдбар + компактный топбар
   ========================================================================== */
@media (max-width: 900px) {
  /* Топбар: гамбургер + бренд слева, одна «+» кнопка справа (иконка),
     search прячем — открываем только по клавише / или на десктопе. */
  .topbar {
    grid-template-columns: auto 1fr auto;
    padding: 0 10px 0 10px;
    height: 60px;
    gap: 8px;
  }
  .topbar-left { padding-left: 0; gap: 8px; }
  .topbar-center { display: none; }
  .topbar-right { gap: 6px; }
  .menu-toggle { display: inline-flex; }
  .brand-sub { display: none; }
  .brand-title { font-size: 14px; }
  .brand-mark { width: 34px; height: 34px; }
  .icon-button { width: 36px; height: 36px; }
  /* На мобильном кнопка «Новая задача» сворачивается в «+» */
  .primary-button.btn-new-task { padding: 9px 12px; }
  .primary-button.btn-new-task .nt-label,
  .primary-button.btn-new-task .nt-kbd { display: none; }

  /* Layout: одна колонка, сайдбар превращается в off-canvas drawer */
  .layout { grid-template-columns: 1fr; min-height: calc(100vh - 60px); }
  .sidebar-backdrop { display: block; pointer-events: none; }
  body.sidebar-open .sidebar-backdrop { pointer-events: auto; }

  .sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    width: min(300px, 88vw);
    height: calc(100vh - 60px);
    height: calc(100dvh - 60px);
    z-index: 40;
    transform: translateX(-105%);
    transition: transform .28s cubic-bezier(.2, .8, .2, 1);
    box-shadow: 12px 0 40px rgba(0,0,0,.25);
    padding: 18px 12px 24px;
    overscroll-behavior: contain;
  }
  body.sidebar-open .sidebar { transform: translateX(0); }

  /* Основная область: заметно меньше воздуха */
  .main { padding: 16px 14px 120px; }

  /* Hero: вертикально, без кальки-белой карточки на стенках */
  .hero {
    padding: 20px 18px;
    grid-template-columns: 1fr;
    border-radius: var(--r-lg);
    gap: 16px;
  }
  .hero-title { font-size: 26px; }
  .hero-greet { font-size: 12px; }
  .hero-date { font-size: 12px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .hero-stat { padding: 10px 12px; min-width: 0; }
  .stat-ico { font-size: 15px; margin-bottom: 2px; }
  .stat-num { font-size: 20px; }
  .stat-label { font-size: 10.5px; }

  /* Слайдер дней: чуть меньше ячейки, стрелки покрупнее для тача */
  .day-slider { gap: 6px; margin-top: 10px; }
  .ds-arrow { width: 30px; height: 52px; font-size: 20px; }
  .ds-cell { min-width: 50px; padding: 6px 8px; }
  .ds-day { font-size: 18px; }
  .ds-wd { font-size: 10px; }
  .ds-mon { font-size: 9.5px; }
  .ds-today { height: 30px; padding: 4px 10px; font-size: 11.5px; }

  /* Карточки проектов-статистики (правила сворачивания — ниже, после
     базовых .proj-stats{...}, чтобы source-order перекрывал базу). */
  .proj-card { padding: 12px 14px; }

  /* Quick add: скрыть подсказку, оставить поле */
  .quick-add { padding: 10px 12px; gap: 10px; }
  .quick-add-hint { display: none; }
  .quick-add input { font-size: 14px; }

  /* Welcome — одна колонка, иллюстрация меньше */
  .welcome-inner { grid-template-columns: 1fr; gap: 16px; }
  .welcome-illu { width: 160px; margin: 0 auto; }
  .welcome-steps { grid-template-columns: 1fr; }

  /* Модалки: почти фулл-скрин, с воздухом под топбаром */
  .modal { padding: 8px; align-items: flex-end; }
  .modal-card, .modal-card.small, .modal-card.large {
    max-width: 100%;
    max-height: 94vh;
    max-height: 94dvh;
    border-radius: 20px 20px 14px 14px;
    animation: slideUpIn .24s cubic-bezier(.16, 1, .3, 1);
  }
  .modal-head { padding: 14px 16px; }
  .modal-head h2 { font-size: 16px; }
  .modal-body { padding: 16px; gap: 14px; }
  .modal-foot {
    padding: 12px 16px;
    gap: 8px;
    flex-wrap: wrap;
    /* Чтобы кнопки «Отмена/Сохранить» не вылезали за экран на узком iPhone */
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  .modal-foot .spacer { flex: 1 1 100%; display: none; }
  .modal-foot > button {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 12px;
    font-size: 13.5px;
  }
  .modal-foot .danger-button { flex: 0 1 auto; order: -1; }
  @keyframes slideUpIn {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: none; }
  }

  /* Формы: два поля в ряд — на мобильном в столбец */
  .field-row { grid-template-columns: 1fr; gap: 10px; }
  .field input, .field textarea, .field select {
    padding: 12px 13px;
    font-size: 16px;            /* 16px — чтобы iOS не зумил при фокусе */
  }

  /* Help grid / shortcuts — в столбец */
  .help-grid, .shortcuts { grid-template-columns: 1fr; }

  /* Помидор-плашка на тач-устройствах — не должен перекрывать task-список */
  .pomodoro { right: 10px; bottom: 10px; width: 188px; transform: scale(.95); transform-origin: bottom right; }

  /* Шапка «все задачи» — тулбар вертикально */
  .all-tasks-toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .all-tasks-filters { flex-wrap: wrap; gap: 8px; }
  .all-tasks-filters select { max-width: 100%; }

  /* Участники проекта: строка «пригласить» — в столбец */
  .share-invite-row { flex-wrap: wrap; }
  .share-invite-row input { flex: 1 1 100%; order: -1; }

  /* Убираем hover-translate на тач — чтобы карточки не «прыгали» под пальцем */
  .task:hover { transform: none; }
  .proj-card:hover { transform: none; }
  .hero-stat:hover { transform: none; }
  /* На тач-устройствах hover не срабатывает, поэтому actions должны быть видны сразу */
  .task-actions { opacity: 1; transform: none; }
}

/* Для любых устройств без hover (тач-планшеты, смартфоны) — скрытые по
   hover'у элементы должны быть видны постоянно. */
@media (hover: none) {
  .task-actions { opacity: 1; transform: none; }
}

/* ==========================================================================
   SMALL PHONES (<= 480px): ужимаем ещё чуть-чуть
   ========================================================================== */
@media (max-width: 480px) {
  .hero { padding: 16px 14px; }
  .hero-title { font-size: 22px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .hero-stat { padding: 8px 10px; }
  .stat-num { font-size: 18px; }
  .stat-label { font-size: 10px; }

  .day-slider { margin-top: 8px; }
  .ds-arrow { width: 26px; height: 48px; font-size: 18px; }
  .ds-cell { min-width: 44px; padding: 5px 6px; }
  .ds-day { font-size: 16px; }

  .proj-stats { grid-template-columns: 1fr; }

  .main { padding: 12px 10px 120px; }
  .task { padding: 12px; gap: 10px; grid-template-columns: auto 1fr; }
  .task-actions { grid-column: 1 / -1; justify-content: flex-start; opacity: 1; transform: none; }
  .task-status { flex-direction: row; }
  .task-btn { min-width: 0; padding: 6px 8px; }

  .modal { padding: 0; }
  .modal-card, .modal-card.small, .modal-card.large {
    max-height: 100vh;
    max-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    animation: fadeIn .18s ease-out;
  }

  .brand-title { font-size: 13.5px; }
  .brand-mark { width: 30px; height: 30px; }
  .menu-toggle { width: 36px; height: 36px; }
  .icon-button { width: 34px; height: 34px; }
  .primary-button.btn-new-task { padding: 8px 10px; }
}

/* ============ Telegram button in header ============ */
.tg-button { position: relative; }
.tg-button .tg-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #94a3b8; border: 2px solid #fff;
  display: none;
}
.tg-button.state-off      .tg-dot { display: block; background: #94a3b8; }
.tg-button.state-pending  .tg-dot { display: block; background: #f59e0b; }
.tg-button.state-linked   .tg-dot { display: block; background: #22c55e; }
.tg-button.state-linked { color: #0ea5e9; }

/* ============ Telegram modal ============ */
.tg-loader { padding: 22px 0; text-align: center; color: var(--ink-500); }
.tg-status-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--r-md);
  background: var(--ink-50); margin-bottom: 14px;
  font-size: 13px;
}
.tg-status-row.ok { background: #dcfce7; color: #14532d; }
.tg-status-row.warn { background: #fef3c7; color: #92400e; }
.tg-status-row.err { background: #fee2e2; color: #991b1b; }
.tg-code-card {
  border: 1px dashed var(--border);
  background: #fafbfd;
  border-radius: var(--r-md);
  padding: 16px; margin: 12px 0;
}
.tg-code {
  font-family: var(--font-mono);
  font-size: 20px; font-weight: 700;
  color: #4338ca;
  padding: 8px 12px; border-radius: 8px;
  background: #eef0ff; display: inline-block;
  letter-spacing: 1px;
}
.tg-open-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  color: #fff; border-radius: 999px;
  padding: 10px 18px; font-weight: 700;
  border: none; cursor: pointer;
  box-shadow: 0 8px 20px rgba(14,165,233,.3);
  margin-top: 10px; text-decoration: none;
}
.tg-open-btn:hover { transform: translateY(-1px); }
.tg-instr { font-size: 13px; color: var(--ink-600); line-height: 1.6; }
.tg-instr code { background: #eef0ff; color: #4338ca; padding: 1px 6px; border-radius: 4px; font-family: var(--font-mono); font-size: 12px; }
.tg-unlink {
  background: #fff1f2; color: #b91c1c;
  border: 1px solid #fecaca;
  padding: 8px 14px; border-radius: var(--r-md);
  font-weight: 600; cursor: pointer;
  margin-top: 10px;
}
.tg-unlink:hover { background: #fee2e2; }

/* ============ Estimate auto-hint в модалке задачи ============ */
.estimate-hint {
  display: flex; gap: 12px; align-items: flex-start;
  background: linear-gradient(135deg, #eef0ff, #fce7f3);
  border: 1px solid #e0e7ff;
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin-top: 6px;
  font-size: 13px; line-height: 1.55;
  color: #3730a3;
}
.estimate-hint b { color: #1e1b4b; }
.estimate-hint .estimate-ico { font-size: 22px; line-height: 1; }
.manual-override {
  color: #6366f1; font-weight: 600; text-decoration: none;
  border-bottom: 1px dashed currentColor; font-size: 12px; margin-left: 6px;
}
.manual-override:hover { color: #4338ca; }

/* --- Доп. соисполнители (chip-list в модалке задачи) --- */
.extra-assignees {
  display: flex; flex-direction: column; gap: 6px;
}
.extra-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  min-height: 32px;
  padding: 6px;
  background: var(--ink-50, #f8fafc);
  border: 1px dashed var(--ink-100);
  border-radius: var(--r-sm, 8px);
}
.extra-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 4px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12.5px; font-weight: 600;
  color: var(--ink-700);
  cursor: pointer;
  transition: all .14s;
}
.extra-chip:hover {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #4338ca;
}
.extra-chip.on {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border-color: #4f46e5;
  box-shadow: 0 2px 8px rgba(99,102,241,.3);
}
.ec-ava {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #94a3b8, #64748b);
  color: #fff; font-size: 10px; font-weight: 800;
}
.extra-chip.on .ec-ava {
  background: rgba(255,255,255,.25);
}
.ec-name {
  max-width: 140px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.ec-check {
  font-size: 13px; font-weight: 700;
  width: 14px; text-align: center;
  opacity: .75;
}
.extra-chip.on .ec-check { opacity: 1; }
.extra-empty {
  font-size: 12px; color: var(--ink-500); font-style: italic;
  padding: 4px 6px;
}

/* Подсказка о дневном плане по проекту в модалке задачи */
.budget-hint {
  display: flex; gap: 12px; align-items: flex-start;
  background: linear-gradient(135deg, rgba(14,165,233,.10), rgba(59,130,246,.06));
  border: 1px solid rgba(14,165,233,.28);
  border-radius: var(--r-md);
  padding: 10px 12px;
  margin-top: 6px;
  font-size: 12.5px; line-height: 1.45;
  color: #0369a1;
}
.budget-hint.over {
  background: linear-gradient(135deg, rgba(239,68,68,.10), rgba(249,115,22,.07));
  border-color: rgba(239,68,68,.35);
  color: #b91c1c;
}
.budget-hint b { color: var(--ink-900); }
.budget-hint.over b { color: #7f1d1d; }
.budget-hint-ico { font-size: 18px; line-height: 1; margin-top: 1px; }
.budget-hint-body { flex: 1; min-width: 0; }
.budget-hint-line { margin-bottom: 5px; }
.budget-hint-bar {
  height: 4px; background: rgba(14,165,233,.15);
  border-radius: 999px; overflow: hidden;
}
.budget-hint.over .budget-hint-bar { background: rgba(239,68,68,.15); }
.budget-hint-fill {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #3b82f6);
  transition: width .25s ease;
}
.budget-hint.over .budget-hint-fill {
  background: linear-gradient(90deg, #ef4444, #f97316);
}

/* ============ Dashboard project group ============ */
.dash-project-head {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 0 10px;
}
.dash-project-head .dash-dot {
  width: 12px; height: 12px; border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,.1);
}
.dash-project-head h3 {
  font-size: 15px; font-weight: 700; letter-spacing: -0.01em;
  color: var(--ink-900);
}
.dash-project-head .dash-meta {
  color: var(--ink-500); font-size: 12px; font-weight: 500;
}
.imp-band {
  margin: 12px 0 6px; padding: 3px 10px;
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.imp-band.imp-1 { background: #fee2e2; color: #991b1b; }
.imp-band.imp-2 { background: var(--ink-100); color: var(--ink-600); }
.imp-band.imp-3 { background: #f1f5f9; color: #64748b; }

/* ==========================================================================
   БЛОК ВСТРЕЧИ В МОДАЛКЕ ЗАДАЧИ
   ========================================================================== */
.meeting-block {
  margin-top: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #eef2ff, #f5f3ff);
  border: 1px solid #c7d2fe;
  border-radius: var(--r-lg);
}
.meeting-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.meeting-ico { font-size: 16px; }
.meeting-title { font-weight: 700; color: #4338ca; font-size: 13px; flex: 1; }
.meeting-input-row {
  display: flex; gap: 6px; align-items: stretch;
}
.meeting-input-row input {
  flex: 1; min-width: 0;
  padding: 8px 10px; border-radius: 8px; border: 1px solid var(--ink-200);
  background: #fff; font-size: 13px; font-family: inherit; color: var(--ink-700);
}
.meeting-input-row input:focus { border-color: #6366f1; outline: none; }
.meeting-input-row .ghost-button { padding: 6px 10px; font-size: 14px; }
.meeting-hint {
  font-size: 11.5px; color: var(--ink-500); margin-top: 6px;
}

.task-meeting-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  background: #eef2ff; color: #4338ca;
  font-size: 11.5px; font-weight: 600;
  text-decoration: none; border: 1px solid #c7d2fe;
  transition: all .15s;
}
.task-meeting-chip:hover { background: #c7d2fe; color: #3730a3; }

/* ==========================================================================
   КАЛЕНДАРЬ — виджет (правая колонка) и полный вид
   ========================================================================== */
.cal-widget-wrap {
  background: #fff;
  border: 1px solid var(--ink-100);
  border-radius: var(--r-xl);
  padding: 14px 14px 12px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}
.cal-widget-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.cal-widget-title {
  flex: 1; text-align: center; font-weight: 700; font-size: 14px;
  text-transform: capitalize; color: var(--ink-700);
}
.cal-nav {
  width: 26px; height: 26px; border-radius: 8px;
  border: 1px solid var(--ink-100); background: #fff; cursor: pointer;
  font-size: 16px; line-height: 1; color: var(--ink-600);
  transition: all .15s;
}
.cal-nav:hover { background: var(--ink-50); border-color: var(--ink-200); }

.cal-widget {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px;
}
.cal-dow {
  font-size: 10px; font-weight: 700; text-align: center;
  text-transform: uppercase; color: var(--ink-400);
  letter-spacing: 0.04em; padding: 4px 0 2px;
}
.cal-day {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background: var(--ink-50);
  border: 1px solid transparent;
  cursor: pointer;
  display: flex; flex-direction: column;
  justify-content: space-between;
  padding: 4px 5px 3px;
  transition: all .15s;
  overflow: hidden;
}
.cal-day:hover { background: #eef2ff; border-color: #c7d2fe; }
.cal-day.other-month { opacity: .35; }
.cal-day.today { border-color: #6366f1; background: #eef2ff; }
.cal-day.today .cal-day-num { color: #4338ca; font-weight: 800; }
.cal-day.has-tasks { background: #fff; border-color: var(--ink-100); }
.cal-day .cal-day-num {
  font-size: 11.5px; font-weight: 600; color: var(--ink-700); line-height: 1;
}
.cal-day .cal-day-load {
  height: 3px; border-radius: 2px; background: var(--ink-100); overflow: hidden;
}
.cal-day .cal-day-load-fill {
  height: 100%; background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 2px; transition: width .25s;
}
.cal-day.over .cal-day-load-fill { background: linear-gradient(90deg, #f97316, #ef4444); }
.cal-day .cal-day-plus {
  position: absolute; top: 2px; right: 3px;
  width: 16px; height: 16px; border-radius: 4px;
  border: none; background: #6366f1; color: #fff;
  font-size: 12px; line-height: 1; cursor: pointer;
  opacity: 0; transition: opacity .15s;
}
.cal-day:hover .cal-day-plus { opacity: 1; }

.cal-widget-foot {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--ink-100);
  font-size: 12px; color: var(--ink-500);
}
.cal-widget-foot b { color: var(--ink-700); }
.cal-open-full { margin-left: auto; padding: 5px 10px; font-size: 12px; }

/* -------- полный вид календаря (вписывается в #task-groups) -------- */
.cal-full {
  background: #fff;
  border: 1px solid var(--ink-100);
  border-radius: var(--r-2xl);
  padding: 18px 20px 22px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}
.cal-full-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.cal-full-title {
  flex: 1; font-size: 22px; font-weight: 800; letter-spacing: -0.02em;
  text-transform: capitalize; color: var(--ink-800);
}
.cal-full-meta { font-size: 12.5px; color: var(--ink-500); }
.cal-full-meta b { color: var(--ink-700); }
.cal-full-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
}
.cal-full-grid .cal-dow { padding: 6px 0 4px; font-size: 11.5px; }
.cal-full-grid .cal-day {
  aspect-ratio: auto;
  min-height: 90px;
  padding: 8px 10px 8px;
  align-items: stretch; justify-content: flex-start;
  gap: 6px;
}
.cal-full-grid .cal-day .cal-day-num { font-size: 14px; }
.cal-full-grid .cal-day .cal-day-chips {
  display: flex; flex-direction: column; gap: 2px;
  font-size: 11px; color: var(--ink-600);
  overflow: hidden;
}
.cal-full-grid .cal-day .cal-day-chip {
  display: flex; align-items: center; gap: 4px;
  background: var(--ink-50); padding: 2px 6px;
  border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-full-grid .cal-day .cal-day-chip.deadline { background: #fef3c7; color: #92400e; }
.cal-full-grid .cal-day .cal-day-chip.done { background: #d1fae5; color: #065f46; text-decoration: line-through; opacity: .75; }
.cal-full-grid .cal-day .cal-day-chip .dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.cal-full-grid .cal-day .cal-day-more {
  font-size: 10.5px; color: var(--ink-400); font-weight: 600;
}
.cal-full-grid .cal-day .cal-day-plus {
  width: 20px; height: 20px; font-size: 14px; top: 6px; right: 6px;
}
.cal-full-grid .cal-day .cal-day-load { height: 4px; margin-top: auto; }

/* -------- модалка дня -------- */
.day-load-card {
  background: var(--ink-50);
  border-radius: var(--r-lg);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.day-load-row {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 8px;
}
.day-load-label { font-size: 12px; color: var(--ink-500); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.day-load-val { font-size: 20px; font-weight: 800; color: var(--ink-800); font-variant-numeric: tabular-nums; }
.day-load-bar { height: 8px; background: var(--ink-100); border-radius: 4px; overflow: hidden; }
.day-load-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  transition: width .3s;
}
.day-load-fill.over { background: linear-gradient(90deg, #f97316, #ef4444); }
.day-load-hint { margin-top: 8px; font-size: 12px; color: var(--ink-500); }

.day-split {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-bottom: 14px;
}
.day-col { min-width: 0; }
.day-col-head {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--ink-500); margin-bottom: 8px;
}
.day-tasks { display: flex; flex-direction: column; gap: 6px; }
.day-task {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 8px;
  background: var(--ink-50); border: 1px solid transparent;
  font-size: 13px; color: var(--ink-700); cursor: pointer;
  transition: all .15s;
}
.day-task:hover { background: #eef2ff; border-color: #c7d2fe; }
.day-task .dt-time { font-size: 11.5px; color: var(--ink-500); font-variant-numeric: tabular-nums; min-width: 38px; }
.day-task .dt-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-task .dt-mins { font-size: 11px; color: var(--ink-400); }
.day-task.done { text-decoration: line-through; opacity: .55; }
.day-tasks-empty { font-size: 12px; color: var(--ink-400); font-style: italic; padding: 4px 0; }
@media (max-width: 680px) {
  .day-split { grid-template-columns: 1fr; }
}

/* ================= IN-PROGRESS GROUP (блок «В работе прямо сейчас») ================= */
.group.in-progress-group .group-head {
  color: #4338ca;
  font-size: 13px;
}
.group.in-progress-group .group-head .group-count {
  background: #eef0ff; color: #4338ca;
}
.group.in-progress-group .group-head .ipg-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,.18);
  animation: blink-dot 1.2s infinite;
  display: inline-block;
}

/* ================= STATUS BAR в модалке задачи ================= */
.task-status-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px;
  background: linear-gradient(135deg, #f5f7ff 0%, #fafbfd 100%);
  border: 1px solid #e0e5ff;
  border-radius: var(--r-md);
}
.task-status-bar .tsb-left {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.task-status-bar .tsb-label {
  font-size: 11.5px; font-weight: 700;
  color: var(--ink-500);
  text-transform: uppercase; letter-spacing: .06em;
}
.task-status-bar .tsb-badge {
  font-size: 12.5px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  background: var(--ink-100); color: var(--ink-700);
  border: 1px solid var(--border);
}
.tsb-badge.st-pending    { background:#f3f4f6; color:#4b5563; border-color:#e5e7eb; }
.tsb-badge.st-inprogress { background:#eef0ff; color:#4338ca; border-color:#c7d2fe; }
.tsb-badge.st-done       { background:#ecfdf5; color:#047857; border-color:#a7f3d0; }
.tsb-badge.st-skipped    { background:#fff7ed; color:#c2410c; border-color:#fed7aa; }

.task-status-bar .tsb-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-left: auto;
}
.tsb-btn {
  cursor: pointer;
  padding: 7px 14px;
  border-radius: var(--r-md);
  font-size: 13px; font-weight: 600;
  border: 1px solid var(--border);
  background: #fff; color: var(--ink-700);
  transition: all .15s;
}
.tsb-btn:hover:not(:disabled) {
  border-color: var(--indigo-400);
  box-shadow: 0 0 0 3px var(--ring);
}
.tsb-btn:disabled { opacity: .55; cursor: wait; }

.tsb-btn.start {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 12px rgba(99,102,241,.28);
}
.tsb-btn.start:hover:not(:disabled) {
  box-shadow: 0 6px 18px rgba(99,102,241,.38);
  transform: translateY(-1px);
}
.tsb-btn.finish {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 12px rgba(16,185,129,.28);
}
.tsb-btn.finish:hover:not(:disabled) {
  box-shadow: 0 6px 18px rgba(16,185,129,.38);
  transform: translateY(-1px);
}
.tsb-btn.pause {
  background: #fff7ed; color: #c2410c; border-color: #fed7aa;
}
.tsb-btn.pause:hover:not(:disabled) {
  background: #ffedd5; border-color: #fdba74;
}
.tsb-btn.reopen {
  background: var(--ink-50); color: var(--ink-700);
}
.tsb-btn.reopen:hover:not(:disabled) {
  background: var(--ink-100); color: var(--ink-900);
}

@media (max-width: 560px) {
  .task-status-bar .tsb-actions { margin-left: 0; width: 100%; }
}

/* ================= PROJECT STATS (дашборд) ================= */
/* Кнопка-toggle «Проекты» — видна только на мобильном (<=900px, см. @media). */
.proj-stats-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  margin: 0 0 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-weight: 700; font-size: 13.5px;
  color: var(--ink-900);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: background .14s, border-color .14s;
  -webkit-tap-highlight-color: transparent;
}
.proj-stats-toggle:hover { background: var(--ink-50); }
.proj-stats-toggle .pst-ico { font-size: 15px; line-height: 1; }
.proj-stats-toggle .pst-label { flex: 1; text-align: left; }
.proj-stats-toggle .pst-count {
  background: var(--ink-100); color: var(--ink-600);
  padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.proj-stats-toggle .pst-chevron {
  font-size: 12px; color: var(--ink-500);
  transition: transform .22s cubic-bezier(.2, .8, .2, 1);
}
body.projects-expanded .proj-stats-toggle .pst-chevron { transform: rotate(180deg); }

.proj-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}
/* Мобильное сворачивание блока «Проекты». Этот @media-блок должен идти
   ПОСЛЕ базовых правил .proj-stats / .proj-stats-toggle, иначе source-order
   их базовые декларации перебивают наши мобильные display:none/flex. */
@media (max-width: 900px) {
  .proj-stats-toggle { display: flex; }
  .proj-stats {
    display: none;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: -2px;
    animation: projStatsIn .22s ease-out;
  }
  body.projects-expanded .proj-stats { display: grid; }
  @keyframes projStatsIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: none; }
  }
}
.proj-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
  transition: transform .12s, box-shadow .15s, border-color .15s;
  display: flex; flex-direction: column; gap: 10px;
  font: inherit; color: inherit;
}
.proj-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(15,20,40,.08);
  border-color: #c7d2fe;
}
.proj-card.active {
  border-color: var(--indigo-500);
  box-shadow: 0 0 0 3px var(--ring), var(--shadow-xs);
  background: #fafbff;
}
/* Главная кликабельная область карточки (заголовок + статистика + шкала). */
.pc-main {
  all: unset;
  display: flex; flex-direction: column; gap: 10px;
  cursor: pointer;
  width: 100%;
  font: inherit; color: inherit;
  text-align: left;
}
.pc-main:focus-visible {
  outline: 2px solid var(--indigo-500);
  outline-offset: 2px;
  border-radius: 6px;
}
.pc-head {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 14px; color: var(--ink-900);
}
.pc-dot {
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0,0,0,.05);
}
.pc-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; min-width: 0;
}
.pc-stats {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.pc-pill {
  font-size: 11.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
  border: 1px solid transparent;
}
.pc-pill.pc-done   { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.pc-pill.pc-active { background: #eef0ff; color: #4338ca; border-color: #c7d2fe; }
.pc-pill.pc-hours  { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.pc-bar {
  height: 4px; background: var(--ink-100); border-radius: 999px;
  overflow: hidden;
}
.pc-bar-fill {
  height: 100%; transition: width .3s ease;
  border-radius: 999px;
}
.pc-foot {
  display: flex; justify-content: space-between;
  font-size: 11.5px; color: var(--ink-500);
  font-variant-numeric: tabular-nums;
}

/* ---------- Дневной бюджет проекта ---------- */
.pc-budget {
  display: flex; flex-direction: column; gap: 5px;
  padding: 8px 10px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(14,165,233,.08), rgba(59,130,246,.05));
  border: 1px solid rgba(14,165,233,.22);
  /* Теперь это <button> — кликом открывает модалку изменения лимита */
  font: inherit; color: inherit; text-align: left;
  cursor: pointer;
  width: 100%;
  transition: background .14s, border-color .14s, box-shadow .14s;
  -webkit-tap-highlight-color: transparent;
}
.pc-budget:hover {
  border-color: rgba(14,165,233,.45);
  box-shadow: 0 2px 10px rgba(14,165,233,.14);
}
.pc-budget.over:hover {
  border-color: rgba(239,68,68,.55);
  box-shadow: 0 2px 10px rgba(239,68,68,.18);
}
.pc-budget:focus-visible {
  outline: 2px solid #0ea5e9;
  outline-offset: 2px;
}
.pc-budget.over {
  background: linear-gradient(135deg, rgba(239,68,68,.10), rgba(249,115,22,.08));
  border-color: rgba(239,68,68,.35);
}
.pc-budget-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11.5px; font-weight: 600;
}
.pc-budget-lbl { color: #0369a1; }
.pc-budget.over .pc-budget-lbl { color: #b91c1c; }
.pc-budget-val {
  font-variant-numeric: tabular-nums;
  color: var(--ink-700);
  font-weight: 700;
}
.pc-budget-bar {
  height: 5px; background: rgba(14,165,233,.15);
  border-radius: 999px; overflow: hidden;
}
.pc-budget.over .pc-budget-bar { background: rgba(239,68,68,.15); }
.pc-budget-fill {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #3b82f6);
  transition: width .3s ease;
}
.pc-budget.over .pc-budget-fill {
  background: linear-gradient(90deg, #ef4444, #f97316);
}
.pc-set-plan {
  background: transparent;
  border: 1px dashed rgba(99,102,241,.35);
  color: #6366f1;
  font-size: 11.5px; font-weight: 600;
  padding: 6px 10px; border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
}
.pc-set-plan:hover {
  background: rgba(99,102,241,.08);
  border-color: var(--indigo-500);
  border-style: solid;
}

/* ---------- Действия в активной карточке проекта ---------- */
.pc-active-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px dashed var(--ink-100);
}
.pc-all-tasks {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 14px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  border: 1px solid #1d4ed8;
  color: #fff;
  font-weight: 700;
  font-size: 12.5px;
  border-radius: 10px;
  cursor: pointer;
  transition: all .16s;
  box-shadow: 0 2px 8px rgba(37,99,235,.25);
}
.pc-all-tasks:hover {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37,99,235,.38);
}
.pc-all-tasks .hat-ico { font-size: 14px; }
.pc-edit-plan {
  background: var(--ink-50, #f8fafc);
  border: 1px solid var(--ink-100);
  color: var(--ink-700);
  font-size: 11.5px; font-weight: 600;
  padding: 8px 10px; border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
}
.pc-edit-plan:hover {
  background: #eef0ff;
  border-color: #c7d2fe;
  color: #4338ca;
}

/* ---------- Модалка «План на день» ---------- */
.dp-project {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 700; color: var(--ink-900);
  margin-bottom: 8px;
}
.dp-dot {
  width: 12px; height: 12px; border-radius: 50%;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0,0,0,.08);
}
.dp-intro {
  margin: 0 0 12px;
  color: var(--ink-500);
  font-size: 13px;
  line-height: 1.45;
}
.dp-input-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.dp-input-row input {
  flex: 1;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 700;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
}
.dp-input-row input:focus {
  outline: none;
  border-color: var(--indigo-500);
  box-shadow: 0 0 0 3px var(--ring);
}
.dp-unit { color: var(--ink-500); font-size: 13px; }
.dp-quick {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.dp-quick-btn {
  padding: 5px 10px;
  background: #eef0ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: all .12s;
}
.dp-quick-btn:hover {
  background: #c7d2fe;
  transform: translateY(-1px);
}
.dp-preview {
  padding: 10px 12px;
  background: #f8fafc;
  border-left: 3px solid #0ea5e9;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--ink-700);
  line-height: 1.5;
}
.dp-preview.over {
  background: #fef2f2;
  border-left-color: #ef4444;
  color: #991b1b;
}
.dp-preview b { color: var(--ink-900); }
.dp-preview.over b { color: #7f1d1d; }

/* ================= SCHEDULED-TODAY BLOCK ================= */
.group.scheduled-today .group-head {
  color: #0369a1;
  font-size: 13px;
}
.group.scheduled-today .group-head .group-count {
  background: #e0f2fe; color: #0369a1;
}
.group.scheduled-today .group-head .group-hint {
  color: #64748b;
}

/* ==========================================================================
   AUTH OVERLAY — экран входа / регистрации
   ========================================================================== */
.auth-overlay {
  position: fixed; inset: 0; z-index: 500;
  background:
    radial-gradient(circle at 10% 0%, rgba(139,92,246,.28), transparent 42%),
    radial-gradient(circle at 95% 95%, rgba(236,72,153,.24), transparent 42%),
    radial-gradient(circle at 50% 50%, rgba(99,102,241,.18), transparent 60%),
    #0a0d1a;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  animation: fadeIn .2s ease-out;
}
.auth-card {
  background: #fff;
  border-radius: var(--r-2xl);
  box-shadow: 0 30px 80px rgba(15,20,40,.45), 0 8px 24px rgba(15,20,40,.25);
  padding: 32px 32px 28px;
  width: 100%; max-width: 420px;
  animation: popIn .24s cubic-bezier(.16, 1, .3, 1);
}
.auth-brand {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 22px;
}
.auth-logo {
  width: 44px; height: 44px; border-radius: var(--r-md);
  background: var(--g-primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 18px rgba(99,102,241,.35);
  flex-shrink: 0;
}
.auth-title {
  font-size: 18px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink-900);
}
.auth-sub {
  font-size: 12px; color: var(--ink-500); margin-top: -1px;
}

.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--ink-50);
  border-radius: var(--r-md);
  padding: 4px;
  gap: 4px;
  margin-bottom: 20px;
  border: 1px solid var(--border-soft);
}
.auth-tab {
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 700;
  color: var(--ink-500);
  transition: all .15s;
  background: transparent;
}
.auth-tab:hover:not(.active) { color: var(--ink-800); background: rgba(99,102,241,.06); }
.auth-tab.active {
  background: #fff;
  color: var(--indigo-700);
  box-shadow: var(--shadow-xs);
}

.auth-form {
  display: flex; flex-direction: column; gap: 14px;
}
.auth-form .field-label {
  font-size: 11.5px; font-weight: 700;
  color: var(--ink-500);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 4px; display: block;
}
.auth-form input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: #fff;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.auth-form input:focus {
  border-color: var(--indigo-500);
  box-shadow: 0 0 0 3px var(--ring);
}

.auth-err {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: 12.5px; font-weight: 500;
}

.auth-submit {
  width: 100%;
  justify-content: center;
  padding: 12px 16px;
  font-size: 14.5px;
  margin-top: 4px;
}

.auth-hint {
  font-size: 12px;
  color: var(--ink-500);
  text-align: center;
  line-height: 1.55;
  padding-top: 4px;
}
.auth-hint code {
  background: #eef0ff; color: #4338ca;
  font-weight: 700;
}

/* ==========================================================================
   SIDEBAR USER BLOCK (аватар + email + кнопка выхода)
   ========================================================================== */
.side-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,.06);
  color: rgba(255,255,255,.85);
  position: relative; z-index: 1;
}
.side-user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--g-primary);
  color: #fff; font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  text-transform: uppercase;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(99,102,241,.35);
}
.side-user-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 1px;
}
.side-user-name {
  font-size: 12.5px; font-weight: 700;
  color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.side-user-email {
  font-size: 11px; color: rgba(255,255,255,.55);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.side-user-logout {
  width: 30px; height: 30px; border-radius: var(--r-sm);
  color: rgba(255,255,255,.55);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s;
  flex-shrink: 0;
}
.side-user-logout:hover {
  background: rgba(239,68,68,.18); color: #fca5a5;
}

/* когда юзер-блок виден — у статуса убираем авто-отступ сверху,
   чтобы он шёл сразу под ним, а не прилипал к низу */
.sidebar .side-user:not(.hidden) ~ .side-status {
  margin-top: 0;
  border-top: none;
}

/* ============================================================
   COLLABORATION — приглашение в проект, участники, shared-бейдж
   ============================================================ */

/* + кнопка у проекта в сайдбаре (для invite) */
.side-list button .proj-share {
  opacity: 0;
  width: 22px; height: 22px; margin-left: 2px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.7); font-size: 14px; line-height: 1;
  transition: all .15s;
  flex-shrink: 0;
  background: rgba(255,255,255,.04);
}
.side-list button:hover .proj-share,
.side-list button.active .proj-share { opacity: 1; }
.side-list button .proj-share:hover {
  background: linear-gradient(135deg,#6366f1,#ec4899);
  color: #fff; transform: scale(1.06);
}
.side-list button .proj-shared-badge {
  font-size: 11px;
  background: rgba(139,92,246,.22);
  color: #e5def6;
  padding: 1px 6px; border-radius: 999px;
  margin-left: 4px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 3px;
}

/* ---------- SHARE modal ---------- */
.share-project-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; margin-bottom: 14px;
  background: linear-gradient(135deg, #eef0ff, #fce7f3);
  border-radius: var(--r-md);
  border: 1px solid var(--border-soft);
}
.share-dot {
  width: 14px; height: 14px; border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255,255,255,.6);
  flex-shrink: 0;
}
.share-project-name { flex: 1; font-weight: 700; font-size: 15.5px; color: var(--ink-900); }
.share-project-role {
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(99,102,241,.15); color: #4338ca;
}
.share-project-role.role-member { background: rgba(20,184,166,.15); color: #0f766e; }

.share-section { margin-bottom: 20px; }
.share-section-title {
  font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-500); margin-bottom: 8px;
}
.share-invite-row {
  display: flex; gap: 6px; align-items: center;
}
.share-invite-row input {
  flex: 1; padding: 9px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--ink-50);
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-800);
}
.share-invite-row input:focus { outline: 2px solid var(--ring); }
.share-invite-row .ghost-button.small,
.share-invite-row .primary-button.small {
  padding: 8px 12px; font-size: 13px; flex-shrink: 0;
}
.share-invite-hint {
  margin-top: 8px; font-size: 12.5px; color: var(--ink-500); line-height: 1.5;
}

.share-members {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 280px; overflow-y: auto;
}
.share-member-row {
  display: grid; grid-template-columns: 32px 1fr auto auto; gap: 10px;
  align-items: center;
  padding: 8px 12px; border-radius: var(--r-sm);
  background: var(--ink-50); border: 1px solid var(--border-soft);
}
.share-member-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
  color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.share-member-info { min-width: 0; }
.share-member-name { font-weight: 600; font-size: 13.5px; color: var(--ink-900);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.share-member-email { font-size: 11.5px; color: var(--ink-500);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.share-member-role {
  font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px;
}
.share-member-role.owner { background: rgba(245,158,11,.2); color: #92400e; }
.share-member-role.member { background: rgba(99,102,241,.12); color: #4338ca; }
.share-member-remove {
  background: transparent; color: var(--red-500);
  width: 28px; height: 28px; border-radius: 50%; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.share-member-remove:hover { background: #fee2e2; color: #b91c1c; }

/* ---------- JOIN modal (поп-ап «Вас пригласили») ---------- */
.join-project-card {
  display: flex; gap: 14px; align-items: center;
  padding: 16px 18px; border-radius: var(--r-md);
  background: linear-gradient(135deg, #eef0ff, #fce7f3);
  border: 1px solid var(--border-soft);
  margin-bottom: 14px;
}
.join-dot {
  width: 48px; height: 48px; border-radius: 14px;
  box-shadow: 0 4px 14px rgba(99,102,241,.28);
  flex-shrink: 0;
}
.join-project-name {
  font-size: 18px; font-weight: 800; color: var(--ink-900);
  letter-spacing: -.01em;
}
.join-meta { font-size: 12.5px; color: var(--ink-500); margin-top: 2px; }
.join-inviter {
  font-size: 13px; color: var(--ink-700); padding: 10px 14px;
  background: var(--ink-50); border-radius: var(--r-sm);
  border-left: 3px solid var(--indigo-500);
  margin-bottom: 12px;
}
.join-hint {
  font-size: 12.5px; color: var(--ink-500); line-height: 1.55;
  padding: 10px 12px; border-radius: var(--r-sm);
  background: rgba(16,185,129,.06);
  border: 1px solid rgba(16,185,129,.18);
}

/* ========== СПИСОК УЧАСТНИКОВ ПОД АКТИВНЫМ ПРОЕКТОМ (САЙДБАР) ========== */
.proj-members {
  list-style: none;
  margin: 2px 0 6px 0;
  padding: 4px 6px 4px 22px;
  display: flex; flex-direction: column; gap: 2px;
  animation: proj-members-in .18s ease;
}
@keyframes proj-members-in {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: translateY(0); }
}
.proj-member {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px;
  font-size: 12px;
  color: #fff;
  border-radius: 8px;
  transition: background .12s, transform .12s;
  cursor: pointer;
  user-select: none;
}
.proj-member:hover {
  background: rgba(99,102,241,.22);
  color: #fff;
  transform: translateX(2px);
}
.proj-member-name { color: #fff; }
.proj-member-ava {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--indigo-500), #8b5cf6);
  flex-shrink: 0;
}
.proj-member-ava.me {
  background: linear-gradient(135deg, #14b8a6, #0ea5e9);
}
.proj-member-name {
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.proj-member-role {
  font-size: 10px; padding: 1px 6px;
  border-radius: 6px;
  background: var(--ink-100);
  color: var(--ink-500);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  flex-shrink: 0;
}
.proj-member-role.owner {
  background: rgba(245,158,11,.14);
  color: #92400e;
}
.proj-member-empty {
  font-size: 11.5px;
  color: var(--ink-400);
  padding: 3px 8px;
  font-style: italic;
}
.proj-member-remove {
  flex-shrink: 0;
  width: 20px; height: 20px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  color: rgba(255,255,255,.55);
  border: 1px solid transparent;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s, background .12s, color .12s, border-color .12s, transform .12s;
  padding: 0;
  margin-left: 2px;
}
.proj-member:hover .proj-member-remove {
  opacity: 1;
}
.proj-member-remove:hover {
  background: rgba(239,68,68,.18);
  color: #fecaca;
  border-color: rgba(239,68,68,.45);
  transform: scale(1.08);
}
.proj-member-remove:active {
  transform: scale(.92);
}

/* ========== КНОПКА «ВСЕ ЗАДАЧИ ПРОЕКТА» В HERO ========== */
.hero-all-tasks {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 14px;
  padding: 8px 14px;
  background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(139,92,246,.10));
  border: 1px solid rgba(99,102,241,.28);
  color: #4338ca;
  font-weight: 600;
  font-size: 13px;
  border-radius: 10px;
  cursor: pointer;
  transition: all .16s;
  box-shadow: 0 1px 2px rgba(99,102,241,.10);
}
.hero-all-tasks:hover {
  background: linear-gradient(135deg, rgba(99,102,241,.18), rgba(139,92,246,.16));
  border-color: rgba(99,102,241,.42);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99,102,241,.16);
}
.hero-all-tasks .hat-ico { font-size: 15px; }

/* ========== МОДАЛКА «ВСЕ ЗАДАЧИ ПРОЕКТА» ========== */
.modal-card.large {
  max-width: 960px;
  width: calc(100vw - 40px);
}
.all-tasks-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--ink-50);
  border: 1px solid var(--ink-100);
  border-radius: var(--r-sm);
  margin-bottom: 14px;
}
.all-tasks-summary {
  font-size: 13px; color: var(--ink-700); font-weight: 500;
}
.all-tasks-summary b { color: var(--ink-900); font-weight: 700; }
.all-tasks-filters {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.all-tasks-filters label {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--ink-600);
}
.all-tasks-filters select {
  padding: 5px 8px;
  font-size: 13px;
  border: 1px solid var(--ink-200);
  border-radius: 7px;
  background: #fff;
  color: var(--ink-800);
  cursor: pointer;
}
.all-tasks-groups {
  display: flex; flex-direction: column; gap: 16px;
}
.at-group {
  border: 1px solid var(--ink-100);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: #fff;
}
.at-group-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: var(--ink-50);
  border-bottom: 1px solid var(--ink-100);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-800);
}
.at-group-count {
  margin-left: auto;
  font-size: 12px;
  padding: 2px 8px;
  background: var(--ink-100);
  color: var(--ink-600);
  border-radius: 10px;
  font-weight: 600;
}
.at-group.status-pending .at-group-head { background: rgba(99,102,241,.08); color: #4338ca; }
.at-group.status-in_progress .at-group-head { background: rgba(251,191,36,.12); color: #92400e; }
.at-group.status-done .at-group-head { background: rgba(16,185,129,.10); color: #065f46; }
.at-group.status-skipped .at-group-head { background: rgba(148,163,184,.14); color: #475569; }

.at-list {
  display: flex; flex-direction: column;
}
.at-row {
  display: grid;
  grid-template-columns: 1fr 170px 110px 110px;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--ink-100);
  font-size: 13px;
  align-items: center;
  cursor: pointer;
  transition: background .12s;
}
.at-row:first-child { border-top: none; }
.at-row:hover { background: rgba(99,102,241,.05); }
.at-row.done .at-title { text-decoration: line-through; color: var(--ink-400); }
.at-title {
  font-weight: 600; color: var(--ink-900);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.at-title .at-imp { margin-right: 5px; }
.at-assignee {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--ink-700);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.at-assignee .av {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--indigo-500), #8b5cf6);
  flex-shrink: 0;
}
.at-assignee .av.me { background: linear-gradient(135deg, #14b8a6, #0ea5e9); }
.at-assignee.unassigned { color: var(--ink-400); font-style: italic; }
.at-deadline {
  font-size: 12px; color: var(--ink-600);
  white-space: nowrap;
}
.at-deadline.overdue { color: #b91c1c; font-weight: 600; }
.at-time {
  font-size: 12px; color: var(--ink-500);
  white-space: nowrap;
  text-align: right;
}
.at-empty {
  padding: 16px; text-align: center;
  color: var(--ink-400); font-size: 13px;
  font-style: italic;
}
@media (max-width: 700px) {
  .at-row {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .at-row .at-time, .at-row .at-deadline { grid-column: span 1; }
  .at-row .at-title { grid-column: span 2; }
  .at-row .at-assignee { grid-column: span 2; }
}

/* ========== МОДАЛКА СООБЩЕНИЯ В TELEGRAM ========== */
.mm-to {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, rgba(99,102,241,.06), rgba(139,92,246,.04));
  border: 1px solid rgba(99,102,241,.18);
  border-radius: var(--r-sm);
}
.mm-to-ava {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--indigo-500), #8b5cf6);
  flex-shrink: 0;
}
.mm-to-name { font-weight: 700; color: var(--ink-900); font-size: 14px; }
.mm-to-email { font-size: 12px; color: var(--ink-500); }
#mm-text {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.5;
  border: 1px solid var(--ink-200);
  border-radius: var(--r-sm);
  resize: vertical;
  color: var(--ink-900);
  background: #fff;
  box-sizing: border-box;
}
#mm-text:focus {
  outline: none;
  border-color: var(--indigo-500);
  box-shadow: 0 0 0 4px var(--ring);
}
.mm-hint {
  font-size: 12px; color: var(--ink-500); line-height: 1.5;
  padding: 8px 10px; margin-top: 10px;
  background: var(--ink-50);
  border-radius: var(--r-sm);
}
.mm-status {
  margin-top: 10px;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: var(--r-sm);
  line-height: 1.4;
}
.mm-status.ok { background: rgba(16,185,129,.1); color: #065f46; border: 1px solid rgba(16,185,129,.3); }
.mm-status.err { background: rgba(239,68,68,.1); color: #991b1b; border: 1px solid rgba(239,68,68,.3); }

/* ============== ks-orchestrator pipeline panel ============== */
.task-pipeline-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; line-height: 1.4;
  margin-left: 6px; cursor: pointer;
  background: linear-gradient(135deg, #6366f1, #8b5cf6); color: white;
  border: none; transition: transform .12s ease;
}
.task-pipeline-badge:hover { transform: scale(1.04); }
.task-pipeline-badge.status-done { background: linear-gradient(135deg, #10b981, #059669); }
.task-pipeline-badge.status-failed { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.task-pipeline-badge.status-paused { background: linear-gradient(135deg, #94a3b8, #64748b); }

.pp-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 9000; backdrop-filter: blur(2px);
}
.pp-panel {
  background: #fff; color: #0f172a;
  width: min(960px, 96vw); max-height: 92vh;
  border-radius: 16px; box-shadow: 0 24px 60px -10px rgba(0,0,0,.4);
  display: flex; flex-direction: column; overflow: hidden;
}
.pp-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; padding: 18px 22px; border-bottom: 1px solid #e2e8f0;
}
.pp-head h2 { margin: 0; font-size: 18px; }
.pp-head .pp-task { color: #64748b; font-size: 13px; margin-top: 4px; }
.pp-head .pp-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.pp-status-chip {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe;
}
.pp-status-chip.s-done { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.pp-status-chip.s-failed { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.pp-status-chip.s-awaiting_approval { background: #fefce8; color: #a16207; border-color: #fde68a; }
.pp-status-chip.s-paused { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.pp-status-chip.s-waiting_resources { background: #fef3c7; color: #92400e; border-color: #fcd34d; }

.pp-close {
  border: none; background: transparent; font-size: 22px; line-height: 1;
  cursor: pointer; color: #64748b; padding: 2px 6px;
}
.pp-close:hover { color: #0f172a; }

.pp-body { padding: 18px 22px; overflow-y: auto; }

.pp-timeline { display: flex; flex-direction: column; gap: 10px; }
.pp-stage {
  border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px 14px;
  background: #f8fafc;
  transition: background .15s ease;
}
.pp-stage.is-current { border-color: #fbbf24; background: #fffbeb; }
.pp-stage.is-done { border-color: #86efac; background: #f0fdf4; }
.pp-stage.is-failed { border-color: #fca5a5; background: #fef2f2; }
.pp-stage-head {
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; user-select: none;
}
.pp-stage-title { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.pp-stage-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: #cbd5e1; color: white; font-size: 11px; font-weight: 700;
}
.pp-stage.is-done .pp-stage-num { background: #10b981; }
.pp-stage.is-current .pp-stage-num { background: #f59e0b; }
.pp-stage.is-failed .pp-stage-num { background: #ef4444; }
.pp-stage-meta { font-size: 11px; color: #64748b; }
.pp-stage-body {
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed #cbd5e1;
  font-size: 13px; line-height: 1.55;
}
.pp-stage-summary { font-weight: 500; margin-bottom: 8px; color: #334155; }

.pp-actions {
  margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap;
  padding-top: 14px; border-top: 1px solid #e2e8f0;
}
.pp-btn {
  border: 1px solid #cbd5e1; background: white; color: #0f172a;
  padding: 8px 16px; border-radius: 8px; cursor: pointer;
  font-size: 13px; font-weight: 600; transition: all .12s ease;
}
.pp-btn:hover { background: #f1f5f9; transform: translateY(-1px); }
.pp-btn.primary { background: #10b981; border-color: #059669; color: white; }
.pp-btn.primary:hover { background: #059669; }
.pp-btn.warn { background: #f59e0b; border-color: #d97706; color: white; }
.pp-btn.warn:hover { background: #d97706; }
.pp-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* HYPO: список гипотез */
.pp-hyp-list { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.pp-hyp {
  background: white; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 10px 12px;
}
.pp-hyp.is-top { border-color: #fbbf24; background: #fffbeb; }
.pp-hyp-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.pp-hyp-title { font-weight: 600; font-size: 13.5px; flex: 1; }
.pp-hyp-score { font-family: 'Courier New', monospace; font-weight: 700; color: #0f172a; }
.pp-hyp-meta { color: #64748b; font-size: 12px; margin-top: 4px; }
.pp-hyp-rationale { margin: 6px 0 4px; color: #334155; font-size: 13px; }
.pp-hyp-step { font-size: 12px; color: #475569; font-style: italic; }

/* Markdown render (для брифа консилиума) */
.pp-md { font-size: 13px; line-height: 1.65; }
.pp-md h1, .pp-md h2, .pp-md h3 { margin: 16px 0 6px; line-height: 1.3; }
.pp-md h1 { font-size: 18px; }
.pp-md h2 { font-size: 15px; color: #334155; }
.pp-md h3 { font-size: 13px; color: #475569; padding-bottom: 4px; border-bottom: 1px dashed #e2e8f0; }
.pp-md p { margin: 6px 0; }
.pp-md ul, .pp-md ol { padding-left: 22px; margin: 6px 0; }
.pp-md li { margin: 3px 0; }
.pp-md strong { color: #0f172a; }
.pp-md code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; font-size: 12px; }

.pp-empty { color: #64748b; font-size: 13px; padding: 8px 0; }
.pp-refreshing { font-size: 11px; color: #64748b; }
.pp-refreshing.live::before { content: '● '; color: #10b981; animation: pp-pulse 1.5s infinite; }
@keyframes pp-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* ============== ks-orchestrator pipelines dashboard ============== */
.ppd-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
.ppd-card {
  background: white; border: 1px solid #e2e8f0; border-radius: 12px;
  padding: 16px 18px; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease;
  display: flex; flex-direction: column; gap: 10px;
}
.ppd-card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -16px rgba(0,0,0,.18); border-color: #cbd5e1; }
.ppd-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ppd-card-id {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11px; letter-spacing: .12em; color: #64748b; text-transform: uppercase;
}
.ppd-card-title { font-weight: 600; font-size: 14px; color: #0f172a; line-height: 1.4; }
.ppd-card-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; }
.ppd-progress {
  display: flex; gap: 4px; margin-top: 4px;
}
.ppd-progress > div {
  flex: 1; height: 6px; border-radius: 3px; background: #e2e8f0;
}
.ppd-progress > div.done    { background: linear-gradient(135deg, #10b981, #059669); }
.ppd-progress > div.current { background: linear-gradient(135deg, #f59e0b, #d97706); animation: ppd-pulse 1.6s ease-in-out infinite; }
.ppd-progress > div.failed  { background: linear-gradient(135deg, #ef4444, #b91c1c); }
@keyframes ppd-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.ppd-card-meta {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 11px;
  color: #64748b;
}
.ppd-card-actions { display: flex; gap: 8px; }
.ppd-card-delete {
  border: none; background: transparent; color: #94a3b8; cursor: pointer;
  font-size: 16px; padding: 4px 6px; border-radius: 6px; transition: all .15s ease;
}
.ppd-card-delete:hover { background: #fef2f2; color: #b91c1c; }

.ppd-empty {
  border: 1px dashed #cbd5e1; border-radius: 14px;
  padding: 56px 24px; text-align: center; color: #64748b; font-size: 14px;
}

/* Filter chips для пайплайн-дашборда */
.ppd-filters {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px;
}
.ppd-filter {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; border: 1px solid #e2e8f0;
  background: white; cursor: pointer; font-size: 12px; color: #475569;
  transition: all .12s ease;
}
.ppd-filter:hover { background: #f1f5f9; }
.ppd-filter.active { background: #0f172a; color: white; border-color: #0f172a; }
.ppd-filter .ct { opacity: .6; font-family: 'IBM Plex Mono', monospace; }
