:root {
  --bg: #0a0d0a;
  --panel: #0c100d;
  --panel-alt: #121713;
  --text: #e0dec8;
  --muted: #9f9f84;
  --line: rgba(194, 199, 158, 0.62);
  --line-soft: rgba(194, 199, 158, 0.28);
  --cyan: #6fd1d8;
  --green: #58a33d;
  --amber: #efc545;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Arial Narrow", Arial, sans-serif;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 232, 137, 0.05), transparent 25%),
    linear-gradient(180deg, #0a0d0a 0%, #090b09 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 20px, 20px 100%;
  opacity: 0.18;
}

.shell {
  max-width: 1600px;
  margin: 0 auto;
  padding: 10px;
}

.status-strip,
.overview,
.grid,
.stats,
.card-footer {
  display: grid;
  gap: 8px;
}

.status-strip {
  grid-template-columns: 1fr;
  margin-bottom: 8px;
}

.strip-cell-wide {
  grid-column: auto;
}

.strip-cell,
.overview-card,
.card,
.stats > div,
.sparkline-wrap {
  background: linear-gradient(180deg, var(--panel-alt), var(--panel));
  border: 1px solid var(--line);
}

.strip-cell,
.overview-card {
  min-height: 54px;
  padding: 8px 10px;
}

.strip-cell strong,
.overview-card strong,
.stat-value,
.card-title {
  display: block;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.meta-label,
.card-subtitle,
.chip,
.footer-chip {
  font-family: "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.meta-label,
.card-subtitle {
  color: var(--muted);
  font-size: 9px;
}

.overview {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 8px;
}

.overview-card strong {
  margin-top: 4px;
  font-size: 1.45rem;
  color: var(--amber);
}

.grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
}

.card {
  height: 100%;
  display: grid;
  grid-template-rows: 44px 124px 94px 24px;
  align-content: start;
  padding: 8px;
}

.card-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 8px;
  min-height: 36px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}

.card-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1;
  text-transform: uppercase;
}

.card-subtitle {
  margin: 4px 0 0;
}

.chip {
  padding: 5px 7px;
  border: 1px solid var(--line);
  color: #0c120d;
  background: var(--cyan);
  font-size: 9px;
}

.stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 8px;
  align-content: start;
}

.stats > div {
  min-height: 58px;
  padding: 7px 8px;
}

.stat-value {
  margin-top: 4px;
  font-size: 1.08rem;
  color: var(--text);
}

.stats > div:nth-child(1) .stat-value {
  color: var(--amber);
}

.stats > div:nth-child(2) .stat-value {
  color: var(--cyan);
}

.stats > div:nth-child(3) .stat-value {
  color: #8ccb5b;
}

.stats > div:nth-child(4) .stat-value {
  color: var(--text);
}

.muted {
  color: var(--cyan);
}

.sparkline-wrap {
  position: relative;
  margin-top: 8px;
  height: 94px;
  padding: 6px 6px 6px 30px;
  background:
    linear-gradient(rgba(194, 199, 158, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(194, 199, 158, 0.1) 1px, transparent 1px),
    linear-gradient(180deg, #0d100d, #090b09);
  background-size: 100% 18px, 18px 100%, auto;
}

.axis-labels {
  position: absolute;
  inset: 6px auto 6px 6px;
  width: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}

.axis-labels span {
  color: var(--muted);
  font-family: "Courier New", monospace;
  font-size: 8px;
  line-height: 1;
}

.sparkline {
  width: 100%;
  height: 100%;
  display: block;
}

.sparkline path.line {
  fill: none;
  stroke: var(--amber);
  stroke-width: 1.4;
  stroke-linecap: square;
  stroke-linejoin: round;
}

.sparkline path.area {
  fill: rgba(239, 197, 69, 0.1);
}

.card-footer {
  grid-template-columns: repeat(3, minmax(0, 44px));
  justify-content: start;
  margin-top: 8px;
  align-self: end;
}

.footer-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border: 1px solid var(--line);
  font-size: 9px;
  color: #0a0d0a;
}

.footer-chip-cyan {
  background: var(--cyan);
}

.footer-chip-green {
  background: var(--green);
}

.footer-chip-amber {
  background: var(--amber);
}

@media (max-width: 1280px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .status-strip,
  .overview,
  .stats {
    grid-template-columns: 1fr;
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card {
    grid-template-rows: 44px 240px 94px 24px;
  }

  .card-footer {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .grid {
    grid-template-columns: 1fr;
  }
}
