/* VSS portal — apeAxe design language (apeaxe.ca CEO portal, scan.hodltalk.org, kolt.hodl2013.com):
   black canvas, flat square panels, orange "ape" + cyan "axe" accents, Space Grotesk / Inter / JetBrains Mono. */

:root {
  --black: #000;
  --white: #fff;
  --gray-400: #a3a3a3;
  --gray-500: #737373;
  --gray-700: #404040;
  --gray-800: #262626;
  --gray-900: #171717;
  --gray-950: #0a0a0a;

  --accent-ape: #ff9500;
  --accent-axe: #00d4ff;
  --accent-ape-dim: rgba(255, 149, 0, 0.12);
  --accent-axe-dim: rgba(0, 212, 255, 0.12);
  --success: #00ff88;
  --success-dim: rgba(0, 255, 136, 0.1);
  --error: #ff4444;
  --error-dim: rgba(255, 68, 68, 0.1);

  --bg: var(--black);
  --bg-subtle: var(--gray-950);
  --fg: var(--white);
  --fg-muted: var(--gray-400);
  --fg-subtle: var(--gray-500);
  --border: var(--gray-800);
  --border-subtle: var(--gray-900);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-display: "Space Grotesk", var(--font-sans);
  --font-mono: "JetBrains Mono", "Fira Code", monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: dark; -webkit-font-smoothing: antialiased; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}
::selection { background: var(--accent-ape); color: var(--black); }
a { color: var(--accent-axe); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--fg-muted); }
.subtle { color: var(--fg-subtle); }

/* Backdrop: kolt-style grid lines fading out, with an orange/cyan wash. */
.backdrop {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(50% 40% at 12% 0%, rgba(255, 149, 0, 0.10), transparent 70%),
    radial-gradient(45% 40% at 88% 4%, rgba(0, 212, 255, 0.08), transparent 70%);
}
.backdrop::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--border-subtle) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border-subtle) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(75% 60% at 50% 0%, #000, transparent 80%);
}

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 0.75rem; color: var(--fg); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--accent-ape); color: var(--accent-ape);
  font-family: var(--font-mono); font-weight: 600; font-size: 0.8rem;
}
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; letter-spacing: -0.02em; }
.brand-name .ape { color: var(--accent-ape); }
.brand-name .axe { color: var(--accent-axe); }
.brand-sub { display: block; font-family: var(--font-mono); font-size: 0.65rem; color: var(--fg-subtle); letter-spacing: 0.12em; text-transform: uppercase; }

/* ---------- labels, status ---------- */
.eyebrow {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fg-subtle); display: flex; align-items: center; gap: 0.5rem;
}
.eyebrow .bar { width: 18px; height: 1px; background: var(--accent-ape); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fg-subtle); display: inline-block; flex: none; }
.dot--on { background: var(--success); box-shadow: 0 0 8px rgba(0, 255, 136, 0.5); }
.dot--warn { background: var(--accent-ape); box-shadow: 0 0 8px rgba(255, 149, 0, 0.5); }
.dot--off { background: var(--error); }

.badge {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.15rem 0.5rem;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid var(--border); color: var(--fg-muted); white-space: nowrap;
}
.badge--ape { color: var(--accent-ape); border-color: rgba(255, 149, 0, 0.4); background: var(--accent-ape-dim); }
.badge--axe { color: var(--accent-axe); border-color: rgba(0, 212, 255, 0.4); background: var(--accent-axe-dim); }
.badge--ok { color: var(--success); border-color: rgba(0, 255, 136, 0.35); background: var(--success-dim); }
.badge--bad { color: var(--error); border-color: rgba(255, 68, 68, 0.4); background: var(--error-dim); }

