/* Dashboard + shared panel styles */

/* .bp-grid-4 — ЕДИНЫЙ источник истины: static/css/components.css
   (4 кол → 2 на ≤980px → 2 на ≤560px). Прежнее дубль-определение здесь
   объявляло свой grid-template-columns со breakpoint 920px, который никогда
   не выигрывал (components.css грузится позже) — мёртвое правило удалено.
   polish.css задаёт только gap, не трогая раскладку (не конфликт). */

.bp-metric {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 14px 12px;
  display: flex; flex-direction: column;
}
.bp-metric__row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.bp-metric__label { font-size: 12px; color: var(--fg-muted); font-weight: 500; }
.bp-metric__icon { color: var(--fg-subtle); }
.bp-metric__value { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; }
.bp-metric__delta { margin-top: 4px; font-size: 12px; font-weight: 500; }
.bp-metric__delta.is-positive { color: var(--ok); }
.bp-metric__delta.is-negative { color: var(--danger); }

/* Panel */
.bp-panel { display: flex; flex-direction: column; overflow: hidden; }
.bp-panel__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
  gap: 12px;
}
.bp-panel__title { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.bp-panel__sub { font-size: 12px; color: var(--fg-subtle); margin-top: 2px; }
.bp-panel__body { padding: 0 16px 14px; }
.bp-panel__body--nopad { padding: 0; }
.bp-panel__body--nopad > * + * { border-top: 1px solid var(--border); }

.bp-dashboard-grid {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px;
  margin-bottom: 12px;
}

/* Day panel — right column of dashboard */
.bp-day-panel { display: flex; flex-direction: column; overflow: hidden; }
.bp-day-panel__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 14px 16px 10px; gap: 10px;
}
.bp-day-panel__title { font-size: 15px; font-weight: 650; letter-spacing: -0.015em; color: var(--fg); }
.bp-day-panel__sub { font-size: 12px; color: var(--fg-muted); margin-top: 2px; }
.bp-day-panel__body { padding: 0 4px 6px; display: flex; flex-direction: column; }
.bp-day-panel__empty {
  padding: 24px 16px; text-align: center; color: var(--fg-muted); font-size: 13px;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.bp-day-row {
  display: grid; grid-template-columns: 72px 1fr auto; gap: 12px;
  padding: 12px; align-items: flex-start; border-radius: var(--radius);
  text-decoration: none; color: inherit; transition: background .12s;
}
.bp-day-row:hover { background: var(--bg-hover); }
.bp-day-row__slot { color: var(--fg-muted); font-size: 12px; display: inline-flex; align-items: center; gap: 4px; padding-top: 2px; }
.bp-day-row__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bp-day-row__client { font-weight: 550; font-size: 13.5px; letter-spacing: -0.01em; color: var(--fg); }
.bp-day-row__meta { font-size: 12px; color: var(--fg-muted); display: flex; gap: 6px; flex-wrap: wrap; }
.bp-day-row__meta > span { display: inline-flex; align-items: center; gap: 3px; }
.bp-day-row__meta b { color: var(--fg); font-weight: 600; }
.bp-day-row__status { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.bp-day-row__price { font-size: 13px; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--fg); }

/* Tiny payment progress indicator (HoneyBook-style) */
.bp-pay-mini {
  display: inline-flex; flex-direction: column; align-items: flex-end; gap: 2px;
  min-width: 110px;
}
.bp-pay-mini__value { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--fg); }
.bp-pay-mini__bar {
  width: 100%; height: 3px; background: var(--bg-sunken); border-radius: 2px; overflow: hidden;
}
.bp-pay-mini__bar > span { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width .3s; }
.bp-pay-mini__bar--paid > span { background: var(--ok); }
.bp-pay-mini__bar--low > span { background: var(--warn); }
.bp-pay-mini__bar--none > span { background: var(--danger); }
.bp-pay-mini__pct { font-size: 10px; color: var(--fg-subtle); }

