@import url("https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700&family=Barlow:wght@400;500;700&display=swap");

:root {
  --bg: #100611;
  --bg-soft: #1b0c1d;
  --panel: rgba(32, 14, 35, 0.78);
  --panel-border: rgba(255, 108, 185, 0.35);
  --text: #ffe9f4;
  --muted: #f8bdd9;
  --pink-strong: #ff4fa9;
  --pink-soft: #ff7bc0;
  --good: #6dffa8;
  --bad: #ff7a9a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background: radial-gradient(circle at 18% 8%, #390f3d 0%, var(--bg) 44%, #0b030c 100%);
  font-family: "Barlow", "Segoe UI", sans-serif;
}

body {
  position: relative;
  overflow-x: hidden;
}

.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.bg-1 {
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 79, 169, 0.28), transparent 40%),
    radial-gradient(circle at 10% 75%, rgba(224, 110, 255, 0.16), transparent 36%);
}

.bg-2 {
  background:
    repeating-linear-gradient(120deg, rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0.015) 1px, transparent 1px, transparent 14px);
  opacity: 0.35;
}

.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  padding: 1.25rem 1.5rem 0.75rem;
}

.topbar-chips {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.brand-wrap h1 {
  margin: 0;
  font-family: "Orbitron", "Segoe UI", sans-serif;
  letter-spacing: 0.08em;
  font-size: clamp(1.4rem, 3vw, 2.15rem);
}

.brand-kicker {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
}

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

.status-chip {
  font-family: "Orbitron", "Segoe UI", sans-serif;
  background: linear-gradient(130deg, rgba(255, 79, 169, 0.25), rgba(255, 79, 169, 0.08));
  border: 1px solid var(--panel-border);
  color: var(--pink-soft);
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  letter-spacing: 0.06em;
  font-size: 0.82rem;
}

.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1rem;
  padding: 0.35rem 1.5rem 1.5rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.panel-main {
  padding: 1rem;
  min-width: 0;
}

.panel-side {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.left-group {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.right-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.field {
  display: grid;
  gap: 0.3rem;
}

.field span {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

input,
select,
button {
  border-radius: 10px;
  border: 1px solid rgba(255, 125, 199, 0.35);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font: inherit;
}

input,
select {
  min-height: 38px;
  padding: 0.45rem 0.65rem;
}

button {
  min-height: 38px;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  font-weight: 700;
  transition: transform 140ms ease, background 140ms ease;
  background: linear-gradient(145deg, rgba(255, 79, 169, 0.65), rgba(167, 48, 118, 0.7));
}

button:hover {
  transform: translateY(-1px);
  background: linear-gradient(145deg, rgba(255, 109, 185, 0.72), rgba(167, 48, 118, 0.78));
}

#refreshServerBtn {
  display: none;
  background: linear-gradient(145deg, rgba(121, 255, 201, 0.55), rgba(43, 132, 99, 0.75));
}

#refreshServerBtn:hover {
  background: linear-gradient(145deg, rgba(148, 255, 213, 0.68), rgba(59, 152, 116, 0.85));
}

#adminAuthBtn {
  background: linear-gradient(145deg, rgba(97, 156, 255, 0.5), rgba(42, 84, 146, 0.76));
}

#adminAuthBtn:hover {
  background: linear-gradient(145deg, rgba(121, 173, 255, 0.62), rgba(53, 101, 171, 0.84));
}

#adminClearBtn {
  display: none;
  background: linear-gradient(145deg, rgba(255, 132, 132, 0.52), rgba(152, 58, 58, 0.72));
}

#adminClearBtn:hover {
  background: linear-gradient(145deg, rgba(255, 156, 156, 0.66), rgba(176, 72, 72, 0.82));
}

.warnings {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.45rem;
}

.warning {
  border: 1px solid rgba(255, 191, 132, 0.4);
  background: rgba(255, 130, 57, 0.16);
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
  font-size: 0.9rem;
}

