/* =========================================================
   Syhub Leads — tema (claro e escuro)
   Identidade SYHUB: degradê ciano → azul royal, azul-noite
   ========================================================= */
:root,
[data-bs-theme="light"] {
  --brand: #1f5bff;
  --brand-rgb: 31, 91, 255;
  --brand-2: #12b4ff;
  --brand-3: #2b3ff0;
  --grad: linear-gradient(135deg, #12b4ff 0%, #1f5bff 55%, #2b3ff0 100%);
  --navy: #07112e;

  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --surface-3: #edf1f8;
  --line: #e3e9f2;
  --ink: #0b1430;
  --muted: #5f6b85;
  --brand-soft: #e8efff;
  --brand-ink: #1846d1;
  --shadow-sm: 0 1px 2px rgba(11, 20, 48, .05);
  --shadow: 0 1px 2px rgba(11, 20, 48, .04), 0 10px 30px -12px rgba(11, 20, 48, .12);
  --shadow-lg: 0 24px 60px -20px rgba(11, 20, 48, .35);
  --code-bg: #0b1430;
  --code-ink: #c9d6ff;
  --chart-grid: #e9eef6;
  --chart-text: #5f6b85;

  --bs-body-bg: var(--bg);
  --bs-body-color: var(--ink);
  --bs-emphasis-color: var(--ink);
  --bs-secondary-color: var(--muted);
  --bs-border-color: var(--line);
  --bs-tertiary-bg: var(--surface-2);
  --bs-secondary-bg: var(--surface-3);
  --bs-primary: #1f5bff;
  --bs-primary-rgb: 31, 91, 255;
  --bs-link-color: #1f5bff;
  --bs-link-color-rgb: 31, 91, 255;
  --bs-link-hover-color: #1846d1;
  --bs-link-hover-color-rgb: 24, 70, 209;
  --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-border-radius: 10px;
  --radius: 18px;
  --sb-w: 264px;
  --sb-mini: 78px;
  --gap: 14px;
}

[data-bs-theme="dark"] {
  --bg: #050a1c;
  --surface: #0c1530;
  --surface-2: #101b3a;
  --surface-3: #15224a;
  --line: #1c2a52;
  --ink: #e7ecff;
  --muted: #8f9bbd;
  --brand-soft: rgba(31, 91, 255, .16);
  --brand-ink: #7fa6ff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 14px 34px -16px rgba(0, 0, 0, .7);
  --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, .8);
  --code-bg: #050a1c;
  --chart-grid: #1a2648;
  --chart-text: #8f9bbd;

  --bs-body-bg: var(--bg);
  --bs-body-color: var(--ink);
  --bs-emphasis-color: #fff;
  --bs-secondary-color: var(--muted);
  --bs-border-color: var(--line);
  --bs-tertiary-bg: var(--surface-2);
  --bs-secondary-bg: var(--surface-3);
  --bs-link-color: #6b9bff;
  --bs-link-color-rgb: 107, 155, 255;
  --bs-link-hover-color: #9dbdff;
  --bs-link-hover-color-rgb: 157, 189, 255;
  color-scheme: dark;
}

/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--bs-body-font-family); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, .page-title, .kpi-value, .brand-word { font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 2000; background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 8px; }
::selection { background: rgba(var(--brand-rgb), .22); }
.text-muted, .text-body-secondary { color: var(--muted) !important; }
a { text-underline-offset: 3px; }

