/* v73: compact cards and shared semantic colours across the Revenue mini app. */
.metric-box,.tiny-stat,.plan-metric {
  display:flex;
  flex-direction:column;
  min-width:0;
  text-align:center;
  padding:10px 9px 12px;
  border-radius:12px;
  background:var(--surface-2);
}
.metric-label,.tiny-stat-label,.plan-metric>span {
  display:flex;
  justify-content:center;
  align-items:center;
  min-height:34px;
  margin:0 0 5px;
  color:var(--muted);
  font-size:13px;
  font-weight:550;
  line-height:1.3;
  text-align:center;
  overflow-wrap:break-word;
}
.data-value {
  display:block;
  max-width:100%;
  min-width:0;
  font-variant-numeric:tabular-nums lining-nums;
  font-feature-settings:"tnum";
  white-space:nowrap;
  word-break:normal;
  overflow-wrap:normal;
  letter-spacing:-.025em;
}
.metric-value,.tiny-stat-value,.plan-metric>strong {
  width:100%;
  margin:0;
  font-size:20px;
  font-weight:700;
  line-height:1.2;
  text-align:center;
}
.metric-foot,.plan-metric>small { text-align:center; line-height:1.4; margin-top:6px; }
.summary-grid,.compact-stats,.readable-metrics,.plan-small-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  align-items:stretch;
  gap:8px;
}
.stat-wide { grid-column:1 / -1; }
.summary-grid.has-large-values,.compact-stats.has-large-values,.readable-metrics.has-large-values,.plan-small-grid.has-large-values { grid-template-columns:minmax(0,1fr); }
.compact-head { align-items:center; }
.compact-titles { flex:1; }
.compact-title { font-size:17px; line-height:1.35; letter-spacing:-.02em; }
.card-arrow { display:block; flex:0 0 auto; color:var(--accent); font-size:25px; line-height:1; }
.compact-head>.card-arrow { padding-left:8px; }
.compact-card { padding:15px; }
/* Every amount must be measured at its real width, even below the fold. */
.cards-stack>.compact-card,.list-rows>.readable-row { content-visibility:visible; contain-intrinsic-size:none; }
.compact-stats>.tiny-stat { min-height:82px; }
.readable-row {
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:12px;
  padding:13px;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:16px;
}
.list-row-head { display:flex; align-items:center; justify-content:space-between; gap:12px; min-width:0; }
.list-main { min-width:0; flex:1; }
.list-row-title { margin:0; font-size:15px; font-weight:650; line-height:1.35; }
.list-row-meta { color:var(--muted); font-size:12px; line-height:1.4; margin-top:4px; }
.readable-row>.list-row-value { font-size:20px; text-align:center; }
.readable-metrics>.tiny-stat { min-height:78px; }
.readable-row .tiny-stat { background:var(--surface-2); }
.list-rows { gap:12px; }
.section-title { font-size:16px; margin-bottom:5px; line-height:1.35; }
.section-subtitle { margin-bottom:12px; font-size:13px; }
.modal-head h2 { min-width:0; overflow-wrap:break-word; line-height:1.4; }
.modal-head>.icon-btn { flex-shrink:0; }
.modal-body { padding:12px; }
.modal-pane { min-width:0; }
.modal-pane>.section-block+.section-block { margin-top:12px; }
.modal-pane>.section-block { padding:12px; }

