/* ============================================================
   GamaVirtual Pulse · Design System (Pulse OS)
   Tema escuro ciano/roxo · Sora + JetBrains Mono (auto-hospedadas)
   ============================================================ */

@font-face { font-family: 'Sora'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/sora-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Sora'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/sora-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Sora'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/sora-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Sora'; font-style: normal; font-weight: 800; font-display: swap; src: url('fonts/sora-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/jetbrains-mono-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/jetbrains-mono-latin-700-normal.woff2') format('woff2'); }

:root {
    --bg: #05070c;
    --panel: #0a0f18;
    --panel-2: #0c1220;
    --panel-deep: #0d1220;
    --panel-grad: linear-gradient(180deg, #0c1220, #090e18);
    --line: #141c2c;
    --line-2: #131c2b;
    --line-soft: #101724;
    --line-row: #0e1522;
    --line-strong: #1e2740;
    --line-hover: #22334f;
    --text: #e3e9f2;
    --text-soft: #aebbcd;
    --text-mid: #93a1b5;
    --muted: #8291a6;
    --dim: #5f6e85;
    --faint: #3d4a61;
    --cyan: #33c6ff;
    --cyan-light: #7fdcff;
    --purple: #9d7bff;
    --green: #2ee0a1;
    --yellow: #f0b429;
    --red: #ff6b6b;
    --bar-dark: #2a3550;
    --glow-cyan: rgba(51, 198, 255, 0.4);
    --sans: 'Sora', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
    --radius: 13px;
    --radius-sm: 9px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: radial-gradient(1200px 500px at 50% -10%, rgba(51, 198, 255, 0.09), transparent 60%), var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 13.5px;
    line-height: 1.5;
    min-height: 100vh;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--cyan-light); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }
code { font-family: var(--mono); font-size: 12px; color: var(--cyan-light); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes ledin { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* ------------------------------------------------------------
   Topbar + navegação
   ------------------------------------------------------------ */
.topbar {
    position: sticky; top: 0; z-index: 40;
    background: rgba(6, 9, 15, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line-2);
}
.topbar-row { display: flex; align-items: center; gap: 14px; padding: 11px 18px 9px; flex-wrap: wrap; }
.hamburger {
    display: none; width: 40px; height: 40px; border: 1px solid var(--line-strong); border-radius: 9px;
    background: var(--panel); cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    flex-shrink: 0; -webkit-tap-highlight-color: transparent; padding: 0;
}
.hamburger span { width: 16px; height: 2px; border-radius: 2px; background: var(--cyan-light); display: block; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark {
    width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
    background: conic-gradient(from 210deg, #33c6ff, #9d7bff, #33c6ff);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; color: #03101c; font-size: 13px;
    box-shadow: 0 0 16px var(--glow-cyan);
}
.brand-mark-sm { width: 30px; height: 30px; font-size: 11px; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-weight: 800; font-size: 14.5px; letter-spacing: .2px; line-height: 1.25; }
.brand-name strong { color: var(--cyan); font-weight: 800; }
.brand-sub { font-size: 9.5px; color: var(--dim); font-family: var(--mono); letter-spacing: 1.6px; }
.topbar-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.status-pill, .clock-pill {
    display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--dim);
    font-family: var(--mono); white-space: nowrap; border: 1px solid var(--line-2);
    border-radius: 20px; padding: 5px 12px; background: var(--panel);
}
.clock-pill strong { color: var(--text); font-weight: 600; }
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-green { background: var(--green); animation: pulse 2s infinite; }
.dot-cyan { background: var(--cyan); animation: pulse 1.6s infinite; }
.bell {
    position: relative; width: 36px; height: 36px; border: 1px solid var(--line-strong); border-radius: 9px;
    display: flex; align-items: center; justify-content: center; color: var(--text-mid); background: var(--panel);
}
.bell:hover { color: var(--cyan-light); border-color: var(--line-hover); }
.bell.has-alerts { color: var(--yellow); }
.bell-count {
    position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; border-radius: 9px;
    background: var(--red); color: #fff; font-size: 10px; font-weight: 700; font-family: var(--mono);
    display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.user-chip { display: flex; align-items: center; gap: 8px; }
.user-avatar {
    width: 30px; height: 30px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line-strong);
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; color: var(--cyan-light);
}
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta strong { font-size: 12px; font-weight: 600; }
.user-meta small { font-size: 9.5px; color: var(--dim); font-family: var(--mono); letter-spacing: .5px; }
.logout-form { margin: 0; }
.btn-ghost {
    background: transparent; border: 1px solid var(--line-strong); color: var(--text-mid);
    font-family: var(--sans); font-weight: 600; font-size: 12px; padding: 7px 13px; border-radius: 8px; cursor: pointer;
}
.btn-ghost:hover { color: var(--text); border-color: var(--line-hover); }
.tabs { display: flex; gap: 4px; padding: 0 12px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
    padding: 11px 13px 12px; font-size: 12.5px; color: var(--text-mid); font-weight: 400; cursor: pointer;
    white-space: nowrap; border-bottom: 2px solid transparent; -webkit-tap-highlight-color: transparent;
    display: flex; align-items: center; gap: 7px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--cyan-light); font-weight: 700; border-bottom-color: var(--cyan); }
.tab-count {
    min-width: 16px; height: 16px; border-radius: 8px; background: rgba(240, 180, 41, 0.15); color: var(--yellow);
    font-size: 9.5px; font-weight: 700; font-family: var(--mono); display: inline-flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* Drawer mobile */
.drawer-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(3, 5, 10, 0.6); backdrop-filter: blur(2px); }
.drawer {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 70; width: min(280px, 82vw);
    background: #080d16; border-right: 1px solid var(--line-strong);
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.5); padding: 18px 14px;
    display: flex; flex-direction: column; gap: 4px; animation: ledin .25s ease; overflow-y: auto;
}
.drawer-head { display: flex; align-items: center; gap: 9px; padding: 2px 4px 16px; }
.drawer-close { margin-left: auto; background: none; border: none; color: var(--dim); font-size: 17px; padding: 4px 8px; cursor: pointer; }
.drawer-item {
    display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-radius: 10px;
    border: 1px solid transparent; color: var(--text-mid); font-weight: 400; font-size: 14px;
    -webkit-tap-highlight-color: transparent;
}
.drawer-item.active {
    background: linear-gradient(90deg, rgba(51, 198, 255, 0.14), rgba(51, 198, 255, 0.02));
    border-color: rgba(51, 198, 255, 0.3); color: var(--cyan-light); font-weight: 700;
}
.drawer-dot { width: 7px; height: 7px; border-radius: 2px; background: var(--bar-dark); flex-shrink: 0; }
.drawer-item.active .drawer-dot { background: var(--cyan); }
.drawer-foot { margin-top: auto; font-size: 10px; color: var(--faint); font-family: var(--mono); padding: 12px 8px 4px; }

/* ------------------------------------------------------------
   Conteúdo
   ------------------------------------------------------------ */
.content { padding: 20px 18px 44px; max-width: 1440px; margin: 0 auto; }
.page-title { margin: 2px 0 18px; font-size: clamp(19px, 2.4vw, 25px); font-weight: 800; letter-spacing: -.3px; }
.footer {
    margin-top: 28px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    font-size: 10.5px; color: var(--faint); font-family: var(--mono);
    border-top: 1px solid var(--line-row); padding-top: 14px;
}
.section-gap { margin-top: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 12px; }

/* Cartões */
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); min-width: 0; }
.card-pad { padding: 16px 18px; }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 18px 10px; flex-wrap: wrap; }
.card-header h2 { margin: 0; font-size: 14.5px; font-weight: 700; }
.card-header p { margin: 2px 0 0; font-size: 11px; color: var(--dim); }
.card-body { padding: 0 18px 16px; }