/* Sticky summary bar for list pages */
.bp-sticky-summary {
  position: sticky; top: 0; z-index: 8;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 12px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
.bp-sticky-summary__item { display: flex; flex-direction: column; gap: 1px; }
.bp-sticky-summary__label { font-size: 11px; color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; }
.bp-sticky-summary__value { font-size: 16px; font-weight: 650; letter-spacing: -0.015em; color: var(--fg); font-variant-numeric: tabular-nums; }
.bp-sticky-summary__value--accent { color: var(--accent); }
.bp-sticky-summary__value--ok { color: var(--ok); }
.bp-sticky-summary__value--warn { color: var(--warn); }
.bp-sticky-summary__sep { width: 1px; align-self: stretch; background: var(--border); }

/* Payment row (в истории оплат на карточке мероприятия) */
.bp-pay-row {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  transition: background .12s;
}
.bp-pay-row:first-child { border-top: none; }
.bp-pay-row:hover { background: var(--bg-hover); }
.bp-pay-row__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.bp-pay-row__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bp-pay-row__date { font-size: 12px; font-weight: 500; }
.bp-pay-row__note { font-size: 12px; }
.bp-pay-row__sum { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.bp-pay-row__amount { font-size: 13.5px; font-weight: 600; color: var(--fg); }

/* Empty state (refined, with CTA) */
.bp-empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 44px 20px; text-align: center; color: var(--fg-muted);
}
.bp-empty-state__icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg-subtle); color: var(--fg-subtle);
  display: flex; align-items: center; justify-content: center;
}
.bp-empty-state__title { font-size: 14px; font-weight: 600; color: var(--fg); }
.bp-empty-state__text { font-size: 13px; color: var(--fg-muted); max-width: 360px; }
.bp-empty-state__cta { margin-top: 6px; }

