/* webhostadmin admin panel. Tokens and components from docs/mockups/phase2-mockup-v2.html
   (palette taken from basbreet.nl: dark default + its light mode). */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080f19; --bg2: #0b1622; --card: #102333; --card2: #12293b; --sunk: #0c1a27;
  --line: #294050; --line2: #2e4a5c; --text: #eef7fb; --text2: #cedde6; --muted: #a3b7c7;
  --accent: #36dce9; --accent2: #87e5f0; --accent-ink: #062027; --soft: rgba(54, 220, 233, .10); --soft2: rgba(54, 220, 233, .18);
  --ok: #54d5a1; --ok-bg: rgba(84, 213, 161, .14); --warn: #f2c14e; --warn-bg: rgba(242, 193, 78, .14);
  --bad: #ed7383; --bad-bg: rgba(237, 115, 131, .14); --violet: #94b1e7; --violet-bg: rgba(148, 177, 231, .16);
  --shadow: 0 10px 30px rgba(0, 0, 0, .35); --glow: 0 0 0 3px rgba(54, 220, 233, .25);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fa; --bg2: #edf1f7; --card: #ffffff; --card2: #e9eff8; --sunk: #f1f4f9;
  --line: #cad3df; --line2: #b9c7d6; --text: #172538; --text2: #2c3c52; --muted: #566578;
  --accent: #267985; --accent2: #1f6570; --accent-ink: #ffffff; --soft: rgba(38, 121, 133, .08); --soft2: rgba(38, 121, 133, .16);
  --ok: #0f7a45; --ok-bg: #dcf3e7; --warn: #9a6700; --warn-bg: #fbf0d4; --bad: #b42318; --bad-bg: #fde4e1;
  --violet: #4b5fa8; --violet-bg: #e6ebf8; --shadow: 0 8px 24px rgba(23, 37, 56, .08); --glow: 0 0 0 3px rgba(38, 121, 133, .2);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
h1, h2, h3 { letter-spacing: -.3px; }
h3 { font-size: 15px; margin: 0 0 4px; }

