:root {
  color-scheme: dark;
  --bg: #020203;
  --panel: rgba(18, 18, 22, 0.62);
  --panel-strong: rgba(18, 18, 23, 0.82);
  --panel-deep: rgba(7, 7, 10, 0.88);
  --line: rgba(255, 255, 255, 0.115);
  --line-soft: rgba(255, 255, 255, 0.065);
  --text: #fbfbff;
  --muted: #8c8d98;
  --soft: #d8d8e4;
  --ok: #64f0b3;
  --watch: #f4c95d;
  --blocked: #ff5d7a;
  --accent: #6f63ff;
  --accent-2: #9d91ff;
  --cyan: #48ddff;
  --orange: #ff8a2a;
  --ink: #080910;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, "SF Pro Display", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(135deg, rgba(111, 99, 255, .18), transparent 31%),
    linear-gradient(235deg, rgba(72, 221, 255, .07), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.035), transparent 19rem),
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.52) 0 1px, transparent 1.6px),
    linear-gradient(90deg, rgba(255,255,255,.014) 1px, transparent 1px);
  background-position: 9% 18%, center;
  background-size: 10.5rem 9rem, 8rem 100%;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.88), rgba(0,0,0,.10));
  opacity: .20;
}

body::after {
  content: "";
  position: fixed;
  inset: -28%;
  pointer-events: none;
  background:
    conic-gradient(from 145deg at 48% 26%, transparent 0deg, rgba(111,99,255,.16) 42deg, transparent 108deg, rgba(72,221,255,.06) 168deg, transparent 260deg, rgba(255,138,42,.055) 305deg, transparent 360deg);
  filter: blur(90px);
  opacity: .58;
}

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

h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(27px, 3.4vw, 44px); font-weight: 420; letter-spacing: 0; }
h2 { font-size: 19px; font-weight: 430; letter-spacing: 0; }
h3 { color: var(--muted); font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .09em; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.meta-line {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.mode-switch a {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--soft);
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 12px;
}

.meta-line span {
  position: relative;
}

.meta-line span + span::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 50%;
  width: 2px;
  height: 2px;
  border-radius: 999px;
  background: rgba(199, 208, 230, 0.45);
}

.meta-line a {
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--soft);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.025));
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

.meta-line a:hover {
  color: white;
}

.notice {
  margin: 8px 0 12px;
  border: 1px solid rgba(100, 240, 179, 0.22);
  border-radius: 14px;
  padding: 9px 11px;
  color: var(--ok);
  background: rgba(100, 240, 179, 0.07);
  font-size: 13px;
}

.health-bar {
  display: flex;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  padding: 5px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 999px;
  background: rgba(8, 8, 11, 0.58);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045), 0 18px 70px rgba(0,0,0,.22);
  margin-bottom: 16px;
  backdrop-filter: blur(24px) saturate(1.25);
  scrollbar-width: none;
}

.health-bar::-webkit-scrollbar {
  display: none;
}

.health-tile {
  display: grid;
  grid-template-columns: auto auto minmax(0, max-content) minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 212px;
  padding: 5px 10px 5px 5px;
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 999px;
  font-size: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015));
}

.health-tile i {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 999px;
  color: #aaa2ff;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  background: rgba(255,255,255,.035);
}

.health-tile strong {
  width: 7px;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  text-indent: -999px;
}

.health-tile span {
  color: var(--soft);
  white-space: nowrap;
}

.health-tile small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ok { background: var(--ok); box-shadow: 0 0 18px rgba(100, 240, 179, 0.36); }
.watch { background: var(--watch); box-shadow: 0 0 18px rgba(244, 201, 93, 0.32); }
.blocked { background: var(--blocked); box-shadow: 0 0 18px rgba(255, 93, 122, 0.32); }

.mode-switch {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 6px;
  width: max-content;
  padding: 5px;
  margin: 0 0 18px;
  border: 1px solid rgba(255,255,255,.105);
  border-radius: 999px;
  background: rgba(8, 8, 11, 0.74);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 18px 62px rgba(0,0,0,.22);
  backdrop-filter: blur(24px);
}

.mode-switch a {
  min-width: 76px;
  text-align: center;
  border-color: transparent;
}

.mode-switch a.active {
  background: linear-gradient(135deg, #8578ff, #5f58ff 72%, #47d8ff);
  box-shadow: 0 0 30px rgba(111,99,255,.42);
  color: white;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.primary-stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.money-card,
.side-card,
.bot-card {
  border: 1px solid rgba(255,255,255,.105);
  background:
    linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.018) 42%, rgba(255,255,255,.012)),
    linear-gradient(145deg, rgba(34,34,43,.72), rgba(8,8,11,.88));
  box-shadow: 0 28px 110px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(28px) saturate(1.18);
}

.money-card {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  padding: 24px;
}

.money-card::before,
.bot-card::before,
.side-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.13), transparent 28%, transparent 72%, rgba(111,99,255,.10));
  mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  mask-composite: exclude;
  padding: 1px;
  opacity: .42;
}

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

.money-head strong {
  display: block;
  margin-top: 14px;
  font-size: clamp(48px, 7vw, 82px);
  font-weight: 360;
  letter-spacing: 0;
  line-height: .95;
}

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

.chart-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.chart-tabs span {
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--soft);
  font-size: 12px;
  background: rgba(255,255,255,.035);
}

.chart-tabs span.active {
  border-color: rgba(117, 104, 255, 0.54);
  color: white;
  background: rgba(117, 104, 255, 0.18);
}