.ticker-rail {
  margin-top: 0.85rem;
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.ticker-card {
  min-width: 175px;
  border: 1px solid rgba(255, 124, 199, 0.32);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 0.5rem 0.65rem;
}

.ticker-card .name {
  font-weight: 700;
}

.ticker-card .value {
  color: var(--muted);
  font-size: 0.92rem;
}

.ticker-card .trend-up {
  color: var(--good);
}

.ticker-card .trend-down {
  color: var(--bad);
}

.table-wrap {
  margin-top: 0.9rem;
  overflow: auto;
  max-height: calc(100vh - 255px);
}

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

thead th {
  text-align: left;
  font-family: "Orbitron", "Segoe UI", sans-serif;
  letter-spacing: 0.05em;
  font-size: 0.78rem;
  color: var(--muted);
  border-bottom: 1px solid rgba(255, 124, 199, 0.35);
  padding: 0.55rem 0.45rem;
  position: sticky;
  top: 0;
  background: rgba(15, 6, 16, 0.92);
  backdrop-filter: blur(8px);
}

tbody td {
  border-bottom: 1px solid rgba(255, 124, 199, 0.14);
  padding: 0.5rem 0.45rem;
  font-size: 0.95rem;
}

tbody tr {
  transition: background 120ms ease;
  cursor: pointer;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

tbody tr.is-active {
  background: rgba(255, 79, 169, 0.19);
}

.item-cell {
  display: flex;
  align-items: center;
  gap: 0.38rem;
}

.item-label {
  font-weight: 600;
}

.expand-btn {
  min-height: unset;
  width: 1.1rem;
  height: 1.1rem;
  padding: 0;
  border: 1px solid rgba(255, 124, 199, 0.3);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.expand-btn:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.12);
}

.expand-spacer {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
}

.row-variant td {
  font-size: 0.89rem;
}

.item-cell-variant {
  padding-left: 1.45rem;
  color: var(--muted);
}

.variant-branch {
  color: rgba(255, 187, 224, 0.85);
}

.variant-label {
  font-weight: 500;
}

.fg-col {
  font-weight: 700;
  color: #ffd2ea;
}

.trend-up {
  color: var(--good);
  font-weight: 700;
}

.trend-down {
  color: var(--bad);
  font-weight: 700;
}

.side-block {
  border: 1px solid rgba(255, 124, 199, 0.25);
  border-radius: 12px;
  padding: 0.7rem;
  background: rgba(255, 255, 255, 0.03);
}

.side-block h2 {
  margin: 0 0 0.55rem;
  font-family: "Orbitron", "Segoe UI", sans-serif;
  font-size: 0.86rem;
  letter-spacing: 0.07em;
  color: var(--muted);
  text-transform: uppercase;
}

.meta-summary {
  color: #ffd5eb;
  line-height: 1.45;
  font-size: 0.95rem;
}

.source-list {
  display: grid;
  gap: 0.5rem;
}

.source-row {
  border: 1px solid rgba(255, 124, 199, 0.2);
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
  font-size: 0.9rem;
  line-height: 1.35;
}

.source-row.bad {
  border-color: rgba(255, 122, 154, 0.45);
}

.source-row.good {
  border-color: rgba(109, 255, 168, 0.35);
}

.item-detail {
  display: grid;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.history-state {
  color: var(--muted);
  font-size: 0.84rem;
}

.history-state.error {
  color: var(--bad);
}

.chart-shell {
  margin-top: 0.2rem;
}

.history-chart {
  width: 100%;
  height: 180px;
  display: block;
  border: 1px solid rgba(255, 124, 199, 0.22);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.26);
}

.axis-line {
  stroke: rgba(255, 225, 242, 0.3);
  stroke-width: 1;
}

.history-line {
  fill: none;
  stroke: #ffc6e7;
  stroke-width: 2;
}

.chart-point {
  fill: #ff9bd0;
  opacity: 0.9;
}

.metric-line {
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.metric-line.min {
  stroke: rgba(109, 255, 168, 0.75);
}

.metric-line.max {
  stroke: rgba(255, 122, 154, 0.75);
}

.metric-line.median {
  stroke: rgba(255, 205, 120, 0.85);
}

.chart-foot {
  margin-top: 0.2rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.76rem;
  color: var(--muted);
}

.chart-empty {
  border: 1px dashed rgba(255, 124, 199, 0.3);
  border-radius: 10px;
  padding: 0.55rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.variant-head {
  margin-top: 0.25rem;
  font-family: "Orbitron", "Segoe UI", sans-serif;
  letter-spacing: 0.06em;
  font-size: 0.74rem;
  color: var(--muted);
  text-transform: uppercase;
}

.variant-list {
  display: grid;
  gap: 0.35rem;
}

.variant-row {
  border: 1px solid rgba(255, 124, 199, 0.2);
  border-radius: 8px;
  padding: 0.35rem 0.45rem;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.82rem;
  line-height: 1.3;
}

.variant-empty {
  color: var(--muted);
  font-size: 0.82rem;
}

.sample {
  border: 1px solid rgba(255, 124, 199, 0.22);
  border-radius: 10px;
  padding: 0.4rem 0.5rem;
  background: rgba(0, 0, 0, 0.2);
}

.sample a {
  color: #ffc6e7;
}

.sample .meta {
  font-size: 0.82rem;
  color: var(--muted);
}

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

  .table-wrap {
    max-height: none;
  }
}
