/* ============================================================================
 * ZKNesia Billing - Monospace Tech UI Theme
 * Inspired by modern developer tools with clean monospace aesthetics
 * Supports dark/light mode with smooth transitions
 * ========================================================================== */

:root {
  /* Dark Mode (Default) */
  --bg: #070707;
  --surface: #0b0b0b;
  --surface-2: #0f0f0f;
  --text: #fefefe;
  --muted: #8f8f8f;
  --subtle: #5f5f5f;
  --line: #1d1d1d;
  --line-strong: #2d2d2d;
  --ok: #fefefe;
  --brand: #9C27F5;
  --brand-dark: #7B1FAB;
  --brand-glow: rgba(156, 39, 245, 0.12);
  --luxury: #C9A24B;
  --luxury-dark: #9A7D54;
  
  /* Status colors */
  --success: #10b981;
  --success-tint: rgba(16, 185, 129, .12);
  --warning: #f59e0b;
  --warning-tint: rgba(245, 158, 11, .12);
  --danger: #f04438;
  --danger-tint: rgba(240, 68, 56, .12);
  --info: #3b82f6;
  --info-tint: rgba(59, 130, 246, .12);
  
  /* Aliases for compatibility */
  --primary: #9C27F5;
  --primary-2: #a855f7;
  --primary-3: #7B1FAB;
  --primary-tint: rgba(156, 39, 245, 0.12);
  --primary-line: rgba(156, 39, 245, 0.32);
  --primary-glow: rgba(156, 39, 245, 0.35);
  --accent: #22d3ee;
  
  --border: #1d1d1d;
  --border-soft: #1a1a1a;
  --border-strong: #2d2d2d;
  
  --bg-2: #0b0b0b;
  
  /* Shape */
  --radius: 9px;
  --radius-sm: 7px;
  --radius-lg: 16px;
  
  /* Typography */
  --font-sans: "Geist Mono", "JetBrains Mono", "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --font-mono: "Geist Mono", "JetBrains Mono", "IBM Plex Mono", monospace;
  
  /* Shadows */
  --shadow: 0 1px 1px rgba(0, 0, 0, .16), 0 3px 6px -2px rgba(0, 0, 0, .28);
  --shadow-lg: 0 6px 14px -4px rgba(0, 0, 0, .3), 0 28px 64px -22px rgba(0, 0, 0, .72);
  --rim: inset 0 1px 0 rgba(255, 255, 255, .05);
}

/* Light Mode */
:root[data-theme="light"] {
  --bg: #FAF8F5;
  --surface: #F5F3EF;
  --surface-2: #F0EDE8;
  --text: #1C1917;
  --muted: #6B6662;
  --subtle: #A39D98;
  --line: #E0DCD5;
  --line-strong: #D4CFC7;
  --ok: #1C1917;
  --brand: #9C27F5;
  --brand-dark: #7B1FAB;
  --brand-glow: rgba(156, 39, 245, 0.08);
  --luxury: #B8976A;
  --luxury-dark: #9A7D54;
  
  --primary: #9C27F5;
  --primary-2: #a855f7;
  --primary-3: #7B1FAB;
  --primary-tint: rgba(156, 39, 245, 0.08);
  --primary-line: rgba(156, 39, 245, 0.25);
  --primary-glow: rgba(156, 39, 245, 0.25);
  
  --border: #E0DCD5;
  --border-soft: #E8E4DD;
  --border-strong: #D4CFC7;
  
  --bg-2: #F5F3EF;
  
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.06);
  --rim: inset 0 1px 0 rgba(255, 255, 255, .3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: -0.02em;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::selection {
  background: var(--text);
  color: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--brand);
}

img, svg, video, canvas {
  max-width: 100%;
  height: auto;
}

::selection {
  background: rgba(156, 39, 245, .38);
  color: #fff;
}

/* -- Container & Layout ---------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-shell {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 28px 32px 56px;
}

/* -- Typography ------------------------------------------------------------ */
h1, h2, h3, h4, h5, h6, p {
  margin-top: 0;
}