.chart {
  position: relative;
  min-height: 270px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(111,99,255,.12), transparent 45%),
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.012)),
    rgba(0,0,0,.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.chart::before {
  content: "";
  position: absolute;
  inset: 18px 20px;
  border-radius: 18px;
  background:
    repeating-linear-gradient(to right, rgba(255,255,255,.035) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(to bottom, rgba(255,255,255,.026) 0 1px, transparent 1px 54px);
  mask-image: linear-gradient(180deg, rgba(0,0,0,.65), transparent 95%);
}

.spark {
  width: 100%;
  height: 48px;
}

.spark.large {
  position: relative;
  z-index: 1;
  height: 270px;
  padding: 20px;
}

.spark-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 13px rgba(111, 99, 255, 0.48));
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 2px 0;
}

.kpi {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.065);
  border-radius: 16px;
  background: rgba(255,255,255,.026);
}

.kpi span,
.bot-primary span,
.bot-meta,
.dynamic,
.row span {
  color: var(--muted);
  font-size: 12px;
}

.kpi strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 440;
  letter-spacing: 0;
}

.kpi small {
  color: rgba(151, 161, 184, 0.72);
  font-size: 10px;
}

.bots h2 {
  margin-bottom: 10px;
}

.bot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.bot-card {
  overflow: hidden;
  border-radius: 26px;
  padding: 17px;
  position: relative;
}

.bot-card::after {
  content: "";
  position: absolute;
  inset: auto -18% -38% 26%;
  height: 150px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(111,99,255,.16), rgba(72,221,255,.05));
  filter: blur(34px);
  opacity: .62;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.phase {
  border: 1px solid rgba(111, 99, 255, 0.42);
  border-radius: 999px;
  padding: 4px 9px;
  color: white;
  background: rgba(111, 99, 255, 0.20);
  font-size: 11px;
  box-shadow: 0 0 22px rgba(111,99,255,.18);
}

.bot-primary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 8px 0;
}

.bot-primary strong {
  font-size: 26px;
  font-weight: 360;
  letter-spacing: 0;
}

.bot-meta {
  display: grid;
  gap: 4px;
}

.dynamic {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.dynamic span {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.065);
  border-radius: 14px;
  background: rgba(255,255,255,.032);
}

.dynamic strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-actions {
  position: relative;
  margin-top: 8px;
}

.bot-actions summary {
  width: 34px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  background: rgba(255,255,255,.045);
  backdrop-filter: blur(16px);
}

.bot-actions summary span {
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
}

.bot-actions summary::-webkit-details-marker {
  display: none;
}

.bot-actions form {
  position: absolute;
  right: 0;
  bottom: 36px;
  z-index: 4;
  width: min(260px, 90vw);
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(13, 13, 18, 0.98);
  box-shadow: 0 28px 80px rgba(0,0,0,.52);
}

.bot-actions label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.bot-actions input {
  min-width: 0;
}

.side {
  position: sticky;
  top: 62px;
}

.side-card {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  padding: 14px;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tabs input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tabs label {
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 999px;
  padding: 9px 10px;
  color: var(--soft);
  text-align: center;
  font-size: 13px;
  cursor: pointer;
  background: rgba(255,255,255,.028);
}

#tab-decisions:checked + label,
#tab-radar:checked + label {
  color: white;
  background: linear-gradient(135deg, rgba(111, 99, 255, 0.34), rgba(111, 99, 255, 0.16));
  border-color: rgba(111, 99, 255, 0.58);
  box-shadow: 0 0 24px rgba(111,99,255,.22);
}

.tab-panel {
  grid-column: 1 / -1;
  display: none;
  padding-top: 4px;
}

#tab-decisions:checked ~ .decisions-panel,
#tab-radar:checked ~ .radar-panel {
  display: block;
}

.decision-lanes {
  display: grid;
  gap: 12px;
}

.decision-lanes h3 {
  margin: 10px 0 6px;
}

.row {
  display: grid;
  gap: 5px;
  padding: 13px 0;
  border-top: 1px solid var(--line-soft);
}

.row strong {
  font-size: 13px;
}

.row em {
  color: #b8adff;
  font-size: 12px;
  font-style: normal;
}

input,
button {
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  padding: 10px 11px;
  background: rgba(255,255,255,.055);
  color: var(--text);
}

button {
  flex: 0 0 auto;
  border-color: rgba(111, 99, 255, 0.58);
  background: linear-gradient(135deg, rgba(111, 99, 255, 0.38), rgba(84, 78, 255, 0.24));
  cursor: pointer;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.018)),
    var(--panel-strong);
  border-radius: 26px;
  padding: 26px;
  box-shadow: 0 30px 110px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.045);
  backdrop-filter: blur(22px);
}

.brand {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  margin-bottom: 18px;
  color: white;
  background: linear-gradient(135deg, rgba(117,104,255,.34), rgba(66,217,255,.10));
}

.login-card form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.login-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.error { color: var(--blocked); }

@media (max-width: 1180px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .side {
    position: static;
  }
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 20px, 1500px);
    padding-top: 14px;
  }
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .meta-line {
    justify-content: flex-start;
  }
  .bot-grid {
    grid-template-columns: 1fr;
  }

  .health-bar { padding: 4px; }

  .health-tile {
    flex: 0 0 auto;
    grid-template-columns: auto auto;
    min-width: auto;
    padding: 5px 7px 5px 5px;
  }

  .health-tile i {
    width: 21px;
    height: 21px;
  }

  .health-tile span { display: none; }
  .health-tile small { display: none; }
  .money-head {
    flex-direction: column;
  }
  .chart-tabs {
    justify-content: flex-start;
  }
  .chart,
  .spark.large {
    min-height: 190px;
    height: 190px;
  }
  .kpi-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dynamic {
    grid-template-columns: 1fr;
  }
}
