/* Growthwright Hub - colours from growthwright-website/BRAND.md */
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/static/hub/fonts/schibsted.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --navy: #0F172A;
  --navy-2: #1E293B;
  --coral: #FF5A5F;
  --coral-ink: #C2272D;
  --sky: #38BDF8;
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --text: #0F172A;
  --muted: #475569;
  --rule: #E2E8F0;
  --good: #15803D;
  --bad: #C2272D;
  --good-bg: #DCFCE7;
  --bad-bg: #FEE2E2;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1120; --card: #131C2E; --text: #E2E8F0; --muted: #94A3B8; --rule: #24324A;
    --coral-ink: #FF8A8E; --good: #4ADE80; --bad: #FF8A8E; --good-bg: #052E16; --bad-bg: #3B0A0C;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font: 15px/1.5 "Schibsted Grotesk", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
a { color: var(--coral-ink); }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--navy); color: #CBD5E1; padding: 20px 14px;
  display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 850; letter-spacing: -0.03em; font-size: 19px; padding: 4px 8px 18px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .crm-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: inherit; text-decoration: none; font-weight: 550;
}
.nav a:hover { background: var(--navy-2); color: #fff; }
.nav a[aria-current="page"] { background: var(--navy-2); color: #fff; box-shadow: inset 3px 0 0 var(--coral); }
.crm-link { margin-top: auto; background: var(--coral); color: var(--navy); font-weight: 750; }
.crm-link:hover { filter: brightness(1.06); }
.logout { background: none; border: 0; color: #94A3B8; padding: 8px 12px; text-align: left; cursor: pointer; }
.logout:hover { color: #fff; }
.main { padding: 32px clamp(16px, 4vw, 48px) 64px; max-width: 1180px; width: 100%; outline: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; height: auto; flex-direction: row; align-items: center; padding: 8px 10px; gap: 4px; z-index: 5; overflow-x: auto; }
  .brand span, .logout { display: none; }
  .brand { padding: 4px; }
  .nav { flex-direction: row; }
  .nav a, .crm-link { padding: 9px 10px; }
  .nav a span, .crm-link span { display: none; }
  .crm-link { margin: 0 0 0 auto; }
  .main { padding-top: 20px; }
}

/* ---------- page parts ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.page-head h1 { font-size: clamp(26px, 3.4vw, 34px); font-weight: 800; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 640px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.cols-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px; min-width: 0; }
.card h2 { font-size: 18px; font-weight: 750; margin-bottom: 12px; }
.card h3 { font-size: 15px; font-weight: 700; margin: 14px 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.stat .label { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat .value { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; margin-top: 4px; }
.stat .sub { font-size: 13px; color: var(--muted); }
.pos { color: var(--good); } .neg { color: var(--bad); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; align-content: start; }
.tile {
  display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--rule); text-decoration: none; color: inherit;
  transition: border-color .15s, transform .15s;
}
.tile:hover { border-color: var(--coral); transform: translateY(-2px); }
.tile strong { font-size: 16px; }
.tile span { color: var(--muted); font-size: 13px; }
.tile .ico { width: 36px; height: 36px; border-radius: 10px; background: color-mix(in srgb, var(--coral) 14%, transparent); color: var(--coral-ink); display: grid; place-items: center; }
.tile.dark { background: var(--navy); color: #fff; border-color: var(--navy); }
.tile.dark span { color: #CBD5E1; }
.tile.dark .ico { background: var(--coral); color: var(--navy); }
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } .tile:hover { transform: none; } }

/* ---------- forms ---------- */
label { display: block; font-weight: 650; font-size: 14px; margin-bottom: 6px; }
.hint { font-weight: 400; color: var(--muted); font-size: 13px; display: block; margin-top: 2px; }
input:not([type]), input[type=text], input[type=number], input[type=date], input[type=password],
input[type=email], input[type=tel], input[type=search], input[type=url], input[type=time], input[type=month], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 10px; background: var(--bg);
  min-height: 44px;
}
textarea { min-height: 88px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--sky); outline-offset: 2px;
}
.field { margin-bottom: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row > .grow { flex: 1 1 160px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--rule);
  cursor: pointer; font-weight: 550; font-size: 14px; background: var(--bg);
}
.chip input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip input:focus-visible + span { outline: 2px solid var(--sky); outline-offset: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 16px;
  border-radius: 10px; border: 1px solid var(--rule); background: var(--card); cursor: pointer; font-weight: 650;
  text-decoration: none; color: var(--text);
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--coral); border-color: var(--coral); color: var(--navy); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { border-color: transparent; background: none; }
.btn.danger { color: var(--bad); }
.btn.sm { min-height: 34px; padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- wizard ---------- */
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.steps button {
  border: 1px solid var(--rule); background: var(--card); border-radius: 999px; padding: 6px 12px; cursor: pointer;
  font-size: 13px; font-weight: 650; color: var(--muted);
}
.steps button[aria-current="step"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.steps button.done { color: var(--good); border-color: var(--good); }
.output { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--rule); border-radius: 10px; padding: 14px; font-size: 13.5px; max-height: 520px; overflow: auto; margin: 0; font-family: inherit; }
.out-item { border-top: 1px solid var(--rule); padding: 14px 0; }
.out-item:first-child { border-top: 0; padding-top: 0; }
.out-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.out-head strong { font-size: 14px; }
.saved-list { display: flex; flex-direction: column; gap: 6px; }
.saved-list .item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--rule); }
.saved-list .item button.open { flex: 1; text-align: left; background: none; border: 0; cursor: pointer; font-weight: 600; padding: 0; }