/* Time occupies one column; each numeric column has a shared baseline. */
.hours-table {
  width:100%;
  table-layout:fixed;
  border-collapse:separate;
  border-spacing:0;
  font-size:13px;
  font-variant-numeric:tabular-nums;
}
.hours-table .hour-col { width:23%; }
.hours-table .revenue-col { width:29%; }
.hours-table .checks-col { width:16%; }
.hours-table .average-col { width:32%; }
.hours-table th,.hours-table td { text-align:center; padding:12px 5px; border-bottom:1px solid var(--line); }
.hours-table thead th { position:sticky; top:-12px; z-index:1; background:var(--surface-3); color:var(--muted); font-size:12px; font-weight:600; line-height:1.35; }
.hours-table thead th:first-child { border-top-left-radius:10px; }
.hours-table thead th:last-child { border-top-right-radius:10px; }
.hours-table tbody th { font-weight:550; font-size:12px; color:var(--muted); }
.hours-table tbody td { font-weight:650; }
.hours-table tbody tr:nth-child(even) { background:var(--surface-2); }
.hours-table tbody tr:hover { background:var(--primary-soft); }
.hours-table tbody tr:last-child th,.hours-table tbody tr:last-child td { border-bottom:0; }
.hour-range { display:flex; flex-direction:column; gap:3px; white-space:nowrap; }
.hour-end { font-size:11px; }
.hours-section .section-title { margin-bottom:5px; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

.cash-events-list .cash-event-row { grid-template-columns:minmax(0,1fr); }
.cash-event-head { text-align:center; }
.cash-event-store { color:var(--muted); font-size:13px; margin-top:5px; overflow-wrap:break-word; }
.cash-event-amount { padding:11px 12px; border-radius:12px; background:var(--surface-2); text-align:center; }
.cash-event-amount>span { display:block; font-size:12px; color:var(--muted); margin-bottom:6px; }
.cash-event-amount>strong { font-size:23px; line-height:1.2; }
.cash-event-amount.amount-negative { background:var(--bad-soft); }
.cash-event-amount.amount-positive { background:var(--good-soft); }
.cash-event-description,.cash-event-comment p { margin:0; font-size:13px; line-height:1.5; overflow-wrap:break-word; }
.cash-event-comment { padding-top:10px; border-top:1px solid var(--line); }
.cash-event-comment>span { display:block; font-size:12px; color:var(--muted); margin-bottom:4px; }
.cash-filter-sum { display:block; text-align:center; padding:12px; }
.cash-filter-sum>span { display:block; font-size:13px; margin-bottom:6px; }
.cash-filter-sum>strong { font-size:23px; }
.cash-detail-note { display:flex; flex-wrap:wrap; justify-content:space-between; gap:5px 12px; font-weight:500; font-size:13px; line-height:1.4; }
.cash-search-hint { font-size:12px; font-weight:400; line-height:1.45; }
.plan-overview .plan-small-grid { margin-top:12px; }
.plan-small-grid>.plan-metric { min-height:85px; }
.plan-small-grid>.plan-metric:last-child:nth-child(odd) { grid-column:1 / -1; }
.plan-card-foot { justify-content:center; }
.plan-level-summary { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); padding:8px; gap:8px; }
.plan-level-summary .plan-metric { background:var(--surface); }
.plan-level-summary .plan-metric>strong { font-size:19px; color:var(--plan-level); }
.plan-hero-number { display:flex; flex-direction:column; align-items:center; gap:5px; margin:16px 0; }
.plan-hero-number>span { margin:0; }
.plan-focus>.plan-eyebrow,.plan-focus>h2 { text-align:center; }
.plan-next-option { text-align:center; }
.plan-next-option>strong { font-variant-numeric:tabular-nums; }
.plan-tiers th,.plan-tiers td { text-align:center; }
.plan-tiers th:first-child { text-align:center; }
.shift-count { align-items:center; text-align:center; }
.shift-count span { display:flex; align-items:center; justify-content:center; min-height:32px; text-align:center; }
.shift-cluster { flex-direction:column; gap:6px; text-align:center; }
.shift-cluster strong,.shift-time { font-variant-numeric:tabular-nums; }
.revenue-total { text-align:center; }
.revenue-caption { text-align:center; }
.revenue-pacing-line { justify-content:center; text-align:center; }
.revenue-pacing-values { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:8px; text-align:center; }
.revenue-pacing-values>strong { font-size:23px; }
.revenue-pacing-percent { align-self:center; font-size:19px; }
.revenue-pacing-values>:only-child { grid-column:1 / -1; }
@media (max-width:390px) {
  .metric-value,.tiny-stat-value,.plan-metric>strong { font-size:18px; }
  .metric-label,.tiny-stat-label,.plan-metric>span { font-size:12px; min-height:32px; }
  .compact-card { padding:12px; }
  .modal-body { padding:10px; }
  .modal-pane>.section-block { padding:10px; }
  .readable-row { padding:10px; }
  .tiny-stat { padding:9px 6px 11px; }
  .readable-metrics,.compact-stats { gap:6px; }
  .hours-table th,.hours-table td { padding:11px 3px; }
  .hours-table thead th { top:-10px; }
}
@media (min-width:600px) {
  .modal-sheet { top:32px; bottom:24px; }
  .metric-value,.tiny-stat-value,.plan-metric>strong { font-size:22px; }
  .hour-range { display:block; }
  .hour-end { margin-left:3px; font-size:12px; }
}

