/* ============================================================
   TRACKING GG — Tema de luxo (dark + dourado)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500&display=swap');

:root {
    --bg:        #0a0b0f;
    --bg-2:      #101219;
    --panel:     #14161f;
    --panel-2:   #191c27;
    --line:      rgba(255,255,255,.07);
    --line-2:    rgba(255,255,255,.12);
    --txt:       #eef0f6;
    --txt-dim:   #9aa0b4;
    --muted:     #6b7187;
    --gold:      #e3c06a;
    --gold-2:    #c9a24a;
    --gold-soft: rgba(227,192,106,.12);
    --green:     #52d59a;
    --red:       #ff6b6b;
    --radius:    16px;
    --radius-sm: 10px;
    --shadow:    0 20px 50px -20px rgba(0,0,0,.7);
    --font:      'Montserrat', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    --serif:     'Montserrat', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: var(--font);
    background: radial-gradient(1200px 700px at 85% -10%, #1a1d2b 0%, transparent 55%),
                radial-gradient(900px 600px at -10% 110%, #15131f 0%, transparent 50%),
                var(--bg);
    color: var(--txt);
    font-size: 14.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
code, .mono { font-family: 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace; }
.small { font-size: 12.5px; }
.muted { color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.ic { flex: none; }

/* ---------- Auth ---------- */
.auth-body {
    display: grid; place-items: center; min-height: 100vh; padding: 24px;
    position: relative; overflow: hidden;
}
.auth-aurora {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background: radial-gradient(600px 400px at 50% 0%, rgba(227,192,106,.10), transparent 60%);
}
.auth-card {
    position: relative; z-index: 1; width: 100%; max-width: 400px;
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 1px solid var(--line-2); border-radius: 22px;
    padding: 38px 34px; box-shadow: var(--shadow);
}
.auth-logo { display: flex; justify-content: center; margin-bottom: 22px; }
.auth-title { font-family: var(--serif); font-weight: 500; font-size: 25px; text-align: center; letter-spacing: .2px; }
.auth-sub { text-align: center; color: var(--txt-dim); margin: 6px 0 22px; }
.auth-foot { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 18px; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.sidebar {
    position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
    background: linear-gradient(180deg, rgba(20,22,31,.9), rgba(13,14,20,.95));
    border-right: 1px solid var(--line); padding: 22px 16px; backdrop-filter: blur(8px);
}
.brand { padding: 6px 10px 22px; }
.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-link {
    display: flex; align-items: center; gap: 12px; padding: 11px 13px;
    border-radius: 11px; color: var(--txt-dim); font-weight: 500; font-size: 13.8px;
    transition: .18s; position: relative;
}
.nav-link:hover { background: var(--panel-2); color: var(--txt); }
.nav-link.active { color: #1a1407; background: linear-gradient(180deg, var(--gold), var(--gold-2)); box-shadow: 0 8px 20px -8px rgba(227,192,106,.5); }
.nav-link.active .ic { color: #1a1407; }
.nav-link.logout { color: var(--muted); }
.nav-link.logout:hover { color: var(--red); }
.sidebar-foot { border-top: 1px solid var(--line); padding-top: 14px; }
.user-chip { display: flex; align-items: center; gap: 11px; padding: 6px 8px 12px; }
.avatar {
    width: 38px; height: 38px; border-radius: 11px; flex: none;
    display: grid; place-items: center; font-weight: 500; color: #1a1407;
    background: linear-gradient(180deg, var(--gold), var(--gold-2));
}
.avatar.lg { width: 48px; height: 48px; border-radius: 13px; font-size: 19px; }
.user-meta { display: flex; flex-direction: column; overflow: hidden; }
.user-meta strong { font-size: 13.5px; }
.user-meta span { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.content { min-width: 0; display: flex; flex-direction: column; }
.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 18px;
    padding: 22px 34px; border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 20;
    background: rgba(10,11,15,.72); backdrop-filter: blur(14px);
}
.page-title { font-family: var(--serif); font-weight: 500; font-size: 23px; letter-spacing: .2px; }
.page-sub { color: var(--txt-dim); font-size: 13px; margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.clock { font-variant-numeric: tabular-nums; color: var(--txt-dim); font-weight: 500; font-size: 13px; }
.live-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 500; color: var(--green); text-transform: uppercase; letter-spacing: .5px; }
.live-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(82,213,154,.6); animation: pulse 1.8s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(82,213,154,.5)} 70%{box-shadow:0 0 0 7px rgba(82,213,154,0)} 100%{box-shadow:0 0 0 0 rgba(82,213,154,0)} }
.page { padding: 26px 34px 60px; display: flex; flex-direction: column; gap: 20px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 8px; justify-content: center;
    padding: 11px 18px; border-radius: 11px; font-weight: 500; font-size: 13.5px;
    border: 1px solid transparent; cursor: pointer; transition: .18s; font-family: var(--font);
}
.btn-gold { background: linear-gradient(180deg, var(--gold), var(--gold-2)); color: #1a1407; box-shadow: 0 10px 24px -10px rgba(227,192,106,.6); }
.btn-gold:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-ghost { background: var(--panel-2); color: var(--txt); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-block { width: 100%; margin-top: 6px; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 9px; }
.icon-btn {
    display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
    background: var(--panel-2); border: 1px solid var(--line); color: var(--txt-dim); cursor: pointer; transition: .16s;
}
.icon-btn:hover { color: var(--gold); border-color: var(--gold); }
.icon-btn.danger:hover { color: var(--red); border-color: var(--red); }
.inline { display: inline; }

/* ---------- Alerts ---------- */
.alert { padding: 13px 16px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500; border: 1px solid; }
.alert-ok { background: rgba(82,213,154,.08); border-color: rgba(82,213,154,.3); color: var(--green); }
.alert-error { background: rgba(255,107,107,.08); border-color: rgba(255,107,107,.3); color: var(--red); }

/* ---------- Stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat-card {
    display: flex; align-items: center; gap: 14px; padding: 18px;
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 1px solid var(--line); border-radius: var(--radius);
}
.stat-card.gold { border-color: rgba(227,192,106,.35); background: linear-gradient(180deg, rgba(227,192,106,.08), var(--panel)); }
.stat-ic { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); }
.stat-card.gold .stat-ic { background: linear-gradient(180deg, var(--gold), var(--gold-2)); color: #1a1407; }
.stat-body { display: flex; flex-direction: column; min-width: 0; }
.stat-label { color: var(--muted); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .4px; }
.stat-value { font-family: var(--serif); font-weight: 500; font-size: 25px; line-height: 1.2; }

/* ---------- Panels ---------- */
.panel {
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head h2 { font-size: 15px; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; }
.panel-head h2 .ic { color: var(--gold); }
.link-more { color: var(--gold); font-size: 12.5px; font-weight: 500; }
.legend { color: var(--txt-dim); font-size: 12.5px; }
.legend strong { color: var(--txt); }
.dot-gold { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); margin-right: 5px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.span-2-main { grid-column: auto; }
@media (min-width: 1100px) { .grid-2:has(.span-2-main) { grid-template-columns: 2fr 1fr; } }

/* ---------- Chart ---------- */
.chart { width: 100%; height: 190px; display: block; }
.chart-x { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 8px; padding: 0 4px; }

/* ---------- Ring ---------- */
.ring-wrap { display: grid; place-items: center; padding: 8px 0 16px; }
.ring {
    --p: 0; width: 140px; height: 140px; border-radius: 50%;
    background: conic-gradient(var(--gold) calc(var(--p) * 1%), rgba(255,255,255,.07) 0);
    display: grid; place-items: center; position: relative;
}
.ring::before { content: ''; position: absolute; inset: 12px; border-radius: 50%; background: var(--panel); }
.ring-center { position: relative; text-align: center; }
.ring-center strong { font-family: var(--serif); font-size: 26px; display: block; }
.ring-center span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.mini-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.mini-list li { display: flex; justify-content: space-between; font-size: 13px; color: var(--txt-dim); border-top: 1px solid var(--line); padding-top: 10px; }
.mini-list strong { color: var(--txt); }

/* ---------- Rank bars ---------- */
.rank { list-style: none; display: flex; flex-direction: column; gap: 13px; }
.rank li { display: grid; grid-template-columns: 1fr 90px auto; align-items: center; gap: 12px; font-size: 13px; }
.rank-name { display: inline-flex; align-items: center; gap: 8px; color: var(--txt-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-bar { height: 7px; background: rgba(255,255,255,.06); border-radius: 20px; overflow: hidden; }
.rank-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-2), var(--gold)); border-radius: 20px; }
.rank li strong { text-align: right; }
.cc { display: inline-grid; place-items: center; min-width: 26px; height: 18px; padding: 0 5px; border-radius: 5px; background: var(--panel); border: 1px solid var(--line-2); font-size: 10.5px; font-weight: 500; color: var(--gold); letter-spacing: .5px; }
.empty-mini { color: var(--muted); font-size: 13px; padding: 10px 0; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 500; padding: 0 14px 12px; }
.table th.num { text-align: right; }
.table td { padding: 14px; border-top: 1px solid var(--line); font-size: 13.5px; vertical-align: middle; }
.table tbody tr:hover { background: rgba(255,255,255,.015); }
.table tr.is-bot { opacity: .5; }
.row-link { font-weight: 500; }
.row-link:hover { color: var(--gold); }
.actions { white-space: nowrap; display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.empty { text-align: center; color: var(--muted); padding: 34px 14px; }
.empty a { color: var(--gold); }

/* ---------- Tags ---------- */
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 500; background: var(--gold-soft); color: var(--gold); border: 1px solid rgba(227,192,106,.25); }
.tag-ghost { background: var(--panel); color: var(--txt-dim); border-color: var(--line-2); }
.tag-on { background: rgba(82,213,154,.1); color: var(--green); border-color: rgba(82,213,154,.3); }
.tag-off { background: rgba(255,107,107,.1); color: var(--red); border-color: rgba(255,107,107,.3); }

/* ---------- Copy rows ---------- */
.copy-row { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.copy-row code { font-size: 12px; color: var(--gold); background: var(--bg-2); padding: 4px 9px; border-radius: 7px; border: 1px solid var(--line); max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-row.big code { font-size: 14px; max-width: 520px; padding: 9px 14px; }
.code-copy { position: relative; }
.code-copy textarea { width: 100%; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--gold); font-family: 'SFMono-Regular', ui-monospace, monospace; font-size: 12.5px; padding: 13px 14px; resize: vertical; line-height: 1.6; }
.code-copy .btn { margin-top: 10px; }

/* ---------- Status button ---------- */
.status-btn { padding: 5px 13px; border-radius: 20px; font-size: 12px; font-weight: 500; cursor: pointer; border: 1px solid; }
.status-btn.on { background: rgba(82,213,154,.1); color: var(--green); border-color: rgba(82,213,154,.3); }
.status-btn.off { background: rgba(255,107,107,.1); color: var(--red); border-color: rgba(255,107,107,.3); }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 15px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 12.5px; font-weight: 500; color: var(--txt-dim); }
.field input, .field select, .field textarea {
    background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
    padding: 11px 13px; color: var(--txt); font-family: var(--font); font-size: 13.5px; transition: .16s; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.field input:disabled { opacity: .5; }
.hint { color: var(--muted); font-size: 11.5px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--txt-dim); cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--gold); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.utm-box { border: 1px dashed var(--line-2); border-radius: var(--radius-sm); padding: 15px; display: flex; flex-direction: column; gap: 13px; }
.utm-box-head { font-size: 12px; font-weight: 500; color: var(--gold); text-transform: uppercase; letter-spacing: .5px; }

/* ---------- Filters / pills ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters select, .filters input { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 9px; padding: 9px 12px; color: var(--txt); font-family: var(--font); font-size: 13px; }
.filters input { flex: 1; min-width: 180px; }
.period-tabs, .pager { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pill { padding: 7px 14px; border-radius: 20px; font-size: 12.5px; font-weight: 500; background: var(--panel-2); border: 1px solid var(--line); color: var(--txt-dim); }
.pill:hover { color: var(--gold); border-color: var(--gold); }
.pill.active { background: linear-gradient(180deg, var(--gold), var(--gold-2)); color: #1a1407; border-color: transparent; }
.mini-select { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 9px; color: var(--txt-dim); font-size: 12px; }

/* ---------- Cards grid (experts) ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.expert-card { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 15px; }
.expert-top { display: flex; align-items: center; gap: 13px; }
.expert-top strong { display: block; font-size: 15px; }
.expert-top .mono { font-size: 11px; }
.expert-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; text-align: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 13px 0; }
.expert-stats div { display: flex; flex-direction: column; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.expert-stats span { font-family: var(--serif); font-size: 21px; color: var(--txt); }
.expert-actions { display: flex; align-items: center; gap: 8px; }
.expert-actions .btn { flex: 1; }
.empty-card { grid-column: 1/-1; text-align: center; color: var(--muted); padding: 40px; border: 1px dashed var(--line-2); border-radius: var(--radius); }
.empty-card strong { color: var(--gold); }

/* ---------- Link hero ---------- */
.link-hero { display: flex; flex-direction: column; gap: 12px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-final { display: flex; flex-direction: column; gap: 4px; }
.hero-final .mono.small { font-size: 12px; color: var(--txt-dim); word-break: break-all; }

/* ---------- Live feed ---------- */
.feed { display: flex; flex-direction: column; gap: 2px; max-height: 420px; overflow-y: auto; }
.feed-row { display: flex; align-items: center; gap: 14px; padding: 12px 10px; border-radius: 10px; transition: .2s; }
.feed-row:hover { background: rgba(255,255,255,.02); }
.feed-row.new { animation: flash 1.2s ease; }
@keyframes flash { 0% { background: var(--gold-soft); } 100% { background: transparent; } }
.feed-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); flex: none; }
.feed-row.bot .feed-dot { background: var(--muted); }
.feed-main { flex: 1; min-width: 0; }
.feed-main strong { font-size: 13.5px; }
.feed-main .sub { font-size: 12px; color: var(--muted); }
.feed-time { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------- Builder presets ---------- */
.builder-presets { margin-top: 18px; }
.preset-list { display: flex; flex-direction: column; gap: 8px; }
.preset-item { display: flex; align-items: center; gap: 10px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; }
.preset-item .tag { flex: none; }
.preset-item code { flex: 1; font-size: 11.5px; color: var(--txt-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline-gen { display: flex; gap: 10px; margin-top: 14px; }
.inp-inline { flex: 1; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 9px; padding: 9px 12px; color: var(--txt); font-family: var(--font); }

/* ---------- Info list ---------- */
.info-list { list-style: none; display: flex; flex-direction: column; }
.info-list li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 13px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.info-list li:first-child { border-top: none; }
.info-list span { color: var(--txt-dim); }
.info-list code { font-size: 12px; color: var(--gold); word-break: break-all; text-align: right; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(5,6,9,.72); backdrop-filter: blur(4px); }
.modal-box {
    position: relative; margin: 5vh auto; width: 92%; max-width: 620px; max-height: 90vh; overflow-y: auto;
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 1px solid var(--line-2); border-radius: 20px; padding: 24px 26px; box-shadow: var(--shadow);
    animation: rise .25s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-head h3 { font-family: var(--serif); font-weight: 500; font-size: 20px; }
.modal-head .icon-btn { font-size: 15px; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 20px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 26px; right: 26px; z-index: 200; background: linear-gradient(180deg, var(--gold), var(--gold-2)); color: #1a1407; padding: 13px 20px; border-radius: 12px; font-weight: 500; font-size: 13.5px; box-shadow: var(--shadow); transform: translateY(80px); opacity: 0; transition: .3s; }
.toast.show { transform: none; opacity: 1; }

/* ---------- Responsivo ---------- */
@media (max-width: 980px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .nav { flex-direction: row; flex-wrap: wrap; flex: 1; }
    .nav-link span { display: none; }
    .sidebar-foot { border-top: none; border-left: 1px solid var(--line); padding: 0 0 0 14px; display: flex; gap: 10px; align-items: center; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .topbar, .page { padding-left: 18px; padding-right: 18px; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
}
