:root {
  --navy: #0D004C; --blue: #00AEEF; --deep-blue: #2E3192;
  --green: #3DAE49; --orange: #EB681D; --yellow: #FFB71A;
  --grey: #6D6E71; --black: #231F20; --bg: #f4f4f7;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--black);
  font-family: 'Urbanist','Helvetica Neue',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
header {
  background: white; border-bottom: 1px solid #ececf2;
  padding: 18px 28px; display: flex; justify-content: space-between; align-items: center;
  border-top: 6px solid var(--navy);
}
nav.tabs {
  background: white; border-bottom: 1px solid #ececf2; padding: 0 28px;
  display: flex; gap: 4px; overflow-x: auto;
}
nav.tabs button {
  background: transparent; border: 0; border-bottom: 3px solid transparent;
  padding: 12px 16px; font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--grey); cursor: pointer; white-space: nowrap;
  letter-spacing: 0.04em;
}
nav.tabs button:hover { color: var(--navy); }
nav.tabs button.active { color: var(--navy); border-bottom-color: var(--blue); }
nav.tabs button.disabled { opacity: 0.45; cursor: not-allowed; }
nav.tabs button.disabled:hover { color: var(--grey); }
header .brand { display: flex; align-items: center; gap: 14px; }
header .brand .logo { height: 39px; width: auto; display: block; }
header .brand span { color: var(--grey); font-weight: 600; font-size: 14px; border-left: 1px solid #ececf2; padding-left: 14px; }
header .meta { color: var(--grey); font-size: 13px; }
main { max-width: 1200px; width: 100%; margin: 0 auto; padding: 24px; flex: 1; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.card { padding: 18px; border-radius: 8px; color: white; }
.card .n { font-size: 32px; font-weight: 800; line-height: 1; }
.card .l { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; margin-top: 8px; font-weight: 600; }
.card.selectable { cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; border: 3px solid transparent; }
.card.selectable:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(13,0,76,0.15); }
.card.selectable.active { border-color: var(--navy); box-shadow: 0 0 0 4px rgba(13,0,76,0.08); }
.chip-row { margin: -8px 0 20px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 6px 14px; border: 1px solid #ddd; background: white; border-radius: 16px; font-size: 12px; cursor: pointer; font-family: inherit; font-weight: 600; color: var(--black); }
.chip:hover { border-color: var(--navy); }
.chip.active { background: var(--navy); color: white; border-color: var(--navy); }
.panel {
  background: white; border-radius: 8px; padding: 18px; margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(13,0,76,0.06);
}
.panel h2 {
  margin: 0 0 12px 0; font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--grey);
}
.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 900px) { .panel-grid { grid-template-columns: 1fr; } }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 10px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--grey); border-bottom: 2px solid var(--navy); font-weight: 700; }
td { padding: 10px; border-bottom: 1px solid #eceef4; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 12px; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
a { color: var(--deep-blue); text-decoration: none; font-weight: 700; }
a:hover { text-decoration: underline; }
.filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.filters button {
  padding: 6px 12px; border: 1px solid #ddd; background: white; border-radius: 16px;
  font-size: 12px; cursor: pointer; font-family: inherit;
}
.filters button.active { background: var(--navy); color: white; border-color: var(--navy); }
.chart-box { position: relative; height: 260px; }
.loading { text-align: center; padding: 60px 20px; color: var(--grey); }
footer {
  background: var(--navy); color: white; padding: 16px 28px;
  display: flex; justify-content: space-between; align-items: center;
}
.actions { display: flex; gap: 8px; }
.btn {
  padding: 8px 16px; border-radius: 6px; background: rgba(255,255,255,0.12); color: white;
  border: 1px solid rgba(255,255,255,0.24); font-family: inherit; font-size: 13px;
  font-weight: 600; cursor: pointer;
}
.btn:hover { background: rgba(255,255,255,0.2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--blue); border-color: var(--blue); }
.date-label { color: rgba(255,255,255,0.75); font-size: 12px; display: flex; align-items: center; gap: 6px; letter-spacing: 0.04em; text-transform: uppercase; font-weight: 600; }
.date-input { background: white; border: 1px solid rgba(255,255,255,0.24); color: var(--navy); padding: 6px 10px; border-radius: 6px; font-family: inherit; font-size: 13px; }
tr.run-row { cursor: pointer; }
tr.run-row:hover { background: #f7f7fb; }
tr.run-row.active { background: #eef2ff; }
tr.run-row.active td:first-child { border-left: 3px solid var(--blue); padding-left: 7px; }
.section-header { margin: 4px 0 20px 0; }
.section-header .overline { color: var(--grey); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.section-header h1 { margin: 6px 0 4px 0; color: var(--navy); font-size: 24px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; }
.section-header .sub { color: var(--grey); font-size: 14px; }
.admin-table { width: 100%; font-size: 14px; }
.admin-table td { vertical-align: middle; padding: 12px 10px; }
.admin-input { padding: 8px 10px; border: 1px solid #ddd; border-radius: 6px; font-family: inherit; font-size: 13px; width: 100%; max-width: 340px; }
.switch { position: relative; display: inline-block; width: 42px; height: 22px; cursor: pointer; }
.switch input { position: absolute; top: 0; left: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 2; }
.switch .slider { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: #ccc; border-radius: 22px; transition: background 0.2s; pointer-events: none; }
.switch .slider::before { content: ''; position: absolute; height: 16px; width: 16px; left: 3px; top: 3px; background: white; border-radius: 50%; transition: transform 0.2s; }
.switch input:checked ~ .slider { background: var(--green); }
.switch input:checked ~ .slider::before { transform: translateX(20px); }
.btn.primary:hover { background: #00c5ff; }
.footer-meta { letter-spacing: 4px; font-weight: 800; font-size: 14px; }
.toast {
  position: fixed; bottom: 80px; right: 24px; background: var(--navy); color: white;
  padding: 12px 18px; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  opacity: 0; transform: translateY(8px); transition: all 0.2s; pointer-events: none;
  max-width: 360px; font-size: 13px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--orange); }
.toast.success { background: var(--green); }
@media (max-width: 700px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  footer { flex-direction: column; gap: 12px; }
  .actions { flex-wrap: wrap; justify-content: center; }
}