/* KPIs */
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 10px; }
.metric-card {
    border: 1px solid var(--line); border-radius: 11px; padding: 14px 15px;
    background: var(--panel-grad); position: relative; overflow: hidden;
    transition: border-color .2s, transform .2s;
}
.metric-card:hover { border-color: var(--line-hover); transform: translateY(-1px); }
.metric-card::before {
    content: ''; position: absolute; top: 0; left: 14px; right: 14px; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(51, 198, 255, 0.35), transparent);
}
.metric-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.metric-label { font-size: 11px; color: var(--muted); letter-spacing: .3px; }
.metric-delta {
    font-size: 9.5px; font-weight: 700; font-family: var(--mono); border-radius: 10px; padding: 2px 7px; white-space: nowrap;
}
.metric-delta.up { color: var(--green); background: rgba(46, 224, 161, 0.1); }
.metric-delta.down { color: var(--red); background: rgba(255, 107, 107, 0.1); }
.metric-delta.flat { color: var(--dim); background: rgba(95, 110, 133, 0.12); }
.metric-value {
    font-size: clamp(17px, 1.5vw, 23px); font-weight: 700; font-family: var(--mono);
    font-variant-numeric: tabular-nums; margin-top: 6px; white-space: nowrap;
}
.metric-value.cyan { color: var(--cyan-light); }
.metric-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; margin-top: 6px; }
.metric-note { font-size: 10.5px; color: var(--dim); }
.metric-spark { width: 64px; height: 20px; flex-shrink: 0; opacity: .9; }
.fin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 10px; margin-bottom: 12px; }
.fin-card { border: 1px solid var(--line); border-radius: 11px; padding: 13px 15px; background: var(--panel); }
.fin-card .metric-value { font-size: clamp(15px, 1.4vw, 20px); margin-top: 5px; }
.fin-card.profit-positive .metric-value { color: var(--cyan-light); }
.fin-card.profit-negative .metric-value { color: var(--red); }