h1 {
  margin-bottom: 24px;
  font-size: clamp(48px, 8vw, 112px);
  line-height: 0.92;
  letter-spacing: -0.09em;
  font-weight: 700;
}

h2 {
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1;
  letter-spacing: -0.07em;
  font-weight: 700;
}

h3 {
  font-size: 17px;
  line-height: 1.15;
  letter-spacing: -0.05em;
  font-weight: 700;
}

.heading-mega {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.section-title {
  font-size: 1.42rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.mono {
  font-family: var(--font-mono);
  font-feature-settings: "zero" 1;
}

.muted {
  color: var(--muted);
}

.gradient-text, .text-animate {
  color: var(--brand);
}

/* -- Tags & Labels --------------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* -- Badges & Pills -------------------------------------------------------- */
.badge, .pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 29px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-icon {
  color: var(--brand);
  font-size: 12px;
  line-height: 1;
}

.pill {
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.74rem;
  gap: 6px;
}

.pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pill-pending {
  background: var(--warning-tint);
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.28);
}

.pill-active {
  background: var(--success-tint);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.28);
}

.pill-suspended {
  background: var(--danger-tint);
  color: #fb7185;
  border-color: rgba(240, 68, 56, 0.28);
}

.pill-expired, .pill-cancelled {
  background: rgba(139, 147, 161, 0.14);
  color: var(--muted);
  border-color: rgba(139, 147, 161, 0.22);
}

.pill-info {
  background: var(--info-tint);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.28);
}

.pill-live::before {
  animation: live-pulse 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes live-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(16, 185, 129, 0);
  }
}

/* -- Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 43px;
  padding: 0 17px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  user-select: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--brand);
  color: var(--text);
  border-color: var(--brand);
}

.btn-primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.btn-secondary, .btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line-strong);
}

.btn-secondary:hover, .btn-ghost:hover {
  border-color: var(--text);
}

.btn-danger {
  background: transparent;
  color: #fca5a5;
  border-color: rgba(240, 68, 56, 0.42);
}

.btn-danger:hover {
  background: var(--danger-tint);
  color: #fecaca;
}

.btn-success {
  background: var(--success);
  color: #04241a;
}

.btn-success:hover {
  background: #0ea371;
  color: #fff;
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 0 22px;
  min-height: 48px;
  font-size: 13px;
}

.btn-sm {
  padding: 0 14px;
  min-height: 36px;
  font-size: 11px;
}

/* -- Cards ----------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}

.card:hover {
  border-color: var(--line-strong);
}

.card-pad {
  padding: 24px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-2);
}

.panel-head h3 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.panel-body {
  padding: 18px;
}

.panel-body.flush {
  padding: 0;
  overflow-x: auto;
}

/* -- Terminal Card (New from Concept) -------------------------------------- */
.terminal-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}

.terminal-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.terminal-body {
  padding: 16px 14px 18px;
}

.terminal-body p {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
}

.terminal-body p + p {
  margin-top: 7px;
}

.terminal-body .ok {
  color: var(--brand);
}

.terminal-body .cursor::after {
  content: "_";
  margin-left: 4px;
  color: var(--brand);
  animation: cursor-blink 1.2s infinite;
}

@keyframes cursor-blink {
  0%, 49% {
    opacity: 1;
  }
  50%, 100% {
    opacity: 0;
  }
}

/* -- Ticker Animation (New from Concept) ----------------------------------- */
.ticker {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
  white-space: nowrap;
}

.ticker-track {
  display: flex;
  width: max-content;
  min-width: 300%;
  animation: ticker-scroll 24s linear infinite;
  will-change: transform;
}

.ticker:hover .ticker-track {
  animation-play-state: paused;
}

.ticker-group {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.ticker-group span {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 30px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  white-space: nowrap;
  text-transform: uppercase;
}

.ticker-group span::after {
  content: "";
  position: absolute;
  right: 0;
  width: 4px;
  height: 4px;
  border: 1px solid var(--subtle);
  transform: rotate(45deg);
}

@keyframes ticker-scroll {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-33.3333%, 0, 0);
  }
}

