/* =========================================================
   PM Dashboard — Anna Mashkina · v2
   editorial light + полноценный Gantt с историей статусов
   ========================================================= */

:root {
  /* фон / поверхность / границы */
  --bg: #FAF8F3;
  --bg-tint: #F2EEE5;
  --surface: #FFFFFF;
  --surface-warm: #FBF8F1;
  --border: #E5E0D5;
  --border-strong: #D4CCBC;
  --ink: #1A1816;
  --ink-muted: #6B6660;
  --ink-soft: #9A938A;

  /* акценты бренда */
  --accent: #C8553D;
  --accent-soft: #F2D7CC;
  --accent-deep: #8E3825;

  /* цвета статусов задач (по выбору Анны) */
  --s-setting:           #94A3B8;   /* setting task — серый */
  --s-setting-soft:      #E2E8F0;
  --s-in-progress:       #3B82F6;   /* in progress — голубой */
  --s-in-progress-soft:  #DBEAFE;
  --s-qc:                #8B5CF6;   /* quality control — фиолетовый */
  --s-qc-soft:           #EDE9FE;
  --s-rfa:               #10B981;   /* ready for acceptance — зелёный */
  --s-rfa-soft:          #D1FAE5;
  --s-paused:            #EF4444;   /* paused — красный */
  --s-paused-soft:       #FEE2E2;
  --s-pending:           #F59E0B;   /* pending more info — оранжевый */
  --s-pending-soft:      #FEF3C7;
  --s-done:              #475569;   /* done — тёмно-серый */
  --s-done-soft:         #CBD5E1;
  --s-canceled:          #EC4899;   /* canceled — розовый */
  --s-canceled-soft:     #FCE7F3;

  /* семантика */
  --danger: #DC2626;
  --warning: #D97706;
  --success: #059669;
  --info:    #2563EB;

  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(26,24,22,0.04);
  --shadow:    0 4px 14px rgba(26,24,22,0.06), 0 1px 2px rgba(26,24,22,0.04);

  --font-display: "Fraunces", "Times New Roman", Georgia, serif;
  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Шапка ===== */
.app-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface-warm);
  padding: 22px 32px 18px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.app-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 28px;
  letter-spacing: -0.02em;
  margin: 0;
  font-variation-settings: "SOFT" 80, "WONK" 0;
}
.app-title em {
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
  font-variation-settings: "SOFT" 100, "WONK" 1;
}
.app-subtitle {
  color: var(--ink-muted);
  font-size: 12px;
  margin: 3px 0 0;
  letter-spacing: 0.02em;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.period-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  background: var(--bg-tint);
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.my-cut-badge {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  padding: 7px 14px 8px;
  border-radius: var(--radius);
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  box-shadow: var(--shadow-sm);
}
.my-cut-badge__label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
}
.my-cut-badge__value {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}
.my-cut-badge__hint {
  font-size: 10px;
  color: var(--ink-soft);
  margin-top: 1px;
}

/* ===== Статус-полосы сверху (free / burning / rfa stuck) ===== */
.status-bands {
  padding: 14px 32px 4px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.status-band {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.status-band__title {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  min-width: 200px;
  padding: 5px 0;
}
.status-band__title--free   { color: var(--success); }
.status-band__title--burning{ color: var(--accent); }
.status-band__title--rfa1   { color: var(--warning); }
.status-band__title--rfa2   { color: var(--danger); }

.status-band__count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
}
.status-band__title--free   .status-band__count { background: var(--s-rfa-soft); color: var(--success); }
.status-band__title--burning .status-band__count { background: var(--accent-soft); color: var(--accent); }
.status-band__title--rfa1   .status-band__count { background: var(--s-pending-soft); color: var(--warning); }
.status-band__title--rfa2   .status-band__count { background: var(--s-paused-soft); color: var(--danger); }

.status-band__items {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}
.status-band__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background .12s, border-color .12s;
  max-width: 320px;
}
.status-band__pill:hover { background: var(--bg-tint); border-color: var(--border-strong); }
.status-band__pill strong {
  font-weight: 600;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status-band__pill span {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-soft);
  white-space: nowrap;
}
.status-band__pill--free strong { color: var(--success); }
.status-band__pill--empty {
  color: var(--ink-soft);
  font-style: italic;
  cursor: default;
  border-color: transparent;
  background: transparent;
}

