/**
 * Dashboard — объединённый дашборд
 */

/* ══════════════════════════════════════════════
   Глобальный заголовок (месяц)
   ══════════════════════════════════════════════ */
.dash-global-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; justify-content: flex-end; }
.dash-global-header .page-title { font-size: 18px; }

/* ══════════════════════════════════════════════
   Блок 1: Фокус дня — 3 столбца (Аврора | ГудОк | Платежи)
   ══════════════════════════════════════════════ */
.dash-focus-days { margin-bottom: 16px; }
.focus-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.focus-col { min-width: 0; }
.focus-col:not(:last-child) { border-right: 1px solid var(--border); }
.focus-col-title { padding: 6px 12px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: #fff; text-align: center; }
.focus-col-title.aurora { background: var(--aurora); }
.focus-col-title.gudok { background: var(--gudok); }
.focus-col-title.pay-title { background: var(--accent); }
.focus-cell { padding: 6px 10px; border-bottom: 1px solid var(--border); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 32px; }
.focus-cell:last-child { border-bottom: none; }
.focus-cell.focus-yesterday { opacity: .5; }
.focus-cell.focus-today { padding: 10px; font-size: 13px; font-weight: 600; background: color-mix(in srgb, var(--accent) 5%, var(--bg)); }
.focus-cell.focus-tomorrow { opacity: .7; }
.focus-date { font-weight: 800; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); min-width: 42px; }
.focus-cell .emp-tag { font-size: 11px; }
.focus-time { font-size: 10px; font-family: var(--font-mono); color: var(--text-muted); }
.focus-status.active { color: var(--green); font-size: 12px; }

/* ══════════════════════════════════════════════
   Блок 4: План — итоги по точкам (v2 — wow)
   ══════════════════════════════════════════════ */
.dash-plan-summary { margin-bottom: 16px; }
.plan-cards { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* Карточка точки */
.plan-card {
  position: relative; border-radius: 14px; padding: 16px 18px 14px;
  background: var(--bg2); border: 1px solid var(--border);
  overflow: hidden; transition: box-shadow .2s, transform .15s;
}
.plan-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); transform: translateY(-1px); }

/* Цветная полоса сверху */
.plan-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
}
.plan-card.aurora::before { background: var(--aurora); }
.plan-card.gudok::before { background: var(--gudok); }
.plan-card.total::before { background: linear-gradient(90deg, var(--aurora), var(--gudok), var(--accent)); }

/* Пульсирующая рамка для отстающей точки */
.plan-card.behind-alert {
  border-color: rgba(255,59,48,.35);
  animation: planPulse 2s ease-in-out infinite;
}
@keyframes planPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,59,48,.0); }
  50% { box-shadow: 0 0 0 4px rgba(255,59,48,.12); }
}

/* Шапка карточки */
.plan-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.plan-card-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.plan-card.aurora .plan-card-icon { background: rgba(90,200,250,.12); }
.plan-card.gudok .plan-card-icon { background: rgba(175,82,222,.12); }
.plan-card.total .plan-card-icon { background: rgba(255,51,102,.10); }
.plan-card-pct { margin-left: auto; font-family: var(--font-mono); font-size: 22px; font-weight: 900; line-height: 1; }
.plan-card-pct.ok { color: var(--green); }
.plan-card-pct.behind { color: var(--red); }

/* Прогресс-бар */
.plan-progress-wrap { position: relative; height: 8px; border-radius: 4px; background: var(--bg3); margin-bottom: 10px; overflow: hidden; }
.plan-progress-bar { height: 100%; border-radius: 4px; transition: width .6s ease; }
.plan-card.aurora .plan-progress-bar { background: var(--aurora); }
.plan-card.gudok .plan-progress-bar { background: var(--gudok); }
.plan-card.total .plan-progress-bar { background: var(--accent); }
.plan-card.behind-alert .plan-progress-bar { background: var(--red); }
/* Маркер ожидаемого прогресса (по дням) */
.plan-progress-marker {
  position: absolute; top: -2px; bottom: -2px; width: 2px;
  background: var(--text); opacity: .3; border-radius: 1px;
}

/* Цифры */
.plan-card-numbers { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; margin-bottom: 6px; }
.plan-num-main { font-family: var(--font-mono); font-size: 15px; font-weight: 800; }
.plan-num-of { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.plan-auto-badge { font-size: 10px; font-weight: 600; color: var(--accent); background: var(--accent-light, rgba(59,130,246,0.1)); padding: 1px 6px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.5px; }

/* Метрики темпа */
.plan-pace { display: flex; gap: 8px; flex-wrap: wrap; }
.plan-pace-item {
  display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-muted);
  padding: 3px 8px; border-radius: 6px; background: var(--bg);
}
.plan-pace-item b { font-family: var(--font-mono); font-weight: 800; color: var(--text); }
.plan-pace-item.tempo-ok b { color: var(--green); }
.plan-pace-item.tempo-behind b { color: var(--red); }

