/* Månedsrapport: report specific surfaces. Shell and tokens live in
   colors_and_type.css and ligo-shell.css. */

:root {
  --chart-prior: #58656d;
}

html[data-theme="light"] {
  --chart-prior: #8a9a86;
}

.report-filters-fixed-client {
  grid-template-columns: minmax(132px, 168px);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
  font-size: 10.5px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chart-legend i {
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 2px;
}

.legend-current {
  background: var(--primary);
}

.legend-prior {
  background: var(--chart-prior);
}

.legend-result {
  background: var(--accent);
}

.revenue-chart {
  height: 220px;
  display: flex;
  align-items: stretch;
  gap: 7px;
  margin: 14px 16px 16px;
  padding-top: 4px;
  border-bottom: 1px solid var(--border);
}

.revenue-month {
  min-width: 0;
  flex: 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 21px;
  gap: 3px;
  color: var(--muted-2);
  font-size: 10px;
  text-align: center;
}

.bar-area {
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  background-image: linear-gradient(to top, var(--border) 1px, transparent 1px);
  background-size: 100% 25%;
}

.bar {
  width: min(42%, 22px);
  min-height: 2px;
  border-radius: 3px 3px 0 0;
}

.bar-current {
  background: var(--primary);
}

.bar-prior {
  background: var(--chart-prior);
}

.line-chart {
  width: calc(100% - 32px);
  height: 190px;
  display: block;
  overflow: visible;
  margin: 14px 16px 0;
  background-image: linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 100% 25%;
}

.line-chart polyline {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.zero-line {
  stroke: var(--border-strong);
  stroke-width: 1;
}

.line-ebitda {
  stroke: var(--primary);
}

.line-result {
  stroke: var(--accent);
}

.chart-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 16px 16px;
}

.chart-summary span {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.chart-summary small,
.chart-summary strong {
  display: block;
}

.chart-summary small {
  margin-bottom: 3px;
  color: var(--muted-2);
  font-size: 10px;
}

.chart-summary strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comparison-card {
  margin-bottom: 16px;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.comparison-table th,
.comparison-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: right;
}

.comparison-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left;
  background: var(--surface);
}

.comparison-table thead th {
  color: var(--muted-2);
  background: var(--bg-cream);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.comparison-table thead th:first-child {
  background: var(--bg-cream);
}

.comparison-table tbody th {
  color: var(--muted);
  font-weight: 500;
}

.comparison-table tbody tr:last-child th,
.comparison-table tbody tr:last-child td {
  border-bottom: 0;
}

.comparison-table tbody tr:hover th,
.comparison-table tbody tr:hover td {
  background: color-mix(in srgb, var(--primary) 4%, var(--surface));
}

.comparison-table .is-total th,
.comparison-table .is-total td {
  color: var(--ink);
  font-weight: 600;
  background: color-mix(in srgb, var(--primary) 4%, transparent);
}

.horizontal-bars {
  display: grid;
  gap: 13px;
  padding: 14px 16px 17px;
}

.horizontal-bar-row > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 5px;
  font-size: 11.5px;
}

.horizontal-bar-row > div span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.horizontal-bar-row > div strong {
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.horizontal-track {
  height: 6px;
  display: block;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg);
}

.horizontal-track i {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--primary);
}

.revenue-mix .horizontal-track i {
  background: var(--accent);
}

.metric-list {
  margin: 0;
  padding: 2px 16px 6px;
}

.metric-list > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.metric-list > div:last-child {
  border-bottom: 0;
}

.metric-list dt {
  color: var(--muted);
}

.metric-list dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.metric-list .ratio-row {
  color: var(--primary);
}

.forecast-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 16px;
  padding: 16px;
}

.forecast-card h2 {
  margin: 4px 0 6px;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 600;
}

.forecast-card p {
  max-width: 800px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.report-source {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 4px 2px 16px;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.5;
}

.report-source strong {
  color: var(--muted);
  white-space: nowrap;
}

@media (max-width: 620px) {
  .chart-legend {
    gap: 7px;
  }

  .revenue-chart {
    height: 180px;
    gap: 3px;
    margin: 12px;
  }

  .line-chart {
    width: calc(100% - 24px);
    height: 170px;
    margin: 12px 12px 0;
  }

  .chart-summary {
    margin: 8px 12px 12px;
  }

  .horizontal-bars,
  .metric-list {
    padding-right: 12px;
    padding-left: 12px;
  }

  .forecast-card,
  .report-source {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
}