/* ===== Фильтры ===== */
.filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.filters__label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
}
.filter-select, .filter-search {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  padding: 5px 26px 5px 11px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 12.5px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236B6660' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
}
.filter-search {
  background-image: none;
  padding: 5px 11px;
  min-width: 220px;
  cursor: text;
}
.filter-select:focus, .filter-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.filter-reset {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--ink-muted);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}
.filter-reset:hover { color: var(--accent); }

/* ===== Toggle pill (legacy / прочие ON/OFF) ===== */
.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12.5px;
  color: var(--ink-muted);
  user-select: none;
  transition: background .15s, border-color .15s, color .15s;
}
.toggle-pill:hover { border-color: var(--ink-muted); color: var(--ink); }
.toggle-pill input { appearance: none; margin: 0; width: 0; height: 0; }
.toggle-pill em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
}
.toggle-pill::before {
  content: "";
  width: 13px; height: 13px;
  border-radius: 3px;
  border: 1.5px solid var(--border-strong);
  display: inline-block;
  background: var(--surface);
  transition: background .15s, border-color .15s;
  flex-shrink: 0;
}
.toggle-pill:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-deep);
}
.toggle-pill:has(input:checked)::before {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent-soft);
}

/* ===== Gantt toolbar (zoom + range label) ===== */
.gantt-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.zoom-toggle {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 0;
}
.zoom-toggle__btn {
  appearance: none;
  background: none;
  border: none;
  padding: 5px 14px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-muted);
  cursor: pointer;
  border-radius: 3px;
  transition: background .15s, color .15s;
}
.zoom-toggle__btn:hover { color: var(--ink); }
.zoom-toggle__btn--active {
  background: var(--accent);
  color: #fff;
}
.zoom-toggle__btn--active:hover { color: #fff; }

/* Inline legend — компактные swatches возле зума */
.legend {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-soft);
  flex-wrap: wrap;
}
.legend__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.legend__sw {
  width: 9px; height: 9px;
  border-radius: 2px;
  display: inline-block;
}

/* ===== Hour-grain header (две строки) ===== */
.gantt__day-headrow {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface-warm);
}
.gantt__day-header {
  text-align: center;
  padding: 6px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  font-family: var(--font-mono);
  border-right: 1px solid var(--border-strong);
}
.gantt__day-header:last-child { border-right: none; }

.gantt__hour-row {
  display: flex;
}
.gantt__hour {
  flex: 1 0 0;
  text-align: center;
  padding: 2px 0 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--ink-soft);
  border-right: 1px solid var(--bg-tint);
  min-height: 18px;
}
.gantt__hour--day-start { border-left: 1px solid var(--border-strong); }
.gantt__hour--now { background: rgba(200, 85, 61, 0.08); }
.gantt__hour em { font-style: normal; font-size: 9.5px; }

/* Граница между днями в час-режиме */
.day-boundary {
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background: var(--border-strong);
  pointer-events: none;
  z-index: 1;
}

/* Подсветка 1-го числа месяца в day-grain (month view) */
.gantt__day--month-start {
  border-left: 2px solid var(--border-strong);
}

/* ===== Legacy task styling ===== */
.tag-legacy {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  font-size: 9.5px;
  font-family: var(--font-mono);
  color: var(--ink-soft);
  background: var(--bg-tint);
  border: 1px solid var(--border);
  border-radius: 3px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  vertical-align: 1px;
}
.task-bar--legacy { opacity: 0.62; }
.task-bar--legacy:hover { opacity: 1; }

/* ===== Табы ===== */
.tabs {
  display: flex;
  gap: 0;
  padding: 0 32px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 11px 16px 10px;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-muted);
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--ink); }
.tab--active { color: var(--ink); border-bottom-color: var(--accent); }
.tab__count {
  display: inline-block;
  margin-left: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  font-weight: 400;
}
.tab--active .tab__count { color: var(--accent); }

