/* Nova Hub Premium UI v1 */
:root {
  --premium-accent: var(--accent, #00ead4);
  --premium-accent-rgb: 0, 234, 212;
  --premium-accent-2: #55f5e6;
  --premium-glow: rgba(var(--premium-accent-rgb), .24);
  --premium-card: rgba(7, 20, 30, .86);
  --premium-card-strong: rgba(5, 15, 22, .96);
  --premium-grid: rgba(var(--premium-accent-rgb), .035);
}

html[data-nova-theme="crimson"] {
  --accent: #ff5f7d;
  --accent2: #ff9aae;
  --line-accent: rgba(255, 95, 125, .34);
  --premium-accent: #ff5f7d;
  --premium-accent-rgb: 255, 95, 125;
  --premium-accent-2: #ff9aae;
}

html[data-nova-theme="violet"] {
  --accent: #9b7cff;
  --accent2: #c2b1ff;
  --line-accent: rgba(155, 124, 255, .34);
  --premium-accent: #9b7cff;
  --premium-accent-rgb: 155, 124, 255;
  --premium-accent-2: #c2b1ff;
}

html[data-nova-theme="midnight"] {
  --accent: #6aa8ff;
  --accent2: #9fc7ff;
  --line-accent: rgba(106, 168, 255, .34);
  --premium-accent: #6aa8ff;
  --premium-accent-rgb: 106, 168, 255;
  --premium-accent-2: #9fc7ff;
}

html[data-nova-density="compact"] .content { padding: 17px; }
html[data-nova-density="compact"] .premium-card,
html[data-nova-density="compact"] .dashboard-panel { padding: 16px; }

body {
  background-image:
    linear-gradient(var(--premium-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--premium-grid) 1px, transparent 1px),
    radial-gradient(circle at 82% 0, rgba(var(--premium-accent-rgb), .08), transparent 30rem);
  background-size: 52px 52px, 52px 52px, auto;
}

.premium-dashboard {
  position: relative;
  isolation: isolate;
}

.premium-dashboard::before {
  content: "";
  position: fixed;
  z-index: -1;
  width: 420px;
  height: 420px;
  right: -170px;
  bottom: -170px;
  border-radius: 50%;
  background: rgba(var(--premium-accent-rgb), .055);
  filter: blur(24px);
  pointer-events: none;
}

.premium-hero {
  position: relative;
  overflow: hidden;
  min-height: 330px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 430px);
  align-items: center;
  gap: 35px;
  padding: clamp(28px, 5vw, 62px);
  border: 1px solid rgba(var(--premium-accent-rgb), .30);
  border-radius: 25px;
  background:
    linear-gradient(125deg, rgba(8, 28, 39, .97), rgba(3, 10, 15, .98) 68%),
    radial-gradient(circle at 85% 30%, rgba(var(--premium-accent-rgb), .18), transparent 26rem);
  box-shadow: 0 28px 75px rgba(0,0,0,.34), inset 0 0 80px rgba(var(--premium-accent-rgb), .025);
}

.premium-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .55;
  background:
    linear-gradient(90deg, transparent 0 79%, rgba(var(--premium-accent-rgb), .055) 79% 79.3%, transparent 79.3%),
    linear-gradient(0deg, transparent 0 72%, rgba(var(--premium-accent-rgb), .045) 72% 72.3%, transparent 72.3%);
  pointer-events: none;
}

.premium-hero-copy,
.premium-command-visual { position: relative; z-index: 1; }

.premium-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  color: var(--premium-accent);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .17em;
}

.premium-kicker::before {
  content: "";
  width: 20px;
  height: 1px;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}

.premium-hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(38px, 5vw, 70px);
  line-height: .98;
  letter-spacing: -.055em;
}

.premium-hero h1 span {
  color: var(--premium-accent);
  text-shadow: 0 0 32px rgba(var(--premium-accent-rgb), .19);
}

.premium-hero p {
  max-width: 690px;
  margin: 19px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.premium-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 25px;
}

.premium-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 13px 22px;
  margin-top: 25px;
  color: #91aab5;
  font-size: 12px;
}

.premium-hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.premium-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #62e9af;
  box-shadow: 0 0 13px #62e9af;
}

.premium-command-visual {
  display: grid;
  place-items: center;
  min-height: 270px;
}

.command-radar {
  position: relative;
  width: min(280px, 70vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--premium-accent-rgb), .25);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(var(--premium-accent-rgb), .09) 0 2px, transparent 3px),
    repeating-radial-gradient(circle, transparent 0 37px, rgba(var(--premium-accent-rgb), .12) 38px 39px);
  box-shadow: 0 0 75px rgba(var(--premium-accent-rgb), .09);
}

