/* ==========================================================
   NIC Hub v4 SaaS theme
   UI-only upgrade. Backend/API/D1/Cloudflare DNS logic remains unchanged.
   ========================================================== */

:root {
  --bg: #060b14;
  --bg2: #090f1a;
  --panel: rgba(11, 17, 29, .84);
  --panel-2: rgba(17, 25, 41, .78);
  --glass: rgba(14, 22, 37, .72);
  --text: #f8fbff;
  --muted: #93a4bf;
  --soft: #c7d3e6;
  --line: rgba(178, 196, 226, .12);
  --line-strong: rgba(178, 196, 226, .22);
  --accent: #7c5cff;
  --accent2: #25d7ff;
  --accent3: #6ff3c1;
  --ok: #6ff3c1;
  --warn: #ffd166;
  --bad: #ff6f91;
  --radius: 22px;
  --radius-sm: 15px;
  --shadow: 0 22px 80px rgba(0, 0, 0, .42);
  --shadow-soft: 0 14px 44px rgba(0, 0, 0, .24);
  --shell: min(1180px, calc(100vw - 36px));
  --shell-wide: min(1480px, calc(100vw - 28px));
}

html {
  background: #050913;
}

body.saas-v4 {
  background:
    radial-gradient(circle at 12% 0%, rgba(37, 215, 255, .16), transparent 28%),
    radial-gradient(circle at 88% 6%, rgba(124, 92, 255, .18), transparent 30%),
    radial-gradient(circle at 48% 96%, rgba(111, 243, 193, .08), transparent 32%),
    linear-gradient(180deg, #050913 0%, #08101c 42%, #050913 100%);
  color: var(--text);
  letter-spacing: -.01em;
}

body.saas-v4::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.75), transparent 80%);
}

body.saas-v4 .sky {
  opacity: .82;
  filter: saturate(1.08);
}

body.saas-v4 [data-glass] {
  background:
    linear-gradient(180deg, rgba(19, 28, 47, .82), rgba(8, 13, 24, .78)),
    linear-gradient(135deg, rgba(124, 92, 255, .08), rgba(37, 215, 255, .05));
  border-color: var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(135%);
}

body.saas-v4 [data-glass]::selection {
  background: rgba(124, 92, 255, .35);
}

body.saas-v4 .site-header {
  top: 12px;
  padding: 12px 14px;
  border-radius: 20px;
  background: rgba(7, 12, 22, .74);
  border-color: rgba(198, 212, 238, .14);
  box-shadow: 0 18px 60px rgba(0,0,0,.32);
}

body.saas-v4 .brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background:
    radial-gradient(circle at 35% 24%, rgba(255,255,255,.65), transparent 18%),
    linear-gradient(135deg, rgba(124, 92, 255, .82), rgba(37, 215, 255, .72));
  color: #06101f;
  box-shadow: 0 12px 30px rgba(37, 215, 255, .16);
}

body.saas-v4 .brand strong {
  font-size: 17px;
}

body.saas-v4 .brand small {
  color: rgba(225, 234, 250, .55);
}

body.saas-v4 .nav {
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 999px;
  background: rgba(0,0,0,.14);
}

body.saas-v4 .nav a {
  padding: 9px 13px;
  border-radius: 999px;
  font-size: 13px;
  color: rgba(229, 238, 255, .72);
}

body.saas-v4 .nav a:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}

body.saas-v4 .btn {
  border-radius: 13px;
  font-weight: 780;
  letter-spacing: -.01em;
}

body.saas-v4 .btn.solid {
  color: #fff;
  background:
    linear-gradient(135deg, rgba(124, 92, 255, 1), rgba(37, 215, 255, .92));
  box-shadow: 0 14px 34px rgba(124, 92, 255, .24), inset 0 1px 0 rgba(255,255,255,.28);
}

body.saas-v4 .btn.solid:hover {
  box-shadow: 0 18px 42px rgba(37, 215, 255, .24), inset 0 1px 0 rgba(255,255,255,.32);
}

body.saas-v4 .btn.ghost {
  background: rgba(255,255,255,.045);
  border-color: rgba(205, 219, 246, .14);
}

body.saas-v4 .btn.ghost:hover {
  border-color: rgba(37, 215, 255, .3);
  background: rgba(37, 215, 255, .08);
}

body.saas-v4 .hero {
  min-height: calc(100svh - 98px);
  gap: 18px;
  padding-top: 20px;
}

body.saas-v4 .hero-copy {
  position: relative;
  overflow: hidden;
  padding: clamp(30px, 5vw, 64px);
  border-radius: 30px;
}

body.saas-v4 .hero-copy::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  background:
    radial-gradient(circle at 72% 24%, rgba(124, 92, 255, .28), transparent 38%),
    radial-gradient(circle at 18% 78%, rgba(37, 215, 255, .18), transparent 34%);
}