/* -- Product Strip / Tables (New from Concept) ----------------------------- */
.product-strip {
  margin-top: 92px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}

.strip-head, .strip-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  min-height: 46px;
  padding: 0 16px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.strip-head {
  border-bottom: 1px solid var(--line);
  color: var(--subtle);
  text-transform: uppercase;
}

.strip-row {
  color: var(--text);
  border-bottom: 1px solid var(--line);
}

.strip-row:last-child {
  border-bottom: 0;
}

.status::before {
  content: "?";
  margin-right: 8px;
  font-size: 8px;
  color: var(--brand);
}

/* -- Tables ---------------------------------------------------------------- */
.table, .table-clean {
  width: 100%;
  border-collapse: collapse;
}

.table th, .table-clean th {
  text-align: left;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  padding: 12px 18px;
  background: var(--bg-2);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
}

.table td, .table-clean td {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  vertical-align: middle;
}

.table-clean tbody tr {
  transition: background 0.12s;
}

.table-clean tbody tr:hover {
  background: var(--surface-2);
}

.table-clean tr:last-child td {
  border-bottom: none;
}

/* -- Forms ----------------------------------------------------------------- */
.field {
  margin-bottom: 16px;
}

.label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 7px;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.input, .select, textarea.input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}

@media (min-width: 768px) {
  .input, .select, textarea.input {
    font-size: 0.92rem;
  }
}

.input::placeholder, textarea.input::placeholder {
  color: var(--subtle);
}

.input:hover:not(:focus), .select:hover:not(:focus) {
  border-color: var(--line-strong);
}

.input:focus, .select:focus, textarea.input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--primary-tint);
}

.select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238f8f8f' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--muted);
}

.checkbox-row input {
  margin-top: 3px;
  accent-color: var(--brand);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* -- Navigation ------------------------------------------------------------ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 13, 17, 0.72);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--line);
}

:root[data-theme="light"] .nav {
  background: rgba(250, 248, 245, 0.72);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.12rem;
  letter-spacing: -0.03em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
  transition: color 0.15s, background 0.15s;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--surface);
}

/* -- Topbar ---------------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  min-height: 88px;
}

.meta-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.meta-line strong {
  color: var(--text);
  font-weight: 500;
}

/* -- Theme Toggle Button --------------------------------------------------- */
.theme-toggle {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
}

:root[data-theme="light"] .theme-toggle {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* -- Portal Layout (Sidebar + Main) ---------------------------------------- */
.portal {
  display: grid;
  grid-template-columns: 258px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding-top: max(18px, env(safe-area-inset-top));
}

.sidebar .brand {
  margin-bottom: 22px;
  padding: 6px 8px;
}

.sidebar .brand img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.side-label {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--subtle);
  padding: 16px 12px 7px;
  font-weight: 600;
  font-family: var(--font-mono);
}

.side-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.89rem;
  margin-bottom: 1px;
  transition: background 0.12s, color 0.12s;
}

.side-link:hover {
  background: var(--surface);
  color: var(--text);
}

.side-link.active {
  background: var(--primary-tint);
  color: #fff;
}

.side-link.active::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
}

.side-link .ic {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.15s;
}

.side-link.active .ic {
  color: var(--brand);
}

.side-link:hover .ic {
  transform: translateX(2px);
}

.side-link .ic svg {
  width: 18px;
  height: 18px;
}

.side-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
}

.side-bal {
  margin-left: auto;
  font-size: 0.66rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--success-tint);
  color: #34d399;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-family: var(--font-mono);
}

.portal-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.portal .topbar {
  height: 62px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(15, 18, 23, 0.72);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: auto;
}

:root[data-theme="light"] .portal .topbar {
  background: rgba(250, 248, 245, 0.72);
}

.portal .topbar .page-title {
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}

.acct-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color 0.15s;
}

.acct-chip:hover {
  border-color: var(--line-strong);
}

.acct-chip .av {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--brand);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
}

.acct-chip .av-img {
  object-fit: cover;
}

