:root {
  color-scheme: light;
  --bg: #f5f7f9;
  --surface: #ffffff;
  --line: #d7dde5;
  --text: #17202a;
  --muted: #5d6b7a;
  --accent: #00697c;
  --accent-dark: #004c5a;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.topbar { align-items: center; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; min-height: 56px; padding: 0 24px; }
.brand { color: var(--text); font-size: 16px; font-weight: 700; text-decoration: none; }
.page { margin: 0 auto; max-width: 1180px; padding: 28px 24px 56px; }
.page-title { margin-bottom: 18px; }
h1, h2, p { margin: 0; }
h1 { font-size: 24px; line-height: 1.2; }
h2 { font-size: 16px; margin: 28px 0 10px; }
p { color: var(--muted); margin-top: 6px; }
table { background: var(--surface); border: 1px solid var(--line); border-collapse: collapse; width: 100%; }
th, td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
th { background: #eef2f6; color: #344150; font-size: 12px; text-transform: uppercase; }
a { color: var(--accent); }
.login-panel { background: var(--surface); border: 1px solid var(--line); margin: 72px auto 0; max-width: 380px; padding: 24px; }
.login-panel form { display: grid; gap: 14px; margin-top: 20px; }
label { color: var(--muted); display: grid; gap: 6px; }
input { border: 1px solid var(--line); font: inherit; min-height: 40px; padding: 8px 10px; width: 100%; }
button { background: var(--accent); border: 0; color: #ffffff; cursor: pointer; font: inherit; font-weight: 700; min-height: 40px; padding: 8px 14px; }
button:hover { background: var(--accent-dark); }
.icon-button { min-height: 34px; }
.alert { background: #fff4d6; border: 1px solid #e3c66a; margin-bottom: 16px; padding: 10px 12px; }


.kpi-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); padding: 16px; }
.kpi span { color: var(--muted); display: block; font-size: 12px; text-transform: uppercase; }
.kpi strong { display: block; font-size: 30px; line-height: 1.1; margin-top: 4px; }
.kpi em { color: var(--muted); display: block; font-style: normal; margin-top: 4px; }
.chart-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chart-panel { background: var(--surface); border: 1px solid var(--line); margin: 18px 0; padding: 16px; }
.chart-panel.wide { margin-top: 16px; }
.section-head { align-items: baseline; display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.section-head span { color: var(--muted); font-size: 12px; }
.legend { display: flex; gap: 18px; margin-top: 12px; }
.legend span { align-items: center; color: var(--muted); display: inline-flex; gap: 6px; }
.legend i { display: inline-block; height: 10px; width: 22px; }
.cohort-1 { background: #00697c; }
.cohort-2 { background: #c44e2f; }
.cohort-3 { background: #6b7c2c; }
.daily-chart { align-items: end; display: grid; gap: 6px; grid-template-columns: repeat(var(--days), minmax(22px, 1fr)); min-height: 240px; overflow-x: auto; padding-top: 8px; }
.day-group { align-items: center; display: grid; gap: 6px; grid-template-rows: 1fr auto; min-width: 24px; }
.day-bars { align-items: end; border-bottom: 1px solid var(--line); display: flex; gap: 3px; height: 210px; justify-content: center; width: 100%; }
.vbar { display: block; min-height: 2px; width: 8px; }
.day-group small { color: var(--muted); font-size: 10px; text-align: center; white-space: nowrap; writing-mode: vertical-rl; }
.bar-chart { display: grid; gap: 12px; }
.bar-chart.compact { gap: 10px; }
.bar-row { align-items: center; display: grid; gap: 12px; grid-template-columns: minmax(140px, 1.2fr) minmax(220px, 2fr) 70px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-stack { display: grid; gap: 5px; }
.hbar-line { align-items: center; display: grid; gap: 8px; grid-template-columns: 78px 1fr 38px; }
.hbar-name { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { background: #edf1f5; display: block; height: 12px; position: relative; width: 100%; }
.hbar-fill { display: block; height: 100%; min-width: 2px; }
.hbar-value { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.delta { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.delta small { display: block; font-size: 11px; }
.delta.up { color: #9b341f; }
.delta.down { color: #00697c; }
@media (max-width: 860px) {
  .chart-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 1fr; }
  .delta { text-align: left; }
}

.report-panel { background: var(--surface); border: 1px solid var(--line); margin: 18px 0; padding: 16px; }
.report-lead { color: var(--text); font-size: 16px; margin: 0 0 14px; }
.report-note { color: var(--muted); margin: 0 0 14px; }
.report-stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.report-stats div { border: 1px solid var(--line); padding: 12px; }
.report-stats span { color: var(--muted); display: block; font-size: 12px; text-transform: uppercase; }
.report-stats strong { display: block; font-size: 24px; margin-top: 3px; }
.issue-card { background: #ffffff; border-left: 4px solid #0f3460; margin: 0 0 12px; padding: 14px 14px 14px 16px; }
.issue-card h3 { color: #16213e; font-size: 14px; margin: 0 0 5px; }
.issue-card p { color: #555; margin: 0; }
.issue-card.critical { border-left-color: #e74c3c; }
.issue-card.info, .issue-card.discarded { border-left-color: #95a5a6; }
.issue-card.recommendation { border-left-color: #00697c; }
.recommendations-list { display: grid; gap: 0; }
.root-cause-section { margin: 0 0 16px; }
.root-cause-section h3 { border-bottom: 2px solid #0f3460; color: #16213e; font-size: 15px; margin: 0 0 10px; padding-bottom: 6px; }
.rc-table { background: #fff; border: 1px solid var(--line); border-collapse: collapse; font-size: 13px; width: 100%; }
.rc-table th { background: #1a1a2e; color: #fff; }
.rc-table td, .rc-table th { border-bottom: 1px solid #ecf0f1; padding: 8px; }