/* ---------- forms & buttons ---------- */
.field { display: grid; gap: 0.4rem; }
.field label { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-muted); }
.input {
  width: 100%; padding: 0.75rem 0.9rem; background: var(--bg); border: 1px solid var(--border);
  color: var(--fg); outline: none; border-radius: 0; transition: border-color 150ms var(--ease);
}
.input:focus { border-color: var(--accent-ape); box-shadow: 0 0 0 3px var(--accent-ape-dim); }
textarea.input { min-height: 90px; resize: vertical; }
.hint { font-size: 0.8rem; color: var(--fg-subtle); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.7rem 1.2rem; border: 1px solid var(--border); background: transparent; color: var(--fg);
  cursor: pointer; font-weight: 500; font-size: 0.9rem; transition: all 150ms var(--ease); border-radius: 0;
}
.btn:hover { border-color: var(--fg-muted); }
.btn:disabled { opacity: 0.5; cursor: progress; }
.btn--primary { background: var(--accent-ape); border-color: var(--accent-ape); color: var(--black); font-weight: 600; }
.btn--primary:hover { background: #ffaa33; border-color: #ffaa33; }
.btn--axe { border-color: rgba(0, 212, 255, 0.5); color: var(--accent-axe); }
.btn--axe:hover { background: var(--accent-axe-dim); border-color: var(--accent-axe); }
.btn--danger:hover { border-color: var(--error); color: var(--error); }
.btn--sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }
.btn--block { width: 100%; }

.alert { padding: 0.75rem 0.9rem; border: 1px solid; font-size: 0.875rem; }
.alert--error { border-color: rgba(255, 68, 68, 0.45); background: var(--error-dim); color: #ff9a9a; }
.alert--ok { border-color: rgba(0, 255, 136, 0.35); background: var(--success-dim); color: var(--success); }
.alert--info { border-color: rgba(0, 212, 255, 0.35); background: var(--accent-axe-dim); color: var(--accent-axe); }

/* ---------- login ---------- */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { padding: clamp(2rem, 5vw, 4rem); display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--border-subtle); }
.auth-hero h1 { font-size: clamp(2.6rem, 6vw, 4.8rem); letter-spacing: -0.05em; margin: 1.5rem 0 1.25rem; font-weight: 400; }
.auth-hero h1 em { font-style: normal; color: var(--accent-ape); }
.auth-hero p { color: var(--fg-muted); max-width: 34rem; }
.spec-strip { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--border); margin-top: 2.5rem; max-width: 36rem; }
.spec-strip div { padding: 1rem; border-right: 1px solid var(--border); }
.spec-strip div:last-child { border-right: 0; }
.spec-strip b { display: block; font-family: var(--font-mono); font-size: 1.05rem; color: var(--accent-axe); font-weight: 500; }
.spec-strip span { font-size: 0.72rem; color: var(--fg-subtle); text-transform: uppercase; letter-spacing: 0.08em; }
.auth-foot { font-family: var(--font-mono); font-size: 0.7rem; color: var(--fg-subtle); display: flex; gap: 1.25rem; flex-wrap: wrap; margin-top: 2rem; }