.portal-body {
  padding: 28px 24px;
  flex: 1;
  min-width: 0;
}

/* -- Stats Cards ----------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stats > div {
  padding: 24px 20px;
  border-right: 1px solid var(--line);
}

.stats > div:last-child {
  border-right: 0;
}

.stat-number {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.05em;
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}

.stat-card {
  position: relative;
  padding: 20px;
  display: grid;
  grid-template-areas: "icon ." "value value" "label label";
  grid-template-columns: auto 1fr;
  row-gap: 6px;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-line);
  box-shadow: var(--shadow-lg);
}

.stat-card .si-wrap {
  grid-area: icon;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
}

.stat-card .sv {
  grid-area: value;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-top: 14px;
  font-variant-numeric: tabular-nums;
}

.stat-card .sl {
  grid-area: label;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.si-wrap.violet {
  background: var(--primary-tint);
  color: var(--brand);
}

.si-wrap.green {
  background: var(--success-tint);
  color: #34d399;
}

.si-wrap.amber {
  background: var(--warning-tint);
  color: var(--warning);
}

.si-wrap.cyan {
  background: var(--info-tint);
  color: #60a5fa;
}

.si-wrap.rose {
  background: var(--danger-tint);
  color: var(--danger);
}

/* -- Service Cards (Dashboard) --------------------------------------------- */
.svc-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.svc-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
  position: relative;
  overflow: hidden;
}

.svc-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-line);
  box-shadow: var(--shadow-lg);
}

.svc-card.is-suspended {
  opacity: 0.82;
}

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

.svc-card .svc-name {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.svc-card .svc-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 11px;
  background: var(--primary-tint);
  color: var(--brand);
  display: grid;
  place-items: center;
}

.svc-card .svc-icon svg {
  width: 20px;
  height: 20px;
}

.svc-card .svc-title {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 14ch;
}

.svc-card .svc-meta {
  display: grid;
  gap: 8px;
  font-size: 0.88rem;
}

.svc-card .svc-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.svc-card .svc-meta-row svg {
  width: 15px;
  height: 15px;
}

.svc-card .svc-actions {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
  margin-top: auto;
}

.svc-card .svc-actions .btn {
  flex: 1;
}

.text-warn {
  color: var(--warning);
  font-weight: 600;
}

/* -- Pricing Grid (from Concept) ------------------------------------------- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.price-card {
  min-height: 420px;
  padding: 22px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.price-card-featured {
  background: var(--surface);
  border-top: 2px solid var(--brand);
  box-shadow: 0 0 32px var(--brand-glow);
}

:root[data-theme="light"] .price-card-featured {
  box-shadow: 0 4px 24px var(--brand-glow), 0 0 0 1px var(--line);
}

.price-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 34px;
}

.price-card h3 {
  margin-bottom: 12px;
  font-size: 17px;
  line-height: 1.15;
  letter-spacing: -0.05em;
}

.price {
  margin-bottom: 28px;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.07em;
  font-weight: 700;
}

.price span {
  margin-left: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
}

.price-card ul {
  list-style: none;
  padding: 0;
  margin: 0 0 34px;
}

.price-card li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.price-card .btn {
  margin-top: auto;
}

/* -- Plan Cards (Original + Enhanced) -------------------------------------- */
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.plan-card-v2 {
  position: relative;
  padding: 26px 24px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.plan-card-v2:hover {
  transform: translateY(-4px);
  border-color: var(--primary-line);
  box-shadow: var(--shadow-lg);
}

.plan-card-v2.is-featured {
  border-color: var(--primary-line);
}

.plan-ribbon {
  position: absolute;
  top: 14px;
  right: -38px;
  background: var(--brand);
  color: #fff;
  font-size: 0.64rem;
  font-weight: 700;
  padding: 5px 44px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  transform: rotate(45deg);
}

.plan-ribbon.bs {
  background: var(--warning);
  color: #241a02;
}

.plan-card-v2 .plan-name {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.plan-card-v2 .plan-desc {
  color: var(--muted);
  font-size: 0.86rem;
  min-height: 36px;
  line-height: 1.5;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 6px;
}

.plan-price .nominal {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.plan-price .period {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.plan-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 18px;
  background: var(--primary-tint);
  border: 1px solid var(--primary-line);
  color: var(--brand);
  font-size: 30px;
  line-height: 1;
}

.specs-v2 {
  list-style: none;
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 4px 0 0;
}

.specs-v2 li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--muted);
}

.specs-v2 li b {
  color: var(--text);
  font-weight: 700;
}

.specs-v2 .spec-ic {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--primary-tint);
  color: var(--brand);
}