/* ---------- money ---------- */
.bar { height: 8px; border-radius: 99px; background: var(--rule); overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; background: var(--coral); border-radius: 99px; }
.bar.in i { background: var(--good); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
th { color: var(--muted); font-weight: 650; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tag { display: inline-block; font-size: 12px; font-weight: 650; padding: 2px 8px; border-radius: 99px; background: var(--bg); border: 1px solid var(--rule); color: var(--muted); }
.tag.in { background: var(--good-bg); color: var(--good); border-color: transparent; }
.tag.out { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.table-wrap { overflow-x: auto; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.seg label { margin: 0; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: 9px 14px; cursor: pointer; font-weight: 650; font-size: 14px; }
.seg input:checked + span { background: var(--navy); color: #fff; }

/* ---------- services ---------- */
.svc-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.svc-tabs button { border: 1px solid var(--rule); background: var(--card); padding: 8px 12px; border-radius: 10px; cursor: pointer; font-weight: 650; font-size: 14px; }
.svc-tabs button[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.price { color: var(--coral-ink); font-weight: 750; }
ul.plain { margin: 0; padding-left: 18px; }
ul.plain li { margin: 4px 0; }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li label { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; padding: 7px 0; cursor: pointer; margin: 0; }
.checks input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--coral); flex: none; }
.checks input:checked + span { color: var(--muted); text-decoration: line-through; }
.progress { font-size: 13px; font-weight: 700; color: var(--muted); }
.job { border: 1px solid var(--rule); border-radius: 12px; padding: 14px; margin-bottom: 10px; background: var(--card); }
.job summary { cursor: pointer; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; list-style: none; }
.job summary::-webkit-details-marker { display: none; }
.job summary strong { font-size: 15px; }
.job.done { opacity: .7; }

/* ---------- todos ---------- */
.todos { list-style: none; margin: 0; padding: 0; }
.todos li { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.todos li:last-child { border-bottom: 0; }
.todos input[type=checkbox] { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--coral); flex: none; }
.todos li.done span { text-decoration: line-through; color: var(--muted); }
.todos span { flex: 1; }

/* ---------- login + toasts ---------- */
.login { position: fixed; inset: 0; background: var(--navy); display: grid; place-items: center; padding: 16px; z-index: 20; }
.login-box { background: var(--card); border-radius: 18px; padding: 28px; width: min(380px, 100%); display: grid; gap: 10px; }
.login-box h1 { font-size: 22px; margin-bottom: 8px; }
.error { color: var(--bad); margin: 0; min-height: 1.2em; font-size: 14px; }
.toasts { position: fixed; bottom: 16px; right: 16px; left: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; z-index: 30; pointer-events: none; }
.toast { background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 10px; font-weight: 600; pointer-events: auto; display: flex; gap: 12px; align-items: center; max-width: 420px; }
.toast.error { background: var(--bad); }
.toast-action { background: none; border: 1px solid #fff6; color: #fff; border-radius: 8px; padding: 3px 8px; cursor: pointer; }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }

/* ---------- servers ---------- */
.warn { color: #B45309; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .warn { color: #FBBF24; } }
.meter { margin-bottom: 14px; }
.bar.pos i { background: var(--good); }
.bar.warn i { background: #F59E0B; }
.bar.neg i { background: var(--bad); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; background: currentColor; vertical-align: middle; }
.dot.pos { color: var(--good); } .dot.warn { color: #F59E0B; } .dot.neg { color: var(--bad); }
.svc-list { list-style: none; margin: 0; padding: 0; }
.svc-list li { display: flex; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.svc-list li:last-child { border-bottom: 0; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 6px; }
.kv div { display: flex; flex-direction: column; padding: 10px; border: 1px solid var(--rule); border-radius: 10px; }
.domains { border: 1px solid var(--rule); border-radius: 10px; padding: 12px; margin-bottom: 16px; }
.domains .tag { text-decoration: none; }
