/* Дашборд эффекта Smart Menu Pricing */

main#app {
  max-width: 1320px; margin: 0 auto;
  padding: 28px 22px 80px;
}
@media (max-width: 700px) {
  main#app { padding: 14px 12px 60px; }
}

.dash-hero {
  background:
    radial-gradient(circle at 100% 0%, rgba(201,168,106,0.22), transparent 50%),
    radial-gradient(circle at 0% 100%, rgba(139,45,31,0.10), transparent 45%),
    linear-gradient(135deg, #FBF6EA 0%, #F4ECD7 100%);
  color: var(--c-text);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  margin-bottom: 24px;
  position: relative; overflow: hidden;
  box-shadow: 0 12px 36px rgba(40,30,20,0.08);
}
@media (max-width: 700px) {
  .dash-hero { padding: 20px 18px; margin-bottom: 14px; border-radius: var(--radius-md); }
  .dash-hero h1 { font-size: 22px; line-height: 1.15; }
  .dash-hero p { font-size: 13px; }
  .dash-hero .meta { gap: 6px; margin-top: 12px; }
  .dash-hero .meta .pill { padding: 4px 10px; font-size: 11px; }
}
.dash-hero h1 { font-family: 'Cormorant Garamond', serif; font-size: 36px; color: var(--c-text); }
.dash-hero p { color: var(--c-text-2); max-width: 70ch; font-size: 15px; margin-top: 10px; line-height: 1.55; }
.dash-hero .meta {
  display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap;
  font-size: 13px;
}
.dash-hero .meta .pill {
  background: #fff;
  color: var(--c-text-2);
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--c-line);
  font-weight: 500;
}