/* ---------- Componentes Bootstrap afinados ---------- */
.btn { border-radius: 11px; font-weight: 600; letter-spacing: -.005em; }
.btn-sm { border-radius: 9px; }
.btn-lg { border-radius: 13px; }
.btn-primary {
  --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: #1846d1; --bs-btn-hover-border-color: #1846d1;
  --bs-btn-active-bg: #153bb0; --bs-btn-active-border-color: #153bb0;
  --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
  background-image: var(--grad); border: 0; box-shadow: 0 6px 16px -6px rgba(var(--brand-rgb), .6);
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-outline-primary { --bs-btn-color: var(--brand-ink); --bs-btn-border-color: rgba(var(--brand-rgb), .45); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand); }
.btn-light { --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--line); --bs-btn-color: var(--ink); --bs-btn-hover-bg: var(--surface-3); --bs-btn-hover-border-color: var(--line); --bs-btn-hover-color: var(--ink); --bs-btn-active-bg: var(--surface-3); --bs-btn-active-color: var(--ink); }
.btn-soft { background: var(--brand-soft); color: var(--brand-ink); border: 0; }
.btn-soft:hover { background: var(--brand); color: #fff; }
.btn-wa { background: #22c55e; color: #fff; border: 0; }
.btn-wa:hover, .btn-wa:focus { background: #16a34a; color: #fff; }

.form-control, .form-select { border-radius: 11px; border-color: var(--line); background-color: var(--surface); color: var(--ink); }
.form-control:focus, .form-select:focus { border-color: rgba(var(--brand-rgb), .55); box-shadow: 0 0 0 .22rem rgba(var(--brand-rgb), .16); background-color: var(--surface); color: var(--ink); }
.form-control::placeholder { color: var(--muted); opacity: .8; }
.form-label { font-weight: 500; color: var(--ink); }
.input-group-text { background: var(--surface-2); border-color: var(--line); color: var(--muted); }
.form-check-input { border-color: var(--line); background-color: var(--surface); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-control-color { padding: .25rem; }
.dropdown-menu { --bs-dropdown-bg: var(--surface); --bs-dropdown-border-color: var(--line); --bs-dropdown-link-color: var(--ink); --bs-dropdown-link-hover-bg: var(--surface-3); --bs-dropdown-link-hover-color: var(--ink); --bs-dropdown-link-active-bg: var(--brand-soft); --bs-dropdown-link-active-color: var(--brand-ink); --bs-dropdown-divider-bg: var(--line); border-radius: 14px; padding: .4rem; }
.dropdown-item { border-radius: 9px; padding: .5rem .7rem; }
.modal-content { --bs-modal-bg: var(--surface); --bs-modal-border-color: var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); }
.modal-header, .modal-footer { border-color: var(--line); }
.alert { border-radius: 14px; border: 0; }
.table { --bs-table-color: var(--ink); --bs-table-bg: transparent; --bs-table-border-color: var(--line); --bs-table-hover-bg: var(--surface-2); --bs-table-hover-color: var(--ink); }
.pagination { --bs-pagination-bg: var(--surface); --bs-pagination-border-color: var(--line); --bs-pagination-color: var(--ink); --bs-pagination-hover-bg: var(--surface-3); --bs-pagination-active-bg: var(--brand); --bs-pagination-active-border-color: var(--brand); --bs-pagination-hover-border-color: var(--line); }
.list-group { --bs-list-group-bg: transparent; --bs-list-group-border-color: var(--line); --bs-list-group-color: var(--ink); }
.badge.text-bg-light { background: var(--surface-3) !important; color: var(--ink) !important; }
.toast { border-radius: 14px; }

/* ---------- Marca SYHUB ---------- */
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand-mark { height: 34px; width: auto; filter: drop-shadow(0 6px 14px rgba(18, 180, 255, .35)); flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-word { font-weight: 800; font-size: 1.32rem; letter-spacing: .02em; color: var(--ink); }
.brand-word b { font-weight: 800; background: linear-gradient(90deg, #12b4ff, #2b6bff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-product { font-size: .66rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-top: .3rem; }
.sidebar .brand-word, .brand-on-dark .brand-word { color: #fff; }
.sidebar .brand-product, .brand-on-dark .brand-product { color: #8fb4ff; }
.brand-lg .brand-mark { height: 48px; }
.brand-lg .brand-word { font-size: 1.8rem; }
.brand-xs { gap: .3rem; vertical-align: middle; }
.brand-xs .brand-mark { height: 16px; filter: none; }
.brand-xs .brand-word { font-size: .8rem; }

/* ---------- Estrutura ---------- */
.shell { min-height: 100vh; }
.sidebar {
  --bs-offcanvas-width: 288px;
  --bs-offcanvas-bg: transparent;
  --bs-offcanvas-border-width: 0;
  color: #b9c6ea;
  border: 0 !important;
}
.sb-inner {
  height: 100%; display: flex; flex-direction: column;
  background:
    radial-gradient(420px 260px at 0% 0%, rgba(18, 180, 255, .16), transparent 60%),
    radial-gradient(380px 300px at 100% 100%, rgba(43, 63, 240, .22), transparent 60%),
    linear-gradient(180deg, #0a1638 0%, #07112e 100%);
  border: 1px solid rgba(255, 255, 255, .06);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
@media (min-width: 992px) {
  .sidebar { position: fixed; top: var(--gap); bottom: var(--gap); left: var(--gap); width: var(--sb-w); z-index: 1035; visibility: visible !important; transform: none !important; transition: width .22s ease; }
  .sb-inner { border-radius: 22px; }
  .main { margin-left: calc(var(--sb-w) + var(--gap) * 2); transition: margin .22s ease; }
}
@media (max-width: 991.98px) {
  .sidebar .sb-inner { border-radius: 0 22px 22px 0; border-left: 0; }
}

.sb-head { display: flex; align-items: center; gap: .5rem; padding: 1.15rem 1rem 1rem 1.15rem; }
.sb-brand { text-decoration: none; min-width: 0; }
.sb-collapse { margin-left: auto; width: 32px; height: 32px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .04); color: #9fb2e6; align-items: center; justify-content: center; transition: all .15s; }
.sb-collapse:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.sb-client { padding: 0 .75rem .5rem; }
.client-btn { width: 100%; display: flex; align-items: center; gap: .65rem; padding: .6rem .7rem; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .05); color: #fff; text-align: left; transition: background .15s; }
.client-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .09); }
.client-btn:disabled { opacity: 1; cursor: default; }
.client-avatar { width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center; flex-shrink: 0; background: var(--grad); color: #fff; font-weight: 800; font-size: .9rem; }
.client-avatar.sm { width: 26px; height: 26px; border-radius: 8px; font-size: .72rem; }
.client-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.client-info small { font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; color: #8fa3d8; }
.client-info strong { font-size: .9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-caret { margin-left: auto; color: #8fa3d8; }
.client-menu { width: 260px; max-height: 60vh; overflow-y: auto; }
.client-item { display: flex; align-items: center; gap: .55rem; }

.sb-nav { flex: 1; overflow-y: auto; padding: .4rem .75rem; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .12) transparent; }
.sb-group { margin-bottom: .55rem; }
.sb-group-title { font-size: .66rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #6f82b8; padding: .7rem .7rem .35rem; }
.sb-link { position: relative; display: flex; align-items: center; gap: .75rem; padding: .62rem .75rem; margin: 2px 0; border-radius: 12px; color: #b9c6ea; text-decoration: none; font-weight: 500; font-size: .92rem; transition: background .15s, color .15s; }
.sb-link i { font-size: 1.08rem; width: 20px; text-align: center; color: #8fa3d8; transition: color .15s; }
.sb-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sb-link:hover i { color: #fff; }
.sb-link.active { color: #fff; background: linear-gradient(90deg, rgba(31, 91, 255, .32), rgba(18, 180, 255, .1)); box-shadow: inset 0 0 0 1px rgba(95, 150, 255, .25); }
.sb-link.active i { color: #5fc4ff; }
.sb-link.active::before { content: ''; position: absolute; left: -.75rem; top: 22%; bottom: 22%; width: 4px; border-radius: 0 4px 4px 0; background: var(--grad); }

.sb-foot { padding: .75rem; }
.sb-promo { display: flex; gap: .65rem; padding: .8rem; border-radius: 14px; background: linear-gradient(135deg, rgba(18, 180, 255, .14), rgba(43, 63, 240, .2)); border: 1px solid rgba(120, 170, 255, .16); }
.sb-promo i { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--grad); color: #fff; flex-shrink: 0; }
.sb-promo strong { display: block; color: #fff; font-size: .84rem; }
.sb-promo span { font-size: .74rem; color: #a9b9e3; }
.sb-signature { text-align: center; font-size: .7rem; color: #6f82b8; padding-top: .8rem; }
.sb-signature .brand-word { color: #c9d6ff; }

/* Menu recolhido (somente computador) */
@media (min-width: 992px) {
  .sb-mini .sidebar { width: var(--sb-mini); }
  .sb-mini .main { margin-left: calc(var(--sb-mini) + var(--gap) * 2); }
  .sb-mini .sb-head { flex-direction: column; padding: 1rem .5rem .75rem; gap: .75rem; }
  .sb-mini .brand-text, .sb-mini .client-info, .sb-mini .client-caret, .sb-mini .sb-link span, .sb-mini .sb-promo, .sb-mini .sb-signature { display: none; }
  .sb-mini .sb-collapse { margin: 0; }
  .sb-mini .sb-collapse i { transform: scaleX(-1); }
  .sb-mini .sb-client { padding: 0 .55rem .5rem; }
  .sb-mini .client-btn { justify-content: center; padding: .5rem; }
  .sb-mini .sb-nav { padding: .4rem .55rem; overflow: visible; }
  .sb-mini .sb-group-title { font-size: 0; padding: .4rem 0; margin: 0 .6rem; border-top: 1px solid rgba(255, 255, 255, .07); }
  .sb-mini .sb-group:first-child .sb-group-title { border-top: 0; }
  .sb-mini .sb-link { justify-content: center; padding: .7rem 0; }
  .sb-mini .sb-link.active::before { left: -.55rem; }
  .sb-mini .sb-inner { overflow: visible; }
  .sb-mini .sb-link:hover::after {
    content: attr(data-tip); position: absolute; left: calc(100% + 14px); top: 50%; transform: translateY(-50%);
    background: var(--navy); color: #fff; padding: .4rem .7rem; border-radius: 8px; font-size: .8rem; white-space: nowrap;
    box-shadow: var(--shadow); z-index: 10; pointer-events: none;
  }
}

/* ---------- Topo ---------- */
.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: .9rem;
  padding: calc(var(--gap) + 4px) 1.75rem .9rem; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
}
.page-head { min-width: 0; }
.crumb { font-size: .76rem; color: var(--muted); display: flex; align-items: center; gap: .35rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb i { font-size: .6rem; }
.crumb span { color: var(--ink); font-weight: 500; }
.page-title { font-size: 1.45rem; font-weight: 800; margin: .1rem 0 0; letter-spacing: -.025em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 1.1rem; box-shadow: var(--shadow-sm); transition: background .15s; flex-shrink: 0; }
.icon-btn:hover { background: var(--surface-3); }
[data-bs-theme="light"] .theme-ico-dark, [data-bs-theme="dark"] .theme-ico-light { display: none; }
.user-btn { display: flex; align-items: center; gap: .6rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: .25rem .7rem .25rem .25rem; border-radius: 14px; box-shadow: var(--shadow-sm); }
.user-btn strong { font-size: .86rem; }
.user-btn small { font-size: .7rem; color: var(--muted); }
.avatar { width: 34px; height: 34px; border-radius: 11px; display: inline-grid; place-items: center; flex-shrink: 0; background: var(--grad); color: #fff; font-weight: 700; font-size: .85rem; }
.content { padding: .5rem 1.75rem 2rem; }
@media (max-width: 575.98px) {
  .content { padding: .5rem 1rem 1.5rem; }
  .topbar { padding: .75rem 1rem; gap: .6rem; }
  .page-title { font-size: 1.15rem; }
  .top-actions .btn-label { display: none; }
}

/* ---------- Cartões ---------- */
.card-soft { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; color: var(--ink); }
.card-header-soft { display: flex; align-items: center; gap: .55rem; padding: 1rem 1.25rem; font-weight: 700; font-size: .95rem; border-bottom: 1px solid var(--line); }
.card-header-soft > i:first-child { width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); font-size: .95rem; }
.card-highlight { border-color: rgba(var(--brand-rgb), .35); background: linear-gradient(180deg, var(--brand-soft), var(--surface) 70%); }
.step { width: 26px; height: 26px; border-radius: 8px; background: var(--grad); color: #fff; display: inline-grid; place-items: center; font-size: .8rem; flex-shrink: 0; }

.table-soft thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; padding: .8rem 1rem; }
.table-soft td { padding: .8rem 1rem; border-color: var(--line); }
.table-soft td.text-end, .table-soft th.text-end { white-space: nowrap; }
.table-soft tbody tr:last-child td { border-bottom: 0; }
.table-kv { margin: 0; }
.table-kv th { width: 42%; font-weight: 500; color: var(--muted); font-size: .84rem; padding: .55rem 1.25rem; background: transparent; }
.table-kv td { font-size: .88rem; padding: .55rem 1.25rem; }
.camp-name { max-width: 280px; }

/* ---------- KPIs ---------- */
.kpi-grid { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1600px) { .kpi-grid:not(.kpi-grid-3) { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.kpi { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.15rem 1rem; box-shadow: var(--shadow); height: 100%; overflow: hidden; transition: transform .18s, box-shadow .18s; }
.kpi:hover { transform: translateY(-2px); }
.kpi::after { content: ''; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: var(--kc); opacity: .09; }
.kpi-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--kc); color: #fff; margin-bottom: .8rem; box-shadow: 0 8px 18px -8px var(--kc); }
.kpi-label { font-size: .78rem; color: var(--muted); font-weight: 600; }
.kpi-value { font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { font-size: .74rem; color: var(--muted); margin-top: .15rem; }
.kpi-blue { --kc: #1f5bff; } .kpi-green { --kc: #10b981; } .kpi-cyan { --kc: #0ea5e9; }
.kpi-amber { --kc: #f59e0b; } .kpi-pink { --kc: #ec4899; } .kpi-violet { --kc: #6d5dfc; }
.kpi-hero { background: var(--grad); border: 0; color: #fff; }
.kpi-hero::after { background: #fff; opacity: .12; }
.kpi-hero .kpi-icon { background: rgba(255, 255, 255, .2); box-shadow: none; }
.kpi-hero .kpi-label, .kpi-hero .kpi-sub { color: rgba(255, 255, 255, .82); }

.roas { padding: .22rem .6rem; border-radius: 999px; font-weight: 700; font-size: .78rem; }
.roas-good { background: rgba(16, 185, 129, .15); color: #059669; }
.roas-mid { background: rgba(245, 158, 11, .16); color: #b45309; }
.roas-bad { background: rgba(239, 68, 68, .14); color: #dc2626; }
[data-bs-theme="dark"] .roas-good { color: #34d399; }
[data-bs-theme="dark"] .roas-mid { color: #fbbf24; }
[data-bs-theme="dark"] .roas-bad { color: #f87171; }

.chart-box { position: relative; height: 290px; }
.chart-box-sm { height: 260px; }
.funnel-row { margin-bottom: .9rem; }
.funnel-bar { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.funnel-bar span { display: block; height: 100%; border-radius: 99px; transition: width .6s; }

.filter-bar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; }
.seg { display: inline-flex; padding: 4px; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); }
.seg a, .seg .btn { border: 0; border-radius: 9px; padding: .35rem .8rem; font-size: .84rem; font-weight: 600; color: var(--muted); text-decoration: none; background: transparent; }
.seg a:hover { color: var(--ink); background: var(--surface-3); }
.seg a.active { background: var(--brand-soft); color: var(--brand-ink); }
.search-box { width: 320px; max-width: 100%; flex: 0 1 auto; }

/* ---------- Chips / etapas ---------- */
.chip { display: inline-flex; align-items: center; gap: .25rem; padding: .16rem .5rem; border-radius: 7px; font-size: .72rem; background: var(--surface-3); color: var(--muted); font-weight: 600; }
.chip-green { background: rgba(16, 185, 129, .14); color: #059669; }
[data-bs-theme="dark"] .chip-green { color: #34d399; }
.stage-badge { display: inline-flex; align-items: center; gap: .4rem; padding: .26rem .66rem; border-radius: 999px; font-size: .77rem; font-weight: 600; background: color-mix(in srgb, var(--stage) 15%, transparent); color: color-mix(in srgb, var(--stage) 78%, var(--ink)); }
.stage-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--stage); }

/* ---------- Kanban ---------- */
.kanban { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 1rem; align-items: flex-start; scroll-snap-type: x proximity; }
.kanban-col { flex: 0 0 292px; background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 210px); scroll-snap-align: start; transition: background .15s, box-shadow .15s; }
[data-bs-theme="dark"] .kanban-col { background: color-mix(in srgb, var(--surface) 70%, var(--bg)); }
.kanban-col.over { background: var(--brand-soft); box-shadow: inset 0 0 0 2px rgba(var(--brand-rgb), .45); }
.kanban-head { padding: .9rem 1rem .7rem; border-top: 4px solid var(--stage); border-radius: var(--radius) var(--radius) 0 0; }
.stage-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--stage); }
.kanban-list { padding: .25rem .6rem .75rem; overflow-y: auto; display: flex; flex-direction: column; gap: .55rem; min-height: 80px; }
.lead-card { position: relative; background: var(--surface); border-radius: 13px; padding: .78rem .88rem; box-shadow: var(--shadow-sm); border: 1px solid var(--line); cursor: grab; transition: box-shadow .15s, transform .15s, border-color .15s; }
.lead-card:hover { box-shadow: var(--shadow); border-color: rgba(var(--brand-rgb), .35); }
.lead-card.dragging { opacity: .5; transform: rotate(2deg); }
.lead-card .stretched-link::after { z-index: 1; }
.owner-pill { position: absolute; right: .7rem; bottom: .65rem; width: 24px; height: 24px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-ink); font-size: .7rem; font-weight: 700; display: grid; place-items: center; }

.stage-picker { display: flex; flex-wrap: wrap; gap: .4rem; }
.btn-stage { border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: .82rem; padding: .36rem .78rem; border-radius: 999px; font-weight: 500; }
.btn-stage:hover { background: var(--surface-3); color: var(--ink); }
.btn-check:checked + .btn-stage { background: var(--stage); border-color: var(--stage); color: #fff; }

/* ---------- Linha do tempo ---------- */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 1.1rem 1.75rem; }
.timeline li::before { content: ''; position: absolute; left: 1px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--muted); }
.timeline .tl-note::before { border-color: var(--brand); }
.timeline .tl-stage::before { border-color: #10b981; }
.tl-meta { font-size: .75rem; color: var(--muted); margin-bottom: .2rem; }
.tl-body { font-size: .9rem; word-break: break-word; }
.tl-note .tl-body { background: var(--surface-2); border: 1px solid var(--line); padding: .6rem .8rem; border-radius: 11px; }

/* ---------- Abas próprias ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); width: fit-content; max-width: 100%; }
.tab-btn { border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: .88rem; padding: .5rem .95rem; border-radius: 10px; display: inline-flex; align-items: center; gap: .45rem; }
.tab-btn:hover { color: var(--ink); background: var(--surface-3); }
.tab-btn.active { background: var(--brand-soft); color: var(--brand-ink); }
.tab-panel[hidden] { display: none !important; }

/* ---------- Código ---------- */
.code-box { position: relative; background: var(--code-bg); border: 1px solid var(--line); border-radius: 13px; padding: 1rem; }
.code-box pre { color: var(--code-ink); margin: 0; font-size: .79rem; white-space: pre-wrap; word-break: break-all; padding-right: 86px; }
.code-box .copy-btn { position: absolute; top: .6rem; right: .6rem; }
code { color: var(--brand-ink); }

/* ---------- Clientes (agência) ---------- */
.client-row-name { display: flex; align-items: center; gap: .7rem; min-width: 260px; }
.client-row-name .fw-semibold { white-space: nowrap; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .35rem; }
.status-on { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, .18); }
.status-off { background: var(--muted); }

/* ---------- Telas de acesso ---------- */
.auth-body { min-height: 100vh; background: var(--bg); }
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-side { position: relative; overflow: hidden; background: linear-gradient(160deg, #0a1638 0%, #07112e 60%, #050a1c 100%); color: #c9d6ff; display: flex; align-items: center; padding: 3rem; }
.auth-glow { position: absolute; inset: 0; background: radial-gradient(520px 380px at 15% 15%, rgba(18, 180, 255, .3), transparent 60%), radial-gradient(520px 420px at 85% 90%, rgba(43, 63, 240, .4), transparent 60%); }
.auth-side-in { position: relative; max-width: 460px; margin: 0 auto; }
.auth-side h2 { color: #fff; font-weight: 800; font-size: 2.3rem; letter-spacing: -.03em; line-height: 1.15; margin: 2.2rem 0 1.6rem; }
.auth-side h2 span { background: linear-gradient(90deg, #12b4ff, #5f8bff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-points { list-style: none; padding: 0; margin: 0 0 2rem; display: grid; gap: .85rem; }
.auth-points li { display: flex; align-items: center; gap: .75rem; font-size: .95rem; }
.auth-points i { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); color: #5fc4ff; flex-shrink: 0; }
.auth-tag { font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; color: #6f82b8; margin: 0; }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.auth-card { width: 100%; max-width: 420px; animation: rise .45s ease both; }
.auth-title { font-weight: 800; letter-spacing: -.03em; font-size: 1.75rem; }
.auth-foot { color: var(--muted); font-size: .78rem; margin-top: 2rem; }
@media (max-width: 991.98px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Formulário hospedado (página do cliente) */
.hosted-body { min-height: 100vh; background: linear-gradient(160deg, #0a1638 0%, #07112e 60%, #050a1c 100%); }
.hosted-bg { position: fixed; inset: 0; background: radial-gradient(520px 380px at 15% 10%, rgba(18, 180, 255, .28), transparent 60%), radial-gradient(520px 420px at 90% 95%, rgba(43, 63, 240, .38), transparent 60%); }
.hosted-wrap { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1rem; }
.hosted-card { width: 100%; max-width: 440px; background: #fff; color: #0b1430; border-radius: 24px; padding: 2.25rem; box-shadow: 0 30px 80px rgba(0, 0, 0, .4); animation: rise .45s ease both; }
.hosted-card .form-control { background: #fff; color: #0b1430; border-color: #e3e9f2; }
.hosted-card .text-muted { color: #5f6b85 !important; }
.hosted-logo { width: 64px; height: 64px; margin: 0 auto; border-radius: 18px; display: grid; place-items: center; font-size: 1.75rem; font-weight: 800; color: #fff; background: var(--grad); box-shadow: 0 12px 30px rgba(31, 91, 255, .45); }
.hosted-foot { color: #8fa3d8; font-size: .75rem; margin-top: 1.25rem; display: flex; align-items: center; gap: .4rem; }
.hosted-foot .brand-word { color: #fff; }

/* ---------- Impressão (relatório para o cliente) ---------- */
@media screen { .print-only { display: none !important; } }
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  :root, [data-bs-theme] { --bg: #fff; --surface: #fff; --surface-2: #f7f9fd; --surface-3: #edf1f8; --line: #dde3ee; --ink: #0b1430; --muted: #5f6b85; --shadow: none; --shadow-sm: none; }
  body { background: #fff !important; }
  .sidebar, .topbar, .no-print, .alert, .toast-container { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0 !important; }
  .kpi-grid { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }
  .print-full { width: 100% !important; flex: 0 0 100% !important; max-width: 100% !important; }
  .card-soft, .kpi { break-inside: avoid; box-shadow: none !important; }
  .kpi-hero { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .row > [class*="col-"] { break-inside: avoid; }
  .chart-box { height: 240px; }
}
.print-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--line); padding-bottom: .75rem; margin-bottom: 1rem; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
