/* HostBMS — "Nebula" client area theme. Dark glassy blue; tokens match docs/SPEC.md (Look and feel). */

:root {
  --bg-base: #070E1F;
  --bg-base-2: #0C1A36;
  --bg-elevated: #0F1E3D;
  --glass-panel: rgba(20, 40, 80, 0.55);
  --glass-solid: #132544;
  --glass-border: rgba(120, 170, 255, 0.18);
  --accent: #3B8BFF;
  --accent-glow: #5AA8FF;
  --text-primary: #E6EEFF;
  --text-muted: #8FA3C8;
  --success: #2FD18A;
  --warning: #FFB547;
  --danger: #FF5C7A;
  --info: #38C6F4;
  --radius: 10px;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh; display: flex; flex-direction: column;
  font: 15px/1.55 var(--font-ui); color: var(--text-primary);
  background:
    radial-gradient(ellipse 80% 50% at 15% -5%, rgba(59, 139, 255, 0.22), transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(56, 198, 244, 0.12), transparent 60%),
    radial-gradient(ellipse at 50% 0%, var(--bg-base-2), var(--bg-base) 70%) fixed, var(--bg-base);
}
a { color: var(--accent-glow); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 10px; font-weight: 650; line-height: 1.25; }
h1 { font-size: 26px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 12px; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.mono { font-family: var(--font-mono); }
.center { text-align: center; }
.text-right { text-align: right; }
.mt { margin-top: 16px; }
.prewrap { white-space: pre-wrap; }
:focus-visible { outline: 2px solid var(--accent-glow); outline-offset: 2px; box-shadow: 0 0 0 4px rgba(90, 168, 255, 0.4); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.glass {
  background: var(--glass-solid); border: 1px solid var(--glass-border); border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(120, 170, 255, 0.12), 0 10px 30px rgba(0, 0, 0, 0.35);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--glass-panel); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); }
}
@media (prefers-reduced-transparency: reduce) {
  .glass { background: var(--glass-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(15, 30, 61, 0.92); border-bottom: 1px solid var(--glass-border); }
@supports (backdrop-filter: blur(1px)) { .site-header { background: rgba(15, 30, 61, 0.7); backdrop-filter: blur(14px); } }
.header-inner { max-width: 1240px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 17px; color: var(--text-primary); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 24px; height: 24px; border-radius: 7px; background: linear-gradient(135deg, var(--accent-glow), var(--accent) 55%, #1C4FB8); box-shadow: 0 0 14px rgba(59, 139, 255, 0.6); }
.topnav { display: flex; flex-wrap: wrap; gap: 2px; flex: 1; }
.topnav a { padding: 8px 12px; border-radius: 8px; color: var(--text-muted); font-weight: 500; }
.topnav a:hover, .topnav a.active { color: var(--text-primary); background: rgba(59, 139, 255, 0.14); text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.cart-link { position: relative; }
.cart-count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; font-size: 11px; line-height: 18px; text-align: center; background: var(--accent); color: #fff; }
.inline-form { display: inline; margin: 0; }
.currency-form select { width: auto; padding: 5px 8px; }

/* Layout */
.page { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 28px 20px 40px; }
.with-sidebar { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: start; }
.sidebar .panel { margin-bottom: 16px; }
.sidebar .panel h3 { padding: 12px 16px; margin: 0; border-bottom: 1px solid var(--glass-border); }
.sidebar ul { list-style: none; margin: 0; padding: 6px; }
.sidebar li a { display: flex; justify-content: space-between; padding: 8px 10px; border-radius: 6px; color: var(--text-primary); }
.sidebar li a:hover, .sidebar li a.active { background: rgba(59, 139, 255, 0.16); text-decoration: none; }
.panel { padding: 18px 20px; margin-bottom: 18px; }
.panel-flush { padding: 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.site-footer { border-top: 1px solid var(--glass-border); padding: 18px 20px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* Hero */
.hero { text-align: center; padding: 56px 20px 40px; }
.hero h1 { font-size: 40px; letter-spacing: -0.02em; }
.hero p { font-size: 18px; color: var(--text-muted); max-width: 620px; margin: 0 auto 22px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.tile { display: block; padding: 20px; color: var(--text-primary); }
.tile:hover { text-decoration: none; border-color: rgba(90, 168, 255, 0.5); transform: translateY(-1px); }
.tile h3 { font-size: 17px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { display: flex; flex-direction: column; padding: 16px 18px; color: var(--text-primary); }
.stat:hover { text-decoration: none; border-color: rgba(90, 168, 255, 0.5); }
.stat-value { font: 650 28px/1.2 var(--font-mono); }
.stat-label { color: var(--text-muted); }

/* Order form templates */
.products { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.product-card { display: flex; flex-direction: column; padding: 22px; position: relative; }
.product-card.featured { border-color: rgba(90, 168, 255, 0.7); box-shadow: 0 0 0 1px rgba(90, 168, 255, 0.4), 0 14px 40px rgba(59, 139, 255, 0.25); }
.product-card .badge-ribbon { position: absolute; top: -11px; left: 22px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--accent); color: #fff; }
.price { margin: 10px 0 14px; }
.price .amount { font: 700 32px/1.1 var(--font-mono); }
.price .per { color: var(--text-muted); }
.features { list-style: none; padding: 0; margin: 0 0 18px; flex: 1; }
.features li { padding: 6px 0 6px 22px; position: relative; border-top: 1px solid var(--glass-border); }
.features li::before { content: ""; position: absolute; left: 2px; top: 13px; width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); }
.product-list .row { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-top: 1px solid var(--glass-border); }
.product-list .row:first-child { border-top: 0; }
.product-list .row .grow { flex: 1; }
.compare th, .compare td { text-align: center; }
.compare td:first-child, .compare th:first-child { text-align: left; }
.compare .featured-col { background: rgba(59, 139, 255, 0.1); }

/* Tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--glass-border); vertical-align: top; }
table.data th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
table.data tbody tr:hover { background: rgba(59, 139, 255, 0.06); }
table.data .num { text-align: right; font-family: var(--font-mono); white-space: nowrap; }
table.data .empty { color: var(--text-muted); text-align: center; padding: 26px; }

/* Forms */
input[type="text"], input[type="search"], input[type="password"], input[type="email"], input[type="number"], input[type="tel"], input[type="date"], select, textarea {
  width: 100%; padding: 9px 12px; color: var(--text-primary); font: inherit;
  background: rgba(7, 14, 31, 0.6); border: 1px solid var(--glass-border); border-radius: 8px;
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(90, 168, 255, 0.35); }
textarea { min-height: 90px; resize: vertical; }
label { display: block; margin: 12px 0 6px; color: var(--text-muted); font-weight: 500; }
.check { display: flex; align-items: center; gap: 8px; margin: 10px 0; color: var(--text-primary); font-weight: 400; }
.check input { width: auto; margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; align-items: center; }
.help { color: var(--text-muted); font-size: 13px; margin: 4px 0 0; }
.text-danger { color: var(--danger); }
fieldset { border: 1px solid var(--glass-border); border-radius: 8px; padding: 8px 16px 14px; margin: 14px 0; }
legend { color: var(--text-muted); padding: 0 6px; font-weight: 600; }
.choice { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 12px; margin: 6px 0; border: 1px solid var(--glass-border); border-radius: 8px; color: var(--text-primary); font-weight: 400; }
.choice:hover { border-color: rgba(90, 168, 255, 0.5); }
.choice input { width: auto; margin: 0 8px 0 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 8px; border: 1px solid transparent;
  font: 600 15px var(--font-ui); cursor: pointer; color: var(--text-primary); text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 13px 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); box-shadow: 0 0 18px rgba(59, 139, 255, 0.4); color: #fff; }
.btn-primary:hover { background: var(--accent-glow); }
.btn-ghost { background: transparent; border-color: var(--glass-border); color: var(--text-muted); }
.btn-ghost:hover { color: var(--text-primary); border-color: var(--accent); }
.btn-success { background: rgba(47, 209, 138, 0.18); color: var(--success); border-color: rgba(47, 209, 138, 0.5); }
.btn-danger { background: rgba(255, 92, 122, 0.16); color: var(--danger); border-color: rgba(255, 92, 122, 0.45); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-success { color: var(--success); background: rgba(47, 209, 138, 0.14); }
.badge-warning { color: var(--warning); background: rgba(255, 181, 71, 0.14); }
.badge-danger { color: var(--danger); background: rgba(255, 92, 122, 0.14); }
.badge-info { color: var(--info); background: rgba(56, 198, 244, 0.14); }
.badge-muted { color: var(--text-muted); background: rgba(143, 163, 200, 0.14); }

.alert { padding: 11px 14px; border-radius: 8px; margin-bottom: 12px; }
.alert-success { color: #C9F7E2; background: rgba(47, 209, 138, 0.14); border: 1px solid rgba(47, 209, 138, 0.4); }
.alert-info { color: #CDEFFC; background: rgba(56, 198, 244, 0.12); border: 1px solid rgba(56, 198, 244, 0.4); }
.alert-warning { color: #FFE7C2; background: rgba(255, 181, 71, 0.12); border: 1px solid rgba(255, 181, 71, 0.4); }
.alert-danger { color: #FFD0D9; background: rgba(255, 92, 122, 0.14); border: 1px solid rgba(255, 92, 122, 0.4); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 18px; margin: 8px 0; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; text-align: right; }
.totals { max-width: 380px; margin-left: auto; }
.auth-wrap { max-width: 440px; margin: 20px auto; }
.auth-split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.summary { position: sticky; top: 80px; }
.gateway-instructions { padding: 12px 14px; border-radius: 8px; background: rgba(7, 14, 31, 0.5); border: 1px solid var(--glass-border); }
.invoice-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.status-big { font-size: 22px; font-weight: 700; }

@media (max-width: 900px) {
  .with-sidebar, .auth-split { grid-template-columns: 1fr; }
  .summary { position: static; }
  .hero h1 { font-size: 30px; }
}
.reply-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.reply-head .small { margin-left: auto; }
.reply.staff { border-left: 3px solid var(--accent); }
.reply-body h2 { margin-top: 18px; }
.reply-body pre { overflow-x: auto; padding: 12px; border-radius: 8px; background: rgba(7, 14, 31, 0.6); }
.reply-body code { font-family: var(--font-mono); font-size: 13px; padding: 1px 5px; border-radius: 4px; background: rgba(7, 14, 31, 0.6); }
.reply-body pre code { padding: 0; background: none; }
.divider { border: 0; border-top: 1px solid var(--glass-border); margin: 20px 0; }
input[type="file"] { color: var(--text-muted); }

/* Section tabs inside a module panel (e.g. KarnakPanel: Overview, Domains, DNS...) */
.subtabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 16px; border-bottom: 1px solid var(--glass-border); }
.subtabs a { padding: 8px 12px; color: var(--text-muted); text-decoration: none; }
.subtabs a:hover { color: var(--text-primary); }
.subtabs a.active { color: var(--text-primary); box-shadow: inset 0 -2px 0 var(--accent); }
.panel details > summary { list-style: none; cursor: pointer; display: inline-block; }
.panel details > summary::-webkit-details-marker { display: none; }
.panel details[open] > form { margin-top: 10px; text-align: left; }