body.saas-v4 .hero-copy::after {
  content: "";
  position: absolute;
  right: -120px;
  top: 10%;
  width: 460px;
  height: 460px;
  border-radius: 999px;
  opacity: .55;
  background:
    radial-gradient(circle at 35% 35%, rgba(255,255,255,.55), rgba(37, 215, 255, .28) 22%, rgba(124, 92, 255, .22) 44%, transparent 67%);
  filter: blur(.2px);
  pointer-events: none;
}

body.saas-v4 .eyebrow {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  padding: 7px 10px;
  margin-bottom: 18px;
  border-radius: 999px;
  color: #c7f7ff;
  background: rgba(37, 215, 255, .08);
  border: 1px solid rgba(37, 215, 255, .16);
  letter-spacing: .14em;
}

body.saas-v4 .hero h1 {
  position: relative;
  z-index: 1;
  max-width: 880px;
  font-size: clamp(46px, 7.4vw, 92px);
  letter-spacing: -.075em;
}

body.saas-v4 .hero h1 span,
body.saas-v4 .section-head h2,
body.saas-v4 .panel h2,
body.saas-v4 .admin-top h1 {
  background: linear-gradient(105deg, #fff 6%, #eaf0ff 24%, var(--accent2) 48%, var(--accent) 76%, #fff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

body.saas-v4 .lead,
body.saas-v4 .panel p,
body.saas-v4 .section-head p,
body.saas-v4 .card p {
  color: rgba(214, 224, 242, .74);
}

body.saas-v4 .claim-box {
  position: relative;
  z-index: 1;
  max-width: 720px;
  background: rgba(255,255,255,.95);
  border: 1px solid rgba(255,255,255,.64);
  box-shadow: 0 18px 46px rgba(0,0,0,.28);
}

body.saas-v4 .claim-box input,
body.saas-v4 .claim-box select {
  color: #07111f;
}

body.saas-v4 .claim-box input::placeholder {
  color: #657187;
}

body.saas-v4 .claim-box select {
  background-color: rgba(246, 248, 252, .9);
  border-color: rgba(7, 17, 31, .08);
}

body.saas-v4 input,
body.saas-v4 select,
body.saas-v4 textarea {
  background-color: rgba(3, 8, 16, .46);
  border-color: rgba(206, 221, 247, .13);
  border-radius: 14px;
}

body.saas-v4 input:hover,
body.saas-v4 select:hover,
body.saas-v4 textarea:hover {
  border-color: rgba(206, 221, 247, .22);
}

body.saas-v4 input:focus,
body.saas-v4 select:focus,
body.saas-v4 textarea:focus {
  border-color: rgba(37, 215, 255, .58);
  box-shadow: 0 0 0 4px rgba(37, 215, 255, .11);
}

body.saas-v4 .domain-stage {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border-radius: 30px;
}

body.saas-v4 .domain-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,.07), transparent 42%),
    radial-gradient(circle at 50% 20%, rgba(37, 215, 255, .16), transparent 38%);
}

body.saas-v4 .orb {
  height: 260px;
  opacity: .95;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.96), rgba(37,215,255,.4) 18%, rgba(124,92,255,.28) 42%, transparent 70%);
}

body.saas-v4 .big-domain {
  position: relative;
  z-index: 1;
  padding: 18px;
  border-radius: 20px;
  background: rgba(0,0,0,.16);
  border: 1px solid rgba(255,255,255,.07);
}

body.saas-v4 .mini-stats span,
body.saas-v4 .card,
body.saas-v4 .metric,
body.saas-v4 .domain-item,
body.saas-v4 details,
body.saas-v4 .selected-zone,
body.saas-v4 .zone-card {
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.028));
  border-color: rgba(204, 219, 247, .12);
}

body.saas-v4 .cards.four {
  gap: 14px;
}

body.saas-v4 .card {
  min-height: 188px;
  transition: transform .22s ease, border-color .22s ease, background .22s ease;
}

body.saas-v4 .card:hover,
body.saas-v4 .metric:hover,
body.saas-v4 .domain-item:hover,
body.saas-v4 .zone-card:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 215, 255, .22);
}

body.saas-v4 .icon {
  border-radius: 14px;
  color: #dffbff;
  background: linear-gradient(135deg, rgba(124,92,255,.25), rgba(37,215,255,.16));
  border-color: rgba(37,215,255,.18);
}

body.saas-v4 .split {
  gap: 18px;
}

body.saas-v4 .panel {
  border-radius: 28px;
  padding: clamp(22px, 3vw, 34px);
}

body.saas-v4 pre {
  background: rgba(1, 5, 12, .44);
  border-color: rgba(206, 221, 247, .11);
}

body.saas-v4 .badge {
  border-radius: 999px;
  background: rgba(255,255,255,.055);
}

body.saas-v4 .badge.active {
  background: rgba(111, 243, 193, .1);
}

body.saas-v4 .badge.pending,
body.saas-v4 .badge.reviewing {
  background: rgba(255, 209, 102, .1);
}