/* Common meanings: loss/outflow, completion bands, profit/inflow, revenue. */
:root {
  --data-line:#becce0;
  --good:#087d54; --good-soft:#edf8f2;
  --bad:#be3347; --bad-soft:#fff1f3;
  --warn:#a14d0b; --warn-soft:#fff3e9;
  --close:#8d6209; --close-soft:#fff8e6;
}
:root[data-theme="dark"] {
  --data-line:#43546f;
  --good:#74d9b0; --good-soft:#1b3832;
  --bad:#ff9aa8; --bad-soft:#3d2831;
  --warn:#ffbc83; --warn-soft:#413225;
  --close:#f5d175; --close-soft:#3c3726;
}
.tone-neutral { --metric-ink:var(--text); --metric-bg:var(--surface-2); --metric-on-hero:var(--hero-muted); }
.tone-accent { --metric-ink:var(--accent); --metric-bg:var(--primary-soft); --metric-on-hero:#c7d9ff; }
.tone-good { --metric-ink:var(--good); --metric-bg:var(--good-soft); --metric-on-hero:#b0f0d0; }
.tone-bad { --metric-ink:var(--bad); --metric-bg:var(--bad-soft); --metric-on-hero:#ffb9c3; }
.tone-warn { --metric-ink:var(--warn); --metric-bg:var(--warn-soft); --metric-on-hero:#ffca9e; }
.tone-close { --metric-ink:var(--close); --metric-bg:var(--close-soft); --metric-on-hero:#ffe09b; }
.data-value.has-tone { color:var(--metric-ink); }
.metric-box.has-tone,.tiny-stat.has-tone,.readable-row .tiny-stat.has-tone,.plan-metric.has-tone {
  background:var(--metric-bg);
}
.metric-box.has-tone>.metric-value,.tiny-stat.has-tone>.tiny-stat-value,.plan-metric.has-tone>strong {
  color:var(--metric-ink);
}

/* One continuous table outline with thin internal row and column dividers. */
.summary-grid,.compact-stats,.readable-metrics,.plan-small-grid {
  gap:1px;
  padding:1px;
  background:var(--data-line);
  border-radius:10px;
  overflow:hidden;
}
.metric-box,.tiny-stat,.plan-metric {
  padding:7px 8px;
  min-height:0;
  border:0;
  border-radius:0;
}
.metric-label,.tiny-stat-label,.plan-metric>span {
  flex:1;
  min-height:0;
  margin:0 0 3px;
  line-height:1.3;
  font-size:12px;
  font-weight:500;
  color:var(--muted);
}
.tiny-stat.cash-plus>.tiny-stat-label,.tiny-stat.cash-minus>.tiny-stat-label,
.cash-inflow-card>.metric-label,.cash-outflow-card>.metric-label { color:var(--muted); }
.metric-value,.tiny-stat-value,.plan-metric>strong {
  margin-top:auto;
  font-size:18px;
  line-height:1.2;
}
.compact-stats>.tiny-stat,.readable-metrics>.tiny-stat,.plan-small-grid>.plan-metric { min-height:0; }
.content,.cards-stack,.list-rows { gap:8px; }
.compact-card,.summary-board,.plan-card,.plan-controls { padding:12px; }
.compact-head { margin-bottom:8px; }
.compact-subtitle { margin-top:2px; font-size:12px; }
.readable-row { gap:7px; padding:10px; border-radius:12px; }
.section-title { margin-bottom:4px; }
.section-subtitle { margin-bottom:8px; font-size:12px; }
.modal-pane>.section-block { padding:10px; }
.modal-pane>.section-block+.section-block { margin-top:8px; }
.summary-section+.summary-section { margin-top:9px; padding-top:9px; }
.compact-footer-line { font-size:12px; }

.cash-event-head { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:3px 8px; text-align:left; }
.cash-event-head>.list-row-title { font-size:14px; white-space:normal; }
.cash-event-head>.list-row-meta { margin:0; font-size:11px; white-space:nowrap; }
.cash-event-store { grid-column:1 / -1; margin:0; font-size:12px; font-weight:600; }
.cash-event-amount { padding:7px 9px; border:1px solid var(--data-line); border-radius:8px; }
.cash-event-amount>span { margin-bottom:3px; font-size:11px; }
.cash-event-amount>strong { font-size:20px; }
.cash-event-description,.cash-event-comment p { font-size:12px; line-height:1.4; }
.cash-event-comment { padding-top:6px; margin-top:0; color:var(--text); font-weight:500; line-height:1.4; }
.cash-event-comment>span { margin-bottom:2px; font-size:11px; font-weight:500; }
.cash-filter-sum { padding:8px; }
.cash-filter-sum>span { margin-bottom:3px; font-size:12px; }
.cash-filter-sum>strong { font-size:20px; }
.cash-detail-actions { margin:6px 0; }
.cash-toggle-btn { min-height:36px; padding:6px 10px; }
.cash-search-box { padding:8px; }
.cash-search-hint { margin-top:5px; }

.plan-progress { margin:8px 0; }
.plan-overview .plan-small-grid { margin-top:8px; }
.plan-card-foot { padding-top:8px; margin-top:8px; }
.plan-card.has-tone>.plan-card-head>strong,.plan-focus.has-tone>.plan-hero-number { color:var(--metric-ink); }
.plan-card.has-tone>.plan-status:not(.plan-level-status) { color:var(--metric-ink); }
.plan-progress.has-tone>span { background:var(--metric-ink); }
.plan-hero-number { margin:10px 0; font-size:38px; }
.plan-pace { margin-top:10px; padding:9px; }
.plan-level-summary { gap:1px; padding:1px; background:var(--data-line); }
.plan-level-summary .plan-metric { padding:7px 8px; }
.plan-next-option { margin:9px 0; padding:10px; }
.plan-kind-tabs { margin-bottom:8px; }
.plan-focus[data-plan-scope="day"]>.plan-pace,.plan-focus[data-plan-scope="period"]>.plan-pace { border-color:var(--metric-ink); }
.plan-focus[data-plan-scope="day"]>.plan-pace>strong,.plan-focus[data-plan-scope="period"]>.plan-pace>strong { color:var(--metric-ink); }
.revenue-plan-line>strong.has-tone { color:var(--metric-on-hero); }
.revenue-track.has-tone>span { background:var(--metric-on-hero); }

.hours-table th,.hours-table td,.plan-tiers th,.plan-tiers td {
  padding:9px 4px;
  border-right:1px solid var(--data-line);
  border-bottom:1px solid var(--data-line);
}
.hours-table th:first-child,.hours-table td:first-child,.plan-tiers th:first-child { border-left:1px solid var(--data-line); }
.hours-table thead th,.plan-tiers thead th { border-top:1px solid var(--data-line); }
.hours-table tbody tr:last-child th,.hours-table tbody tr:last-child td { border-bottom:1px solid var(--data-line); }
.plan-tiers { table-layout:fixed; }
.plan-tiers th:first-child { width:16%; }
.plan-tiers .data-value { font-size:12px; }
.revenue-hero { padding:17px 16px; }
.revenue-total { margin:12px 0 16px; }
@media (max-width:390px) {
  .metric-box,.tiny-stat,.plan-metric { padding:6px; }
  .compact-card,.summary-board,.plan-card,.plan-controls { padding:10px; }
  .readable-row { padding:9px; }
  .hours-table th,.hours-table td { padding:8px 3px; }
  .cash-event-head>.list-row-meta { font-size:10px; }
}
@media (min-width:600px) {
  .metric-value,.tiny-stat-value,.plan-metric>strong { font-size:20px; }
}

/* Dense summary: keep the total prominent and put pacing on a compact line. */
.revenue-hero { padding:12px; border-radius:18px; }
.revenue-scope { padding:3px 6px; font-size:11px; }
.revenue-total { margin:6px 0 8px; font-size:clamp(26px,7.4vw,34px); }
.revenue-plan-line { font-size:12px; }
.revenue-track { height:4px; margin:6px 0; }
.revenue-caption { font-size:11px; }
.revenue-pacing { margin-top:8px; padding-top:8px; }
.revenue-pacing-row { display:flex; align-items:center; justify-content:space-between; gap:5px 9px; }
.revenue-pacing-row>.revenue-pacing-line { display:block; flex:1; min-width:0; font-size:12px; line-height:1.3; text-align:left; }
.revenue-pacing-values { display:flex; align-items:baseline; gap:8px; margin:0; min-width:0; max-width:68%; }
.revenue-pacing-values>strong { flex:1; min-width:0; font-size:18px; }
.revenue-pacing-values>.revenue-pacing-percent { font-size:12px; flex:0 1 auto; max-width:35%; }
.revenue-pacing-note { margin-top:4px; font-size:11px; line-height:1.35; }

/* Product rows use more of the available width instead of tall empty cells. */
.product-row.readable-row { padding:8px; gap:5px; border-radius:10px; }
.product-row .list-row-title { font-size:14px; line-height:1.25; }
.product-metrics { border-radius:8px; }
.product-metrics>.tiny-stat { padding:4px 5px; }
.product-metrics>.tiny-stat>.tiny-stat-label { font-size:11px; line-height:1.2; margin-bottom:2px; }
.product-metrics>.tiny-stat>.tiny-stat-value { font-size:16px; }
@media (min-width:360px) {
  .product-metrics { grid-template-columns:repeat(6,minmax(0,1fr)); }
  .product-metrics>.tiny-stat { grid-column:span 2; }
  .product-metrics>.tiny-stat:last-child:nth-child(3n + 1) { grid-column:span 6; }
  .product-metrics>.tiny-stat:nth-last-child(2):nth-child(3n + 1),
  .product-metrics>.tiny-stat:last-child:nth-child(3n + 2) { grid-column:span 3; }
  .product-metrics.has-large-values { grid-template-columns:minmax(0,1fr); }
  .product-metrics.has-large-values>.tiny-stat { grid-column:1 / -1; }
}

/* Amount, before and after share one bordered row in each cash event. */
.cash-event-row.readable-row { padding:8px; gap:5px; }
.cash-event-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); border-radius:8px; }
.cash-event-metrics>.tiny-stat { grid-column:auto; padding:5px 4px; }
.cash-event-metrics>.tiny-stat>.tiny-stat-label { font-size:11px; line-height:1.2; margin-bottom:2px; }
.cash-event-metrics>.tiny-stat>.tiny-stat-value { font-size:16px; }
.cash-event-metrics.has-large-values { grid-template-columns:minmax(0,1fr); }
.cash-filter-sum { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:6px 8px; }
.cash-filter-sum>span { margin:0; font-size:11px; }
.cash-filter-sum>strong { font-size:18px; max-width:65%; }
.cash-search-box { padding:6px; }
.cash-search-hint { font-size:11px; margin-top:4px; }

/* REVENUE_CARD_HEAD_V1: шапка карточки выделена, чтобы название не сливалось с цифрами */
.compact-card>.compact-head {
  background:var(--primary-soft);
  border-left:4px solid var(--primary-2);
  border-radius:12px;
  padding:9px 10px 9px 12px;
  margin:-3px -3px 10px;
}
.compact-card>.compact-head .compact-title { color:var(--accent); font-weight:800; }
.compact-card>.compact-head .compact-subtitle { color:var(--muted); opacity:.85; }
.compact-card>.compact-head>.card-arrow { color:var(--primary-2); }
:root[data-theme="dark"] .compact-card>.compact-head { border-left-color:#7fa2ff; }
/* Сводка: подзаголовки «План и прогноз», «Финансы», «Бонусы» — в том же стиле */
.summary-board .summary-subhead {
  background:var(--primary-soft);
  border-left:4px solid var(--primary-2);
  border-radius:10px;
  padding:7px 10px;
  margin:0 0 9px;
  color:var(--accent);
  font-weight:800;
}
:root[data-theme="dark"] .summary-board .summary-subhead { border-left-color:#7fa2ff; }

/* REVENUE_CARD_FRAME_V1: рамка карточек магазинов/групп и Сводки заметнее */
.compact-card,.summary-board {
  border:1.5px solid color-mix(in srgb, var(--primary-2) 38%, var(--line)) !important;
  box-shadow:0 2px 10px rgba(49,91,209,.12), 0 1px 2px rgba(24,36,58,.06) !important;
}
:root[data-theme="dark"] .compact-card,:root[data-theme="dark"] .summary-board {
  border-color:color-mix(in srgb, #7fa2ff 45%, var(--line)) !important;
  box-shadow:0 2px 12px rgba(0,0,0,.35) !important;
}

/* REVENUE_CARD_DARK_TITLE_V1: тёмная тема — название на шапке белое, подложка насыщеннее */
:root[data-theme="dark"] .compact-card>.compact-head,
:root[data-theme="dark"] .summary-board .summary-subhead {
  background:linear-gradient(90deg, #2f4f8f, #273f6e);
  border-left-color:#8fb0ff;
}
:root[data-theme="dark"] .compact-card>.compact-head .compact-title,
:root[data-theme="dark"] .summary-board .summary-subhead { color:#ffffff; text-shadow:0 1px 1px rgba(0,0,0,.35); }
:root[data-theme="dark"] .compact-card>.compact-head .compact-subtitle { color:#d6e2fa; opacity:1; }
:root[data-theme="dark"] .compact-card>.compact-head>.card-arrow { color:#cfe0ff; }

/* Сравнение с прошлым периодом: по центру, как сумма выручки */
.revenue-total-row { justify-content:center; margin:6px 0 4px; }
.revenue-compare-note { margin:2px 0 10px; text-align:left; }

/* Стрелка и % отклонения от аналогичного прошлого периода в плитках */
.tiny-stat { position:relative; }
.tiny-stat.has-cmp>.tiny-stat-label { justify-content:flex-start; text-align:left; padding-right:4px; }
.cmp-arrow { position:absolute; top:5px; right:6px; display:inline-flex; align-items:baseline; gap:3px; font-size:11px; font-weight:700; line-height:1.2; white-space:nowrap; font-variant-numeric:tabular-nums; }
.cmp-arrow--up { color:var(--good); }
.cmp-arrow--down { color:var(--bad); }