/* Tabelas */
.table-wrap { overflow-x: auto; min-width: 0; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 560px; }
.data-table thead th {
    text-align: left; padding: 6px 10px 8px; font-size: 10px; letter-spacing: 1px; font-weight: 500;
    color: var(--dim); font-family: var(--mono); text-transform: uppercase; border-bottom: 1px solid var(--line-soft);
    white-space: nowrap;
}
.data-table tbody td, .data-table tfoot td { padding: 10px; border-bottom: 1px solid var(--line-row); vertical-align: middle; white-space: nowrap; }
.data-table tbody tr { animation: fadein .25s ease; }
.data-table tbody tr:hover { background: var(--panel-2); }
.data-table thead th:first-child, .data-table tbody td:first-child, .data-table tfoot td:first-child { padding-left: 18px; }
.data-table thead th:last-child, .data-table tbody td:last-child, .data-table tfoot td:last-child { padding-right: 18px; }
.data-table .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.data-table thead th.num { text-align: right; }
.data-table tfoot td { border-bottom: none; font-family: var(--mono); font-weight: 700; color: var(--cyan-light); font-size: 12px; }
.data-table tfoot .total-label { font-size: 10px; letter-spacing: 1px; }
.primary { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.secondary { display: block; font-size: 10.5px; color: var(--dim); }
.share-track { height: 2px; border-radius: 2px; background: var(--line-soft); margin-top: 5px; max-width: 110px; }
.share-fill { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--purple)); border-radius: 2px; }
.empty { padding: 22px 18px; color: var(--dim); font-size: 12px; text-align: center; }
.nowrap { white-space: nowrap; }
.muted { color: var(--dim); font-size: 12px; }
.small { font-size: 10.5px; }

/* Badges */
.badge {
    display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700; letter-spacing: .5px;
    border: 1px solid; border-radius: 14px; padding: 3px 9px; text-transform: uppercase; font-family: var(--sans);
    white-space: nowrap;
}
.badge.active, .badge.approved, .badge.success, .badge.alta { color: var(--green); border-color: rgba(46, 224, 161, 0.35); }
.badge.escalar, .badge.info { color: var(--cyan); border-color: rgba(51, 198, 255, 0.35); }
.badge.pending, .badge.warning, .badge.media, .badge.paused, .badge.partial, .badge.observar { color: var(--yellow); border-color: rgba(240, 180, 41, 0.35); }
.badge.rejected, .badge.critical, .badge.error, .badge.baixa, .badge.inactive { color: var(--red); border-color: rgba(255, 107, 107, 0.35); }
.badge.archived, .badge.neutral, .badge.skipped, .badge.disabled { color: var(--dim); border-color: rgba(95, 110, 133, 0.35); }
.chip {
    display: inline-flex; align-items: center; font-size: 10.5px; color: var(--cyan-light);
    border: 1px solid rgba(51, 198, 255, 0.3); border-radius: 20px; padding: 4px 11px; font-family: var(--mono); white-space: nowrap;
}