.specs-v2 .spec-ic svg {
  width: 14px;
  height: 14px;
}

.specs-v2 .spec-ic.ram {
  background: var(--info-tint);
  color: var(--info);
}

.specs-v2 .spec-ic.cpu {
  background: var(--warning-tint);
  color: var(--warning);
}

.specs-v2 .spec-ic.disk {
  background: var(--success-tint);
  color: var(--success);
}

.specs-v2 .spec-ic.port {
  background: var(--danger-tint);
  color: var(--danger);
}

/* -- Alerts ---------------------------------------------------------------- */
.alert {
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 16px;
  border: 1px solid;
  border-left-width: 3px;
}

.alert-success {
  background: var(--success-tint);
  border-color: rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.alert-error {
  background: var(--danger-tint);
  border-color: rgba(240, 68, 56, 0.3);
  color: #fca5a5;
}

.alert-info {
  background: var(--primary-tint);
  border-color: var(--primary-line);
  color: #b4aeff;
}

.alert-warning {
  background: var(--warning-tint);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fcd34d;
}

/* -- Modal ----------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 7, 11, 0.68);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: none;
  place-items: center;
  z-index: 100;
  padding: 20px;
}

.modal-overlay.open {
  display: grid;
}

.modal {
  width: 100%;
  max-width: 440px;
  padding: 26px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  animation: pop 0.18s ease;
}

@keyframes pop {
  from {
    transform: scale(0.97) translateY(6px);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal h2 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

/* -- FAQ Accordion --------------------------------------------------------- */
.faq {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  transition: border-color 0.2s;
}

.faq details[open] {
  border-color: var(--primary-line);
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.96rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.faq summary::after {
  content: '+';
  color: var(--brand);
  font-size: 1.2rem;
}

.faq details[open] summary::after {
  content: '-';
}

.faq .a {
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.6;
  font-size: 0.9rem;
}

/* -- Empty State ----------------------------------------------------------- */
.empty {
  text-align: center;
  padding: 56px 24px;
}

.empty .ei-wrap {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: var(--radius);
  background: var(--primary-tint);
  color: var(--brand);
  display: grid;
  place-items: center;
}

.empty .ei-wrap svg {
  width: 30px;
  height: 30px;
}

.empty h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

/* -- Footer ---------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 48px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
}

/* -- Layout Utilities ------------------------------------------------------ */
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 16px 0;
}

.grid {
  display: grid;
  gap: 18px;
}

.two-col {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 22px;
  align-items: start;
}

.flex {
  display: flex;
}

.gap {
  gap: 12px;
}

.wrap {
  flex-wrap: wrap;
}

.text-c {
  text-align: center;
}

.mb-0 {
  margin-bottom: 0;
}

.mt-2 {
  margin-top: 8px;
}

.mt-3 {
  margin-top: 16px;
}

.mt-4 {
  margin-top: 24px;
}

/* -- Dashboard Specific ---------------------------------------------------- */
.dash-hero {
  position: relative;
  overflow: hidden;
  padding: 30px;
}

.dash-hero h1 {
  font-size: clamp(1.45rem, 2.6vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.dash-hero p {
  color: var(--muted);
  font-size: 0.94rem;
  margin-top: 4px;
}

.dash-hero .wave {
  display: inline-block;
  animation: wave 1.6s ease-in-out infinite;
  transform-origin: 70% 70%;
}

@keyframes wave {
  0%, 60%, 100% {
    transform: rotate(0);
  }
  10%, 30%, 50% {
    transform: rotate(14deg);
  }
  20%, 40% {
    transform: rotate(-8deg);
  }
}

.hero-metrics {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.hero-metrics .hm {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-metrics .hm .v {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.hero-metrics .hm .l {
  color: var(--muted);
  font-size: 0.76rem;
}

.quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.qa-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
  font-size: 0.88rem;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}

.qa-btn:hover {
  border-color: var(--primary-line);
  background: var(--surface);
  transform: translateY(-1px);
}

.qa-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.15s;
}

.qa-btn:hover svg {
  transform: scale(1.08);
}

.qa-btn.primary {
  background: var(--brand);
  border-color: transparent;
  color: #fff;
}

.qa-btn.primary:hover {
  background: var(--brand-dark);
}

.balance-amount {
  font-size: 1.9rem;
  font-weight: 800;
  color: #34d399;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* -- Bento Layout (Dashboard) ---------------------------------------------- */
.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.b-4 {
  grid-column: span 4;
}

.b-8 {
  grid-column: span 8;
}

.b-12 {
  grid-column: span 12;
}

.side-tile {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* -- Responsive Design ----------------------------------------------------- */
.menu-toggle {
  display: none;
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 10, 0.62);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  z-index: 55;
}

.sidebar-backdrop.show {
  display: block;
}

@media (max-width: 980px) {
  .site-shell {
    padding: 24px 20px 44px;
  }

  .topbar {
    display: block;
  }

  .nav-links {
    margin-top: 18px;
  }

  .hero-grid, .section-head {
    grid-template-columns: 1fr;
  }

  .terminal-card {
    max-width: 100%;
  }

  .stats, .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .bento {
    grid-template-columns: 1fr;
  }

  .b-4, .b-8, .b-12 {
    grid-column: span 1;
  }
}

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

  .sidebar {
    position: fixed;
    left: -300px;
    width: 264px;
    z-index: 60;
    transition: left 0.2s;
  }

  .sidebar.open {
    left: 0;
  }

  .portal .topbar .menu-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  .acct-chip .av {
    margin: 0;
  }

  .acct-chip > div {
    display: none;
  }

  .portal .topbar {
    padding: 0 16px;
  }

  .portal-body {
    padding: 18px 16px;
  }

  .two-col {
    gap: 16px;
    grid-template-columns: 1fr;
  }

  .nav-links a:not(.btn) {
    display: none;
  }
}

@media (max-width: 768px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-card .sv {
    font-size: 1.45rem;
    margin-top: 10px;
  }

  .stat-card .sl {
    font-size: 0.76rem;
  }

  .stat-card .si-wrap {
    width: 38px;
    height: 38px;
  }

  .stat-card .si-wrap svg {
    width: 19px;
    height: 19px;
  }

  .svc-grid, .store-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .dash-hero {
    padding: 22px;
  }

  .dash-hero h1 {
    font-size: 1.3rem;
  }
}

@media (max-width: 640px) {
  .site-shell {
    padding-inline: 16px;
  }

  .container {
    padding: 0 16px;
  }

  .card-pad {
    padding: 18px;
  }

  h1 {
    font-size: 48px;
    letter-spacing: -0.08em;
  }

  .stats, .pricing-grid {
    grid-template-columns: 1fr;
  }

  .stats > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .stats > div:last-child {
    border-bottom: 0;
  }

  .strip-head, .strip-row {
    grid-template-columns: 1fr 1fr;
    row-gap: 4px;
    padding-block: 12px;
  }

  .footer {
    grid-template-columns: 1fr;
  }

  .btn {
    padding: 11px 16px;
  }

  .btn-lg {
    padding: 13px 20px;
  }

  .modal {
    max-width: 100%;
  }

  .balance-amount {
    font-size: 1.5rem;
  }

  .table-clean th, .table-clean td {
    padding: 11px 14px;
    font-size: 0.85rem;
  }

  .panel-head {
    padding: 13px 15px;
    flex-wrap: wrap;
    gap: 6px;
  }

  .panel-head h3 {
    font-size: 0.96rem;
  }
}

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

  .btn {
    padding: 10px 14px;
    font-size: 0.9rem;
  }

  .dash-hero h1 {
    font-size: 1.2rem;
  }

  .sidebar {
    width: 86vw;
  }

  .side-bal {
    display: none;
  }
}

@media (hover: none) and (pointer: coarse) {
  .btn, .qa-btn {
    min-height: 42px;
  }

  .btn-sm {
    min-height: 38px;
  }

  .side-link {
    padding: 12px;
  }

  select.select, .input {
    min-height: 44px;
  }
}

@media (hover: none) {
  .svc-card:hover, .stat-card:hover, .plan-card-v2:hover, .card:hover {
    transform: none;
  }
}

@media (min-width: 1600px) {
  .portal-body {
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }
}

/* -- Scrollbar ------------------------------------------------------------- */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

*::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 8px;
}

*::-webkit-scrollbar-thumb:hover {
  background: #43434e;
}

:root[data-theme="light"] *::-webkit-scrollbar-thumb {
  background: var(--line-strong);
}

:root[data-theme="light"] *::-webkit-scrollbar-thumb:hover {
  background: var(--line);
}

/* -- Focus Visible --------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 5px;
}

/* -- Animations ------------------------------------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s, transform 0.6s;
}

.reveal.reveal-in {
  opacity: 1;
  transform: none;
}

.zk-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s cubic-bezier(0.22, 0.9, 0.32, 1), transform 0.55s cubic-bezier(0.22, 0.9, 0.32, 1);
}

.zk-reveal.is-in {
  opacity: 1;
  transform: none;
}

@keyframes zk-fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.portal-body > * {
  animation: zk-fade-up 0.45s cubic-bezier(0.22, 0.9, 0.32, 1) both;
}

.portal-body > *:nth-child(1) {
  animation-delay: 0s;
}

.portal-body > *:nth-child(2) {
  animation-delay: 0.05s;
}

.portal-body > *:nth-child(3) {
  animation-delay: 0.10s;
}

.portal-body > *:nth-child(4) {
  animation-delay: 0.15s;
}

.portal-body > *:nth-child(5) {
  animation-delay: 0.20s;
}

.stats > *, .svc-grid > * {
  animation: zk-fade-up 0.5s cubic-bezier(0.22, 0.9, 0.32, 1) both;
}

.stats > *:nth-child(1), .svc-grid > *:nth-child(1) {
  animation-delay: 0.04s;
}

.stats > *:nth-child(2), .svc-grid > *:nth-child(2) {
  animation-delay: 0.08s;
}

.stats > *:nth-child(3), .svc-grid > *:nth-child(3) {
  animation-delay: 0.12s;
}

.stats > *:nth-child(4), .svc-grid > *:nth-child(4) {
  animation-delay: 0.16s;
}

/* -- Reduced Motion -------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .wave {
    animation: none !important;
  }

  .ticker-track {
    animation: none !important;
  }
}

/* -- Safe Area Insets (Mobile) --------------------------------------------- */
.portal .topbar {
  padding-top: env(safe-area-inset-top);
  height: calc(62px + env(safe-area-inset-top));
}

.footer {
  padding-bottom: max(28px, env(safe-area-inset-bottom));
}

.portal-body {
  padding-bottom: max(28px, env(safe-area-inset-bottom));
}

/* -- Light Mode Enhancements ----------------------------------------------- */
:root[data-theme="light"] .terminal-card,
:root[data-theme="light"] .product-strip,
:root[data-theme="light"] .card {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

:root[data-theme="light"] .price-card-featured .pill {
  background: var(--luxury);
  color: var(--bg);
  border-color: var(--luxury);
}

/* -- Additional Utilities -------------------------------------------------- */
.inline-link {
  color: var(--brand);
  font-weight: 600;
}

.inline-link:hover {
  text-decoration: underline;
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  animation: live-pulse 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  vertical-align: middle;
}

.live-dot.warn {
  background: var(--warning);
}

.live-dot.down {
  background: var(--danger);
}
