:root {
  color-scheme: dark;
  --bg: #04080f;
  --panel: rgba(9, 18, 34, 0.84);
  --panel-2: rgba(14, 28, 52, 0.88);
  --panel-3: rgba(18, 39, 72, 0.72);
  --line: rgba(154, 190, 238, 0.16);
  --line-strong: rgba(46, 133, 240, 0.36);
  --text: #f6f9ff;
  --muted: #91a5c7;
  --muted-2: #617391;
  --blue: #1a5fb4;
  --bright: #2e85f0;
  --cyan: #69c7ff;
  --success: #62e6b1;
  --warning: #f6c76b;
  --danger: #ff6b87;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 18% 0%, rgba(46, 133, 240, 0.24), transparent 30%),
    radial-gradient(circle at 84% 12%, rgba(105, 199, 255, 0.14), transparent 26%),
    linear-gradient(180deg, #04080f 0%, #08111f 46%, #050912 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(46, 133, 240, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 133, 240, 0.055) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.86), rgba(0,0,0,0.22));
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.026), transparent);
  pointer-events: none;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1260px, calc(100% - 44px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 8px 0 28px;
  border-bottom: 1px solid var(--line);
}

.brandBlock {
  display: flex;
  align-items: center;
  gap: 22px;
}

.brandLogo {
  width: 152px;
  max-width: 32vw;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 14px 34px rgba(46, 133, 240, 0.24));
}

.monoTag,
.sectionKicker,
.filterPill span,
.panelChip,
.headerMeta,
th {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}

.monoTag,
.sectionKicker {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  max-width: 780px;
  font-size: clamp(30px, 4.7vw, 54px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  max-width: 820px;
  margin-bottom: 0;
  font-size: clamp(28px, 4.4vw, 56px);
  line-height: 1.02;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: 0;
}

.subtitle {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
}

.headerMeta {
  min-width: 220px;
  text-align: right;
  color: var(--muted);
  font-size: 12px;
}

.engineButton {
  margin-top: 4px;
  padding: 9px 12px;
  color: #ffffff;
  background: linear-gradient(135deg, rgba(26,95,180,.72), rgba(46,133,240,.26));
  border: 1px solid rgba(46,133,240,.42);
  border-radius: 8px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 0 34px rgba(46,133,240,.16);
}

.statusBadge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  margin-bottom: 10px;
  color: #d9ecff;
  background: rgba(46, 133, 240, 0.12);
  border: 1px solid rgba(46, 133, 240, 0.38);
  border-radius: 6px;
}

.statusBadge span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(98, 230, 177, 0.12);
}

.filterRail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0;
}