/* buttons, pills */
.btn, button { display: inline-flex; align-items: center; gap: 6px; font: 600 14px Inter, system-ui, sans-serif; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover, button:hover { box-shadow: var(--glow); text-decoration: none; }
.btn.ghost, button.ghost { background: transparent; color: var(--text); border-color: var(--line2); }
.btn.outline, button.outline { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn.danger, button.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.sm, button.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
button:disabled, fieldset[disabled] button { opacity: .5; cursor: not-allowed; box-shadow: none; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ok { background: var(--ok-bg); color: var(--ok); }
.warn { background: var(--warn-bg); color: var(--warn); }
.bad { background: var(--bad-bg); color: var(--bad); }
.off { background: var(--sunk); color: var(--muted); border: 1px solid var(--line); }
.later { display: inline-block; background: var(--violet-bg); color: var(--violet); font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 1px 6px; border-radius: 999px; margin-left: 4px; vertical-align: middle; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.card > h4 { margin: 0; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 13px; letter-spacing: .02em; }
.pad { padding: 18px 20px; }
.mb { margin-bottom: 16px; }

/* forms */
label { display: block; font-weight: 600; margin: 14px 0 5px; font-size: 13px; }
.hint { color: var(--muted); font-size: 12px; font-weight: 400; }
.field-error { color: var(--bad); font-size: 12px; margin-top: 4px; }
input, select, textarea { width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line2); background: var(--sunk); color: var(--text); font: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--glow); }
input[aria-invalid="true"] { border-color: var(--bad); }
input:disabled, select:disabled { opacity: .55; cursor: not-allowed; }
.row { display: flex; gap: 14px; }
.row > * { flex: 1; min-width: 0; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.check input { width: auto; margin-top: 3px; accent-color: var(--accent); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset[disabled] { opacity: .6; }

/* tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--sunk); }
tr:last-child td { border-bottom: 0; }
.tbl { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); background: var(--card); }
table.kv th { width: 34%; text-transform: none; letter-spacing: 0; font-size: 13px; }
.bar { height: 7px; border-radius: 999px; background: var(--sunk); border: 1px solid var(--line); overflow: hidden; margin: 6px 0 2px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); border-radius: 999px; }
.bar i.w { background: var(--warn); }
.callout { border: 1px solid var(--line2); border-left: 3px solid var(--accent); background: var(--soft); padding: 10px 14px; border-radius: 10px; margin: 0 0 16px; }
.callout.warn { border-left-color: var(--warn); background: var(--warn-bg); }
.callout.bad { border-left-color: var(--bad); background: var(--bad-bg); }
.callout ul { margin: 6px 0 0; padding-left: 18px; }
pre { overflow: auto; background: var(--sunk); border: 1px solid var(--line); padding: 10px 12px; border-radius: 10px; font: 13px ui-monospace, Consolas, monospace; margin: 8px 0 0; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* layout: top bar + left rail (WHM style) */
.cp-top { display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: linear-gradient(90deg, var(--bg2), var(--card)); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 800; font-size: 18px; letter-spacing: -.3px; color: var(--text); min-width: 170px; }
.brand:hover { text-decoration: none; }
.brand span { color: var(--accent); }
.brand small { display: block; font-size: 10px; letter-spacing: .14em; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.cp-top .user { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.cp-top .user form { margin: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--soft2); color: var(--accent); display: grid; place-items: center; font-weight: 700; border: 1px solid var(--accent); text-transform: uppercase; }
.iconbtn { width: 34px; height: 34px; padding: 0; border-radius: 9px; border: 1px solid var(--line2); background: transparent; color: var(--text2); display: grid; place-items: center; cursor: pointer; font-size: 16px; }
.cp { display: flex; min-height: calc(100vh - 58px); }
.rail { width: 250px; flex-shrink: 0; border-right: 1px solid var(--line); background: var(--bg2); padding: 14px 10px; }
.rail a, .rail .dim { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; color: var(--text2); font-weight: 500; margin-bottom: 2px; }
.rail a:hover { background: var(--soft); text-decoration: none; }
.rail a.on { background: var(--soft2); color: var(--accent); }
.rail .dim { opacity: .55; cursor: default; }
.rail .sec { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 14px 12px 6px; }
.search { position: relative; margin-bottom: 10px; }
.search input { padding-left: 36px; background: var(--card); }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.cp-main { flex: 1; min-width: 0; padding: 22px 24px; }
.cp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.crumb { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--accent); }
h2.title { margin: 0 0 16px; font-size: 24px; letter-spacing: -.4px; }
.stat { padding: 10px 18px; border-bottom: 1px solid var(--line); }
.stat:last-child { border-bottom: 0; }
.stat .top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 16px 18px; }
.kpi .v { font-size: 26px; font-weight: 800; letter-spacing: -.6px; margin: 4px 0 2px; }
.whm-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.tool { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; color: var(--text); border: 1px solid var(--line); }
.tool:hover { background: var(--soft); border-color: var(--line2); text-decoration: none; }
.tool .ti { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--sunk); border: 1px solid var(--line); color: var(--accent); }
.secret { background: var(--sunk); border: 1px dashed var(--warn); border-radius: 10px; padding: 12px 14px; }
.login { max-width: 420px; margin: 64px auto; padding: 28px; }

@media (max-width: 1100px) { .cp-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .cp { flex-direction: column; }
  .rail { width: 100%; display: flex; flex-wrap: wrap; gap: 4px; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .rail .sec, .rail .search { display: none; }
  .rail a, .rail .dim { padding: 6px 10px; margin: 0; }
  .cp-top { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .brand { min-width: 0; }
  .cp-main { padding: 16px; }
  .row { flex-direction: column; gap: 0; }
  .login { margin: 24px 16px; padding: 20px; }
}
.qr { margin: 8px 0 12px; line-height: 0; }
.qr svg { max-width: 100%; height: auto; border-radius: 6px; }