/* ===== Period switch ===== */
.period-switch {
  display: inline-flex;
  background: var(--c-surface-2);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 16px;
  border: 1px solid var(--c-line);
}
.period-btn {
  padding: 9px 22px;
  border-radius: 999px;
  background: transparent;
  color: var(--c-text-2);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  border: none;
}
.period-btn.active {
  background: var(--c-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(139,45,31,0.30);
}
.period-btn:hover:not(.active) { color: var(--c-text); }

.period-label { margin-bottom: 14px; }
.period-label-main {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px; font-weight: 700;
  margin-right: 10px;
}
.period-label-sub {
  font-size: 13px;
  color: var(--c-text-3);
}

/* ===== Histogram ===== */
.histogram-section { background: linear-gradient(180deg, #FCFAF6 0%, var(--c-surface) 100%); }
.histogram-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.histogram-total {
  text-align: right;
  flex-shrink: 0;
  background: linear-gradient(135deg, #D8F3DC 0%, #95E6B7 100%);
  border: 1px solid #74C69D;
  border-radius: 14px;
  padding: 12px 18px;
}
.histogram-total-val {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px; font-weight: 700;
  color: #1B4332;
  line-height: 1;
}
.histogram-total-lbl {
  font-size: 11px;
  color: #1B4332;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
  font-weight: 700;
}

.histogram {
  display: flex; align-items: flex-end; gap: 6px;
  height: 280px;
  margin: 10px 0 14px;
  padding-top: 30px;       /* место для подписей сверху */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.hbar {
  flex: 1; min-width: 36px;
  display: flex; flex-direction: column; align-items: center;
  position: relative;
  height: 100%;
}
.hbar-vals {
  position: absolute; top: -28px; left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-size: 10px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .15s;
  pointer-events: none;
}
.hbar:hover .hbar-vals { opacity: 1; }
.hbar.today .hbar-vals { opacity: 1; }
.hbar-val-delta { color: var(--c-success); font-weight: 800; font-size: 11px; }
.hbar-val-total { color: var(--c-text-3); font-weight: 600; }

.hbar-stack {
  flex: 1; width: 100%;
  display: flex; flex-direction: column;
  justify-content: flex-end;
  border-radius: 4px 4px 0 0;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}
.hbar-piece {
  width: 100%;
  transition: filter .15s;
}
.hbar-piece.base {
  background: linear-gradient(180deg, #B8B0A2 0%, #908778 100%);
}
.hbar-piece.delta {
  background: linear-gradient(180deg, #95E6B7 0%, #52B788 100%);
  box-shadow: 0 0 0 1px rgba(31,138,63,0.20) inset;
}
.hbar.weekend .hbar-piece.base {
  background: linear-gradient(180deg, #C9A86A 0%, #A88846 100%);
}
.hbar.today .hbar-piece.delta {
  background: linear-gradient(180deg, #1F8A3F 0%, #146629 100%);
}
.hbar:hover .hbar-piece { filter: brightness(1.08); }

.hbar-date {
  margin-top: 6px;
  text-align: center;
  font-size: 11px;
  color: var(--c-text-3);
  line-height: 1.1;
}
.hbar-day { font-weight: 800; font-size: 13px; color: var(--c-text); }
.hbar.today .hbar-day { color: var(--c-primary); }
.hbar.weekend .hbar-day { color: var(--c-accent-dark); }
.hbar-wd { font-size: 10px; margin-top: 1px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }

.hbar-today-pill {
  position: absolute; bottom: -28px; left: 50%;
  transform: translateX(-50%);
  background: var(--c-primary); color: #fff;
  font-size: 9px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px;
  white-space: nowrap;
}

.histogram-legend {
  display: flex; gap: 16px;
  font-size: 12px; color: var(--c-text-2);
  flex-wrap: wrap;
}
.histogram-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend-block {
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 3px;
}
.legend-block.base { background: linear-gradient(180deg, #B8B0A2 0%, #908778 100%); }
.legend-block.delta { background: linear-gradient(180deg, #95E6B7 0%, #52B788 100%); }
.legend-block.weekend { background: linear-gradient(180deg, #C9A86A 0%, #A88846 100%); }

@media (max-width: 700px) {
  .histogram { height: 200px; padding-top: 0; }
  .histogram-head { flex-direction: column; }
  .hbar-vals { display: none; }
  .hbar-wd { display: none; }
}

/* KPI highlight для прироста маржи */
.kpi.highlight {
  background: linear-gradient(135deg, #FCFAF6 0%, #F5EAD2 100%);
  border-color: var(--c-accent);
}
.kpi.accent {
  background: linear-gradient(135deg, #D8F3DC 0%, #B7E4C7 100%);
  border-color: #74C69D;
}
.kpi.accent .kpi-value { color: #1B4332; }
.kpi.accent .kpi-label { color: #1B4332; opacity: 0.7; }
.kpi.accent .kpi-foot { color: #1B4332; opacity: 0.8; }

/* ===== KPI grid ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 24px; }
  .kpi-label { font-size: 10px; }
  .kpi-foot { font-size: 11px; }
}

.kpi {
  background: var(--c-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--c-line);
  padding: 22px;
  display: flex; flex-direction: column; gap: 8px;
  position: relative; overflow: hidden;
}
.kpi-label { font-size: 12px; color: var(--c-text-3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.kpi-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px; font-weight: 600; line-height: 1;
  color: var(--c-text);
}
.kpi-delta {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
  width: fit-content;
}
.kpi-delta.up      { background: #D8F3DC; color: #1B4332; }
.kpi-delta.down    { background: var(--c-primary-light); color: var(--c-primary-dark); }
.kpi-delta.neutral { background: var(--c-surface-2); color: var(--c-text-3); }
.kpi-foot { font-size: 12px; color: var(--c-text-2); }

.kpi-spark {
  position: absolute; right: 0; bottom: 0;
  width: 100px; height: 40px; opacity: 0.5;
}

/* ===== Compare table ===== */
.section {
  background: var(--c-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--c-line);
  margin-bottom: 24px;
  overflow: hidden;
}
.section-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--c-line);
  background: linear-gradient(180deg, #FCFAF6, #F8F4EC);
}
.section-head h2 { font-size: 22px; }
.section-head .sub { font-size: 13px; color: var(--c-text-2); margin-top: 2px; }
.section-body { padding: 24px; }
.section-body.tight { padding: 0; }

@media (max-width: 700px) {
  .section { margin-bottom: 14px; }
  .section-head { padding: 14px 16px; }
  .section-head h2 { font-size: 18px; }
  .section-head .sub { font-size: 12px; }
  .section-body { padding: 14px; }
}

table.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.compare th, table.compare td {
  padding: 12px 18px;
  text-align: right;
  border-bottom: 1px solid var(--c-line);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 700px) {
  table.compare { font-size: 12px; }
  table.compare th, table.compare td { padding: 8px 10px; }
  table.compare th { font-size: 10px; }
}
table.compare th:first-child, table.compare td:first-child {
  text-align: left; font-weight: 500; color: var(--c-text);
}
table.compare th {
  background: var(--c-surface-2);
  font-weight: 700; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--c-text-2);
}
table.compare tr.total td {
  background: #FCFAF6; font-weight: 700; font-size: 15px;
  border-top: 2px solid var(--c-line); border-bottom: none;
}
table.compare td.delta-up   { color: var(--c-success); font-weight: 700; }
table.compare td.delta-down { color: var(--c-danger); font-weight: 700; }
table.compare td.mono       { font-family: 'JetBrains Mono', monospace; }

/* ===== Timeline ===== */
.timeline-wrap {
  margin-top: 12px;
  background: var(--c-surface-2);
  border-radius: var(--radius-md);
  padding: 20px 16px;
}
.timeline {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 0;
  font-size: 12px;
}
@media (max-width: 700px) {
  .timeline-wrap { padding: 12px 8px; }
  .timeline { grid-template-columns: 48px 1fr; font-size: 11px; }
  .timeline-hour { padding: 4px 6px 4px 0; }
  .timeline-cell { padding: 3px 6px; }
  .timeline-bar { font-size: 10px; padding: 0 6px; height: 16px; }
}

.mix-row {
  display: grid;
  grid-template-columns: 200px 1fr 70px;
  gap: 12px; align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
}
@media (max-width: 700px) {
  .mix-row { grid-template-columns: 1fr 70px; gap: 6px; margin-bottom: 14px; }
  .mix-row .mix-bar { grid-column: 1 / -1; }
}
.timeline-hour {
  color: var(--c-text-3);
  padding: 6px 12px 6px 0;
  font-family: 'JetBrains Mono', monospace;
  border-right: 1px solid var(--c-line);
}
.timeline-cell {
  padding: 4px 12px;
  display: flex; flex-direction: column; gap: 4px;
  border-bottom: 1px solid #EFE9DD;
}
.timeline-bar {
  height: 18px; border-radius: 4px;
  display: flex; align-items: center; padding: 0 8px;
  font-size: 11px; color: #fff; font-weight: 600;
  white-space: nowrap; overflow: hidden;
}

/* ===== Mix donut (текст-bar) ===== */
.mix-bar { height: 16px; background: var(--c-surface-2); border-radius: 999px; overflow: hidden; }
.mix-bar-fill { height: 100%; transition: width .3s; }

/* ===== Disclaimer ===== */
.disclaimer {
  background: var(--c-accent-light);
  border-left: 4px solid var(--c-accent);
  padding: 14px 18px; border-radius: var(--radius-sm);
  margin-top: 24px;
  font-size: 13px; color: var(--c-accent-dark);
}
