:root {
    --bg: #f6f7f9; --panel: #fff; --text: #16181d; --muted: #667085; --line: #e4e7ec;
    --brand: #5b3df5; --brand-ink: #fff; --ok: #12805c; --warn: #b54708; --bad: #b42318;
    --chip: #eef0f4;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1115; --panel: #171a21; --text: #eceef3; --muted: #98a2b3; --line: #262b36;
        --brand: #8b76ff; --brand-ink: #10111a; --ok: #4ade9a; --warn: #f5a524; --bad: #ff7b72;
        --chip: #222734;
    }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.brand { font-weight: 700; font-size: 17px; padding: 4px 10px 18px; }
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.side a.nav { display: block; padding: 9px 12px; border-radius: 8px; color: var(--text); margin-bottom: 2px; }
.side a.nav:hover { background: var(--chip); text-decoration: none; }
.side a.nav.on { background: var(--brand); color: var(--brand-ink); }
.side form { position: absolute; bottom: 18px; left: 14px; right: 14px; }
.main { padding: 26px 30px 60px; max-width: 1200px; width: 100%; }
h1 { font-size: 22px; margin: 0 0 4px; }
.sub { color: var(--muted); margin: 0 0 22px; }
.bar { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 18px; }
.card h2 { font-size: 15px; margin: 0 0 12px; }
.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.kpi b { display: block; font-size: 26px; line-height: 1.2; }
.kpi span { color: var(--muted); font-size: 13px; }
.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
.tablewrap { overflow-x: auto; }
.btn { display: inline-block; border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 8px; padding: 8px 14px; font: inherit; cursor: pointer; }
.btn:hover { background: var(--chip); text-decoration: none; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], select, textarea, input[type=file] {
    width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit;
}
textarea { min-height: 160px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.field { margin-bottom: 14px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 3px; }
.err { color: var(--bad); font-size: 13px; margin-top: 3px; }
.flash { background: color-mix(in srgb, var(--ok) 14%, transparent); border: 1px solid var(--ok); border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--chip); font-size: 12px; }
.chip.ok { color: var(--ok); } .chip.warn { color: var(--warn); } .chip.bad { color: var(--bad); }
.swatches { display: flex; }
.swatches i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--panel); margin-right: -6px; box-shadow: 0 0 0 1px var(--line); }
.colors { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.colorrow { display: flex; gap: 8px; } .colorrow input[type=color] { width: 44px; height: 38px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.formgrid { display: grid; grid-template-columns: 1fr 360px; gap: 18px; align-items: start; }
.preview { position: sticky; top: 20px; }
canvas.sim { width: 100%; aspect-ratio: 9 / 16; border-radius: 12px; border: 1px solid var(--line); display: block; background: #000; }
.thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--chip); }
.login { max-width: 380px; margin: 12vh auto; }
.funnelbar { height: 10px; border-radius: 6px; background: var(--brand); min-width: 2px; }
.drag { cursor: grab; color: var(--muted); user-select: none; }
.report li { margin-bottom: 2px; }
@media (max-width: 860px) {
    .shell { grid-template-columns: 1fr; }
    .side { position: static; height: auto; display: flex; flex-wrap: wrap; gap: 4px; padding: 10px; }
    .side form { position: static; margin-left: auto; }
    .brand { width: 100%; padding-bottom: 6px; }
    .main { padding: 18px 14px 50px; }
    .formgrid { grid-template-columns: 1fr; }
    .preview { position: static; }
}