/* Onboarding card */
.bp-onboarding { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.bp-onboarding__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bp-onboarding__title { font-size: 13px; font-weight: 600; color: var(--fg); display: inline-flex; align-items: center; gap: 6px; }
.bp-onboarding__bar { height: 4px; background: var(--bg-sunken); border-radius: 2px; overflow: hidden; }
.bp-onboarding__bar > span { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width .25s; }
.bp-onboarding__step {
  display: flex; align-items: center; gap: 8px; padding: 6px 4px;
  font-size: 13px; color: var(--fg); text-decoration: none; border-radius: var(--radius-sm);
}
.bp-onboarding__step:hover { background: var(--bg-hover); }
.bp-onboarding__step.is-done { color: var(--fg-subtle); text-decoration: line-through; }
.bp-onboarding__step svg { flex-shrink: 0; }

/* Compact list blocks ("Ближайшие мероприятия", "Задачи на сегодня") */
.bp-compact-list { display: flex; flex-direction: column; }
.bp-compact-list a,
.bp-compact-list > div { padding: 10px 14px; display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; text-decoration: none; color: inherit; border-top: 1px solid var(--border); }
.bp-compact-list a:first-child,
.bp-compact-list > div:first-child { border-top: none; }
.bp-compact-list a:hover { background: var(--bg-hover); }
.bp-compact-list__date { display: flex; flex-direction: column; align-items: center; font-variant-numeric: tabular-nums; }
.bp-compact-list__day { font-size: 18px; font-weight: 650; letter-spacing: -0.02em; line-height: 1; color: var(--fg); }
.bp-compact-list__month { font-size: 10px; text-transform: uppercase; color: var(--fg-subtle); letter-spacing: 0.08em; margin-top: 2px; }
.bp-compact-list__main { min-width: 0; }
.bp-compact-list__title { font-size: 13px; font-weight: 550; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-compact-list__meta { font-size: 12px; color: var(--fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.bp-compact-list__right { font-size: 12px; color: var(--fg-subtle); }
.bp-dashboard-grid-2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; }
@media (max-width: 1100px) { .bp-dashboard-grid, .bp-dashboard-grid-2 { grid-template-columns: 1fr; } }

/* Calendar */
.bp-cal { padding: 14px 16px 6px; }
.bp-cal__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 10px; flex-wrap: wrap; }
.bp-cal__title { display: flex; align-items: baseline; gap: 8px; font-size: 16px; font-weight: 650; letter-spacing: -0.015em; }
.bp-cal__year { color: var(--fg-subtle); font-weight: 500; font-size: 14px; }
.bp-cal__total { color: var(--fg-subtle); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.bp-cal__nav { display: flex; gap: 2px; }
.bp-cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; background: transparent; border: none; border-radius: 0; overflow: visible; }
.bp-cal__dow { font-size: 10px; font-weight: 600; color: var(--fg-subtle); padding: 10px 2px 8px; text-align: center; background: transparent; text-transform: uppercase; letter-spacing: 0.08em; min-width: 0; }
.bp-cal__dow.is-weekend { color: var(--fg-faint); }
.bp-cal__cell {
  min-height: 96px;
  min-width: 0;
  background: transparent;
  border: 1px solid transparent;
  padding: 6px 6px 6px;
  display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start;
  gap: 4px;
  cursor: pointer; font-family: inherit;
  position: relative;
  transition: background .12s, border-color .12s;
  text-align: left;
  border-radius: var(--radius);
  overflow: hidden;
}
.bp-cal__cell:hover { background: var(--bg-hover); }
.bp-cal__cell.is-weekend { }
.bp-cal__cell.is-other .bp-cal__num { color: var(--fg-faint); font-weight: 400; }
.bp-cal__cell.is-other { cursor: default; }
.bp-cal__cell.is-other:hover { background: transparent; }
.bp-cal__cell.is-selected { background: var(--bg-subtle); border-color: var(--fg); }
.bp-cal__cell.is-today { background: var(--accent-softer, #eef2ff); }
.bp-cal__cell.is-today .bp-cal__num { color: white; background: var(--accent); }
.bp-cal__cell-top { display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 4px; padding: 0 2px; }
.bp-cal__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  font-size: 12px; font-weight: 500;
  font-variant-numeric: tabular-nums;
  border-radius: 50%;
  color: var(--fg);
  transition: background .12s;
  flex-shrink: 0;
}
.bp-cal__cell-count {
  font-size: 10px; font-weight: 600; color: var(--fg-subtle);
  font-variant-numeric: tabular-nums;
  padding: 1px 5px; border-radius: 9px; background: var(--bg-subtle);
}
.bp-cal__cell.is-today .bp-cal__cell-count { background: white; color: var(--accent); }
.bp-cal__cell.is-other .bp-cal__cell-count { display: none; }

/* Compact Notion-style event indicators: 1 event = 1 dot (no names, no slots).
   Dots wrap horizontally under the date number. Cell becomes shorter and cleaner. */
.bp-cal__chips {
  display: flex; flex-direction: row; flex-wrap: wrap;
  gap: 4px; padding: 2px 2px 0;
  min-width: 0;
  align-content: flex-start;
}
.bp-cal__chip {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  line-height: 0;
  padding: 0;
  border: none;
  transition: transform .1s;
}
.bp-cal__chip:hover { transform: scale(1.4); }
.bp-cal__chip-txt,
.bp-cal__chip svg { display: none; }
.bp-cal__chip--accent  { background: var(--accent); }
.bp-cal__chip--success { background: var(--ok); }
.bp-cal__chip--warning { background: var(--warn); }
.bp-cal__chip--danger  { background: var(--danger); }
.bp-cal__chip--neutral { background: var(--fg-faint); }
.bp-cal__more {
  font-size: 10px; font-weight: 600; color: var(--fg-subtle);
  padding: 0 2px;
  line-height: 1;
  align-self: center;
}

.bp-cal__legend {
  display: flex; align-items: center; gap: 14px; padding: 10px 16px 14px;
  font-size: 11px; color: var(--fg-muted); border-top: 1px solid var(--border); margin-top: 10px;
  flex-wrap: wrap;
}
.bp-cal__legend span { display: inline-flex; align-items: center; gap: 5px; }
.bp-swatch-mini { width: 10px; height: 10px; border-radius: 2px; }
.bp-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }

/* Cells can be shorter — dots take much less space than name chips */
.bp-cal__cell { min-height: 74px; }
@media (max-width: 1200px) {
  .bp-cal__cell { min-height: 64px; }
}

/* Week view удалён как мёртвый: классы .bp-week__* нигде не используются
   (ни в шаблонах, ни в JS). Месячная сетка .bp-cal__* остаётся. */

/* Event row */
.bp-event-row {
  display: grid;
  grid-template-columns: 84px 1fr auto auto 14px;
  gap: 14px; align-items: center;
  width: 100%; padding: 10px 16px;
  background: transparent; border: none;
  font-family: inherit; text-align: left; cursor: pointer;
  transition: background .12s;
}
.bp-event-row:hover { background: var(--bg-hover); }
.bp-event-row__slot {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--fg-muted); font-size: 12px; font-weight: 500;
}
.bp-event-row__title { font-size: 13px; font-weight: 550; color: var(--fg); letter-spacing: -0.005em; }
.bp-event-row__meta {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--fg-muted);
  margin-top: 2px;
}
.bp-event-row__amount { font-size: 13px; color: var(--fg); font-weight: 550; }
.bp-event-row__chev { color: var(--fg-faint); }

.bp-dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--fg-faint); }

/* Status */
.bp-status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.bp-status-dot--ok { background: var(--ok); }
.bp-status-dot--warn { background: var(--warn); }
.bp-status-dot--danger { background: var(--danger); }
.bp-status-dot--accent { background: var(--accent); }
.bp-status-dot--neutral { background: var(--fg-faint); }
.bp-status-dot--info { background: var(--info); }
.bp-status-dot--confirmed { background: var(--accent); }
.bp-status-dot--done { background: var(--ok); }
.bp-status-dot--in_progress { background: var(--warn); }
.bp-status-dot--prepaid { background: var(--info); }
.bp-status-dot--canceled { background: var(--danger); }