/* ===== Контент-вкладок ===== */
.tab-content { display: none; padding: 20px 32px 60px; }
.tab-content--active { display: block; }

/* ===== Gantt ===== */
.gantt {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.gantt__header {
  display: grid;
  grid-template-columns: 220px 1fr;
  border-bottom: 1px solid var(--border);
  background: var(--surface-warm);
}
.gantt__header-left {
  padding: 10px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  font-weight: 700;
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.gantt__dates {
  position: relative;
  display: flex;
}
.gantt__dates:has(.gantt__day-headrow) {
  flex-direction: column;
}
.gantt__day-headrow,
.gantt__hour-row {
  display: flex;
  width: 100%;
}
.gantt__day {
  flex: 1 0 0;
  text-align: center;
  padding: 6px 0 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-soft);
  border-right: 1px solid var(--border);
  line-height: 1.2;
  position: relative;
}
.gantt__day:last-child { border-right: none; }
.gantt__day--today { background: rgba(200, 85, 61, 0.06); color: var(--accent); font-weight: 700; }
.gantt__day--weekend { background: var(--bg-tint); }
.gantt__day strong {
  display: block;
  font-size: 13px;
  color: var(--ink);
  font-weight: 600;
}
.gantt__day em {
  font-style: normal;
  font-size: 9.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gantt__rows {
  display: flex;
  flex-direction: column;
}

.g-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  border-bottom: 1px solid var(--border);
  min-height: 44px;
}
.g-row:last-child { border-bottom: none; }
.g-row:hover { background: rgba(200, 85, 61, 0.025); }

.g-row__label {
  padding: 8px 14px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-content: center;
}
.g-row__name {
  font-weight: 500;
  font-size: 13px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
}
.g-row__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--ink-soft);
  flex-wrap: wrap;
}
.g-row__pos {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.g-row__timeline {
  position: relative;
  background:
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent calc(100% / var(--days)),
      var(--border) calc(100% / var(--days)),
      var(--border) calc(100% / var(--days) + 1px)
    );
}
.g-row__timeline-weekends {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.weekend-bg {
  position: absolute;
  top: 0; bottom: 0;
  background: var(--bg-tint);
  opacity: 0.5;
  pointer-events: none;
}

/* ===== Task bars ===== */
.task-bar {
  position: absolute;
  top: 7px;
  height: 28px;
  border-radius: 5px;
  display: flex;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.10);
  border: 1px solid rgba(0,0,0,0.06);
  transition: transform .12s, box-shadow .12s;
  z-index: 2;
  min-width: 12px;
}
.task-bar:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  z-index: 5;
}
.task-bar__segment {
  flex: 1 0 0;
  min-width: 1px;
}
.task-bar__segment.s-setting           { background: var(--s-setting); }
.task-bar__segment.s-in_progress       { background: var(--s-in-progress); }
.task-bar__segment.s-quality_control   { background: var(--s-qc); }
.task-bar__segment.s-ready             { background: var(--s-rfa); }
.task-bar__segment.s-paused            { background: var(--s-paused); }
.task-bar__segment.s-pending           { background: var(--s-pending); }
.task-bar__segment.s-done              { background: var(--s-done); }
.task-bar__segment.s-canceled          { background: var(--s-canceled); }
.task-bar__segment.s-unknown           { background: var(--ink-soft); }

/* лейбл задачи поверх */
.task-bar__label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

/* подсветка на горящих */
.task-bar--burning {
  animation: pulse-ring 1.8s ease-in-out infinite;
  border-color: var(--danger);
  border-width: 2px;
}
@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.0), 0 1px 2px rgba(0,0,0,0.10); }
  50%      { box-shadow: 0 0 0 4px rgba(220,38,38,0.18), 0 1px 2px rgba(0,0,0,0.10); }
}
.task-bar__fire {
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 16px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
  pointer-events: none;
  z-index: 6;
}