/* Botões */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    background: transparent; border: 1px solid var(--line-strong); color: var(--text-mid);
    font-family: var(--sans); font-weight: 600; font-size: 12.5px; padding: 9px 16px;
    border-radius: 8px; cursor: pointer; white-space: nowrap; text-decoration: none; line-height: 1.2;
}
.btn:hover { color: var(--text); border-color: var(--line-hover); }
.btn-primary {
    background: var(--cyan); border-color: var(--cyan); color: #03101c; font-weight: 700;
    box-shadow: 0 0 14px rgba(51, 198, 255, 0.3);
}
.btn-primary:hover { background: var(--cyan-light); border-color: var(--cyan-light); color: #03101c; }
.btn-small { padding: 6px 11px; font-size: 11.5px; border-radius: 7px; }
.btn-danger:hover { color: var(--red); border-color: rgba(255, 107, 107, 0.45); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.icon-btn {
    width: 28px; height: 28px; border: 1px solid var(--line-strong); border-radius: 7px; background: transparent;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-mid); font-size: 12px;
}
.icon-btn:hover { border-color: var(--cyan); color: var(--cyan-light); }
.link-btn { background: none; border: none; color: var(--cyan); cursor: pointer; font-size: 12px; font-family: var(--sans); padding: 0; }
.page-actions { display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }

/* Alertas / avisos */
.alert {
    border: 1px solid; border-radius: var(--radius-sm); padding: 11px 14px; font-size: 12.5px; margin-bottom: 12px;
    display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; animation: ledin .3s ease;
}
.alert strong { font-weight: 700; }
.alert-success { border-color: rgba(46, 224, 161, 0.35); background: rgba(46, 224, 161, 0.07); color: var(--green); }
.alert-info { border-color: rgba(51, 198, 255, 0.3); background: rgba(51, 198, 255, 0.06); color: var(--cyan-light); }
.alert-warning { border-color: rgba(240, 180, 41, 0.35); background: rgba(240, 180, 41, 0.07); color: var(--yellow); }
.alert-error { border-color: rgba(255, 107, 107, 0.4); background: rgba(255, 107, 107, 0.07); color: var(--red); }

/* Formulários */
form { margin: 0; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; color: var(--muted); min-width: 0; }
input, select, textarea {
    width: 100%; min-width: 0; background: var(--panel-deep); border: 1px solid var(--line-strong);
    border-radius: 8px; color: var(--text); padding: 10px 12px; font-size: 13px; outline: none;
    font-family: var(--mono); color-scheme: dark;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { border-color: var(--cyan); }
input[readonly] { color: var(--dim); }
textarea { min-height: 74px; resize: vertical; font-family: var(--sans); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; margin-top: 16px; justify-content: flex-end; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 13px; }
.help { font-size: 10.5px; color: var(--dim); font-weight: 400; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; margin: 0 0 14px; }
legend { font-size: 11px; color: var(--cyan-light); font-family: var(--mono); letter-spacing: 1px; text-transform: uppercase; padding: 0 6px; }
.filter-bar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; padding: 0 18px 14px; }
.filter-bar.bare { padding: 0 0 14px; }
.filter-bar label { flex: 0 1 160px; }
.filter-bar .grow { flex: 1 1 220px; }
.filter-bar .btn { flex: 0 0 auto; }
.form-panel {
    margin: 6px 18px 14px; border: 1px solid rgba(51, 198, 255, 0.3); border-radius: 12px;
    background: var(--panel-2); padding: 18px; box-shadow: 0 0 30px rgba(51, 198, 255, 0.07); animation: ledin .25s ease;
}
.form-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.form-panel-head h3 { margin: 0; font-size: 14px; font-weight: 700; color: var(--cyan-light); }
.formula-note { font-size: 11px; color: var(--dim); font-family: var(--mono); border: 1px dashed var(--line-strong); border-radius: 8px; padding: 9px 12px; margin-top: 12px; }

/* Toggle switch */
.switch {
    width: 36px; height: 20px; border-radius: 12px; background: var(--line-strong); border: none;
    position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0; padding: 0;
}
.switch::after {
    content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
    background: var(--text); transition: left .2s;
}
.switch.on { background: var(--cyan); }
.switch.on::after { left: 18px; }
.row-off { opacity: .45; }

/* Leads ao vivo */
.live-list { display: flex; flex-direction: column; gap: 8px; padding: 0 18px 16px; overflow: hidden; }
.live-item {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 9px 12px;
    background: var(--panel-deep); animation: ledin .4s ease;
}
.live-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: var(--green); }
.live-dot.pending { background: var(--yellow); }
.live-dot.rejected { background: var(--red); }
.live-main { min-width: 0; }
.live-main strong { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-main small { display: block; font-size: 10px; color: var(--dim); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-value { font-family: var(--mono); font-size: 12.5px; font-weight: 700; flex-shrink: 0; color: var(--green); }
.live-value.pending { color: var(--yellow); }
.live-value.rejected { color: var(--red); }
.live-tag { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--cyan-light); font-family: var(--mono); white-space: nowrap; }

/* Barras (ROI, países, horas, dias) */
.bar-list { display: flex; flex-direction: column; gap: 11px; padding: 4px 18px 16px; }
.bar-item { min-width: 0; }
.bar-item-head { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; margin-bottom: 5px; }
.bar-item-head .name { color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-item-head .value { font-family: var(--mono); font-weight: 600; color: var(--cyan-light); white-space: nowrap; }
.bar-track { height: 7px; border-radius: 4px; background: var(--line-soft); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--cyan), var(--cyan) 70%, rgba(255,255,255,0.25)); box-shadow: 0 0 10px var(--glow-cyan); transition: width .6s ease; }
.bar-fill.purple { background: linear-gradient(90deg, var(--purple), var(--purple) 70%, rgba(255,255,255,0.25)); box-shadow: 0 0 10px rgba(157, 123, 255, 0.4); }
.bar-fill.green { background: linear-gradient(90deg, var(--green), var(--green) 70%, rgba(255,255,255,0.25)); box-shadow: 0 0 10px rgba(46, 224, 161, 0.35); }
.bar-fill.dark { background: var(--bar-dark); box-shadow: none; }
.bars-compact { display: flex; flex-direction: column; gap: 6px; padding: 4px 18px 16px; }
.bar-row { display: grid; grid-template-columns: 44px 1fr 58px; align-items: center; gap: 10px; font-size: 11px; }
.bar-row > span { color: var(--dim); font-family: var(--mono); }
.bar-row > strong { font-family: var(--mono); font-weight: 600; text-align: right; font-size: 11.5px; }