body.saas-v4 .badge.error,
body.saas-v4 .badge.suspended,
body.saas-v4 .badge.blocked {
  background: rgba(255, 111, 145, .1);
}

/* Admin SaaS surface */
body.saas-v4.admin-body {
  background:
    radial-gradient(circle at 20% 0%, rgba(37,215,255,.13), transparent 28%),
    radial-gradient(circle at 100% 14%, rgba(124,92,255,.19), transparent 34%),
    linear-gradient(180deg, #050913 0%, #07101d 100%);
}

body.saas-v4 .admin-shell {
  width: min(100%, calc(100vw - 20px));
  max-width: calc(100vw - 20px);
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 14px;
}

body.saas-v4 .admin-sidebar {
  border-radius: 26px;
  padding: 18px;
  background: rgba(7, 12, 22, .78);
}

body.saas-v4 .side-nav {
  gap: 5px;
}

body.saas-v4 .side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  border-radius: 14px;
  color: rgba(224, 234, 252, .68);
}

body.saas-v4 .side-nav a::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(224, 234, 252, .32);
  box-shadow: 0 0 0 4px rgba(255,255,255,.02);
}

body.saas-v4 .side-nav a.active,
body.saas-v4 .side-nav a:hover {
  color: #fff;
  background: linear-gradient(135deg, rgba(124,92,255,.24), rgba(37,215,255,.08));
}

body.saas-v4 .side-nav a.active::before {
  background: var(--accent2);
  box-shadow: 0 0 0 4px rgba(37,215,255,.12);
}

body.saas-v4 .admin-top {
  border-radius: 26px;
  padding: 26px 28px;
  background:
    radial-gradient(circle at 80% 10%, rgba(124,92,255,.18), transparent 36%),
    rgba(10, 16, 28, .78);
}

body.saas-v4 .admin-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

body.saas-v4 .metric {
  border-radius: 22px;
  padding: 18px;
}

body.saas-v4 .metric strong {
  font-size: 34px;
}

body.saas-v4 .admin-section {
  margin-top: 14px;
}

body.saas-v4 .admin-form-grid,
body.saas-v4 .admin-form-grid-wide {
  gap: 10px;
}

body.saas-v4 .tag span {
  min-width: 72px;
  background: rgba(255,255,255,.045);
}

body.saas-v4 .tag input:checked + span {
  border-color: rgba(124,92,255,.58);
  background: linear-gradient(135deg, rgba(124,92,255,.34), rgba(37,215,255,.12));
}

body.saas-v4 .table-wrap {
  border-radius: 20px;
  background: rgba(2, 7, 15, .32);
}

body.saas-v4 table {
  min-width: 880px;
}

body.saas-v4 th {
  background: rgba(255,255,255,.035);
  color: rgba(210, 224, 248, .62);
  font-size: 11px;
}

body.saas-v4 td {
  color: rgba(242, 247, 255, .9);
}

body.saas-v4 tr {
  transition: background .18s ease;
}

body.saas-v4 tbody tr:hover {
  background: rgba(255,255,255,.025);
}

body.saas-v4 .dialog {
  background:
    radial-gradient(circle at 80% 0%, rgba(124,92,255,.22), transparent 38%),
    linear-gradient(180deg, rgba(14,22,38,.96), rgba(6,10,18,.94));
  border-color: rgba(205, 219, 246, .16);
}

body.saas-v4 .dialog-wide {
  width: min(880px, calc(100vw - 28px));
}

body.saas-v4 .dialog::backdrop {
  background: rgba(1, 4, 10, .7);
  backdrop-filter: blur(12px);
}

body.saas-v4 .footer {
  border-top: 1px solid rgba(255,255,255,.06);
  margin-top: 20px;
}

/* Compact responsiveness */
@media (max-width: 1180px) {
  body.saas-v4 .admin-shell {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  body.saas-v4 .admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  body.saas-v4 .admin-shell {
    grid-template-columns: 1fr;
  }

  body.saas-v4 .admin-sidebar {
    height: auto;
  }

  body.saas-v4 .side-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body.saas-v4 .hero {
    grid-template-columns: 1fr;
  }

  body.saas-v4 .domain-stage {
    min-height: 420px;
  }
}

@media (max-width: 720px) {
  body.saas-v4 .site-header {
    top: 8px;
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
  }

  body.saas-v4 .hero-copy::after {
    width: 280px;
    height: 280px;
    right: -110px;
  }

  body.saas-v4 .hero h1 {
    font-size: 42px;
  }

  body.saas-v4 .cards.four,
  body.saas-v4 .faq-grid,
  body.saas-v4 .admin-grid {
    grid-template-columns: 1fr;
  }

  body.saas-v4 .side-nav {
    grid-template-columns: 1fr 1fr;
  }

  body.saas-v4 .admin-actions,
  body.saas-v4 .header-actions {
    width: 100%;
  }

  body.saas-v4 .header-actions .theme-dot {
    display: none;
  }

  body.saas-v4 .claim-box {
    background: rgba(255,255,255,.94);
  }
}