/* Event detail: two-col layout + specific blocks */
.bp-event-cols { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 14px; }
.bp-event-main > * + * { margin-top: 12px; }
.bp-event-aside { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
@media (max-width: 1000px) { .bp-event-cols { grid-template-columns: 1fr; } }

/* Check-list row (used in event overview) */
.bp-check-row {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 12px;
  padding: 10px 14px;
  align-items: center;
  border-top: 1px solid var(--border);
}
.bp-check-row:first-child { border-top: none; }
.bp-check-row__body { min-width: 0; }
.bp-check-row__title { font-size: 13px; font-weight: 500; color: var(--fg); }
.bp-check-row.is-done .bp-check-row__title { text-decoration: line-through; color: var(--fg-subtle); }
.bp-check-row__meta { font-size: 12px; color: var(--fg-muted); margin-top: 2px; }
.bp-check-row__actions { display: inline-flex; gap: 4px; align-items: center; }

/* Breadcrumb */
.bp-breadcrumb { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--fg-muted); }
.bp-breadcrumb a { color: var(--fg-muted); text-decoration: none; }
.bp-breadcrumb a:hover { color: var(--fg); }
.bp-breadcrumb span { display: inline-flex; align-items: center; }

/* Empty state */
.bp-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 20px; color: var(--fg-subtle); font-size: 13px;
  gap: 8px;
}
.bp-empty svg { color: var(--fg-faint); }

/* Tasks */
.bp-task {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 0;
}
.bp-task + .bp-task { border-top: 1px solid var(--border); }
.bp-task.is-done .bp-task__title { color: var(--fg-subtle); text-decoration: line-through; }
.bp-checkbox {
  width: 16px; height: 16px; border: 1.5px solid var(--border-strong);
  border-radius: 4px; background: var(--bg-elev); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 2px; padding: 0;
  transition: background .12s, border-color .12s;
}
.bp-checkbox:hover { border-color: var(--fg-muted); }
.bp-checkbox.is-checked { background: var(--fg); border-color: var(--fg); color: var(--bg-elev); }
.bp-task__main { flex: 1; min-width: 0; }
.bp-task__title { font-size: 13px; font-weight: 450; color: var(--fg); }
.bp-task__meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 12px; }

/* Stats period trigger/popover (.bp-period-*) удалён как мёртвый — живой
   пикер периода в stats/finance.html и analytics.html собран из inline <a>. */

/* ──────────────────────────────────────────────────────────────────────────
   KPI-плитки задач (.bp-tstats / .bp-tstat) — порт прототипа upgrades.css.
   Плитка-карточка: иконка в тон + крупное число + подпись. Тоновые модификаторы
   danger/accent/warn/ok красят бейдж иконки; активный фильтр подсвечивает рамку.
   Используется на экране «Задачи» (task_list.html, вкладка «Все задачи»).
   ────────────────────────────────────────────────────────────────────────── */
.bp-tstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.bp-tstat {
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start; text-align: left;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--bg-elev); cursor: pointer; font-family: inherit; text-decoration: none; color: inherit;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast);
}
.bp-tstat:hover { border-color: var(--border-strong); box-shadow: var(--shadow-1); transform: translateY(-1px); }
.bp-tstat__top { display: flex; align-items: center; gap: 9px; }
.bp-tstat__ico { width: 30px; height: 30px; border-radius: var(--radius-md); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bp-tstat__num { font-size: 24px; font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; line-height: 1; }
.bp-tstat__lbl { font-size: 12px; color: var(--fg-muted); font-weight: var(--fw-medium); }
.bp-tstat--danger .bp-tstat__ico { background: var(--danger-soft); color: var(--danger); }
.bp-tstat--accent .bp-tstat__ico { background: var(--accent-soft); color: var(--accent); }
.bp-tstat--warn   .bp-tstat__ico { background: var(--warn-soft);   color: var(--warn-strong); }
.bp-tstat--ok     .bp-tstat__ico { background: var(--ok-soft);     color: var(--ok-strong); }
.bp-tstat.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.bp-tstat--danger.is-active { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.bp-tstat--danger .bp-tstat__num { color: var(--danger-strong); }
@media (max-width: 760px) { .bp-tstats { grid-template-columns: repeat(2, 1fr); } }

/* Имя ответственного рядом с аватаром в строке задачи (_task_row.html).
   На узких экранах прячем — остаётся только аватар. */
.bp-task-row__who { font-size: 12px; color: var(--fg-muted); white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .bp-task-row__who { display: none; } }