.command-radar::before,
.command-radar::after {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  height: 1px;
  background: rgba(var(--premium-accent-rgb), .16);
}

.command-radar::after { transform: rotate(90deg); }

.radar-sweep {
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 74%, rgba(var(--premium-accent-rgb), .28) 97%, transparent 100%);
  animation: premium-radar 5s linear infinite;
}

.radar-core {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 94px;
  height: 94px;
  border: 1px solid rgba(var(--premium-accent-rgb), .55);
  border-radius: 28px;
  color: var(--premium-accent);
  background: rgba(4, 15, 22, .92);
  font-size: 42px;
  font-weight: 950;
  box-shadow: 0 0 50px rgba(var(--premium-accent-rgb), .18);
}

.radar-node {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--premium-accent);
  box-shadow: 0 0 18px var(--premium-accent);
  animation: premium-node 2.3s ease-in-out infinite;
}
.radar-node:nth-of-type(1) { top: 21%; left: 28%; }
.radar-node:nth-of-type(2) { right: 19%; top: 47%; animation-delay: .7s; }
.radar-node:nth-of-type(3) { left: 36%; bottom: 16%; animation-delay: 1.2s; }

.premium-stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.premium-stat {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: inherit;
  background: linear-gradient(145deg, var(--premium-card), var(--premium-card-strong));
  text-decoration: none;
  box-shadow: 0 15px 38px rgba(0,0,0,.15);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.premium-stat::after {
  content: "";
  position: absolute;
  width: 90px;
  height: 90px;
  right: -44px;
  bottom: -48px;
  border-radius: 50%;
  background: rgba(var(--premium-accent-rgb), .08);
  transition: transform .25s ease;
}

.premium-stat:hover {
  transform: translateY(-3px);
  border-color: rgba(var(--premium-accent-rgb), .34);
  box-shadow: 0 20px 45px rgba(0,0,0,.22), 0 0 26px rgba(var(--premium-accent-rgb), .045);
}

.premium-stat:hover::after { transform: scale(1.3); }

.premium-stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
}

.premium-stat-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(var(--premium-accent-rgb), .22);
  border-radius: 12px;
  color: var(--premium-accent);
  background: rgba(var(--premium-accent-rgb), .055);
  font-weight: 950;
}

.premium-stat strong {
  display: block;
  margin-top: 15px;
  font-size: 27px;
}

.premium-stat small { color: var(--muted); }

.premium-trend {
  color: #62e9af;
  font-size: 11px;
}

.premium-stat-meter {
  height: 3px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.055);
}

.premium-stat-meter span {
  display: block;
  width: var(--meter, 55%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--premium-accent), var(--premium-accent-2));
  box-shadow: 0 0 14px rgba(var(--premium-accent-rgb), .3);
  animation: premium-meter .8s ease both;
}

.premium-layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr);
  gap: 16px;
  margin-top: 16px;
}

.premium-card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, var(--premium-card), var(--premium-card-strong));
  box-shadow: 0 17px 45px rgba(0,0,0,.14);
}

.premium-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 18px;
}

.premium-card-heading h2 {
  margin: 5px 0 0;
  font-size: 21px;
}

.premium-card-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.live-widget {
  position: relative;
  overflow: hidden;
  min-height: 145px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.018);
}

.live-widget:hover { border-color: rgba(var(--premium-accent-rgb), .28); }

.live-widget-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.live-widget-value {
  margin-top: 18px;
  font-size: clamp(24px, 4vw, 35px);
  font-weight: 900;
  letter-spacing: -.04em;
}

.live-widget-sub {
  margin-top: 7px;
  color: #819ba6;
  font-size: 11px;
}

.live-widget-chart {
  position: absolute;
  inset: auto 0 0;
  height: 45px;
  opacity: .45;
  background:
    linear-gradient(135deg, transparent 0 12%, rgba(var(--premium-accent-rgb), .3) 13% 15%, transparent 16% 28%, rgba(var(--premium-accent-rgb), .28) 29% 31%, transparent 32% 45%, rgba(var(--premium-accent-rgb), .35) 46% 48%, transparent 49% 62%, rgba(var(--premium-accent-rgb), .25) 63% 65%, transparent 66%);
  clip-path: polygon(0 100%,0 68%,13% 52%,27% 70%,46% 25%,63% 52%,78% 18%,100% 42%,100% 100%);
}

.analytics-bars {
  display: grid;
  gap: 13px;
}

.analytics-row {
  display: grid;
  grid-template-columns: 115px minmax(0,1fr) 44px;
  align-items: center;
  gap: 12px;
  color: #abc0c8;
  font-size: 12px;
}

