:root {
  --bg: #0b0d11;
  --surface: #12151b;
  --surface-2: #1a1f28;
  --surface-3: #222833;
  --border: #262c38;
  --border-soft: #1d222c;
  --text: #eef2f6;
  --muted: #8b96a7;
  --muted-2: #5f6b7d;
  /* Olympas LLC brand blues, sampled from the real logo */
  --accent: #1e97d1;
  --accent-bright: #43c7f1;
  --accent-dim: rgba(30, 151, 209, .16);
  --brand-navy: #0f54a5;
  --green: #3fb950;
  --green-dim: rgba(63, 185, 80, .14);
  --amber: #d29922;
  --amber-dim: rgba(210, 153, 34, .14);
  --red: #f85149;
  --red-dim: rgba(248, 81, 73, .14);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.5);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.35);
  --ease: cubic-bezier(.2,.7,.3,1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* subtle radial glow behind everything, in the brand's navy/cyan */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(30,151,209,.09), transparent 60%),
    radial-gradient(700px 400px at 100% 0%, rgba(15,84,165,.07), transparent 60%);
}

a { color: var(--accent-bright); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; }

::selection { background: var(--accent-dim); color: var(--text); }

/* dark scrollbars (Chromium/Edge) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #2c3442; }

/* ---------- login ---------- */

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 34px 32px;
  box-shadow: var(--shadow);
}

.login-brand { margin-bottom: 16px; }
.login-brand img { filter: drop-shadow(0 4px 14px rgba(30,151,209,.4)); }
.login-card h1 { margin: 0 0 4px; font-size: 21px; letter-spacing: -.01em; }
.login-card .sub { color: var(--muted); margin: 0 0 24px; font-size: 13px; }

label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }

input[type=text], input[type=email], input[type=password], input[type=date], select {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  margin-bottom: 16px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}

input:hover, select:hover { border-color: #333c4a; }
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  cursor: pointer;
  font-weight: 550;
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 1px 2px rgba(0,0,0,.3);
  transition: filter .15s var(--ease), transform .1s var(--ease);
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn.secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn.secondary:hover { background: var(--surface-3); border-color: #333c4a; }
.btn.full { width: 100%; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: default; filter: none; }

.error {
  background: var(--red-dim);
  border: 1px solid rgba(248, 81, 73, .35);
  color: #ff9d96;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* ---------- shell ---------- */

.shell { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border-soft);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand {
  padding: 4px 10px 22px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand img { flex: 0 0 auto; filter: drop-shadow(0 2px 6px rgba(30,151,209,.35)); }
.brand-name { font-weight: 700; font-size: 15.5px; letter-spacing: -.01em; }
.brand-sub { font-size: 11px; color: var(--muted); font-weight: 500; margin-top: 1px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  border: none;
  background: none;
  text-align: left;
  width: 100%;
  transition: background .12s var(--ease), color .12s var(--ease);
}
.nav-item svg { flex: 0 0 auto; opacity: .8; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border);
}
.nav-item.active svg { opacity: 1; color: var(--accent-bright); }

.sidebar .spacer { flex: 1; }
.sidebar .who { font-size: 11px; color: var(--muted-2); padding: 0 10px 8px; word-break: break-all; }

.main { padding: 24px 28px 60px; overflow-x: hidden; }

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.topbar h2 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -.01em; flex: 1; }
.topbar input[type=date], .topbar select { margin: 0; width: auto; }
.range-presets { display: flex; gap: 6px; }

/* ---------- cards + kpis ---------- */

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 17px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s var(--ease), transform .15s var(--ease);
}
.kpi:hover { border-color: #333c4a; transform: translateY(-1px); }
.kpi .label { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; }
.kpi .value { font-size: 25px; font-weight: 650; margin-top: 6px; letter-spacing: -.01em; }
.kpi .value small { font-size: 13px; color: var(--muted); font-weight: 400; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.card h3 { margin: 0 0 14px; font-size: 14.5px; font-weight: 650; letter-spacing: -.01em; }
.card h3 .hint { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 8px; letter-spacing: 0; }

.card.accent { position: relative; overflow: hidden; }
.card.accent::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--brand-navy), var(--accent), var(--accent-bright));
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } .shell { grid-template-columns: 1fr; } }

/* ---------- tables ---------- */

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  font-weight: 650;
  padding: 0 10px 9px;
  border-bottom: 1px solid var(--border);
}
td { padding: 10px 10px; border-bottom: 1px solid var(--border-soft); word-break: break-word; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .1s var(--ease); }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 550;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.pill.good { background: var(--green-dim); color: var(--green); border-color: rgba(63,185,80,.3); }
.pill.bad  { background: var(--red-dim); color: var(--red); border-color: rgba(248,81,73,.3); }
.pill.on   { background: var(--green-dim); color: var(--green); border-color: rgba(63,185,80,.3); }
.pill.off  { background: var(--surface-2); color: var(--muted); }
.pill.on::before, .pill.good::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor;
}

.user-cell { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(160deg, var(--surface-3), var(--surface-2));
  border: 1px solid var(--border);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 650; color: var(--muted);
  flex: 0 0 auto;
}
.user-cell .name { font-weight: 550; }
.user-cell .sub { font-size: 11px; color: var(--muted); }

.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12px; }
.empty { color: var(--muted); text-align: center; padding: 44px 0; font-size: 13px; }

/* ---------- charts ---------- */

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 10px; }
.legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 5px; }

.bar-row { display: grid; grid-template-columns: 150px 1fr 66px; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 12.5px; }
.bar-row .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: var(--surface-2); border-radius: 5px; height: 17px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 5px; transition: width .3s var(--ease); }
.bar-row .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

.strip { width: 100%; height: 38px; display: block; }
.axis { font-size: 10px; fill: var(--muted); }

.tooltip {
  position: fixed;
  pointer-events: none;
  background: #05070a;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  z-index: 50;
  max-width: 320px;
  box-shadow: var(--shadow);
  display: none;
}

/* ---------- misc widgets ---------- */

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  margin-bottom: 12px;
}
.search-box svg { flex: 0 0 auto; color: var(--muted); }
.search-box input {
  border: none; background: none; margin: 0; padding: 0; width: 100%;
  color: var(--text); font: inherit;
}
.search-box input:focus { outline: none; box-shadow: none; }

.scroll-list { max-height: 420px; overflow-y: auto; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); }
.scroll-list table { font-size: 12.5px; }
.scroll-list thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }

.stat-strip { display: flex; gap: 20px; flex-wrap: wrap; }
.stat-strip > div { min-width: 120px; }
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; }

.hidden { display: none !important; }
