/* ── Пульс магазина ───────────────────────────────────────────────────────── */
/* Карта и итоги — общие с «Часом магазина» (.sh-*), здесь — факт с % к норме
   в клетке, будущие дни и корзина часа под картой. */

.sp-fact-badge {
  display: inline-block; vertical-align: middle; margin-right: 6px; padding: 2px 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: #fff; background: var(--text-primary); border-radius: 999px;
}

.sp-heat .sh-cell, .sp-heat .sh-sum { height: 38px; line-height: 1.1; }
.sp-cell { cursor: pointer; }
.sp-v { display: block; }
.sp-p { display: block; font-size: 10px; opacity: .8; }
.sp-date { font-weight: 400; color: var(--text-muted); font-size: 11px; }
.sp-cell--future { background: repeating-linear-gradient(45deg, var(--bg-stripe) 0 4px, transparent 4px 8px); }
.sp-row--future th { opacity: .5; }
.sp-future-note { font-size: 11px; font-weight: 400; color: var(--text-muted); }
.sp-day { cursor: pointer; }
.sp-day:hover { outline: 2px solid var(--text-primary); outline-offset: -1px; }
.sp-cell--sel { outline: 3px solid var(--text-primary) !important; outline-offset: -2px; }
.sp-up { color: #1a8a01; }
.sp-down { color: #cc2b1d; }
.sh-sum .sp-p { opacity: 1; font-weight: 600; }

.sp-slot {
  margin: 14px 0; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-card);
}
.sp-slot__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 14px; }

.sp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 14px; }
.sp-tile { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); }
.sp-tile__lbl { font-size: 11.5px; color: var(--text-muted); }
.sp-tile__val { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sp-tile__norm { font-size: 11.5px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

.sp-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; }
@media (max-width: 900px) { .sp-cols { grid-template-columns: 1fr; } }
.sp-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }

.sp-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.sp-table th { text-align: left; font-weight: 500; font-size: 11.5px; color: var(--text-muted); padding: 4px 6px; border-bottom: 1px solid var(--border); }
.sp-table td { padding: 5px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.sp-table .num, .sp-table th:not(:first-child) { text-align: right; white-space: nowrap; }
.sp-mgmt { font-size: 11px; color: var(--text-muted); }
.sp-dim { color: var(--text-muted); font-size: 11.5px; }

.sp-checklist { max-height: 520px; overflow-y: auto; border-top: 1px solid var(--border); }
.sp-check { padding: 6px 4px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 13px; }
.sp-check:hover, .sp-check--open { background: var(--bg-stripe); }
.sp-check__row { display: flex; gap: 10px; align-items: baseline; font-variant-numeric: tabular-nums; }
.sp-check__time { color: var(--text-secondary); min-width: 40px; }
.sp-check__sum { font-weight: 600; min-width: 80px; }
.sp-check__lines { margin-top: 4px; padding-left: 50px; font-size: 12px; }
.sp-check__lines > div { display: grid; grid-template-columns: 1fr auto 80px; gap: 8px; padding: 2px 0; }
.sp-check__lines .num { text-align: right; font-variant-numeric: tabular-nums; }
.sp-promo { font-style: normal; font-size: 10.5px; padding: 0 4px; border-radius: 3px; background: #fde7e5; color: #cc2b1d; }

/* Ступени отклонения: 1 — до 10%, 2 — 10–30%, 3 — 30–100%, 4 — больше 100% */
.sp-l1u { background: #e6f4df; } .sp-l1d { background: #fbe6e3; }
.sp-l2u { background: #a9dc93; } .sp-l2d { background: #f4aaa1; }
.sp-l3u { background: #3fae1f; color: #fff; } .sp-l3d { background: #e0503f; color: #fff; }
.sp-l4u { background: #0a7d00; color: #fff; font-weight: 700; box-shadow: inset 0 0 0 2px #064d00; }
.sp-l4d { background: #b80f00; color: #fff; font-weight: 700; box-shadow: inset 0 0 0 2px #730900; }
.sp-l3u .sp-p, .sp-l3d .sp-p, .sp-l4u .sp-p, .sp-l4d .sp-p { opacity: 1; }
.sp-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin: 0 3px 0 8px; }

/* Неделя: кнопки с номером и датами, строка выбранной недели крупно */
.sp-week { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.15; padding-top: 3px; padding-bottom: 3px; }
.sp-week__sub { font-size: 10.5px; color: var(--text-muted); }
.bd-preset--on .sp-week__sub { color: inherit; opacity: .8; }
.sp-weekline { font-size: 15px; padding: 6px 0 2px; color: var(--text-secondary); }
.sp-weekline b { color: var(--text-primary); }

/* Дата в строке — крупно */
.sp-rowhead { white-space: nowrap; }
.sp-rowhead__dow { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-right: 5px; }
.sp-rowhead__date { font-size: 13px; font-weight: 600; color: var(--text-primary); }

/* Сводка недели */
.sp-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 10px; margin: 0 0 14px; }
.sp-sum-block { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-card); }
.sp-sum-title { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.sp-sum-title .sp-dim { font-weight: 400; }
.sp-list { list-style: none; margin: 0; padding: 0; }
.sp-list li { padding: 5px 4px; border-top: 1px solid var(--border); font-size: 13px; cursor: pointer; font-variant-numeric: tabular-nums; }
.sp-list li:first-child { border-top: 0; }
.sp-list li:hover { background: var(--bg-stripe); }
.sp-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 6px; }
.sp-chip { display: inline-block; padding: 1px 6px; border-radius: 999px; font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sp-days { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.sp-days th { font-weight: 500; font-size: 11px; color: var(--text-muted); text-align: right; padding: 2px 2px; }
.sp-days tbody th { text-align: left; color: var(--text-primary); font-size: 12.5px; white-space: nowrap; }
.sp-days td { text-align: right; padding: 3px 2px; white-space: nowrap; border-top: 1px solid var(--border); }
.sp-days tbody th { border-top: 1px solid var(--border); }
.sp-days tr { cursor: pointer; }
.sp-days tr:hover td, .sp-days tr:hover th { background: var(--bg-stripe); }
.sp-days .sp-v { display: inline; }
.sp-cardline { font-size: 12.5px; color: var(--text-secondary); margin-bottom: 4px; }

/* Метки чеков */
.sp-tag { display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.sp-tag--big { background: #e8eefc; color: #2848a8; }
.sp-tag--extra { background: #2848a8; color: #fff; }
.sp-tag--nocard { background: #fff1c2; color: #8a5a00; }
.sp-tag--store { background: var(--bg-stripe); color: var(--text-secondary); margin-right: 4px; }
.sp-check--nocard { background: #fffaea; }
.sp-tile--nocard { border-color: #e9c96a; background: #fffaea; }
.bd-preset.sp-week { height: auto; min-height: 34px; }
.sp-days td .sp-v { display: block; }
.sp-days td .sp-chip { margin-top: 1px; }
.sp-sum-block { min-width: 0; overflow-x: auto; }
.sp-heat { user-select: none; }
.sp-summary-wrap { margin: 14px 0 0; }
.sp-summary-toggle {
  cursor: pointer; padding: 8px 12px; font-weight: 600; font-size: 14px;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-card);
  list-style-position: inside;
}
.sp-summary-toggle .sp-dim { font-weight: 400; margin-left: 8px; }
.sp-summary-wrap[open] .sp-summary-toggle { margin-bottom: 10px; }

/* Дни без данных — строка целиком одной плашкой, у каждой причины свой вид */
.sp-gap { height: 30px; padding: 0 12px; font-size: 12.5px; border-radius: var(--radius-sm); text-align: left; }
.sp-gap--future { color: var(--text-muted); background: repeating-linear-gradient(45deg, var(--bg-stripe) 0 4px, transparent 4px 8px); }
.sp-gap--nodata {
  color: #7a4b00; font-weight: 700; letter-spacing: .02em;
  background: repeating-linear-gradient(45deg, #ffe9a8 0 6px, #fff6d6 6px 12px);
  border: 1px dashed #d9a400;
}
.sp-gap--closed { color: var(--text-secondary); background: var(--bg-stripe); font-style: italic; }
.sp-gap--before { color: var(--text-muted); background: var(--bg-stripe); }
.sp-row--future th, .sp-row--before th { opacity: .5; }
.sp-row--nodata .sp-rowhead__dow, .sp-row--nodata .sp-rowhead__date { color: #7a4b00; }

/* Дата, введённая руками */
.sp-rowhead--picked { box-shadow: inset 3px 0 0 #2848a8; background: #e8eefc; border-radius: var(--radius-sm); }
.sp-pick { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; font-size: 11.5px; color: var(--text-muted); }
.sp-pick input { height: 27px; padding: 0 8px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-card); font: inherit; color: var(--text-primary); }

.sp-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* «За счёт кого» — разбивка сети по точкам в корзине */
.sp-bd { margin-bottom: 14px; }
.sp-bd-table td { vertical-align: top; }
.sp-bd-table .sp-v { display: inline; margin-right: 4px; }
.sp-bd-table .sp-bd-cur { background: var(--bg-stripe); }
.sp-bd-table tfoot td { border-top: 2px solid var(--border); }