.auth-panel { display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 400px; border: 1px solid var(--border); background: rgba(10, 10, 10, 0.85); backdrop-filter: blur(6px); }
.auth-card header { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.auth-card form { padding: 1.5rem; display: grid; gap: 1.1rem; }
.auth-card h2 { font-size: 1.6rem; }
.auth-card .note { padding: 1rem 1.5rem; border-top: 1px solid var(--border); font-size: 0.8rem; color: var(--fg-subtle); }

/* ---------- portal shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10; height: 64px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(1rem, 4vw, 2.5rem); border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(10px);
}
.who { display: flex; align-items: center; gap: 1rem; }
.who-text { text-align: right; line-height: 1.25; }
.who-text b { display: block; font-weight: 500; font-size: 0.9rem; }
.who-text span { font-family: var(--font-mono); font-size: 0.7rem; color: var(--fg-subtle); }

main.wrap > *, .cols > * { min-width: 0; }
main.wrap { max-width: 1240px; margin: 0 auto; padding: 2rem clamp(1rem, 4vw, 2.5rem) 4rem; display: grid; gap: 2rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 400; margin-top: 0.6rem; }
.page-head h1 em { font-style: normal; color: var(--accent-ape); }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); }
.kpi { background: var(--bg); padding: 1.1rem 1.25rem; display: grid; gap: 0.3rem; }
.kpi .v { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 500; color: var(--fg); }
.kpi .v.ape { color: var(--accent-ape); }
.kpi .v.axe { color: var(--accent-axe); }
.kpi .s { font-size: 0.78rem; color: var(--fg-subtle); }

.panel { border: 1px solid var(--border); background: rgba(10, 10, 10, 0.7); }
.panel-head {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--border); background: var(--bg-subtle);
}
.panel-head h2 { font-size: 1.05rem; font-weight: 500; letter-spacing: -0.01em; display: flex; align-items: center; gap: 0.6rem; }
.panel-head h2 .ic { color: var(--accent-ape); font-family: var(--font-mono); font-size: 0.8rem; }
.panel-body { padding: 1.25rem; }
.empty { padding: 1.5rem 1.25rem; color: var(--fg-subtle); font-size: 0.9rem; }

/* server card */
.server-grid { display: grid; grid-template-columns: 1.3fr 1fr; }
.server-specs { padding: 1.25rem; display: grid; gap: 1.1rem; border-right: 1px solid var(--border); }
.spec-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); }
.spec-tile { background: var(--bg); padding: 1rem 1.1rem; }
.spec-tile .k { font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--fg-muted); }
.spec-tile .n { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1.1; color: var(--accent-axe); letter-spacing: -0.03em; margin-top: 0.35rem; }
.spec-tile .u { font-family: var(--font-mono); font-size: 0.75rem; color: var(--fg-subtle); }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.9rem 1.5rem; padding-top: 1rem; border-top: 1px dashed var(--border); }
.fact .k { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-subtle); }
.fact .v { font-size: 0.9rem; word-break: break-word; }
.billing { padding: 1.25rem; display: grid; gap: 0.1rem; align-content: start; }
.bill-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border-subtle); font-size: 0.9rem; }
.bill-row:last-child { border-bottom: 0; }
.bill-row .k { color: var(--fg-muted); }
.bill-row .v { font-family: var(--font-mono); text-align: right; }
.strike { text-decoration: line-through; color: var(--fg-subtle); margin-right: 0.4rem; }
.due-box { margin-top: 0.8rem; padding: 1rem; border: 1px solid rgba(255, 149, 0, 0.4); background: var(--accent-ape-dim); display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.due-box .amt { font-family: var(--font-mono); font-size: 1.4rem; color: var(--accent-ape); }
.due-box.overdue { border-color: rgba(255, 68, 68, 0.5); background: var(--error-dim); }
.due-box.overdue .amt { color: var(--error); }

/* two-column area */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }

/* upgrade form */
.upgrade-form { display: grid; gap: 1rem; }
.presets { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  padding: 0.45rem 0.8rem; border: 1px solid var(--border); background: transparent; cursor: pointer;
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--fg-muted); transition: all 150ms var(--ease);
}
.chip:hover { border-color: var(--accent-axe); color: var(--accent-axe); }
.chip.on { border-color: var(--accent-axe); color: var(--accent-axe); background: var(--accent-axe-dim); }
.triple { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.preview { font-family: var(--font-mono); font-size: 0.8rem; color: var(--fg-muted); padding: 0.75rem; border: 1px dashed var(--border); }
.preview b { color: var(--accent-axe); font-weight: 500; }

/* lists */
.items { display: grid; }
.item { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-subtle); display: grid; gap: 0.5rem; }
.item:last-child { border-bottom: 0; }
.item-top { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.item-no { font-family: var(--font-mono); font-size: 0.85rem; color: var(--fg); }
.item-meta { font-size: 0.8rem; color: var(--fg-subtle); }
.item-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.quote-price { display: flex; gap: 1.5rem; flex-wrap: wrap; font-family: var(--font-mono); font-size: 0.85rem; }
.quote-price b { color: var(--accent-ape); font-weight: 500; }
.quote-card.open { border-left: 2px solid var(--accent-ape); }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th { text-align: left; font-family: var(--font-mono); font-weight: 500; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-subtle); padding: 0.7rem 1.25rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--border-subtle); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num { font-family: var(--font-mono); text-align: right; white-space: nowrap; }
th.num { text-align: right; }

