:root {
  --bg: #020814;
  --panel: rgba(1, 8, 22, 0.97);
  --panel-2: rgba(2, 12, 28, 0.97);
  --cyan: #00f6ff;
  --sky: #38bdf8;
  --pink: #ff2eea;
  --lime: #b7ff2a;
  --orange: #ff9d2e;
  --text: #f5fbff;
  --muted: #a9bdd2;
  --border: rgba(0, 246, 255, 0.34);
  --max-width: 1360px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  padding: 112px 48px 24px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    linear-gradient(rgba(1, 7, 22, .92), rgba(1, 7, 22, .97)),
    url("/assets/bg-water.jpg") center / cover fixed no-repeat;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(0,246,255,.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,246,255,.024) 1px, transparent 1px);
  background-size: 76px 76px;
}

.hero {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 99999;
  height: 88px;
  background: #020817;
  border-bottom: 1px solid rgba(0, 246, 255, .55);
  box-shadow: 0 12px 36px rgba(0,0,0,.72);
}

.hero-inner {
  max-width: var(--max-width);
  height: 100%;
  margin: 0 auto;
  padding: 18px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: .22em;
  font-weight: 950;
  text-transform: uppercase;
  color: var(--text);
  text-shadow:
    0 0 12px rgba(0,246,255,.85),
    0 0 26px rgba(0,246,255,.32);
}

.hero p {
  margin: 5px 0 0;
  color: #c7d4e4;
  font-size: 12px;
}

.date-status {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid rgba(0,246,255,.65);
  background: rgba(0, 12, 28, .95);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
  box-shadow:
    0 0 20px rgba(0,246,255,.22),
    inset 0 0 16px rgba(0,246,255,.06);
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.card,
.panel {
  position: relative;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: 13px;
  box-shadow:
    0 0 18px rgba(0,246,255,.10),
    inset 0 0 22px rgba(0,246,255,.02);
  overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.card:hover,
.panel:hover {
  transform: translateY(-4px);
  border-color: rgba(56,189,248,.86);
  box-shadow:
    0 14px 34px rgba(0,0,0,.62),
    0 0 28px rgba(56,189,248,.34),
    inset 0 0 26px rgba(56,189,248,.045);
}

.card {
  min-height: 82px;
  padding: 14px 16px;
}

.card-label {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 7px;
}

.card-value {
  font-size: 23px;
  font-weight: 950;
  color: #fff;
  text-shadow:
    0 0 11px rgba(0,246,255,.82),
    0 0 18px rgba(56,189,248,.24);
}

.card-sub {
  color: #d6e5f4;
  font-size: 10.5px;
  margin-top: 6px;
}

.card:nth-child(3) .card-value,
.card:nth-child(6) .card-value {
  color: var(--pink);
  text-shadow: 0 0 14px rgba(255,46,234,.70);
}

.card:nth-child(8) .card-value {
  color: var(--lime);
  text-shadow: 0 0 14px rgba(183,255,42,.70);
}

.top-analytics-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 1fr;
  gap: 14px;
  align-items: stretch;
}

.panel {
  padding: 14px;
}

.top-analytics-grid .panel {
  height: 405px;
  min-height: 405px;
  display: flex;
  flex-direction: column;
}

.chart-box {
  flex: 1;
  min-height: 0;
  position: relative;
  padding: 8px 10px 4px;
}

.panel h2,
.section-header h2 {
  margin: 0 0 9px;
  font-size: 16px;
  font-weight: 950;
  color: #fff;
  text-shadow:
    0 0 8px rgba(255,255,255,.85),
    0 0 18px rgba(0,246,255,.45),
    0 0 26px rgba(0,246,255,.18);
}

canvas {
  width: 100% !important;
  height: 100% !important;
}

.intelligence-console {
  height: 405px;
  min-height: 405px;
}

.console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.console-header span {
  color: var(--cyan);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .14em;
  text-shadow: 0 0 10px rgba(0,246,255,.75);
}

#intelligenceConsole {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.console-card {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(0, 15, 34, .88);
  border: 1px solid rgba(0,246,255,.30);
  color: #f1f8ff;
  font-size: 11.5px;
  font-weight: 850;
  line-height: 1.32;
  box-shadow: inset 0 0 12px rgba(0,246,255,.025);
}

.console-icon {
  color: var(--orange);
  filter: drop-shadow(0 0 7px rgba(255,157,46,.60));
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

input,
select {
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(0,246,255,.38);
  background: rgba(0, 10, 24, .94);
  color: var(--text);
  outline: none;
}

input {
  min-width: 280px;
}

button {
  height: 38px;
  min-width: 102px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--pink), var(--orange));
  color: #fff;
  font-weight: 950;
  cursor: pointer;
  box-shadow:
    0 0 18px rgba(255,46,234,.26),
    0 0 12px rgba(56,189,248,.16);
}

button:hover {
  transform: translateY(-2px);
  filter: brightness(1.15);
}

.collapsible-body {
  display: block;
}

.table-wrap {
  overflow: auto;
  max-height: 440px;
  border-radius: 12px;
  border: 1px solid rgba(0,246,255,.20);
}

table {
  width: 100%;
  min-width: 1050px;
  border-collapse: collapse;
  font-size: 12px;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px;
  text-align: left;
  white-space: nowrap;
  background: linear-gradient(180deg, #061f4d, #030e25);
  color: #fff;
  border: 1px solid rgba(255,255,255,.055);
}

td {
  padding: 8px 10px;
  white-space: nowrap;
  color: #eaf6ff;
  border: 1px solid rgba(255,255,255,.045);
  background: rgba(0, 8, 20, .72);
}

tr:nth-child(even) td {
  background: rgba(0, 16, 34, .76);
}

tr:hover td {
  background: rgba(56,189,248,.08);
}

.badge {
  display: inline-block;
  min-width: 68px;
  text-align: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 950;
}

.badge.Active {
  color: var(--lime);
  background: rgba(183,255,42,.10);
  border: 1px solid rgba(183,255,42,.32);
}

.badge.AtRisk {
  color: var(--orange);
  background: rgba(255,157,46,.12);
  border: 1px solid rgba(255,157,46,.30);
}

.badge.Churned {
  color: var(--pink);
  background: rgba(255,46,234,.10);
  border: 1px solid rgba(255,46,234,.30);
}

@media (max-width: 1200px) {
  body {
    padding: 120px 24px 18px;
  }

  .hero-inner {
    padding-inline: 24px;
  }

  .cards,
  .top-analytics-grid {
    grid-template-columns: 1fr;
  }

  .top-analytics-grid .panel,
  .intelligence-console {
    height: auto;
    min-height: 360px;
  }
}