:root {
  --bg: #f1f3f6;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --nav: #0f1b2d;
  --nav-2: #16263d;
  --nav-text: #b6c2d4;
  --brand: #059669;
  --brand-strong: #047857;
  --brand-soft: #d1fae5;
  --brand-tint: #ecfdf5;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 16px rgba(15, 23, 42, .04);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220; --surface: #121c2e; --text: #e5edf7; --muted: #8b9bb2; --line: #22314a;
    --nav: #070d18; --nav-2: #0f1a2c; --brand: #10b981; --brand-strong: #059669;
    --brand-soft: #0d3b2e; --brand-tint: #0e2a24; --amber: #fbbf24; --amber-soft: #3a2c0b;
    --danger: #f87171; --danger-soft: #3b1418; --shadow: 0 1px 2px rgba(0,0,0,.3);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
a { color: var(--brand-strong); }
@media (prefers-color-scheme: dark) { a { color: #6ee7b7; } }
a.btn, a.tab, .nav a, .tabs a { text-decoration: none; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }
.side {
  background: linear-gradient(180deg, var(--nav), var(--nav-2));
  color: var(--nav-text); display: flex; flex-direction: column; padding: 18px 14px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; color: #fff; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: #10b981; display: grid; place-items: center; color: #062b1f; }
.brand-mark svg { width: 20px; height: 20px; fill: currentColor; stroke: none; }
.brand-name { font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.brand-name b { color: #34d399; font-weight: 800; }
.who { padding: 0 8px 14px; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 14px; }
.who strong { color: #fff; display: block; font-size: 14px; }
.nav-title { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #6b7d96; padding: 10px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px;
  color: var(--nav-text); text-decoration: none; font-weight: 500; margin-bottom: 2px;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: rgba(16,185,129,.16); color: #6ee7b7; box-shadow: inset 0 0 0 1px rgba(52,211,153,.35); }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.side-foot button {
  width: 100%; display: flex; align-items: center; gap: 10px; background: none; border: 0;
  color: var(--nav-text); padding: 9px 10px; border-radius: 10px;
}
.side-foot button:hover { background: rgba(255,255,255,.06); color: #fff; }
.main { padding: 28px 32px 48px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; color: var(--brand-strong); }
@media (prefers-color-scheme: dark) { .page-head h1 { color: #34d399; } }
.page-head p { margin: 2px 0 0; color: var(--muted); }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- componentes ---------- */
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.panel-pad { padding: 18px 20px; }
.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 14px 0; }
.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.stat-top { display: flex; align-items: center; gap: 10px; color: var(--text); }
.stat-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-strong); }
.stat-ico.amber { background: var(--amber-soft); color: var(--amber); }
.stat-ico.gray { background: var(--line); color: var(--muted); }
.stat-val { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.domain-hero { display: flex; align-items: center; gap: 14px; padding: 18px 20px; flex-wrap: wrap; }
.domain-hero .ico { width: 46px; height: 46px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-strong); display: grid; place-items: center; }
.domain-hero .ico svg { width: 24px; height: 24px; }
.domain-list { display: flex; flex-direction: column; gap: 8px; }
.domain-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.domain-row .name { font-family: var(--mono); font-size: 20px; font-weight: 700; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--brand-soft); color: var(--brand-strong); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.pending { background: var(--amber-soft); color: var(--amber); }
.chip.off { background: var(--line); color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 10px;
  border: 1px solid transparent; font-weight: 600; background: var(--brand); color: #fff; transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--brand-tint); color: var(--brand-strong); border-color: var(--brand-soft); }
@media (prefers-color-scheme: dark) { .btn.ghost { color: #6ee7b7; } }
.btn.plain { background: transparent; color: var(--text); border-color: var(--line); }
.btn.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn.sm { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn.icon { padding: 9px; }

label.field { display: block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }
.input, select.input {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
.input:focus, select.input:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: transparent; }
.input.mono { font-family: var(--mono); font-size: 14px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- abas de domínio ---------- */
.tabs { display: flex; align-items: stretch; overflow-x: auto; margin-bottom: 16px; padding: 0 6px; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 14px 16px; background: none; border: 0; white-space: nowrap;
  color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand-strong); border-bottom-color: var(--brand); }
@media (prefers-color-scheme: dark) { .tab.active { color: #34d399; } }
.tab .cnt { font-weight: 500; color: var(--muted); font-size: 12px; }
.tabs .end { margin-left: auto; display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; padding-left: 12px; white-space: nowrap; }
.tabs .end a.tab { color: var(--muted); }
.tabs .end a.tab:hover { color: var(--text); }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.card { overflow: hidden; position: relative; }
.card::before { content: ""; display: block; height: 4px; background: linear-gradient(90deg, #34d399, #f59e0b); }
.card.off::before { background: var(--line); }
.card.new::before { background: var(--brand); }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; }
.card-head .tag { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--muted); }
.host-box {
  margin: 0 16px; padding: 12px 14px; border: 1px dashed #6ee7b7; background: var(--brand-tint); border-radius: 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.host-box code { font-family: var(--mono); font-weight: 700; font-size: 14px; overflow-wrap: anywhere; min-width: 0; }
.host-box .btn { flex: none; }
.dest { padding: 12px 16px 0; }
.dest .k { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.dest .k svg { width: 12px; height: 12px; }
.dest .v { font-family: var(--mono); word-break: break-all; margin-top: 2px; }
.dest .v.empty { font-family: inherit; font-style: italic; color: var(--muted); }
.note-chip { margin: 12px 16px 0; padding: 8px 12px; border-radius: 10px; background: var(--amber-soft); color: var(--amber); font-weight: 500; font-size: 14px; }
.card-foot { padding: 12px 16px 16px; }
.card-body { border-top: 1px solid var(--line); margin-top: 14px; padding: 4px 16px 16px; }
.card-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 12px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.progress { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.suffix { display: flex; align-items: center; gap: 6px; }
.suffix span { font-family: var(--mono); color: var(--muted); white-space: nowrap; }
.history { margin-top: 12px; font-size: 12px; }
.history li { margin: 4px 0; color: var(--muted); word-break: break-all; }
.history ul { padding-left: 16px; margin: 6px 0 0; }

.banner { padding: 16px 20px; margin-bottom: 16px; border-radius: var(--radius); background: var(--amber-soft); color: var(--text); border: 1px solid rgba(180,83,9,.25); }
.banner h3 { color: var(--amber); font-size: 15px; margin-bottom: 4px; }
.banner.info { background: var(--brand-tint); border-color: var(--brand-soft); }
.banner.info h3 { color: var(--brand-strong); }
.rec { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 14px; background: var(--surface); border-radius: 10px; overflow: hidden; }
.rec th, .rec td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.rec th { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rec td { font-family: var(--mono); }

/* ---------- tabelas (admin) ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.num-input { width: 78px; padding: 6px 8px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.form-grid label.field { margin: 0 0 6px; }
.section-title { font-size: 16px; font-weight: 700; margin: 24px 0 10px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1000px 500px at 20% -10%, rgba(16,185,129,.22), transparent), linear-gradient(180deg, var(--nav), var(--nav-2)); }
.login .box { width: 100%; max-width: 380px; padding: 28px; }
.login .brand { justify-content: center; color: var(--text); padding-bottom: 6px; }
.login .brand-name b { color: var(--brand); }
.login p.sub { text-align: center; color: var(--muted); margin: 0 0 8px; }
.success { color: var(--brand-strong); background: var(--brand-tint); padding: 8px 12px; border-radius: 8px; font-size: 14px; margin-top: 12px; }
.error { color: var(--danger); background: var(--danger-soft); padding: 8px 12px; border-radius: 8px; font-size: 14px; margin-top: 12px; }

/* ---------- modal / toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(2,6,23,.55); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { width: 100%; max-width: 420px; padding: 22px; max-height: 92vh; overflow-y: auto; }
.modal.wide { max-width: 620px; }
.modal h3 { font-size: 18px; margin-bottom: 6px; }
.modal p { margin: 0 0 4px; color: var(--muted); }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: #0f172a; color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: 340px; font-size: 14px; border-left: 4px solid #10b981; }
.toast.error { border-left-color: #ef4444; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px; }
  .brand { padding: 0 8px 0 4px; }
  .who, .nav-title { display: none; }
  .nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .side-foot { margin: 0 0 0 auto; padding: 0; border: 0; }
  .side-foot button { padding: 8px; }
  .side-foot button span { display: none; }
  .main { padding: 18px 14px 40px; }
}

/* ---------- passo a passo ---------- */
.steps { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.step { display: flex; gap: 12px; align-items: flex-start; }
.step-n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; margin-top: 1px; }
.step-body { min-width: 0; flex: 1; font-size: 14px; }
.step-body > b { display: block; margin-bottom: 2px; }
.guide-box { margin: 10px 0 2px; padding: 14px 16px; border-radius: 12px; background: var(--brand-tint); border: 1px solid var(--brand-soft); }
.banner .steps { margin-bottom: 14px; }
.copycell { display: inline-flex; align-items: center; gap: 8px; }
.btn.icon-only { padding: 3px 6px; border-radius: 6px; }
.btn.icon-only svg { width: 14px; height: 14px; }
.rec { max-width: 520px; }
@media (max-width: 520px) { .rec th, .rec td { padding: 8px 6px; } .rec td { font-size: 13px; } .guide-box { padding: 12px; } .copycell { gap: 4px; } }

/* ---------- planos, pagamentos, admin ---------- */
.banner.danger { background: var(--danger-soft); border-color: rgba(220,38,38,.3); }
.banner.danger h3 { color: var(--danger); }
.banner .btn.sm { display: inline-flex; }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.brand-tag { margin-left: 4px; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; background: rgba(245,158,11,.18); color: #fbbf24; }
.login .brand-tag { color: var(--amber); background: var(--amber-soft); }
.switch-mode { text-align: center; margin-top: 16px; font-size: 14px; color: var(--muted); }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--line); }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 7px 14px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.seg button.on { background: var(--surface); color: var(--brand-strong); box-shadow: var(--shadow); }
@media (prefers-color-scheme: dark) { .seg button.on { color: #34d399; } }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; max-width: 760px; }
.plan { padding: 20px; display: flex; flex-direction: column; }
.plan.current { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft), var(--shadow); }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-head h3 { font-size: 18px; }
.plan-price { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin-top: 12px; }
.plan-price small { font-size: 14px; font-weight: 500; color: var(--muted); }
.plan-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; flex: 1; font-size: 14px; }
.plan-list li { display: flex; gap: 8px; align-items: flex-start; }
.plan-list svg { color: var(--brand); margin-top: 2px; width: 16px; height: 16px; }
.plan-list.compact { flex-direction: row; flex-wrap: wrap; gap: 6px 14px; }
.prov { padding: 18px 20px; margin-bottom: 16px; }
.prov-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.prov-head h3 { font-size: 18px; }
.secret-set { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-left: 6px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.urlbox { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px dashed var(--brand); border-radius: 10px; background: var(--brand-tint); font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.plan-edit { padding: 16px 18px; margin-bottom: 12px; }
.plan-edit.inactive { opacity: .65; }
.secret-box { padding: 14px; border-radius: 10px; background: var(--brand-tint); border: 1px solid var(--brand-soft); margin-top: 12px; }
.secret-box code { font-family: var(--mono); font-size: 15px; font-weight: 700; word-break: break-all; letter-spacing: .05em; }
.stat.money .stat-val { color: var(--brand-strong); }

/* ---------- logo ---------- */
.brand { flex-wrap: wrap; }
.brand-plate { background: #fff; border-radius: 12px; padding: 8px 12px; display: flex; align-items: center; gap: 10px; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.brand-plate.text { padding: 4px 10px 4px 6px; }
.brand-plate.text .brand-name { color: #0f172a; }
.brand-plate.text .brand-name b { color: #059669; }
.brand-img { display: block; height: 30px; width: auto; max-width: 170px; object-fit: contain; }
.login .brand { padding-bottom: 14px; }
.login .brand-plate { padding: 6px 10px; box-shadow: none; }
.login .brand-img { height: 44px; max-width: 250px; }
.logo-preview { display: inline-flex; padding: 14px 18px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.logo-preview img { display: block; height: 56px; width: auto; max-width: 100%; }

/* ---------- cadastro / captcha ---------- */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.captcha { display: flex; justify-content: center; margin-top: 16px; min-height: 65px; }
.captcha-note { text-align: center; font-size: 12px; color: var(--muted); margin-top: 6px; }
.sent-ico { width: 56px; height: 56px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong); display: grid; place-items: center; margin: 4px auto 14px; }
.sent-ico svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.login h2 { text-align: center; margin: 0 0 6px; font-size: 20px; }
.login .link-row { text-align: right; margin-top: 6px; font-size: 13px; }
.btn.link { background: none; border: 0; color: var(--brand-strong); padding: 0; cursor: pointer; font: inherit; text-decoration: underline; }