.analytics-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
}

.analytics-track span {
  display: block;
  width: var(--value, 40%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(var(--premium-accent-rgb), .72), var(--premium-accent));
  box-shadow: 0 0 18px rgba(var(--premium-accent-rgb), .18);
  transform-origin: left;
  animation: premium-bar .8s ease both;
}

.analytics-row strong {
  color: var(--text);
  text-align: right;
}

.premium-activity-list {
  display: grid;
  gap: 8px;
}

.premium-activity {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255,255,255,.014);
}

.premium-activity-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  color: var(--premium-accent);
  background: rgba(var(--premium-accent-rgb), .065);
  font-weight: 900;
}

.premium-activity strong,
.premium-activity small { display: block; }
.premium-activity small { margin-top: 3px; color: var(--muted); }
.premium-activity time { color: #657e89; font-size: 10px; }

.premium-health {
  display: grid;
  gap: 9px;
}

.health-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #78919e;
  box-shadow: 0 0 0 transparent;
}

.health-row.is-online .health-dot {
  background: #62e9af;
  box-shadow: 0 0 13px #62e9af;
}

.health-row.is-error .health-dot {
  background: #ff6d85;
  box-shadow: 0 0 13px rgba(255,109,133,.6);
}

.health-row span { color: #9db2bc; }
.health-row strong { color: var(--muted); font-size: 11px; }
.health-row.is-online strong { color: #62e9af; }
.health-row.is-error strong { color: #ff91a3; }

.premium-theme-button {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 70;
  display: grid;
  place-items: center;
  width: 51px;
  height: 51px;
  border: 1px solid rgba(var(--premium-accent-rgb), .35);
  border-radius: 16px;
  color: var(--premium-accent);
  background: rgba(4, 14, 20, .94);
  box-shadow: 0 15px 40px rgba(0,0,0,.35), 0 0 25px rgba(var(--premium-accent-rgb), .09);
  cursor: pointer;
}

.premium-theme-button:hover { transform: translateY(-2px); }

.premium-theme-panel {
  position: fixed;
  right: 22px;
  bottom: 84px;
  z-index: 80;
  width: min(350px, calc(100vw - 28px));
  padding: 18px;
  border: 1px solid rgba(var(--premium-accent-rgb), .30);
  border-radius: 17px;
  background: rgba(4, 14, 20, .97);
  box-shadow: 0 28px 80px rgba(0,0,0,.5);
  backdrop-filter: blur(20px);
}

.premium-theme-panel[hidden] { display: none; }

.premium-theme-panel h3 { margin: 0; }
.premium-theme-panel p { margin: 6px 0 16px; color: var(--muted); font-size: 12px; }

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

.theme-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: #a9bdc5;
  background: rgba(255,255,255,.018);
  cursor: pointer;
}

.theme-option:hover,
.theme-option.active {
  border-color: rgba(var(--premium-accent-rgb), .42);
  color: #fff;
  background: rgba(var(--premium-accent-rgb), .07);
}

.theme-swatch {
  width: 15px;
  height: 15px;
  border-radius: 5px;
  background: var(--swatch);
  box-shadow: 0 0 12px color-mix(in srgb, var(--swatch) 50%, transparent);
}

.theme-settings {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.premium-switch {
  width: 44px;
  height: 24px;
  padding: 3px;
  border: 0;
  border-radius: 999px;
  background: #18303a;
  cursor: pointer;
}

.premium-switch::after {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #8ca5af;
  transition: transform .18s ease, background .18s ease;
}

.premium-switch[aria-pressed="true"] {
  background: rgba(var(--premium-accent-rgb), .24);
}

.premium-switch[aria-pressed="true"]::after {
  transform: translateX(20px);
  background: var(--premium-accent);
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .5s ease, transform .5s ease;
}

@keyframes premium-radar { to { transform: rotate(360deg); } }
@keyframes premium-node { 50% { transform: scale(1.6); opacity: .45; } }
@keyframes premium-meter { from { width: 0; } }
@keyframes premium-bar { from { transform: scaleX(0); } }

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

@media (max-width: 980px) {
  .premium-hero { grid-template-columns: 1fr; }
  .premium-command-visual { display: none; }
  .premium-layout-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .premium-stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .premium-stat:last-child { grid-column: 1 / -1; }
  .live-widget-grid { grid-template-columns: 1fr; }
  .analytics-row { grid-template-columns: 86px minmax(0,1fr) 35px; }
  .premium-theme-button { right: 14px; bottom: 14px; }
  .premium-theme-panel { right: 14px; bottom: 76px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}