:root {
  --bg: #0b1120;
  --panel: #111827;
  --border: #1f2937;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --blue: #38bdf8;
  --red: #f87171;
  --green: #34d399;
  --accent: #0284c7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  border-bottom: 1px solid var(--border);
  padding: 1.4rem 1.75rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.badge-top {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--blue);
  font-weight: 700;
}

.hero h1 { margin: 0.3rem 0; font-size: 1.35rem; }
.subtitle { margin: 0; color: var(--muted); font-size: 0.86rem; max-width: 780px; }

.hero-actions { display: flex; gap: 0.65rem; flex-wrap: wrap; }

button, .btn-outline {
  height: 2.3rem;
  padding: 0 0.9rem;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

button { background: var(--accent); color: #fff; border: none; }
button:hover { background: #0369a1; }

.btn-outline {
  border: 1px solid #334155;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.6);
}

.layout {
  max-width: 1240px;
  margin: 1.25rem auto 2.5rem;
  padding: 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.controls-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.control-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
}
.control-head label { color: var(--muted); }
.control-head strong { color: var(--blue); }

input[type="range"] { width: 100%; accent-color: var(--blue); cursor: pointer; }

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}

.kpi {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.95rem 1.1rem;
  display: flex;
  flex-direction: column;
}
.kpi.highlight { border-left: 4px solid var(--green); }
.kpi-title { font-size: 0.76rem; color: var(--muted); font-weight: 600; }
.kpi-num { font-size: 1.45rem; margin: 0.25rem 0 0.15rem; }
.kpi-note { font-size: 0.75rem; color: var(--muted); }

.grid-two {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1rem;
}
@media (max-width: 920px) { .grid-two { grid-template-columns: 1fr; } }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem 1.2rem;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}
.card-head h2 { margin: 0; font-size: 0.96rem; }

.legend { display: flex; gap: 0.85rem; font-size: 0.76rem; color: var(--muted); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; }
.swatch.blue { background: var(--blue); }
.swatch.red { background: var(--red); }
.swatch.green { background: var(--green); }

canvas { width: 100%; height: auto; background: #090d16; border-radius: 6px; border: 1px solid #1e293b; }

.bar-item { margin-bottom: 0.85rem; }
.bar-label { display: flex; justify-content: space-between; font-size: 0.82rem; margin-bottom: 0.3rem; }
.bar-bg { height: 16px; background: #1e293b; border-radius: 4px; overflow: hidden; }
.bar-fill.red { background: var(--red); height: 100%; }
.bar-fill.green { background: var(--green); height: 100%; }

.protocol-box {
  margin-top: 1rem;
  padding: 0.8rem 0.95rem;
  background: rgba(56, 189, 248, 0.07);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 6px;
  font-size: 0.8rem;
}
.protocol-box h3 { margin: 0 0 0.4rem; font-size: 0.85rem; color: var(--blue); }
.protocol-box ul { margin: 0; padding-left: 1.1rem; color: #cbd5e1; }
.protocol-box li { margin-bottom: 0.3rem; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
th, td { padding: 0.65rem; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--muted); font-size: 0.74rem; text-transform: uppercase; background: #0f172a; }
