/* WEB TRAFFIC PRO — identidade visual própria: azul-noite + ciano elétrico + âmbar */
:root {
  --bg: #f4f6fa; --surface: #ffffff; --surface-2: #f8fafc; --line: #e3e8f0; --line-2: #eef2f7;
  --text: #0f1b2d; --muted: #5b6b82; --faint: #8a98ad;
  --side: #0b1424; --side-2: #121f36; --side-text: #c9d4e5; --side-muted: #7f8ea8;
  --brand: #0ea5c6; --brand-2: #0b87a3; --brand-soft: #e2f6fb; --accent: #f59e0b; --accent-soft: #fff4dc;
  --ok: #16a34a; --ok-soft: #e7f7ec; --warn: #d4a106; --warn-soft: #fff7d6; --err: #dc2626; --err-soft: #fdecec;
  --off: #8a94a6; --off-soft: #eef1f5; --proc: #2563eb; --proc-soft: #e6efff;
  --c1: #0ea5c6; --c2: #f59e0b; --c3: #8b5cf6; --c4: #ef4444; --c5: #10b981; --c6: #64748b; --c7: #ec4899;
  --radius: 12px; --radius-sm: 8px; --shadow: 0 1px 2px rgba(15,27,45,.05), 0 4px 16px rgba(15,27,45,.05);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0a111e; --surface: #111b2c; --surface-2: #0e1727; --line: #1f2d44; --line-2: #18243a;
  --text: #e6edf7; --muted: #9aabc4; --faint: #6d7f9a; --side: #070d18; --side-2: #0e1a2e;
  --brand-soft: #0b2d3a; --accent-soft: #3a2a08; --ok-soft: #0e2e1b; --warn-soft: #34290a; --err-soft: #3a1414; --off-soft: #1a2436; --proc-soft: #122447;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-2); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 750; } h2 { font-size: 18px; font-weight: 700; } h3 { font-size: 15px; font-weight: 650; }
small, .muted { color: var(--muted); } .faint { color: var(--faint); }
code, .mono { font-family: Consolas, "Cascadia Mono", ui-monospace, monospace; font-size: 12.5px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: linear-gradient(180deg, var(--side), var(--side-2)); color: var(--side-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 30; }
.brand { padding: 20px 18px 14px; display: flex; gap: 10px; align-items: center; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: conic-gradient(from 210deg, var(--brand), #22d3ee, var(--accent), var(--brand)); display: grid; place-items: center; box-shadow: 0 0 0 3px rgba(14,165,198,.18); }
.brand-mark svg { width: 20px; height: 20px; color: #06121f; }
.brand-name { font-weight: 800; letter-spacing: .06em; font-size: 14px; color: #fff; }
.brand-sub { font-size: 10.5px; letter-spacing: .14em; color: var(--side-muted); text-transform: uppercase; }
.nav { padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-label { font-size: 10.5px; letter-spacing: .14em; color: var(--side-muted); text-transform: uppercase; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--side-text); font-weight: 550; text-decoration: none; position: relative; transition: background .15s, color .15s; }
.nav a svg { width: 18px; height: 18px; opacity: .8; flex: none; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: rgba(14,165,198,.14); color: #fff; }
.nav a.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--brand); }
.nav .count { margin-left: auto; font-size: 11px; background: rgba(255,255,255,.1); border-radius: 20px; padding: 1px 8px; }
.side-foot { padding: 12px 14px 16px; border-top: 1px solid rgba(255,255,255,.07); font-size: 12px; color: var(--side-muted); }
.side-status { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.crumbs { color: var(--muted); font-size: 13px; } .crumbs b { color: var(--text); font-weight: 600; }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; }
.content { padding: 26px 28px 60px; max-width: 1500px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--brand-2); text-transform: uppercase; margin-bottom: 6px; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head .eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: .13em; color: var(--brand-2); text-transform: uppercase; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }

.kpi { padding: 16px 18px; position: relative; overflow: hidden; }
.kpi .label { color: var(--muted); font-size: 12.5px; display: flex; gap: 6px; align-items: center; }
.kpi .label svg { width: 15px; height: 15px; color: var(--brand-2); }
.kpi .value { font-size: 26px; font-weight: 750; margin-top: 6px; letter-spacing: -.02em; }
.kpi .delta { font-size: 12px; font-weight: 600; margin-top: 2px; }
.delta.up { color: var(--ok); } .delta.down { color: var(--err); } .delta.flat { color: var(--faint); }
.kpi::after { content: ""; position: absolute; right: -24px; top: -24px; width: 80px; height: 80px; border-radius: 50%; background: var(--brand-soft); opacity: .6; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 600 13px var(--font); cursor: pointer; white-space: nowrap; transition: transform .06s, background .15s, border-color .15s, box-shadow .15s; text-decoration: none; }
.btn:hover { border-color: #c8d2e1; background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; } .btn.sm svg { width: 14px; height: 14px; }
.btn.icon { width: 34px; padding: 0; } .btn.sm.icon { width: 28px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(14,165,198,.25); } .btn.primary:hover { background: var(--brand-2); }
.btn.go { background: var(--ok); border-color: var(--ok); color: #fff; } .btn.go:hover { filter: brightness(.95); }
.btn.warn { background: var(--accent); border-color: var(--accent); color: #1f1300; }
.btn.danger { color: var(--err); border-color: #f3c4c4; } .btn.danger:hover { background: var(--err-soft); }
.btn.ghost { border-color: transparent; background: transparent; } .btn.ghost:hover { background: var(--line-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.loading { pointer-events: none; opacity: .7; }
.btn.loading::after { content: ""; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 650; padding: 3px 9px; border-radius: 20px; background: var(--off-soft); color: var(--muted); white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.st-active { background: var(--ok-soft); color: var(--ok); } .st-paused { background: var(--warn-soft); color: #a07800; } .st-error { background: var(--err-soft); color: var(--err); }
.st-disabled, .st-stopped, .st-archived { background: var(--off-soft); color: var(--off); } .st-processing { background: var(--proc-soft); color: var(--proc); }
.st-processing::before { animation: pulse 1.2s ease-in-out infinite; }
.pill-ok { background: var(--ok-soft); color: var(--ok); } .pill-err { background: var(--err-soft); color: var(--err); } .pill-warn { background: var(--warn-soft); color: #a07800; } .pill-info { background: var(--brand-soft); color: var(--brand-2); }
@keyframes pulse { 50% { opacity: .3; } }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--off); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); } .dot.err { background: var(--err); box-shadow: 0 0 0 3px var(--err-soft); } .dot.warn { background: var(--warn); }
.dot.live { background: var(--ok); animation: pulse 1.6s infinite; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label-sm { font-size: 12.5px; font-weight: 600; color: var(--text); }
.field .hint { font-size: 12px; color: var(--muted); }
input[type=text], input[type=url], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], select, textarea {
  font: 14px var(--font); color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; width: 100%; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,165,198,.15); }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input[type=number] { width: 96px; text-align: right; }
.search { position: relative; } .search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); } .search input { padding-left: 33px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cdd5e1; border-radius: 22px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--brand); } .switch input:checked + span::before { transform: translateX(16px); }

/* slider sincronizado */
.slider-row { display: grid; grid-template-columns: minmax(180px, 1.1fr) minmax(160px, 2fr) 110px; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.slider-row:last-child { border-bottom: 0; }
.slider-row .t { font-weight: 650; } .slider-row .s { font-size: 12px; color: var(--muted); }
.slider-row .num { display: flex; align-items: center; gap: 6px; justify-content: flex-end; } .slider-row .num span { color: var(--muted); font-size: 12px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--brand) var(--p, 50%), var(--line) var(--p, 50%)); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); cursor: pointer; }

.tabs { display: flex; gap: 4px; background: var(--line-2); padding: 4px; border-radius: 10px; flex-wrap: wrap; }
.tabs button { border: 0; background: transparent; font: 600 12.5px var(--font); color: var(--muted); padding: 6px 12px; border-radius: 7px; cursor: pointer; }
.tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
.t th { text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 650; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); position: sticky; top: 0; }
.t td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.t tr:hover td { background: var(--surface-2); }
.t td.num, .t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.t .clip { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); max-height: 560px; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }
.empty svg { width: 34px; height: 34px; color: var(--faint); margin-bottom: 8px; }

.notice { display: flex; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--brand-soft); border: 1px solid rgba(14,165,198,.25); font-size: 13px; }
.notice svg { width: 18px; height: 18px; flex: none; color: var(--brand-2); margin-top: 1px; }
.notice.warn { background: var(--accent-soft); border-color: rgba(245,158,11,.35); } .notice.warn svg { color: #b26b00; }
.notice.err { background: var(--err-soft); border-color: rgba(220,38,38,.25); } .notice.err svg { color: var(--err); }
.notice.ok { background: var(--ok-soft); border-color: rgba(22,163,74,.25); } .notice.ok svg { color: var(--ok); }
.notice b { display: block; margin-bottom: 2px; }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.bar { height: 7px; background: var(--line-2); border-radius: 7px; overflow: hidden; } .bar > i { display: block; height: 100%; background: var(--brand); border-radius: 7px; transition: width .5s; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; font-weight: 600; word-break: break-word; }

/* ---------- assistente de 8 etapas ---------- */
.wizard { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.steps { display: grid; grid-template-columns: repeat(8, 1fr); border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; }
.step { border: 0; background: transparent; padding: 12px 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; font: 600 12px var(--font); color: var(--muted); position: relative; }
.step i { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-style: normal; font-size: 11.5px; background: var(--surface); }
.step.done i { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.step.on { color: var(--text); } .step.on i { background: var(--brand); border-color: var(--brand); color: #fff; }
.step.on::after { content: ""; position: absolute; left: 18%; right: 18%; bottom: -1px; height: 3px; border-radius: 3px; background: var(--brand); }
.step-body { padding: 22px 24px; }
.step-body .eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--brand-2); text-transform: uppercase; }
.step-body h2 { font-size: 22px; margin: 6px 0 4px; }
.step-foot { display: flex; align-items: center; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--line); }
.preview { position: sticky; top: 76px; }
.preview .donut-wrap { display: grid; place-items: center; margin: 6px 0 10px; }
.origin-card { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-top: 12px; }
.origin-card .head { display: flex; gap: 12px; align-items: flex-start; }
.origin-ico { width: 34px; height: 34px; border-radius: 9px; background: var(--brand-soft); display: grid; place-items: center; color: var(--brand-2); flex: none; } .origin-ico svg { width: 18px; height: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; cursor: pointer; user-select: none; }
.chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-2); font-weight: 600; }
.chip .x { cursor: pointer; opacity: .6; } .chip .x:hover { opacity: 1; }
.review-card { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.review-card .row-h { display: flex; align-items: center; margin-bottom: 10px; } .review-card .row-h h3 { flex: 1; }

/* ---------- gráficos ---------- */
.chart { width: 100%; display: block; }
.chart text { font: 11px var(--font); fill: var(--muted); }
.chart .grid-line { stroke: var(--line-2); }
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; } .legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.tip { position: fixed; pointer-events: none; background: #0b1424; color: #fff; font-size: 12px; padding: 7px 10px; border-radius: 8px; z-index: 200; box-shadow: 0 6px 20px rgba(0,0,0,.25); white-space: nowrap; transform: translate(-50%, -115%); }
.map path { stroke: var(--surface); stroke-width: .6; transition: opacity .15s; cursor: pointer; } .map path:hover { opacity: .8; }

/* ---------- modal / toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(8,14,26,.5); display: grid; place-items: center; z-index: 100; padding: 20px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 14px; width: min(560px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); animation: rise .18s; }
.modal.wide { width: min(980px, 100%); }
.modal-h { padding: 18px 20px 8px; display: flex; align-items: center; } .modal-h h2 { flex: 1; }
.modal-b { padding: 8px 20px 16px; } .modal-f { padding: 12px 20px 18px; display: flex; gap: 8px; justify-content: flex-end; }
@keyframes fade { from { opacity: 0; } } @keyframes rise { from { transform: translateY(8px); opacity: 0; } }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 300; }
.toast { background: #0b1424; color: #fff; padding: 11px 14px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: 13px; max-width: 420px; animation: rise .2s; display: flex; gap: 8px; align-items: flex-start; }
.toast.err { background: #7f1d1d; } .toast.ok { background: #14532d; }

.skeleton { background: linear-gradient(90deg, var(--line-2), var(--line), var(--line-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; min-height: 16px; }
@keyframes sk { to { background-position: -200% 0; } }
.fade-in { animation: rise .25s; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: radial-gradient(ellipse at 20% 20%, rgba(14,165,198,.35), transparent 55%), radial-gradient(ellipse at 80% 80%, rgba(245,158,11,.25), transparent 50%), var(--side); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art h1 { font-size: 40px; line-height: 1.1; max-width: 460px; }
.login-art p { color: var(--side-text); max-width: 440px; }
.login-form { display: grid; place-items: center; padding: 30px; }
.login-form .card { width: min(380px, 100%); padding: 28px; }

/* ---------- impressão / PDF ---------- */
@media print {
  .side, .topbar, .no-print, .page-head .actions { display: none !important; }
  .app { display: block; } .content { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; } body { background: #fff; }
}

/* ---------- responsivo ---------- */
@media (max-width: 1200px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .wizard { grid-template-columns: 1fr; } .preview { position: static; } }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); }
  .menu-btn { display: inline-flex; }
  .g2, .g3, .g-main { grid-template-columns: 1fr; }
  .content { padding: 18px 14px 50px; } .topbar { padding: 0 14px; }
  .steps { grid-template-columns: repeat(4, 1fr); }
  .slider-row { grid-template-columns: 1fr; gap: 8px; } .slider-row .num { justify-content: flex-start; }
  .login { grid-template-columns: 1fr; } .login-art { display: none; }
}
@media (max-width: 560px) { .g4 { grid-template-columns: 1fr; } .kpi .value { font-size: 22px; } }
