:root {
  --bg: #0d1321;
  --panel: #1d2d44;
  --panel-2: #243b55;
  --text: #f0f4f8;
  --muted: #b6c2cf;
  --line: #334e68;
  --accent: #4fd1c5;
  --danger: #ff8a80;
  --ok: #8bc34a;
  --warn: #ffd166;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #0b1020 0%, #111827 100%);
  color: var(--text);
}
.container {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
}
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(7, 12, 23, 0.95);
  position: sticky;
  top: 0;
  backdrop-filter: blur(10px);
  z-index: 5;
}
.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 18px 0;
}
.brand {
  color: white;
  font-size: 1.35rem;
  font-weight: 800;
  text-decoration: none;
}
.subtitle {
  color: var(--muted);
  font-size: 0.9rem;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.nav a {
  color: var(--text);
  text-decoration: none;
  opacity: 0.92;
}
.nav a:hover { color: var(--accent); }
main { padding: 28px 0 40px; }
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}
h1, h2, h3 { margin-top: 0; }
.muted { color: var(--muted); }
.tiny { font-size: 0.78rem; }
.grid {
  display: grid;
  gap: 18px;
}
.cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { grid-template-columns: 1.08fr 0.92fr; margin-top: 18px; }
.card {
  background: rgba(22, 32, 52, 0.92);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
}
.card-label {
  color: var(--muted);
  font-size: 0.9rem;
}
.card-value {
  font-size: 1.9rem;
  font-weight: 800;
  margin: 10px 0 6px;
}
.card-value.small { font-size: 1.08rem; line-height: 1.35; }
.actions, .action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.btn, button {
  background: var(--accent);
  color: #082032;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-danger {
  background: rgba(255, 138, 128, 0.2);
  color: #ffe6e3;
  border: 1px solid rgba(255, 138, 128, 0.45);
}
.btn-small { padding: 8px 10px; font-size: 0.85rem; }
.flash-wrap { display: grid; gap: 10px; margin-bottom: 18px; }
.flash {
  background: rgba(79, 209, 197, 0.15);
  border: 1px solid rgba(79, 209, 197, 0.45);
  color: #c9fff7;
  padding: 12px 14px;
  border-radius: 12px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
}
.section-head a { color: var(--accent); }
.list { display: grid; gap: 12px; }
.list-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.compact-list .list-item {
  justify-content: flex-start;
  align-items: flex-start;
}
.result-chip, .pill {
  background: rgba(255,255,255,0.08);
  padding: 8px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.form-grid {
  display: grid;
  gap: 12px;
}
.two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.full { grid-column: 1 / -1; }
label {
  display: grid;
  gap: 6px;
  font-size: 0.95rem;
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.checkbox-row input {
  width: auto;
}
input, select, textarea {
  width: 100%;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
select option { color: #111; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th, td {
  padding: 10px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  vertical-align: top;
}
a { color: var(--accent); }
.matrix-table th, .matrix-table td { text-align: center; }
.cell-self { color: var(--muted); }
.cell-missing { background: rgba(255, 209, 102, 0.08); }
.cell-open { background: rgba(79, 209, 197, 0.08); }
.cell-done { background: rgba(139, 195, 74, 0.08); }
.narrow { max-width: 920px; }
.inline-form { display: inline; }
.top-gap { margin-top: 12px; }
.top-gap-block { margin-top: 18px; }
.info-box {
  background: rgba(79, 209, 197, 0.08);
  border: 1px solid rgba(79, 209, 197, 0.25);
  border-radius: 12px;
  padding: 12px 14px;
  color: #dffaf6;
}
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.compact-check {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 10px 12px;
}
.chart-wrap {
  width: 100%;
  overflow-x: auto;
}
.history-chart {
  width: 100%;
  min-width: 860px;
  display: block;
}
.chart-label {
  fill: #b6c2cf;
  font-size: 12px;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  display: inline-block;
}

@media (max-width: 980px) {
  .cards-2, .cards-3, .cards-4, .split, .two-cols { grid-template-columns: 1fr; }
  .nav-row, .page-head { flex-direction: column; align-items: stretch; }
  table { font-size: 0.88rem; }
}
