* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #0f172a;
  background: #f8fafc;
}
header {
  padding: 16px 20px;
  background: #0b1220;
  color: #e2e8f0;
}
header a { color: #e2e8f0; text-decoration: none; }
main { padding: 20px; max-width: 1700px; margin: 0 auto; }

.user-badge {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 10px;
  font-weight: 700;
  color: #2563eb;
  font-size: 13px;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(226, 232, 240, 0.18);
  background: rgba(226, 232, 240, 0.08);
  color: #e2e8f0;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  transition: background 120ms ease, border-color 120ms ease;
}
.nav-btn:hover {
  background: rgba(226, 232, 240, 0.14);
  border-color: rgba(226, 232, 240, 0.28);
}
.nav-btn.active {
  background: rgba(37, 99, 235, 0.18);
  border-color: rgba(37, 99, 235, 0.45);
}
.nav-btn.danger {
  background: rgba(185, 28, 28, 0.20);
  border-color: rgba(185, 28, 28, 0.55);
}
.nav-btn.danger:hover {
  background: rgba(185, 28, 28, 0.28);
  border-color: rgba(185, 28, 28, 0.70);
}

.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
}
.grid {
  display: grid;
  gap: 12px;
  align-items: start;
}
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
label { font-weight: 600; font-size: 13px; color: #334155; }
select, input[type="file"], input[type="number"] {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
}
button {
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid #0b1220;
  background: #0b1220;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
button.secondary {
  background: #fff;
  color: #0b1220;
}

.muted { color: #64748b; }
.error { color: #b91c1c; }
.ok { color: #15803d; }

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}
th, td {
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  font-size: 13px;
}
th { background: #f1f5f9; position: sticky; top: 0; }
.table-wrap { max-height: 420px; overflow: auto; border: 1px solid #e2e8f0; border-radius: 10px; }
canvas { display: block; width: 100%; }

.yoy-rev { background: #f8fafc; }
.yoy-gm { background: #f1f5f9; }
.yoy-gmpct { background: #e2e8f0; }

.section-title {
  margin: 22px 0 10px;
  font-size: 16px;
  font-weight: 800;
}
.critical-title { color: #b91c1c; }
.positive-title { color: #15803d; }
.summary-value { color: #2563eb; }
.title-note {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}
.pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

@media (max-width: 900px) {
  .grid.cols-3 { grid-template-columns: 1fr; }
  .grid.cols-2 { grid-template-columns: 1fr; }
}