/* Funil */
.funnel { display: flex; flex-direction: column; gap: 14px; padding: 8px 18px 16px; }
.funnel-item-head { display: flex; justify-content: space-between; font-size: 11.5px; margin-bottom: 6px; }
.funnel-item-head .name { color: var(--text-soft); }
.funnel-item-head .value { font-family: var(--mono); }
.funnel-item-head .value strong { font-weight: 700; }
.funnel-item-head .value span { color: var(--dim); }
.funnel-track { height: 26px; border-radius: 6px; background: var(--line-soft); overflow: hidden; }
.funnel-fill { height: 100%; border-radius: 6px; }

/* Heatmap */
.heatmap-wrap { overflow-x: auto; padding: 0 18px 8px; }
.heatmap { display: grid; grid-template-columns: 42px repeat(24, minmax(26px, 1fr)); gap: 3px; min-width: 760px; padding-bottom: 6px; }
.heat-label { font-size: 9.5px; color: var(--dim); font-family: var(--mono); display: flex; align-items: center; justify-content: center; }
.heat-cell {
    aspect-ratio: 1.35; border-radius: 4px; display: flex; align-items: center; justify-content: center;
    font-size: 9px; font-family: var(--mono); color: var(--text-soft);
    background: rgba(51, 198, 255, var(--heat, 0.03)); cursor: default;
}
.heat-legend { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--dim); padding: 4px 18px 16px; }
.heat-swatch { width: 18px; height: 10px; border-radius: 3px; background: rgba(51, 198, 255, var(--heat, .1)); display: inline-block; }