.filterPill {
  min-height: 74px;
  padding: 13px 14px;
  color: var(--text);
  text-align: left;
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.filterPill:hover,
.filterPill.isActive {
  background: rgba(46, 133, 240, 0.12);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.filterPill span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.filterPill strong {
  display: block;
  font-size: 14px;
  line-height: 1.2;
}

.heroPanel {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 22px;
  align-items: end;
  min-height: 290px;
  padding: 32px;
  margin-bottom: 16px;
  background:
    radial-gradient(circle at 90% 6%, rgba(46,133,240,.18), transparent 28%),
    linear-gradient(135deg, rgba(26, 95, 180, 0.22), rgba(46, 133, 240, 0.08)),
    rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: fadeUp .55s ease both;
}

.heroCopy {
  position: relative;
  z-index: 1;
}

.heroNote {
  max-width: 860px;
  margin: 18px 0 0;
  color: #b8c7df;
  font-size: 14px;
  line-height: 1.55;
}

.sanitationBadge {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  padding: 10px 12px;
  color: #ffe5eb;
  background: rgba(255,107,135,.11);
  border: 1px solid rgba(255,107,135,.32);
  border-radius: 8px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
}

.sanitationBadge strong {
  color: #fff;
}

.heroNumbers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.heroNumbers div {
  min-height: 132px;
  padding: 18px;
  background: rgba(4, 8, 15, 0.52);
  border: 1px solid rgba(154, 190, 238, 0.18);
  border-radius: 8px;
}

.heroNumbers span {
  display: block;
  margin-bottom: 10px;
  color: #fff;
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
}

.heroNumbers small {
  color: var(--muted);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.kpiGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  margin-bottom: 22px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.kpi {
  min-height: 142px;
  padding: 22px;
  background: rgba(9, 18, 34, 0.92);
  position: relative;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.kpi:hover,
.panel:hover,
.doctorCard:hover {
  transform: translateY(-2px);
  border-color: rgba(46,133,240,.34);
}

.kpi::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--bright));
  opacity: 0;
}

.kpi.isPrimary {
  background: rgba(26, 95, 180, 0.18);
}

.kpi.isPrimary::before {
  opacity: 1;
}

.kpiLabel {
  margin-bottom: 14px;
  color: var(--muted);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.kpiValue {
  margin-bottom: 10px;
  color: #fff;
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 800;
  line-height: 1;
}

.kpiHint {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.dashboardGrid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.panel {
  grid-column: span 4;
  min-height: 344px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.panelLarge { grid-column: span 7; }
.panelDonut { grid-column: span 5; }
.panelWide { grid-column: span 8; }
.panelSplit { grid-column: span 6; }
.panelFull { grid-column: 1 / -1; }

.panelHeader {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.panelChip {
  flex: 0 0 auto;
  padding: 6px 9px;
  color: #d5e9ff;
  background: rgba(46, 133, 240, 0.12);
  border: 1px solid rgba(46, 133, 240, 0.26);
  border-radius: 5px;
  font-size: 10px;
}

.dangerChip {
  color: #ffd8df;
  background: rgba(255,107,135,.12);
  border-color: rgba(255,107,135,.34);
}

canvas {
  width: 100%;
  max-width: 100%;
}

.donutLayout {
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  gap: 18px;
  align-items: center;
}

.conversionMega {
  display: grid;
  gap: 2px;
  margin-bottom: 14px;
}

.conversionMega strong {
  font-size: clamp(42px, 6vw, 72px);
  line-height: .9;
}

.conversionMega span {
  color: var(--muted);
  font-size: 13px;
}

.progressTrack {
  height: 9px;
  overflow: hidden;
  margin-bottom: 14px;
  background: rgba(255,255,255,.07);
  border-radius: 999px;
}

.progressFill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--bright), var(--cyan));
  border-radius: inherit;
  transition: width 1s cubic-bezier(.16,1,.3,1);
}

.legendStack {
  display: grid;
  gap: 12px;
}

.legendItem {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.legendDot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.legendItem strong {
  color: #fff;
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

.doctorGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.doctorCard {
  min-height: 248px;
  padding: 18px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: transform .2s ease, border-color .2s ease;
}

.doctorCardAdvanced {
  position: relative;
  overflow: hidden;
  padding: 20px;
  background:
    radial-gradient(circle at 12% 0%, rgba(46,133,240,.16), transparent 24%),
    linear-gradient(180deg, rgba(14,28,52,.96), rgba(8,17,32,.92));
}

.doctorCardAdvanced::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, var(--bright), rgba(105,199,255,.2));
  opacity: .78;
}

.doctorTop {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.doctorName {
  margin-bottom: 4px;
  font-size: 17px;
  font-weight: 800;
}

.doctorTotal {
  display: block;
  color: var(--cyan);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 30px;
  font-weight: 800;
  text-align: right;
  line-height: 1;
}

.doctorStatus {
  display: inline-flex;
  justify-content: center;
  margin-top: 8px;
  padding: 5px 8px;
  color: #dbeafe;
  background: rgba(46,133,240,.12);
  border: 1px solid rgba(46,133,240,.24);
  border-radius: 999px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  white-space: nowrap;
}

.doctorStatus.risk {
  color: #ffd8df;
  background: rgba(255,107,135,.12);
  border-color: rgba(255,107,135,.32);
}

.doctorStatus.warning {
  color: #ffe8b8;
  background: rgba(246,199,107,.11);
  border-color: rgba(246,199,107,.30);
}

.doctorStatus.positive {
  color: #d6fff0;
  background: rgba(98,230,177,.10);
  border-color: rgba(98,230,177,.30);
}

.doctorFocusGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 14px;
}

.focusBox {
  min-height: 96px;
  padding: 13px;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(154,190,238,.12);
  border-radius: 8px;
}

.focusWide {
  grid-column: 1 / -1;
  min-height: auto;
}

.focusBox span,
.microTitle {
  display: block;
  margin-bottom: 7px;
  color: var(--muted-2);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.focusBox strong {
  display: block;
  color: #fff;
  font-size: 17px;
  line-height: 1.15;
}

.focusBox small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.doctorAnalyticsGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.microGroup {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 190px;
  padding: 12px;
  color: var(--muted);
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(154,190,238,.12);
  border-radius: 8px;
}

.microTitle {
  margin: 0 0 2px;
}

.microDonutGroup {
  align-items: center;
  justify-items: center;
}

.microDonut {
  width: 106px;
  height: 106px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 0 26px rgba(46,133,240,.12);
}

.microDonut::after {
  content: "";
  position: absolute;
  inset: 15px;
  background: #091220;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(154,190,238,.11);
}

.microDonut span {
  position: relative;
  z-index: 1;
  color: #fff;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 16px;
  font-weight: 900;
}

.microLegend {
  display: grid;
  gap: 5px;
  width: 100%;
  margin-top: 2px;
}

.microLegend span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.microLegend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.rankingStack {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.rankItem {
  display: grid;
  gap: 8px;
}

.rankTop,
.matrixRow {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.rankTop strong,
.matrixRow strong {
  color: #fff;
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

.miniMatrix {
  display: grid;
  gap: 9px;
  padding-top: 14px;
  border-top: 1px solid rgba(154,190,238,.12);
}

.matrixRow {
  align-items: flex-start;
  padding: 10px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(154,190,238,.10);
  border-radius: 8px;
}

.matrixRow span {
  text-align: right;
  line-height: 1.4;
}

.badgeRow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.badgeRow span {
  padding: 7px 9px;
  color: #dbeafe;
  background: rgba(46,133,240,.10);
  border: 1px solid rgba(46,133,240,.24);
  border-radius: 999px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
}

.alertLine {
  margin-bottom: 14px;
  padding: 12px 14px;
  color: #ffdce4;
  background: rgba(255,107,135,.10);
  border: 1px solid rgba(255,107,135,.28);
  border-radius: 8px;
  font-size: 13px;
}

.miniBar {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.miniBarTop {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.miniBarTop strong {
  color: #fff;
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

.barTrack {
  height: 8px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
  border-radius: 99px;
}

.barFill {
  height: 100%;
  background: linear-gradient(90deg, var(--bright), var(--cyan));
  border-radius: inherit;
}

.tableWrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

thead {
  background: rgba(255,255,255,0.035);
}

th,
td {
  padding: 15px 16px;
  border-bottom: 1px solid rgba(154, 190, 238, 0.11);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

td {
  color: #dde8fb;
  font-size: 13px;
  line-height: 1.45;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.tableNumber {
  color: #fff;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 800;
}

.diagnosticStack {
  display: grid;
  gap: 12px;
}

.diagnosticCard {
  padding: 15px;
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.diagnosticCard.positive { border-color: rgba(98, 230, 177, 0.34); }
.diagnosticCard.warning { border-color: rgba(246, 199, 107, 0.34); }
.diagnosticCard.risk { border-color: rgba(255, 107, 135, 0.34); }

.diagnosticMetric {
  color: var(--cyan);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 22px;
  font-weight: 800;
}

.diagnosticTitle {
  margin: 6px 0;
  color: #fff;
  font-weight: 800;
}

.diagnosticText {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.nextPanel {
  display: grid;
  grid-template-columns: 0.42fr 1fr;
  gap: 24px;
  align-items: start;
  min-height: auto;
  background:
    linear-gradient(135deg, rgba(26, 95, 180, 0.18), rgba(46, 133, 240, 0.08)),
    var(--panel);
}

.nextSteps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.nextSteps li {
  min-height: 118px;
  padding: 16px;
  background: rgba(4, 8, 15, 0.46);
  border: 1px solid rgba(154, 190, 238, 0.16);
  border-radius: 8px;
  color: #dbe7f9;
  font-size: 13px;
  line-height: 1.45;
}

.nextSteps span {
  display: block;
  margin-bottom: 10px;
  color: var(--cyan);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 800;
}

@media (max-width: 1080px) {
  .filterRail,
  .kpiGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel,
  .panelLarge,
  .panelDonut,
  .panelWide,
  .panelSplit {
    grid-column: 1 / -1;
  }

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

@media (max-width: 720px) {
  .shell {
    width: min(100% - 24px, 1260px);
    padding-top: 18px;
  }

  .topbar,
  .brandBlock,
  .heroPanel,
  .donutLayout,
  .nextPanel {
    display: block;
  }

  .brandLogo {
    margin-bottom: 16px;
    max-width: 190px;
  }

  .headerMeta {
    margin-top: 18px;
    text-align: left;
  }

  .filterRail,
  .kpiGrid,
  .heroNumbers,
  .doctorGrid,
  .doctorAnalyticsGrid,
  .doctorFocusGrid,
  .nextSteps {
    grid-template-columns: 1fr;
  }

  .focusWide {
    grid-column: auto;
  }

  .heroPanel {
    min-height: auto;
    padding: 22px;
  }

  .heroNumbers {
    margin-top: 22px;
  }

  .panel {
    padding: 18px;
  }
}