/* password gate */
.gate { max-width: 460px; margin: 3rem auto; }
.gate form, .panel-body form { display: grid; gap: 1rem; }
td .mono { white-space: nowrap; }

/* staff: customer page & editor */
.back { display: inline-block; font-family: var(--font-mono); font-size: 0.75rem; margin-bottom: 0.9rem; }
.stack { display: grid; gap: 0; }
.stack > .panel + .panel { border-top: 0; }
.form-section { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-ape); padding-top: 0.25rem; }
.edit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.9rem; }
.form-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.kpi .v { overflow-wrap: anywhere; }

/* support thread */
.thread { max-height: 440px; overflow-y: auto; padding: 1.25rem; display: grid; gap: 0.9rem; align-content: start; border-bottom: 1px solid var(--border); }
.thread .empty { padding: 0; }
.msg { max-width: 78%; border: 1px solid var(--border); background: var(--bg); padding: 0.7rem 0.9rem; justify-self: start; }
.msg--staff { border-color: rgba(0, 212, 255, 0.3); }
.msg--mine { justify-self: end; border-color: rgba(255, 149, 0, 0.4); background: var(--accent-ape-dim); }
.msg-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; font-size: 0.78rem; margin-bottom: 0.3rem; }
.msg-head b { font-weight: 600; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.92rem; }
.thread-form { padding: 1.25rem; display: grid; gap: 0.75rem; }
.inbox-row { color: inherit; text-decoration: none; }
.inbox-row:hover { background: var(--bg-subtle); text-decoration: none; }
.inbox-snippet { color: var(--fg-muted); font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-badges { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* package history */
.changes { display: grid; gap: 0.35rem; }
.change { display: grid; grid-template-columns: 9rem auto auto 1fr; gap: 0.6rem; align-items: baseline; font-size: 0.88rem; }
.change .k { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-subtle); }
.change .from { color: var(--fg-subtle); text-decoration: line-through; }
.change .arrow { color: var(--fg-subtle); }
.change .to { color: var(--accent-axe); font-family: var(--font-mono); }

.mb-1 { margin-bottom: 1rem; }
.mb-half { margin-bottom: 0.4rem; }
.facts--flat { border-top: 0; padding-top: 0; }
.narrow { max-width: 460px; }

.cli { font-family: var(--font-mono); font-size: 0.78rem; color: var(--fg-muted); background: var(--bg); border: 1px solid var(--border-subtle); padding: 1rem; overflow-x: auto; white-space: pre; line-height: 1.7; }
.cli .c { color: var(--fg-subtle); }
.cli .p { color: var(--accent-ape); }

.toast {
  position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); z-index: 50;
  max-width: calc(100% - 2rem); padding: 0.75rem 1rem; background: var(--bg-subtle); border: 1px solid var(--accent-axe); color: var(--fg); font-size: 0.875rem;
}
.toast.err { border-color: var(--error); }

.site-foot { max-width: 1240px; margin: 0 auto; padding: 1.5rem clamp(1rem, 4vw, 2.5rem) 2.5rem; border-top: 1px solid var(--border-subtle); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-family: var(--font-mono); font-size: 0.7rem; color: var(--fg-subtle); }

@media (max-width: 960px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero { border-right: 0; border-bottom: 1px solid var(--border-subtle); }
  .server-grid, .cols { grid-template-columns: 1fr; }
  .server-specs { border-right: 0; border-bottom: 1px solid var(--border); }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .edit-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr; }
  .spec-tiles { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .triple { grid-template-columns: 1fr; }
  .edit-grid { grid-template-columns: 1fr; }
  .msg { max-width: 92%; }
  .change { grid-template-columns: 1fr auto auto; }
  .change .k { grid-column: 1 / -1; }
  .spec-strip { grid-template-columns: 1fr; }
  .spec-strip div { border-right: 0; border-bottom: 1px solid var(--border); }
  .who-text { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