/* Gráficos SVG */
.chart-box { padding: 4px 18px 12px; }
.chart-svg { width: 100%; display: block; }
.chart-legend { display: flex; gap: 18px; padding: 2px 18px 14px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.chart-legend .key { display: flex; align-items: center; gap: 6px; }
.chart-legend .swatch { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.chart-legend .swatch.block { width: 10px; height: 10px; border-radius: 3px; }
.chart-hover-strip {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 10px 18px 0;
    border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); padding: 9px 14px;
    font-family: var(--mono); font-size: 12px;
}
.chart-hover-strip .hl { color: var(--cyan-light); font-weight: 700; }
.chart-hover-strip .kv { color: var(--muted); }
.chart-hover-strip .kv strong { color: var(--text); font-weight: 600; }
.chart-hover-strip .hint { color: var(--faint); font-size: 10.5px; margin-left: auto; }

/* Mapa-múndi */
.worldmap-box { position: relative; padding: 6px 18px 16px; }
.worldmap-box svg { width: 100%; height: auto; display: block; }
.wm-land path { fill: #0e1522; stroke: #1c2638; stroke-width: .6; }
.wm-dot { fill: var(--cyan); }
.wm-halo { fill: var(--cyan); opacity: .13; }
.wm-label { fill: var(--text-soft); font-size: 12px; font-family: var(--mono); }

/* Recomendações */
.recommendation { border: 1px solid var(--line-soft); border-radius: var(--radius-sm); background: var(--panel-deep); padding: 11px 13px; margin: 0 18px 9px; }
.recommendation:last-child { margin-bottom: 16px; }
.recommendation-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.recommendation-head strong { font-size: 12.5px; }
.recommendation-head .score { font-family: var(--mono); font-size: 11px; color: var(--cyan-light); font-weight: 700; }
.recommendation p { margin: 6px 0 2px; font-size: 12px; color: var(--text-soft); }
.recommendation small { font-size: 10.5px; color: var(--dim); }

/* Tracking URL + código */
.tracking-url { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tracking-url code {
    border: 1px solid rgba(51, 198, 255, 0.25); border-radius: 8px; background: var(--panel-deep);
    padding: 8px 11px; font-size: 11px; overflow-x: auto; white-space: nowrap; max-width: 420px; display: block;
}
.code-block {
    display: block; border: 1px solid rgba(51, 198, 255, 0.25); border-radius: var(--radius-sm); background: var(--panel-deep);
    padding: 11px 13px; font-family: var(--mono); font-size: 12px; color: var(--cyan-light);
    overflow-x: auto; white-space: nowrap;
}
.kv-list { display: flex; gap: 16px; font-size: 11px; color: var(--muted); font-family: var(--mono); flex-wrap: wrap; }

/* Período (chips) */
.period-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.period-chip {
    padding: 8px 15px; border-radius: 20px; border: 1px solid var(--line); background: transparent;
    color: var(--text-mid); font-weight: 400; font-size: 12.5px; cursor: pointer; white-space: nowrap; font-family: var(--sans);
}
.period-chip:hover { color: var(--text); }
.period-chip.active { background: rgba(51, 198, 255, 0.14); border-color: rgba(51, 198, 255, 0.4); color: var(--cyan-light); font-weight: 700; }
.dashboard-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.dashboard-period-selector { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.dashboard-period-selector label { flex: 0 1 auto; }
.dashboard-period-selector select { min-width: 190px; }
.dashboard-custom-period { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.dashboard-refresh-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-family: var(--mono); font-size: 11px; color: var(--dim); }

/* Paginação */
.pagination { display: flex; gap: 6px; padding: 12px 18px 16px; flex-wrap: wrap; }
.pagination a {
    min-width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line-strong); border-radius: 7px; color: var(--text-mid); font-size: 12px; font-family: var(--mono);
    padding: 0 8px;
}
.pagination a.active { border-color: var(--cyan); color: var(--cyan-light); background: rgba(51, 198, 255, 0.08); }
.campaign-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 18px 16px; font-size: 11px; color: var(--dim); font-family: var(--mono); }

/* Integrações (cards de rede) */
.integration-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 12px; margin-bottom: 12px; }
.integration-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 16px 18px; }
.integration-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.integration-head h3 { margin: 0; font-size: 14.5px; font-weight: 700; }
.integration-status { display: flex; align-items: center; gap: 6px; font-size: 10.5px; font-family: var(--mono); white-space: nowrap; }
.integration-role { font-size: 11px; color: var(--dim); margin-top: 3px; }
.integration-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 13px; }
.integration-stat { border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 9px 11px; background: var(--panel-deep); }
.integration-stat .k { font-size: 10px; color: var(--dim); letter-spacing: .5px; font-family: var(--mono); text-transform: uppercase; }
.integration-stat .v { font-family: var(--mono); font-size: 12.5px; margin-top: 4px; }
.integration-note { margin-top: 11px; font-size: 11px; color: var(--muted); font-family: var(--mono); }

