:root {
  --bg: #f5f4fa;
  --surface: #ffffff;
  --surface-2: #f8f7fc;
  --border: #e7e4f0;
  --border-strong: #d6d1e4;
  --text: #17132b;
  --muted: #6b6785;
  --faint: #9a96b0;
  --primary: #7c3aed;
  --primary-2: #db2777;
  --primary-soft: #f1eafe;
  --grad: linear-gradient(135deg, #7c3aed 0%, #c026d3 55%, #db2777 100%);
  --ok: #0f9f6e;
  --ok-soft: #e3f7ef;
  --warn: #b7791f;
  --warn-soft: #fdf3e1;
  --danger: #dc2626;
  --danger-soft: #fdeaea;
  --info: #2563eb;
  --info-soft: #e8f0fe;
  --side: #120b24;
  --side-text: #c9c3e0;
  --side-active: rgba(255, 255, 255, 0.08);
  --shadow: 0 1px 2px rgba(23, 19, 43, 0.04), 0 4px 16px rgba(23, 19, 43, 0.05);
  --radius: 14px;
  --c1: #7c3aed;
  --c2: #db2777;
  --c3: #0ea5e9;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0a18;
    --surface: #161226;
    --surface-2: #1c1730;
    --border: #2a2440;
    --border-strong: #3a3356;
    --text: #efedf7;
    --muted: #a39dbd;
    --faint: #6f6990;
    --primary: #a78bfa;
    --primary-soft: #261d45;
    --ok: #34d399;
    --ok-soft: #10291f;
    --warn: #fbbf24;
    --warn-soft: #2b2210;
    --danger: #f87171;
    --danger-soft: #2f1416;
    --info: #60a5fa;
    --info-soft: #132239;
    --side: #0a0714;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --c1: #a78bfa;
    --c2: #f472b6;
    --c3: #38bdf8;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 Inter, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
p { margin: 0; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.between { justify-content: space-between; }
.hidden { display: none !important; }

/* ---------- Botões e campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(124, 58, 237, .25); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.icon { width: 34px; padding: 0; }
.btn.block { width: 100%; height: 42px; }

label.field { display: flex; flex-direction: column; gap: 6px; }
label.field > span, .label { font-weight: 600; font-size: 13px; }
.hint { color: var(--muted); font-size: 12.5px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=search], select, textarea {
  width: 100%; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.counter { font-size: 11.5px; color: var(--faint); text-align: right; margin-top: -2px; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 38px; height: 22px; border-radius: 99px; background: var(--border-strong); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--primary-soft); }

.seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side {
  background: var(--side); color: var(--side-text); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: #fff; font-weight: 800; font-size: 17px; letter-spacing: -0.01em; }
.brand .logo { width: 32px; height: 32px; border-radius: 9px; background: var(--grad); display: grid; place-items: center; }
.brand .logo svg { width: 18px; height: 18px; color: #fff; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--side-text); font-weight: 550; }
.nav a:hover { background: var(--side-active); text-decoration: none; color: #fff; }
.nav a.on { background: var(--side-active); color: #fff; }
.nav a.on svg { color: #f0abfc; }
.nav svg { width: 18px; height: 18px; flex: none; }
.side .spacer { flex: 1; }
.side .me { display: flex; align-items: center; gap: 10px; padding: 10px; border-top: 1px solid rgba(255,255,255,.08); margin-top: 8px; }
.side .me .avatar { background: rgba(255,255,255,.12); color: #fff; }
.side .me b { color: #fff; font-weight: 600; display: block; font-size: 13px; }
.side .me small { color: var(--side-text); opacity: .7; font-size: 11.5px; display: block; overflow: hidden; text-overflow: ellipsis; }
.side .me .btn { color: var(--side-text); }
.side .me .btn:hover { background: var(--side-active); color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 28px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.topbar .menu { display: none; }
.content { padding: 26px 28px 60px; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 4px; }

.acc-select { display: flex; align-items: center; gap: 8px; }
.acc-select select { width: auto; min-width: 200px; height: 36px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 16px; }
.kpi { padding: 16px 18px; }
.kpi .label { color: var(--muted); font-weight: 550; font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.kpi .label svg { width: 15px; height: 15px; }
.kpi .value { font-size: 26px; font-weight: 750; letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--faint); font-size: 12px; margin-top: 2px; }

.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: var(--grad); flex: none; overflow: hidden; font-size: 13px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }
.avatar.ring { padding: 2px; background: linear-gradient(45deg, #f59e0b, #ef4444, #db2777, #7c3aed); }
.avatar.ring > * { border-radius: 50%; width: 100%; height: 100%; display: grid; place-items: center; background: var(--grad); border: 2px solid var(--surface); }

.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 11.5px; font-weight: 650; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.pill.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.pill.primary { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; background: var(--info-soft); color: var(--text); margin-bottom: 16px; border: 1px solid transparent; }
.banner svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--info); }
.banner.warn { background: var(--warn-soft); }
.banner.warn svg { color: var(--warn); }
.banner.danger { background: var(--danger-soft); }
.banner.danger svg { color: var(--danger); }
.banner.ok { background: var(--ok-soft); }
.banner.ok svg { color: var(--ok); }
.banner .grow p + p { margin-top: 4px; }

table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .ico { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; margin: 0 auto 14px; background: var(--primary-soft); color: var(--primary); }
.empty .ico svg { width: 26px; height: 26px; }
.empty h3 { color: var(--text); font-size: 16px; margin-bottom: 6px; }
.empty p { max-width: 420px; margin: 0 auto 16px; }

/* ---------- Gráfico ---------- */
.chart { width: 100%; height: 240px; display: block; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--faint); font-size: 11px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart-tip { position: absolute; pointer-events: none; background: var(--text); color: var(--surface); padding: 8px 10px; border-radius: 8px; font-size: 12px; white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .1s; z-index: 3; }

/* ---------- Atividade ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); align-items: flex-start; }
.feed li:last-child { border-bottom: 0; }
.feed .ev-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--muted); }
.feed .ev-ico svg { width: 16px; height: 16px; }
.feed .ev-ico.ok { background: var(--ok-soft); color: var(--ok); }
.feed .ev-ico.primary { background: var(--primary-soft); color: var(--primary); }
.feed .ev-ico.info { background: var(--info-soft); color: var(--info); }
.feed .ev-ico.danger { background: var(--danger-soft); color: var(--danger); }
.feed .ev-ico.warn { background: var(--warn-soft); color: var(--warn); }
.feed .ev-title { font-weight: 600; }
.feed .ev-detail { color: var(--muted); white-space: pre-wrap; word-break: break-word; margin-top: 2px; font-size: 13px; }
.feed time { color: var(--faint); font-size: 12px; white-space: nowrap; }

/* ---------- Automações ---------- */
.auto-list { display: grid; gap: 12px; }
.auto-item { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 16px; padding: 16px 18px; }
.auto-item .trig { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.auto-item .trig svg { width: 20px; height: 20px; }
.auto-item h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.auto-item .meta { color: var(--muted); font-size: 12.5px; margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.auto-stats { display: flex; gap: 22px; }
.auto-stats div { text-align: right; }
.auto-stats b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.auto-stats span { color: var(--faint); font-size: 11.5px; }
.auto-actions { display: flex; gap: 4px; align-items: center; }
.kw { display: inline-flex; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; color: var(--text); }

/* ---------- Editor ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.editor .sec { padding: 20px; }
.sec-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sec-title .n { width: 26px; height: 26px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); font-weight: 750; font-size: 13px; display: grid; place-items: center; flex: none; }
.sec-title h2 { flex: 1; }
.sec-body { display: flex; flex-direction: column; gap: 14px; }
.trigger-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.opt-card { border: 1.5px solid var(--border); border-radius: 12px; padding: 12px; cursor: pointer; background: var(--surface); text-align: left; font: inherit; color: var(--text); display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, background .15s; }
.opt-card:hover { border-color: var(--border-strong); }
.opt-card.on { border-color: var(--primary); background: var(--primary-soft); }
.opt-card svg { width: 20px; height: 20px; color: var(--primary); }
.opt-card b { font-size: 13px; }
.opt-card small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.media { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; cursor: pointer; border: 2px solid transparent; background: var(--surface-2); padding: 0; }
.media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media.on { border-color: var(--primary); }
.media .check { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.35); border: 2px solid #fff; display: grid; place-items: center; color: #fff; }
.media.on .check { background: var(--primary); }
.media .check svg { width: 12px; height: 12px; opacity: 0; }
.media.on .check svg { opacity: 1; }
.media .tag { position: absolute; left: 6px; bottom: 6px; font-size: 10px; font-weight: 700; background: rgba(0,0,0,.55); color: #fff; padding: 1px 6px; border-radius: 5px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 1px solid var(--border-strong); border-radius: 10px; min-height: 42px; align-items: center; background: var(--surface); }
.chips:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); font-weight: 600; font-size: 13px; }
.chip button { border: 0; background: transparent; color: inherit; cursor: pointer; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; padding: 0; }
.chip button:hover { background: rgba(124,58,237,.15); }
.chip button svg { width: 12px; height: 12px; }
.chips input { border: 0 !important; box-shadow: none !important; background: transparent !important; flex: 1; min-width: 140px; height: 28px; padding: 0 6px; }
.vars { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.vars button { border: 1px dashed var(--border-strong); background: transparent; color: var(--muted); border-radius: 7px; font: inherit; font-size: 12px; padding: 2px 8px; cursor: pointer; }
.vars button:hover { color: var(--primary); border-color: var(--primary); }
.sub-box { border: 1px solid var(--border); background: var(--surface-2); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.editor-foot { position: sticky; bottom: 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); padding: 14px 0; display: flex; gap: 10px; justify-content: flex-end; align-items: center; border-top: 1px solid var(--border); margin-top: 6px; z-index: 4; }

/* ---------- Celular (pré-visualização) ---------- */
.phone-wrap { position: sticky; top: 80px; }
.phone { width: 300px; margin: 0 auto; border-radius: 38px; padding: 10px; background: #0b0816; box-shadow: 0 20px 50px rgba(23, 19, 43, .25); }
.phone .screen { border-radius: 30px; overflow: hidden; background: #fff; color: #111; height: 590px; display: flex; flex-direction: column; }
.phone .ph-top { display: flex; align-items: center; gap: 9px; padding: 14px 14px 10px; border-bottom: 1px solid #efefef; font-size: 13px; }
.phone .ph-top .avatar { width: 30px; height: 30px; font-size: 11px; }
.phone .ph-top b { display: block; font-size: 13px; }
.phone .ph-top small { color: #8e8e8e; font-size: 11px; }
.phone .ph-body { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 7px; font-size: 13px; background: #fff; }
.phone .ph-body > * { flex-shrink: 0; }
.phone .ph-sep { text-align: center; color: #8e8e8e; font-size: 10.5px; margin: 6px 0 2px; text-transform: uppercase; letter-spacing: .04em; }
.bubble { max-width: 82%; padding: 8px 12px; border-radius: 18px; line-height: 1.38; white-space: pre-wrap; word-break: break-word; }
.bubble.them { background: #efefef; align-self: flex-start; border-bottom-left-radius: 6px; }
.bubble.me { background: linear-gradient(135deg, #7c3aed, #a21caf); color: #fff; align-self: flex-end; border-bottom-right-radius: 6px; }
.bubble.tpl { padding: 0; overflow: hidden; background: #efefef; color: #111; align-self: flex-end; border-bottom-right-radius: 6px; }
.bubble.tpl .t { padding: 9px 12px; }
.bubble.tpl .b { border-top: 1px solid #dcdcdc; padding: 8px 12px; text-align: center; color: #3b5bdb; font-weight: 600; background: #f7f7f7; }
.bubble.tpl .b + .b { border-top: 1px solid #e4e4e4; }
.ph-comment { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; }
.ph-comment .avatar { width: 26px; height: 26px; font-size: 10px; }
.ph-comment b { margin-right: 4px; }
.ph-comment.reply { margin-left: 30px; }
.ph-note { align-self: center; font-size: 10.5px; color: #8e8e8e; background: #f5f5f5; border-radius: 99px; padding: 3px 10px; }
.ph-input { margin: 8px 12px 14px; border: 1px solid #dbdbdb; border-radius: 99px; padding: 8px 14px; color: #8e8e8e; font-size: 12.5px; }

/* ---------- Contas ---------- */
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.acc-card { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.acc-card .top { display: flex; gap: 12px; align-items: center; }
.acc-card h3 { font-size: 15px; }
.acc-meter { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.acc-meter i { display: block; height: 100%; background: var(--grad); }
.acc-limits { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.acc-limits input { height: 34px; }
.acc-card .foot { display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 12px; }

/* ---------- Configurações ---------- */
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; background: var(--surface-2); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.steps > li { counter-increment: s; position: relative; padding-left: 38px; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); font-weight: 750; display: grid; place-items: center; font-size: 13px; }
.steps > li > b:first-child { display: block; margin-bottom: 3px; }
.steps ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(12, 8, 24, .55); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s; }
.modal { width: 100%; max-width: 860px; max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: 18px; border: 1px solid var(--border); box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.modal.sm { max-width: 440px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 20px; }
.sim { display: grid; grid-template-columns: 1fr 320px; gap: 22px; align-items: start; }
@keyframes fade { from { opacity: 0; } }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { background: radial-gradient(1200px 600px at -10% -10%, #7c3aed 0%, transparent 55%), radial-gradient(900px 600px at 110% 110%, #db2777 0%, transparent 55%), #120b24; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-hero h1 { font-size: 40px; line-height: 1.08; letter-spacing: -0.03em; font-weight: 800; max-width: 460px; }
.auth-hero p { color: #d7d0ef; max-width: 420px; margin-top: 14px; font-size: 15px; }
.auth-hero ul { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 10px; color: #ece8fb; }
.auth-hero li { display: flex; gap: 10px; align-items: center; }
.auth-hero li svg { width: 18px; height: 18px; color: #f0abfc; }
.auth-form { display: grid; place-items: center; padding: 32px 16px; background: var(--surface); }
.auth-form form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; }
.auth-form h2 { font-size: 22px; }
.google-btn { gap: 10px; background: #fff; color: #1f1f1f; border: 1px solid var(--border-strong); font-weight: 600; }
.google-btn:hover { background: #f7f7f9; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted, #8a84a3); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.err { color: var(--danger); font-size: 13px; min-height: 18px; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--text); color: var(--surface); padding: 11px 16px; border-radius: 11px; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: 380px; animation: fade .15s; font-weight: 550; }
.toast.err { background: var(--danger); color: #fff; }

.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--border); }

/* ---------- Responsivo ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .editor { grid-template-columns: minmax(0, 1fr); }
  .phone-wrap { position: static; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 250px; z-index: 30; transform: translateX(-100%); transition: transform .2s; }
  .shell.nav-open .side { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.4); }
  .topbar { padding: 0 16px; }
  .topbar .menu { display: inline-flex; }
  .content { padding: 20px 16px 60px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .auto-item { grid-template-columns: auto 1fr; }
  .auto-stats, .auto-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .auto-stats div { text-align: left; }
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 32px 20px; }
  .auth-hero h1 { font-size: 30px; }
  .sim { grid-template-columns: 1fr; }
  .acc-select select { min-width: 0; max-width: 170px; }
}
@media (max-width: 560px) {
  .hide-sm { display: none; }
  .topbar { gap: 8px; }
  .acc-select select { max-width: 200px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acc-grid { grid-template-columns: 1fr; }
  .phone { width: 100%; max-width: 300px; }
  .page-head .btn { flex: 1; }
}