/* RFA-stuck акценты */
.task-bar--rfa-1w { box-shadow: 0 0 0 2px rgba(217,119,6,0.55), 0 1px 2px rgba(0,0,0,.10); }
.task-bar--rfa-2w { box-shadow: 0 0 0 2px rgba(220,38,38,0.65), 0 1px 2px rgba(0,0,0,.10); }

/* линия "сегодня" */
.today-line {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: var(--accent);
  pointer-events: none;
  z-index: 3;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.6);
}
.today-line::before {
  content: "";
  position: absolute;
  top: 0;
  left: -4px;
  width: 10px;
  height: 6px;
  background: var(--accent);
  border-radius: 1px;
}

/* линия дедлайна (планируемое окончание) */
.deadline-marker {
  position: absolute;
  top: 4px;
  height: 34px;
  width: 3px;
  background: var(--ink);
  z-index: 2;
  border-radius: 1px;
  pointer-events: none;
}
.deadline-marker--burning { background: var(--danger); }

/* LOA-полоса на строке спека (если он сейчас в LOA) */
.loa-strip {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    135deg,
    rgba(239,68,68,0.0) 0px,
    rgba(239,68,68,0.0) 6px,
    rgba(239,68,68,0.10) 6px,
    rgba(239,68,68,0.10) 10px
  );
  pointer-events: none;
  z-index: 1;
}

/* статус-чип возле имени */
.spec-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}
.spec-tag--free  { background: var(--s-rfa-soft);    color: var(--success); }
.spec-tag--busy  { background: var(--s-in-progress-soft); color: var(--info); }
.spec-tag--loa   { background: var(--s-paused-soft); color: var(--danger); }
.spec-tag--idle  { background: var(--bg-tint);       color: var(--ink-soft); }

/* пустой стейт */
.gantt-empty {
  padding: 40px;
  text-align: center;
  color: var(--ink-soft);
  font-style: italic;
}

/* ===== Карточки / таблицы ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card__header {
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.card__title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.01em;
}
.card__subtitle {
  font-size: 12px;
  color: var(--ink-soft);
}
.card__body { padding: 14px 18px 16px; }
.card__body--flush { padding: 0; }

.row { display: grid; gap: 16px; }
.row--cols-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .row--cols-2 { grid-template-columns: 1fr; } }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data thead th {
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-warm);
  white-space: nowrap;
}
table.data tbody td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--surface-warm); cursor: pointer; }
table.data tbody tr.row--burning { background: rgba(239,68,68,0.06); }
table.data tbody tr.row--burning:hover { background: rgba(239,68,68,0.10); }

table.data .cell-num   { font-family: var(--font-mono); font-size: 12px; text-align: right; white-space: nowrap; }
table.data .cell-muted { color: var(--ink-muted); }
table.data .cell-bold  { font-weight: 600; }
table.data .cell-truncate { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-wrap { max-height: 600px; overflow-y: auto; }
.table-wrap thead th { position: sticky; top: 0; z-index: 1; }

/* статус-бейдж в таблице */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
  text-transform: uppercase;
}
.badge--setting     { background: var(--s-setting-soft);     color: var(--s-setting); }
.badge--in_progress { background: var(--s-in-progress-soft); color: var(--s-in-progress); }
.badge--quality_control { background: var(--s-qc-soft);      color: var(--s-qc); }
.badge--ready       { background: var(--s-rfa-soft);         color: var(--s-rfa); }
.badge--paused      { background: var(--s-paused-soft);      color: var(--s-paused); }
.badge--pending     { background: var(--s-pending-soft);     color: var(--s-pending); }
.badge--done        { background: var(--s-done-soft);        color: var(--s-done); }
.badge--canceled    { background: var(--s-canceled-soft);    color: var(--s-canceled); }
.badge--neutral     { background: var(--bg-tint); color: var(--ink-muted); border: 1px solid var(--border); }