/* Вердикт — крупный блок с суммой */
.plan-verdict {
  margin-top: 10px; padding: 10px 14px; border-radius: 10px;
  text-align: center;
}
.plan-verdict.ok { background: rgba(52,199,89,.08); }
.plan-verdict.behind { background: rgba(255,59,48,.08); }
.plan-verdict-label {
  display: block; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px;
}
.plan-verdict.ok .plan-verdict-label { color: var(--green); }
.plan-verdict.behind .plan-verdict-label { color: var(--red); }
.plan-verdict-amount {
  display: block; font-family: var(--font-mono); font-size: 20px; font-weight: 900; line-height: 1.2;
}
.plan-verdict.ok .plan-verdict-amount { color: var(--green); }
.plan-verdict.behind .plan-verdict-amount { color: var(--red); }
.plan-verdict-amount small { font-size: 13px; font-weight: 700; opacity: .7; }

/* Будущий месяц — «Всё впереди» */
.plan-card-future { display: flex; flex-direction: column; }
.plan-future-msg {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex: 1; gap: 4px; padding: 14px 0 6px; text-align: center;
}
.plan-future-emoji { font-size: 32px; line-height: 1; }
.plan-future-text { font-size: 15px; font-weight: 800; color: var(--text-muted); }
.plan-future-plan { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.plan-future-plan b { font-family: var(--font-mono); font-weight: 800; color: var(--text); }

/* Инлайн-инпуты (директор) */
.plan-card-edit { display: flex; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.plan-inline-input { width: 80px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 8px; font-size: 11px; font-family: var(--font-mono); background: var(--bg); color: var(--text); text-align: right; }
.plan-inline-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px rgba(255,51,102,.1); }

@media (max-width: 900px) {
  .plan-cards { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════
   Блок 5: Таблица месяца — тулбар
   ══════════════════════════════════════════════ */
.dash-table-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }

/* Строки в таблице кликабельные */
.dash-row { cursor: pointer; transition: background .1s; }
.dash-row:hover { background: var(--bg2); }

/* Edit mode rows — заметный жёлтый фон */
.dash-edit-row { cursor: default; background: rgba(255,200,0,.08); }
.dash-edit-row:hover { background: rgba(255,200,0,.14); }
.dash-edit-row td { border-bottom: 1px solid rgba(255,200,0,.18); }
.dash-editable { cursor: pointer; }
.dash-editable:hover { opacity: .7; }
.empty-slot.dash-editable { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; border: 2px dashed rgba(255,200,0,.5); color: var(--text-muted); font-size: 14px; font-weight: 700; cursor: pointer; transition: all .15s; }
.empty-slot.dash-editable:hover { border-color: var(--accent); color: var(--accent); background: rgba(255,51,102,.06); }

/* Фиксируем строки одинаковой высоты в обоих режимах */
.schedule-table tbody tr { height: 32px; }
.schedule-table tbody td { box-sizing: border-box; }

/* ══════════════════════════════════════════════
   Модалка детализации дня
   ══════════════════════════════════════════════ */
.day-detail-section { margin-bottom: 16px; }
.day-detail-label { font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; letter-spacing: .5px; }
.day-detail-emp { padding: 8px 0; border-bottom: 1px solid var(--border); }
.day-detail-emp:last-child { border-bottom: none; }
.day-detail-timeline { margin-top: 6px; padding-left: 12px; }
.timeline-event { font-size: 12px; padding: 2px 0; }
.timeline-event b { font-family: var(--font-mono); }
.day-detail-pay { font-size: 13px; padding: 4px 0; }
.day-detail-pay b { font-family: var(--font-mono); }

/* Микро-сводка в модалке */
.day-detail-micro { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; padding-left: 12px; }
.micro-chip { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: var(--bg2); border: 1px solid var(--border); }
.day-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.summary-chip { font-size: 13px; padding: 6px 12px; border-radius: 8px; background: var(--bg2); border: 1px solid var(--border); }
.summary-chip b { font-family: var(--font-mono); }

/* ══════════════════════════════════════════════
   Встроенные секции ЗП / Бонусы
   ══════════════════════════════════════════════ */
.dash-section-divider { height: 1px; background: var(--border); margin: 24px 0 16px; }
.dash-section-title { margin: 0 0 12px; font-size: 16px; font-weight: 800; }

/* ══════════════════════════════════════════════
   Блок 2: Смена + Касса (рядом)
   ══════════════════════════════════════════════ */
.dash-shift-cash-row {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.dash-shift-cash-row .shift-buttons-wrap {
  margin: 0;
  max-width: none;
}

/* Компактный виджет кассы на дашборде — один прямоугольник */
.dcw {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dcw-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dcw-bal {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  white-space: nowrap;
}
.dcw-bal-icon { font-size: 14px; }
.dcw-bal-val {
  font-weight: 800;
  font-family: var(--font-mono);
  font-size: 14px;
}
.dcw-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
  flex-shrink: 0;
}
.dcw-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.dcw-btn {
  padding: 4px 10px;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  transition: filter .15s;
  white-space: nowrap;
}
.dcw-btn:hover { filter: brightness(1.1); }
.dcw-btn-in { background: #22C55E; }
.dcw-btn-out { background: #EF4444; }
.dcw-btn-tr { background: #3B82F6; }

/* ══════════════════════════════════════════════
   Респонсив
   ══════════════════════════════════════════════ */
@media (max-width: 900px) {
  .focus-grid { grid-template-columns: 1fr; }
  .focus-col:not(:last-child) { border-right: none; border-bottom: 1px solid var(--border); }
  .schedule-tables.side-by-side { grid-template-columns: 1fr !important; }
  .plan-cards { grid-template-columns: 1fr; }
  .dash-global-header { justify-content: center; }
  .dash-shift-cash-row { grid-template-columns: 1fr; }
}
