/* РНП, Еженедельный отчёт, План продаж и полоса плана на дашборде.
   Только классы с префиксом pulse-; цвета — токены из app.css, поэтому
   тёмная тема перекрашивает всё сама. */

/* скрытая подпись для экранного диктора */
.pulse-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.pulse-cap { padding: 8px 18px 12px; border-top: 1px solid var(--line); }
.pulse .tiles--row .delta { font-weight: 500; }

/* ── РНП ─────────────────────────────────────────────────── */

/* неполный день — приглушён и подписан словами, цвет никогда не говорит один */
.pulse-days tr.pulse-partial td, .pulse-days tr.pulse-partial th { color: var(--ink-3); }
.pulse-days tr.pulse-partial th .sub { color: var(--warn); font-weight: 500; }
.pulse-days tfoot th, .pulse-days tfoot td { font-weight: 650; border-bottom: 0;
  border-top: 1px solid var(--line-2); }
.pulse-days tbody th { white-space: nowrap; }

.pulse-add { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pulse-add .select { width: auto; max-width: 320px; padding: 5px 9px; font-size: 12.5px; }

.pulse-watch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  border-top: 1px solid var(--line); }
.pulse-watch { padding: 14px 20px 12px; border-left: 1px solid var(--line); border-top: 1px solid var(--line);
  margin: -1px 0 0 -1px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pulse-watch__head { display: flex; align-items: flex-start; gap: 8px; }
.pulse-watch__name { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pulse-watch__name b { font-size: 15px; font-weight: 650; }
.pulse-watch__name .sub { font-size: 12px; color: var(--ink-3); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.pulse-watch__nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 12px;
  margin: 0; font-variant-numeric: tabular-nums; }
.pulse-watch__nums dt { font-size: 11.5px; color: var(--ink-3); }
.pulse-watch__nums dd { margin: 0; font-size: 14px; font-weight: 600; }
.pulse-watch__nums dd span { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 400; }
.pulse-more > summary { cursor: pointer; font-size: 12.5px; color: var(--ink-2); padding: 2px 0; }
.pulse-more > summary:hover { color: var(--ink); }
.pulse-more[open] > summary { margin-bottom: 6px; }
.pulse-more .data--pad th:first-child, .pulse-more .data--pad td:first-child { padding-left: 0; }

/* ── Неделя ──────────────────────────────────────────────── */

.pulse-who { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.pulse-who li { padding: 10px 0; border-top: 1px solid var(--line); display: flex;
  flex-direction: column; gap: 2px; }
.pulse-who li:first-child { border-top: 0; padding-top: 0; }
.pulse-who__top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pulse-who__top b { font-weight: 650; }
.pulse-who__top .sub { font-size: 12px; color: var(--ink-3); }
.pulse-who__delta { margin-left: auto; font-weight: 650; font-variant-numeric: tabular-nums; }
.pulse-who__nums { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pulse-who__why { margin: 0; font-size: 13.5px; color: var(--ink-2); }

.pulse-abc { display: inline-grid; place-items: center; width: 22px; height: 20px; border-radius: 5px;
  font-size: 12px; font-weight: 650; background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--line); }
.pulse-abc--A { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.pulse-abc--B { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.pulse-sort { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer;
  text-align: inherit; line-height: inherit; }
.pulse-sort:hover, .pulse-sort.is-on { color: var(--ink); }
.pulse-sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.pulse-text { margin: 0; padding: 12px 14px; border-radius: var(--r-s); background: var(--surface-2);
  border: 1px solid var(--line); font: 13px/1.5 var(--font); white-space: pre-wrap;
  overflow-wrap: anywhere; color: var(--ink); max-width: 80ch; }

/* ── План продаж ─────────────────────────────────────────── */

.pulse-month b { min-width: 118px; text-align: center; font-weight: 650; font-size: 14px; }
.pulse-month .btn { font-size: 16px; line-height: 1; padding: 4px 10px; }
.pulse-file { position: relative; overflow: hidden; }
.pulse-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.pulse-file:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.pulse-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pulse-suggest .tiles { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.pulse-invite { gap: 12px; padding-top: 18px; padding-bottom: 18px; }
.pulse-err { margin: 0; }

.pulse-progs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.pulse-prog { padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; min-width: 0;
  border-left: 1px solid var(--line); margin-left: -1px; }
.pulse-prog__head { display: flex; align-items: baseline; gap: 10px; }
.pulse-prog__head h3 { margin: 0; font-size: 15px; font-weight: 650; }
.pulse-prog__big { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 14px; }
.pulse-prog__big b { font-size: 26px; font-weight: 650; color: var(--ink); letter-spacing: -.01em; }
.pulse-prog__pct { margin-left: 6px; font-weight: 650; color: var(--ink); }
.pulse-prog__phrase { margin: 0; font-size: 13.5px; line-height: 1.45; max-width: 70ch; }
.pulse-prog .mute { color: var(--ink-3); }

.pulse-st { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 10px; font-size: 11.5px;
  font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
  white-space: nowrap; }
.pulse-st.pulse-st--done { background: var(--good-soft); color: var(--good); border-color: transparent; }
.pulse-st.pulse-st--ok { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pulse-st.pulse-st--bad { background: var(--warn-soft); color: var(--warn); border-color: transparent; }

/* полоса выполнения: заливка — факт, чёрточка — где по графику надо быть сегодня */
.pulse-bar { position: relative; height: 12px; border-radius: 6px; background: var(--bar-track); }
.pulse-bar__fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: var(--s1); }
.pulse-bar.pulse-st--done .pulse-bar__fill { background: var(--st-good); }
.pulse-bar.pulse-st--bad .pulse-bar__fill { background: var(--st-warn); }
.pulse-bar__mark { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px;
  background: var(--ink); border-radius: 1px; }
.pulse-bar__mark::after { content: ""; position: absolute; left: -6px; right: -6px; top: -2px; bottom: -2px; }

svg.pulse-cum { overflow: visible; }
.pulse-cum__plan { fill: none; stroke: var(--ink-3); stroke-width: 1.6; stroke-dasharray: 5 4; }
.pulse-cum__fact { fill: none; stroke: var(--s1); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.pulse-cum__fc { fill: none; stroke: var(--s2); stroke-width: 2; stroke-dasharray: 2 4; stroke-linecap: round; }
.pulse-cum__area { fill: var(--s1); fill-opacity: .1; }
.legend i.pulse-lg--plan { background: var(--ink-3); }
.legend i.pulse-lg--fact { background: var(--s1); height: 3px; }
.legend i.pulse-lg--fc { background: var(--s2); }

.pulse-plan-t .pulse-grp { text-align: center; border-bottom: 1px solid var(--line); color: var(--ink-2);
  font-weight: 600; }
.pulse-plan-t thead tr:first-child th[rowspan] { vertical-align: bottom; }
.pulse-plan-t td:nth-child(6), .pulse-plan-t th.pulse-grp + th.pulse-grp { border-left: 1px solid var(--line); }
.pulse-in { width: 108px; padding: 4px 7px; font-size: 13px; text-align: right;
  font-variant-numeric: tabular-nums; border-radius: 6px; }
.pulse-in::placeholder { color: var(--ink-3); font-size: 11.5px; }
.pulse-in::-webkit-inner-spin-button { opacity: .5; }
.pulse-shoprow th, .pulse-shoprow td { background: var(--surface-2); font-weight: 600; }
.data--sticky .pulse-shoprow th:first-child { background: var(--surface-2); }
.pulse-plan-t td { vertical-align: middle; }
.pulse-mini { display: block; height: 3px; border-radius: 2px; background: var(--bar-track);
  margin: 3px 0 0 auto; width: 48px; overflow: hidden; }
.pulse-mini span { display: block; height: 100%; background: var(--bar); }

/* ── Полоса плана на дашборде ────────────────────────────── */

.pulse-dash__body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 28px; }
.pulse-dash__row { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.pulse-dash__top { display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap;
  font-variant-numeric: tabular-nums; font-size: 13px; color: var(--ink-2); }
.pulse-dash__top .lbl { font-weight: 600; color: var(--ink); font-size: 13.5px; }
.pulse-dash__top b { font-size: 18px; font-weight: 650; color: var(--ink); }
.pulse-dash__phrase { margin: 0; font-size: 12.8px; color: var(--ink-2); line-height: 1.45; }
.pulse-dash--empty .card__body { display: flex; gap: 10px 16px; align-items: center; flex-wrap: wrap;
  font-size: 13px; color: var(--ink-2); }
.pulse-dash--empty b { color: var(--ink); }

/* ── Телефон ─────────────────────────────────────────────── */

@media (max-width: 900px) {
  .pulse-progs, .pulse-dash__body { grid-template-columns: minmax(0, 1fr); }
  .pulse-prog { border-left: 0; margin-left: 0; border-top: 1px solid var(--line); }
  .pulse-prog:first-child { border-top: 0; }
}

@media (max-width: 520px) {
  .pulse-watch-grid { grid-template-columns: minmax(0, 1fr); }
  .pulse-watch { padding: 12px 16px; }
  .pulse-watch__nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pulse-cap { padding: 8px 14px 10px; }
  .pulse-prog { padding: 14px 16px; }
  .pulse-prog__big b { font-size: 22px; }
  /* выбор артикула — во всю ширину под заголовком, а не за краем панели */
  .pulse .panel__head .aside { margin-left: 0; width: 100%; }
  .pulse-add { flex-wrap: nowrap; }
  .pulse-add .select { flex: 1 1 auto; width: 1px; min-width: 0; max-width: none; }
  .pulse-in { width: 92px; }
}