.badge-sc--open      { background: var(--s-in-progress-soft); color: var(--s-in-progress); }
.badge-sc--done      { background: var(--s-rfa-soft);         color: var(--s-rfa); }
.badge-sc--draft     { background: var(--s-pending-soft);     color: var(--s-pending); }
.badge-sc--canceled  { background: var(--s-canceled-soft);    color: var(--s-canceled); }

/* метка «передано от Натали» */
.tag-transferred {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 9.5px;
  font-family: var(--font-mono);
  color: var(--info);
  background: var(--s-in-progress-soft);
  border-radius: 3px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ===== Drawer (детали задачи) ===== */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,24,22,0.32);
  z-index: 100;
  display: none;
}
.drawer-overlay--open { display: block; }
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(560px, 92vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 101;
  transform: translateX(100%);
  transition: transform .25s ease;
  overflow-y: auto;
  box-shadow: -10px 0 30px rgba(26,24,22,0.10);
}
.drawer--open { transform: translateX(0); }
.drawer__header {
  padding: 20px 26px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-warm);
  position: sticky;
  top: 0;
}
.drawer__eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.drawer__title {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 0;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding-right: 32px;
}
.drawer__close {
  position: absolute;
  top: 16px; right: 22px;
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--ink-muted);
  cursor: pointer;
}
.drawer__close:hover { color: var(--ink); }
.drawer__body { padding: 18px 26px 28px; }
.drawer__section { margin-bottom: 22px; }
.drawer__section-title {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
  margin: 0 0 10px;
}
.drawer__kv {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 6px 14px;
  font-size: 13px;
}
.drawer__kv dt { color: var(--ink-muted); }
.drawer__kv dd { margin: 0; color: var(--ink); }

.status-history {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 12.5px;
}
.status-history__item {
  display: grid;
  grid-template-columns: 16px 1fr auto auto;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  align-items: center;
}
.status-history__item:last-child { border-bottom: none; }
.status-history__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--s-setting);
}
.status-history__dot.s-setting         { background: var(--s-setting); }
.status-history__dot.s-in_progress     { background: var(--s-in-progress); }
.status-history__dot.s-quality_control { background: var(--s-qc); }
.status-history__dot.s-ready           { background: var(--s-rfa); }
.status-history__dot.s-paused          { background: var(--s-paused); }
.status-history__dot.s-pending         { background: var(--s-pending); }
.status-history__dot.s-done            { background: var(--s-done); }
.status-history__dot.s-canceled        { background: var(--s-canceled); }

.status-history__name { font-weight: 500; color: var(--ink); }
.status-history__name small {
  display: block;
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-style: italic;
  margin-top: 2px;
}
.status-history__date {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-soft);
  text-align: right;
  white-space: nowrap;
}
.status-history__dur {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink);
  text-align: right;
  white-space: nowrap;
  font-weight: 600;
}

/* tooltip над барами */
.tooltip {
  position: fixed;
  background: #1A1816;
  color: #FAF8F3;
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 12px;
  pointer-events: none;
  z-index: 200;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  max-width: 320px;
  display: none;
}
.tooltip__title {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 12.5px;
}
.tooltip__row { color: rgba(250,248,243,0.7); font-size: 11px; line-height: 1.45; }
.tooltip__row b { color: #fff; font-weight: 500; }

/* ===== ACTQ ===== */
.actq-list { display: flex; flex-direction: column; }
.actq-item {
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 60px 90px 1fr;
  gap: 12px;
  align-items: start;
}
.actq-item:last-child { border-bottom: none; }
.actq-item__cat {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}
.actq-item__date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
}
.actq-item__body {
  font-size: 13px;
  word-break: break-word;
}
.actq-item__body small {
  display: block;
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 11px;
}

/* утилиты */
.text-mono { font-family: var(--font-mono); }
.text-muted { color: var(--ink-muted); }
.text-soft { color: var(--ink-soft); }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }

.detail-toggle {
  background: none;
  border: 1px solid var(--border-strong);
  color: var(--ink-muted);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 10.5px;
  font-family: var(--font-mono);
  cursor: pointer;
}
.detail-toggle:hover { background: var(--bg-tint); color: var(--ink); }