/* Login / instalador */
.login-page, .install-page { display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 40px; }
.login-shell, .install-shell { width: 100%; max-width: 420px; }
.install-shell { max-width: 640px; }
.login-card, .install-card {
    border: 1px solid var(--line); border-radius: 16px; background: var(--panel);
    padding: 30px 28px; box-shadow: 0 22px 70px rgba(0, 0, 0, .5), 0 0 40px rgba(51, 198, 255, .05);
    animation: ledin .35s ease;
}
.brand-large { margin-bottom: 18px; }
.brand-large .brand-mark { width: 44px; height: 44px; font-size: 16px; border-radius: 11px; }
.login-card h1, .install-card h1 { margin: 4px 0 4px; font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.login-card .muted, .install-card .muted { margin: 0 0 18px; }
.login-foot { margin: 18px 0 0; font-size: 10.5px; color: var(--faint); font-family: var(--mono); text-align: center; }
.requirements { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 16px; }
.requirement { font-size: 10.5px; font-family: var(--mono); border: 1px solid; border-radius: 14px; padding: 4px 10px; }
.requirement.ok { color: var(--green); border-color: rgba(46, 224, 161, 0.35); }
.requirement.fail { color: var(--red); border-color: rgba(255, 107, 107, 0.4); }
.success-panel { border: 1px solid rgba(46, 224, 161, 0.35); border-radius: var(--radius-sm); background: rgba(46, 224, 161, 0.06); padding: 18px; }
.success-panel h2 { margin: 0 0 8px; font-size: 16px; color: var(--green); }
.success-panel p { margin: 4px 0; font-size: 12.5px; color: var(--text-soft); }
.success-panel .btn { margin-top: 12px; }

/* Responsivo */
@media (max-width: 860px) {
    .topbar-row { padding: 10px 12px 9px; }
    .hamburger { display: flex; }
    .tabs { display: none; }
    .status-pill, .user-meta, .clock-pill { display: none; }
    .content { padding: 14px 12px 36px; }
    .card-header { padding: 13px 13px 8px; }
    .live-list, .bar-list, .bars-compact, .funnel { padding-left: 13px; padding-right: 13px; }
    .chart-box, .chart-legend, .worldmap-box { padding-left: 13px; padding-right: 13px; }
    .recommendation { margin-left: 13px; margin-right: 13px; }
    .data-table thead th:first-child, .data-table tbody td:first-child, .data-table tfoot td:first-child { padding-left: 13px; }
    .data-table thead th:last-child, .data-table tbody td:last-child, .data-table tfoot td:last-child { padding-right: 13px; }
    .tracking-url code { max-width: 220px; }
    .filter-bar { padding-left: 13px; padding-right: 13px; }
    .form-panel { margin-left: 13px; margin-right: 13px; }
}
@media (min-width: 861px) {
    .drawer, .drawer-backdrop { display: none !important; }
}
