:root {
  --bg: #07111d;
  --bg2: #0c1a2c;
  --ink: #e8f1ff;
  --muted: #8aa0bc;
  --line: rgba(140, 180, 230, 0.16);
  --accent: #3de0b0;
  --accent2: #5aa8ff;
  --warn: #ffb454;
  --danger: #ff6b7a;
  --panel: rgba(12, 28, 48, 0.82);
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --display: "Syne", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  max-width: 100%;
}
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  max-width: 100%;
  font-family: var(--mono);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(61, 224, 176, 0.18), transparent 55%),
    radial-gradient(900px 420px at 95% 0%, rgba(90, 168, 255, 0.16), transparent 50%),
    linear-gradient(180deg, #06101a 0%, var(--bg) 40%, #050d16 100%);
}

.glow {
  position: fixed;
  right: 0;
  bottom: -20%;
  width: min(55vw, 100%);
  height: 55vw;
  max-width: 100vw;
  background: radial-gradient(circle, rgba(61, 224, 176, 0.08), transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
  overflow-x: clip;
  max-width: 100%;
  min-width: 0;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 1.4rem;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--accent);
}

h1 {
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0.15rem 0;
  letter-spacing: -0.03em;
}

.sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.cost-hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 1.1rem 1.2rem;
  background:
    linear-gradient(135deg, rgba(61, 224, 176, 0.12), rgba(90, 168, 255, 0.08)),
    var(--panel);
  border: 1px solid rgba(61, 224, 176, 0.28);
  border-radius: 16px;
  backdrop-filter: blur(8px);
  min-width: 0;
  max-width: 100%;
}
.cost-total {
  margin: 0.25rem 0 0.2rem;
  font-family: var(--display);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  letter-spacing: -0.04em;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
  transition: transform 0.25s ease;
}
.cost-total.tick {
  transform: scale(1.02);
}
.cost-hero-side {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  align-content: center;
}
.cost-stat {
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(8, 20, 34, 0.45);
}
.cost-stat .kpi-value {
  font-size: 1.15rem;
}
/* cost chart sits in the 2-col grid like the others (no full-bleed) */

.live {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 20, 34, 0.7);
  font-size: 0.78rem;
  color: var(--muted);
}

.dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 0 rgba(61, 224, 176, 0.4);
}
.dot.on {
  background: var(--accent);
  animation: pulse 1.6s ease-out infinite;
}
.dot.off { background: var(--danger); }
.sep { opacity: 0.45; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 224, 176, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(61, 224, 176, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 224, 176, 0); }
}

.kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
  min-width: 0;
  max-width: 100%;
}

.kpi, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  backdrop-filter: blur(8px);
  min-width: 0;
  max-width: 100%;
}

.kpi { padding: 0.9rem 1rem; }
.kpi-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.kpi-value {
  margin: 0.35rem 0 0.15rem;
  font-family: var(--display);
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}
.kpi-hint {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 0.74rem;
}

.meter {
  height: 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.meter i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 0.4s ease;
}
.meter.warn i { background: linear-gradient(90deg, var(--warn), var(--danger)); }

.charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
  min-width: 0;
  max-width: 100%;
}

.panel { padding: 0.95rem 1rem 0.7rem; }
.panel h2 {
  margin: 0 0 0.55rem;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}
.panel-head h2 { margin: 0; }
.panel-head code {
  font-size: 0.75rem;
  color: var(--accent2);
}

.chip {
  font-size: 0.72rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(61, 224, 176, 0.35);
  color: var(--accent);
  background: rgba(61, 224, 176, 0.08);
}
.chip.soft {
  color: var(--accent2);
  border-color: rgba(90, 168, 255, 0.35);
  background: rgba(90, 168, 255, 0.08);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 0.75rem;
  min-width: 0;
  max-width: 100%;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 280px;
  max-width: 100%;
  min-width: 0;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}
.table-wrap.tall { max-height: 420px; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  min-width: 0;
  table-layout: fixed;
}
th, td {
  text-align: left;
  padding: 0.42rem 0.35rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
td.name {
  font-weight: 600;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
th {
  color: var(--muted);
  font-weight: 600;
  position: sticky;
  top: 0;
  background: #0c1c30;
  z-index: 1;
}
.empty { color: var(--muted); text-align: center; padding: 1.2rem; }

.badge {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  border: 1px solid var(--line);
}
.badge.up {
  color: var(--accent);
  border-color: rgba(61, 224, 176, 0.4);
  background: rgba(61, 224, 176, 0.1);
}
.badge.down {
  color: var(--danger);
  border-color: rgba(255, 107, 122, 0.4);
  background: rgba(255, 107, 122, 0.1);
}

@media (max-width: 980px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .charts, .split { grid-template-columns: 1fr; }
  .cost-hero { grid-template-columns: 1fr; }
  .cost-hero-side { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  td.name { max-width: 10rem; }
}
@media (max-width: 560px) {
  .page { width: calc(100% - 1rem); padding-top: 1rem; }
  .kpis { grid-template-columns: 1fr; }
  .cost-hero-side { grid-template-columns: 1fr; }
  .cost-total { font-size: clamp(2rem, 10vw, 2.8rem); }
  th, td { font-size: 0.72rem; padding: 0.36rem 0.28rem; }
  td.name { max-width: 8rem; }
}
