/* ==========================================================================
   1. Design Tokens
   ========================================================================== */
:root {
    /* Nexvora Canonical Brand & Surface Palette */
    --nx-navy: #0B1F44;
    --nx-navy-soft: #132A57;
    --nx-blue: #3B82F6;
    --nx-blue-hover: #2563EB;
    --nx-blue-soft: rgba(59, 130, 246, 0.12);
    --nx-cyan: #06B6D4;
    --nx-cyan-soft: rgba(6, 182, 212, 0.12);
    --nx-purple: #8B5CF6;
    --nx-purple-soft: rgba(139, 92, 246, 0.12);

    --nx-bg: #F3F4F6;
    --nx-surface: #FFFFFF;
    --nx-border: #E5E7EB;
    --nx-border-strong: #D1D5DB;
    --nx-ink: #1F2937;
    --nx-ink-soft: #4B5563;
    --nx-ink-strong: #0B1F44;
    --nx-muted: #6B7280;

    --nx-emerald: #10B981;
    --nx-emerald-soft: rgba(16, 185, 129, 0.12);
    --nx-amber: #F59E0B;
    --nx-amber-soft: rgba(245, 158, 11, 0.14);
    --nx-danger: #EF4444;
    --nx-danger-soft: rgba(239, 68, 68, 0.12);

    /* Restricted to special brand highlights — never on primary buttons */
    --nx-gradient: linear-gradient(135deg, #3B82F6 0%, #06B6D4 50%, #8B5CF6 100%);

    /* Typography */
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;

    /* Shape & Elevation */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow: 0 4px 16px rgba(11, 31, 68, 0.08);
    --shadow-lg: 0 12px 32px rgba(11, 31, 68, 0.16);
}

/* ==========================================================================
   2. Reset & Typography
   ========================================================================== */
* { box-sizing: border-box; }

body {
    background: var(--nx-bg);
    color: var(--nx-ink);
    font-family: var(--font-sans);
    font-size: 14.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, .font-display {
    font-family: var(--font-sans);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--nx-ink-strong);
}

a { color: var(--nx-blue); text-decoration: none; }
a:hover { color: var(--nx-blue-hover); }

code, pre, kbd { font-family: var(--font-mono); }

/* Metric, financial, phone, and date values stay in Inter with tabular figures */
.stat-value,
.stat-value-sm,
.cell-mono,
.kanban-count,
.lead-tel,
.date-field input[type="date"],
.plano-preco,
.chart-total,
.sbar b,
.uso-lista .uso-valor,
.uso-valor {
    font-family: var(--font-sans);
    font-variant-numeric: tabular-nums;
}

::selection {
    background: rgba(59, 130, 246, 0.18);
    color: var(--nx-ink-strong);
}

*:focus-visible {
    outline: 2px solid var(--nx-blue);
    outline-offset: 2px;
}

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

/* ==========================================================================
   3. App Shell (Sidebar & Mobile Topbar)
   ========================================================================== */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 248px;
    flex-shrink: 0;
    background: var(--nx-navy);
    color: rgba(255, 255, 255, 0.78);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-close { display: none; }

.mobile-topbar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--nx-navy);
    color: #FFFFFF;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 1050;
}

.mobile-topbar .hamburger {
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: 1.4rem;
    line-height: 1;
    padding: 4px;
    cursor: pointer;
}

.mobile-topbar-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #FFFFFF;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(11, 31, 68, 0.55);
    z-index: 1090;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 18px;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #FFFFFF;
}

.brand-wordmark {
    font-family: var(--font-sans);
    font-weight: 800;
    letter-spacing: 0.14em;
    line-height: 1;
    color: #FFFFFF;
}
.sidebar-brand .brand-wordmark { font-size: 1.05rem; }
.mobile-topbar-brand .brand-wordmark { font-size: 0.96rem; }

/* Nexvora mark SVG (400x296 -> ~1.35:1) */
.sidebar-brand .mark,
.mobile-topbar-brand .mark,
.login-side .brand .mark {
    background: url("../img/mark-light.f95072460773.svg") center / contain no-repeat;
    border-radius: 0;
    flex-shrink: 0;
}
.sidebar-brand .mark { width: 30px; height: 22px; }
.mobile-topbar-brand .mark { width: 24px; height: 18px; }
.login-side .brand .mark { width: 36px; height: 27px; }
.sidebar-brand .mark::after,
.login-side .brand .mark::after { display: none; }

.sidebar-section-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 600;
    padding: 14px 12px 6px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.74);
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #FFFFFF;
}

.sidebar-nav a.active {
    background: var(--nx-blue);
    color: #FFFFFF;
    font-weight: 600;
}

.sidebar-nav a i {
    width: 18px;
    text-align: center;
    font-size: 0.98rem;
    opacity: 0.85;
    flex-shrink: 0;
}
.sidebar-nav a.active i { opacity: 1; }

.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.sidebar-user .avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.22);
    border: 1px solid rgba(59, 130, 246, 0.45);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sidebar-user .meta { line-height: 1.25; overflow: hidden; }
.sidebar-user .meta .name {
    color: #FFFFFF;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user .meta .role {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.56);
}

.sidebar-logout {
    display: block;
    width: 100%;
    margin-top: 10px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.78);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.sidebar-logout:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.24);
    color: #FFFFFF;
}

.content-area {
    flex: 1;
    min-width: 0;
    padding: 34px 40px 60px;
}

@media (max-width: 900px) {
    .mobile-topbar { display: flex; }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        width: 82vw;
        max-width: 300px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 1100;
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open { transform: translateX(0); }

    .sidebar-close {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        background: none;
        border: none;
        color: rgba(255, 255, 255, 0.78);
        font-size: 1.1rem;
        padding: 4px;
        cursor: pointer;
    }

    .sidebar-backdrop.open { display: block; }

    .app-shell { min-height: calc(100vh - 53px); }

    .content-area { padding: 18px 16px 40px; }
}

/* ==========================================================================
   4. Page Header, Trial Banner & Alerts
   ========================================================================== */
.topbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.page-eyebrow {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--nx-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.page-title {
    font-size: 1.6rem;
    margin: 0;
}

.page-subtitle {
    font-size: 0.9rem;
    color: var(--nx-muted);
    margin: 4px 0 0;
    line-height: 1.45;
}

@media (max-width: 900px) {
    .topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 22px;
    }
    .topbar .btn-pro { width: 100%; justify-content: center; }
    .page-title { font-size: 1.35rem; }
}

.trial-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    color: #92400E;
    border-radius: var(--radius-sm);
    padding: 9px 14px;
    font-size: 0.84rem;
    margin-bottom: 16px;
}
.trial-banner a {
    color: #78350F;
    font-weight: 700;
    text-decoration: underline;
    white-space: nowrap;
}

.alert-pro {
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 0.87rem;
    margin-bottom: 16px;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.alert-pro-success { background: #ECFDF5; color: #065F46; border-color: #A7F3D0; }
.alert-pro-error { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }
.alert-pro-info { background: #EFF6FF; color: #1E40AF; border-color: #BFDBFE; }
.alert-pro button {
    background: none;
    border: none;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
}
.alert-pro button:hover { opacity: 1; }

/* ==========================================================================
   5. Buttons, Badges & Etiquetas
   ========================================================================== */
.btn-pro {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: var(--radius-sm);
    padding: 9px 16px;
    font-family: var(--font-sans);
    font-size: 0.86rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    text-decoration: none;
    line-height: 1.2;
}
.btn-pro:active { transform: translateY(1px); }
.btn-pro:disabled,
button.btn-pro[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-pro-primary {
    background: var(--nx-blue);
    color: #FFFFFF;
    box-shadow: var(--shadow-sm);
}
.btn-pro-primary:hover {
    background: var(--nx-blue-hover);
    color: #FFFFFF;
}

.btn-pro-ghost {
    background: var(--nx-surface);
    color: var(--nx-ink);
    border-color: var(--nx-border-strong);
}
.btn-pro-ghost:hover {
    background: var(--nx-bg);
    color: var(--nx-ink-strong);
}

.btn-pro-outline {
    background: transparent;
    color: var(--nx-ink-soft);
    border-color: var(--nx-border-strong);
}
.btn-pro-outline:hover {
    background: var(--nx-surface);
    color: var(--nx-ink-strong);
}

.btn-pro-sm { padding: 5px 11px; font-size: 0.78rem; }

.badge-pro {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-neutral {
    background: var(--nx-bg);
    color: var(--nx-ink-soft);
    border: 1px solid var(--nx-border-strong);
}
.badge-success { background: var(--nx-emerald-soft); color: #047857; }
.badge-warn { background: var(--nx-amber-soft); color: #92400E; }
.badge-danger { background: var(--nx-danger-soft); color: #B91C1C; }

.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* Radar pulse for active scraping searches */
.status-radar { position: relative; width: 9px; height: 9px; flex-shrink: 0; }
.status-radar::before,
.status-radar::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--nx-amber);
}
.status-radar::before {
    animation: radar-ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes radar-ping {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(3.2); opacity: 0; }
}

/* Custom lead labels */
.etq-teal { background: var(--nx-emerald-soft); color: #047857; }
.etq-copper { background: var(--nx-amber-soft); color: #92400E; }
.etq-danger { background: var(--nx-danger-soft); color: #B91C1C; }
.etq-blue { background: var(--nx-blue-soft); color: #1D4ED8; }
.etq-purple { background: var(--nx-purple-soft); color: #6D28D9; }
.etq-neutral {
    background: var(--nx-bg);
    color: var(--nx-ink-soft);
    border: 1px solid var(--nx-border-strong);
}

/* ==========================================================================
   6. Cards, KPIs & Usage Bars
   ========================================================================== */
.card-pro {
    background: var(--nx-surface);
    border: 1px solid var(--nx-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card-pro-pad { padding: 24px; }
@media (max-width: 640px) { .card-pro-pad { padding: 16px; } }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) {
    .stat-grid { gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-card .stat-value { font-size: 1.55rem; }
}
@media (max-width: 380px) { .stat-grid { grid-template-columns: 1fr; } }

.stat-grid-6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1200px) { .stat-grid-6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .stat-grid-6 { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
@media (max-width: 380px) { .stat-grid-6 { grid-template-columns: 1fr; } }

.stat-card {
    background: var(--nx-surface);
    border: 1px solid var(--nx-border);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
}

.stat-card-link {
    text-decoration: none;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-card-link:hover {
    transform: translateY(-1px);
    border-color: var(--nx-border-strong);
    box-shadow: var(--shadow);
}
.stat-card-link.stat-card-warn,
.stat-card.is-warn { border-color: #FCD34D; }
.stat-card-link.stat-card-warn .stat-value,
.stat-card.is-warn .stat-value { color: #B45309; }
.stat-card-link.stat-card-danger,
.stat-card.is-danger { border-color: #FCA5A5; }
.stat-card-link.stat-card-danger .stat-value,
.stat-card.is-danger .stat-value { color: var(--nx-danger); }

.stat-card .stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--nx-muted);
    font-weight: 600;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--nx-ink-strong);
}

.stat-card .stat-value small {
    font-size: 1rem;
    color: var(--nx-muted);
    font-weight: 500;
}

.stat-card .stat-value.stat-value-sm {
    font-size: 1.05rem;
    line-height: 2.2rem;
}

.stat-sub {
    font-size: 0.74rem;
    color: var(--nx-muted);
    margin-top: 4px;
    line-height: 1.4;
}

/* KPI header & icon badges (Etapa 4+) */
.kpi-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
.kpi-head .stat-label { margin-bottom: 0; }

.kpi-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
    background: var(--nx-bg);
    color: var(--nx-muted);
}
.kpi-icon-blue { background: var(--nx-blue-soft); color: var(--nx-blue); }
.kpi-icon-cyan { background: var(--nx-cyan-soft); color: #0E7490; }
.kpi-icon-purple { background: var(--nx-purple-soft); color: var(--nx-purple); }
.kpi-icon-emerald { background: var(--nx-emerald-soft); color: var(--nx-emerald); }
.kpi-icon-amber { background: var(--nx-amber-soft); color: #B45309; }
.kpi-icon-danger { background: var(--nx-danger-soft); color: var(--nx-danger); }

.stat-card .stat-sub { font-variant-numeric: tabular-nums; }
.stat-grid-6 .stat-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-section-title {
    font-size: 1.05rem;
    margin: 0 0 16px;
    color: var(--nx-ink-strong);
}

/* Warning banner (shared search queue / Amber notices) */
.banner-amber {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 20px;
    background: #FFFBEB;
    border-color: #FDE68A;
    color: #92400E;
    font-size: 0.86rem;
    line-height: 1.5;
}
.banner-amber i {
    color: var(--nx-amber);
    font-size: 1.1rem;
    margin-top: 2px;
    flex-shrink: 0;
}
.banner-amber strong { color: #78350F; }
.banner-amber p { margin: 4px 0 0; color: #92400E; line-height: 1.5; }
.banner-amber a { color: #78350F; text-decoration: underline; font-weight: 700; }
.banner-amber code {
    background: rgba(245, 158, 11, 0.14);
    color: #78350F;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.8em;
}

/* Danger banner (plan limit reached / error notices) */
.banner-danger {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 20px;
    background: #FEF2F2;
    border-color: #FECACA;
    color: #991B1B;
    font-size: 0.86rem;
    line-height: 1.5;
}
.banner-danger i {
    color: var(--nx-danger);
    font-size: 1.1rem;
    margin-top: 2px;
    flex-shrink: 0;
}
.banner-danger strong { color: #7F1D1D; }
.banner-danger p { margin: 4px 0 0; color: #991B1B; line-height: 1.5; }
.banner-danger a { color: #7F1D1D; text-decoration: underline; font-weight: 700; }

/* Usage bars (partials/uso_barras.html) */
.uso-lista {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.uso-topo {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    font-size: 0.85rem;
    margin-bottom: 6px;
}
.uso-rotulo {
    font-weight: 600;
    color: var(--nx-ink);
}
.uso-valor {
    font-family: var(--font-sans);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 0.84rem;
    color: var(--nx-ink-soft);
    white-space: nowrap;
}
.uso-trilho {
    height: 8px;
    background: var(--nx-bg);
    border: 1px solid var(--nx-border);
    border-radius: 99px;
    overflow: hidden;
}
.uso-barra {
    height: 100%;
    background: linear-gradient(90deg, var(--nx-blue) 0%, var(--nx-purple) 100%);
    border-radius: 99px;
    transition: width 0.3s ease;
}
.uso-aviso .uso-barra { background: var(--nx-amber); }
.uso-estourado .uso-barra { background: var(--nx-danger); }
.uso-dica {
    font-size: 0.75rem;
    color: var(--nx-muted);
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}
.uso-dica-aviso {
    color: #92400E;
    font-weight: 500;
}
.uso-dica-estourado {
    color: #B91C1C;
    font-weight: 500;
}

/* ==========================================================================
   7. Tables, Forms & Pagination
   ========================================================================== */
.table-pro-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table-pro {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.87rem;
}

.table-pro thead th {
    text-align: left;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--nx-muted);
    font-weight: 600;
    padding: 0 14px 10px;
    border-bottom: 1px solid var(--nx-border);
}

.table-pro tbody td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--nx-border);
    vertical-align: middle;
    color: var(--nx-ink);
}

.table-pro tbody tr:last-child td { border-bottom: none; }
.table-pro tbody tr:hover { background: var(--nx-bg); }

.cell-muted { color: var(--nx-muted); }
.cell-mono { font-weight: 600; color: var(--nx-ink-strong); font-variant-numeric: tabular-nums; }
.cell-empty { text-align: center; color: var(--nx-muted); padding: 40px 14px; }
.table-pro .cell-empty { padding: 48px 14px; }
.buscas-table tbody td { font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
    .table-pro thead th, .table-pro tbody td { padding: 10px 10px; font-size: 0.82rem; }

    .buscas-table th:nth-child(5), .buscas-table td:nth-child(5),
    .buscas-table th:nth-child(6), .buscas-table td:nth-child(6) {
        display: none;
    }
}

.field-pro { margin-bottom: 18px; }

.field-pro label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--nx-ink-soft);
    margin-bottom: 6px;
}

.field-pro .form-text { font-size: 0.75rem; color: var(--nx-muted); margin-top: 5px; }
.field-pro .text-danger { font-size: 0.75rem; margin-top: 5px; }

.field-pro input[type="text"],
.field-pro input[type="password"],
.field-pro input[type="email"],
.field-pro input[type="number"],
.field-pro select,
.field-pro textarea,
input.form-control,
textarea.form-control,
select.form-select {
    width: 100%;
    border: 1px solid var(--nx-border-strong);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 0.88rem;
    font-family: var(--font-sans);
    color: var(--nx-ink);
    background: var(--nx-surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field-pro input:focus,
.field-pro select:focus,
.field-pro textarea:focus,
input.form-control:focus,
textarea.form-control:focus,
select.form-select:focus {
    border-color: #3B82F6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

/* Date field with clear button */
.date-field {
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--nx-surface);
    border: 1px solid var(--nx-border-strong);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    height: 42px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.date-field:focus-within {
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

.date-field.has-value {
    background: var(--nx-blue-soft);
    border-color: rgba(59, 130, 246, 0.35);
}
.date-field.has-value .date-field-icon { color: var(--nx-blue-hover); }

.date-field-icon {
    color: var(--nx-muted);
    font-size: 0.95rem;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.date-field input[type="date"] {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--nx-ink);
    height: 100%;
    accent-color: var(--nx-blue);
}
.date-field input[type="date"]:focus { outline: none; box-shadow: none; }

.date-field input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(54%) sepia(95%) saturate(1800%) hue-rotate(197deg) brightness(104%);
    cursor: pointer;
    border-radius: 6px;
    padding: 4px;
    transition: background 0.15s ease;
}
.date-field input[type="date"]::-webkit-calendar-picker-indicator:hover {
    background: rgba(59, 130, 246, 0.12);
}

.date-field-clear {
    background: none;
    border: none;
    color: var(--nx-muted);
    font-size: 0.95rem;
    cursor: pointer;
    display: none;
    align-items: center;
    padding: 2px;
    flex-shrink: 0;
    transition: color 0.15s ease, transform 0.15s ease;
}
.date-field.has-value .date-field-clear { display: flex; }
.date-field-clear:hover { color: var(--nx-danger); transform: scale(1.1); }

/* Pagination */
.paginacao {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--nx-border);
}

.paginacao-info {
    font-size: 0.82rem;
    color: var(--nx-ink-soft);
    font-variant-numeric: tabular-nums;
}

.paginacao-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.paginacao-btn,
.paginacao-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-decoration: none;
    color: var(--nx-ink-soft);
    border: 1px solid var(--nx-border);
    background: var(--nx-surface);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.paginacao-btn:hover,
.paginacao-num:hover {
    background: var(--nx-bg);
    color: var(--nx-ink-strong);
    border-color: var(--nx-border-strong);
}

.paginacao-btn.disabled {
    opacity: 0.35;
    pointer-events: none;
}

.paginacao-num.atual {
    background: var(--nx-blue);
    border-color: var(--nx-blue);
    color: #FFFFFF;
}
.paginacao-num.atual:hover {
    background: var(--nx-blue-hover);
    border-color: var(--nx-blue-hover);
    color: #FFFFFF;
}

.paginacao-ellipsis {
    color: var(--nx-muted);
    padding: 0 4px;
    font-size: 0.82rem;
}

@media (max-width: 480px) {
    .paginacao { justify-content: center; text-align: center; }
    .paginacao-nav { justify-content: center; }
    .paginacao-btn, .paginacao-num { min-width: 38px; height: 38px; }
}

/* Shared Form, Search & Import Helpers (Etapa 5) */
.form-instructions {
    color: var(--nx-muted);
    font-size: 0.86rem;
    max-width: 640px;
    margin: 0 0 22px;
    line-height: 1.5;
}
.form-subnote {
    font-size: 0.82rem;
    color: var(--nx-muted);
    margin: 0 0 18px;
    line-height: 1.45;
}
.quota-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--nx-muted);
    margin: 0 0 14px;
    font-variant-numeric: tabular-nums;
}
.form-card-gap { margin-bottom: 20px; }
.field-pro-last { margin-bottom: 0; }
.cell-strong { font-weight: 600; color: var(--nx-ink-strong); }

.btn-submit-mobile {
    width: 100%;
    justify-content: center;
    margin-top: 6px;
}

.file-input-mobile {
    height: auto;
    padding: 8px 10px;
    font-size: 0.86rem;
}

.import-summary-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.86rem;
    color: var(--nx-ink-soft);
    font-variant-numeric: tabular-nums;
}
.import-summary-row i {
    color: var(--nx-blue);
    font-size: 1.15rem;
    flex-shrink: 0;
}

.import-map-sample {
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}
.import-map-select { min-width: 190px; }

.import-map-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 860px) {
    .btn-submit-mobile {
        height: 46px;
        font-size: 0.94rem;
    }
}

@media (max-width: 640px) {
    .import-map-actions { flex-direction: column-reverse; }
    .import-map-actions .btn-pro {
        width: 100%;
        justify-content: center;
        height: 44px;
    }
}

/* ==========================================================================
   8. Domain Views (Auth, Planos, Kanban, WhatsApp, Plataforma & Lead Modal)
   ========================================================================== */

/* --- Auth / Login --- */
.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.08fr 1fr;
}

.login-side {
    min-width: 0;
    background: var(--nx-navy);
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    position: relative;
    overflow: hidden;
}

.login-side::before {
    content: "";
    position: absolute;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.16) 0%, rgba(6, 182, 212, 0.08) 45%, transparent 72%);
    top: -150px;
    right: -160px;
    pointer-events: none;
}

.login-side::after {
    content: "";
    position: absolute;
    width: 560px;
    height: 560px;
    border-radius: 50%;
    bottom: -240px;
    left: -180px;
    padding: 1.5px;
    background: var(--nx-gradient);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.45;
    pointer-events: none;
}

.login-side .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 36px;
    position: relative;
    z-index: 1;
}
.login-side .brand-lockup {
    display: flex;
    flex-direction: column;
}
.login-side .brand .brand-wordmark,
.login-side .brand > span:not(.mark) {
    font-family: var(--font-sans);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1;
    color: #FFFFFF;
}
.login-side .brand .brand-tagline {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.68);
    margin-top: 4px;
}

.login-side h1 {
    font-size: 2.05rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: #FFFFFF;
    max-width: 460px;
    position: relative;
    z-index: 1;
    line-height: 1.18;
    margin-bottom: 14px;
}

.login-gradient-text {
    background: linear-gradient(90deg, #3B82F6 0%, #06B6D4 50%, #8B5CF6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.login-side p {
    color: rgba(255, 255, 255, 0.78);
    max-width: 420px;
    position: relative;
    z-index: 1;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0;
}

.login-side-lista {
    list-style: none;
    padding: 0;
    margin: 22px 0 0;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 9px;
    font-variant-numeric: tabular-nums;
}
.login-side-lista li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.88rem;
}
.login-side-lista i {
    color: var(--nx-cyan);
    font-size: 1rem;
    flex-shrink: 0;
}

.login-form-col {
    min-width: 0;
    background: var(--nx-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--nx-surface);
    border: 1px solid var(--nx-border);
    border-radius: var(--radius-lg);
    padding: 34px 32px;
    box-shadow: var(--shadow);
}
.login-card h2 { font-size: 1.4rem; margin-bottom: 6px; color: var(--nx-ink-strong); }
.login-card .subtitle { color: var(--nx-muted); font-size: 0.88rem; line-height: 1.5; margin-bottom: 24px; }
.login-card .subtitle a,
.login-aux-link a { font-weight: 600; }
.login-aux-link { margin: 16px 0 0; text-align: center; font-size: 0.84rem; color: var(--nx-muted); }

.login-card .form-text { font-size: 0.76rem; color: var(--nx-muted); line-height: 1.45; margin-top: 6px; }
.login-card .form-text ul { padding-left: 18px; margin: 4px 0 0; }
.login-card .form-text li + li { margin-top: 2px; }
.login-card .text-danger { font-size: 0.76rem; color: var(--nx-danger) !important; font-weight: 500; margin-top: 5px; }
.login-card .alert-pro { overflow-wrap: anywhere; }

@media (max-width: 900px) {
    .login-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    .login-side {
        padding: 28px 22px 24px;
        justify-content: flex-start;
    }
    .login-side::before { width: 320px; height: 320px; top: -120px; right: -120px; }
    .login-side::after { width: 360px; height: 360px; bottom: -190px; left: -120px; }
    .login-side .brand { margin-bottom: 16px; }
    .login-side h1 {
        font-size: 1.45rem;
        max-width: none;
        margin-bottom: 8px;
    }
    .login-side p {
        font-size: 0.86rem;
        max-width: none;
    }
    .login-side-lista { margin-top: 14px; gap: 6px; }
    .login-side-lista li { font-size: 0.82rem; }
    .login-form-col {
        padding: 24px 16px 36px;
        align-items: flex-start;
    }
    .login-card { padding: 26px 22px; }
}

@media (max-width: 480px) {
    .login-side { padding: 22px 18px 20px; }
    .login-side .brand .mark { width: 30px; height: 22px; }
    .login-side .brand .brand-wordmark,
    .login-side .brand > span:not(.mark) { font-size: 1.08rem; }
    .login-side h1 { font-size: 1.26rem; }
    .login-side p { font-size: 0.82rem; }
    .login-form-col { padding: 20px 14px 32px; }
    .login-card { padding: 22px 18px; border-radius: var(--radius); }
}

/* --- Planos & Assinatura --- */
.assinatura-aviso {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 24px;
    background: #FFFBEB;
    border-color: #FDE68A;
    color: #92400E;
    font-size: 0.88rem;
}
.assinatura-aviso i {
    color: var(--nx-amber);
    font-size: 1.15rem;
    margin-top: 1px;
    flex-shrink: 0;
}
.assinatura-aviso p {
    margin: 4px 0 0;
    color: #78350F;
    line-height: 1.5;
}
.assinatura-nota {
    font-size: 0.85rem;
    color: var(--nx-muted);
    margin-top: 18px;
}

.planos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.plano-card {
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.plano-card:hover {
    border-color: var(--nx-border-strong);
    box-shadow: var(--shadow);
}
.plano-nome {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--nx-ink-strong);
}
.plano-preco {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--nx-ink-strong);
    margin: 10px 0 4px;
}
.plano-moeda { font-size: 1rem; color: var(--nx-muted); margin-right: 2px; }
.plano-periodo { font-size: 0.9rem; color: var(--nx-muted); font-weight: 500; }

.plano-lista {
    list-style: none;
    padding: 0;
    margin: 14px 0 20px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    flex: 1;
}
.plano-lista li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--nx-ink-soft);
    font-variant-numeric: tabular-nums;
}
.plano-lista i { color: var(--nx-emerald); flex-shrink: 0; }
.plano-lista i.plano-icon-muted { color: var(--nx-muted); }

/* Meu plano (Etapa 6 — sem afetar assinatura_necessaria.html) */
.plano-card-atual {
    border-color: var(--nx-blue);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25), var(--shadow-sm);
}
.plano-card-atual:hover {
    border-color: var(--nx-blue);
}
.plano-atual-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}
.plano-atual-eyebrow {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--nx-muted);
}
.plano-atual-nome {
    font-family: var(--font-sans);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--nx-ink-strong);
    line-height: 1.25;
}
.plano-preco-atual {
    font-size: 1.6rem;
    margin: 8px 0 0;
}
.plano-trial-nota {
    font-size: 0.82rem;
    color: var(--nx-muted);
    margin: 10px 0 0;
    font-variant-numeric: tabular-nums;
}
.plano-lista-atual {
    margin-top: 16px;
    margin-bottom: 0;
}
.planos-secao-titulo {
    font-size: 1.1rem;
    margin: 28px 0 14px;
    color: var(--nx-ink-strong);
}
.plano-badge-atual {
    margin-left: 6px;
    vertical-align: middle;
}
.plano-cta-btn {
    width: 100%;
    justify-content: center;
}
.planos-nota-rodape {
    font-size: 0.82rem;
    color: var(--nx-muted);
    margin: 14px 0 0;
}

/* --- Kanban & Leads --- */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(5, minmax(220px, 1fr));
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
}
@media (max-width: 1100px) { .kanban-board { grid-template-columns: repeat(5, 260px); } }

.kanban-col {
    background: #EBEEF3;
    border: 1px solid var(--nx-border);
    border-top: 3px solid var(--nx-border-strong);
    border-radius: var(--radius);
    padding: 12px;
    min-height: 220px;
}
.kanban-col[data-status="novo"] { border-top-color: var(--nx-blue); }
.kanban-col[data-status="contatado"] { border-top-color: var(--nx-cyan); }
.kanban-col[data-status="interessado"] { border-top-color: var(--nx-purple); }
.kanban-col[data-status="sem_interesse"] { border-top-color: #9CA3AF; }
.kanban-col[data-status="convertido"] { border-top-color: var(--nx-emerald); }

.kanban-col-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 0 2px;
}

.kanban-col-head h6 {
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: var(--nx-ink-soft);
    font-weight: 700;
    margin: 0;
}

.kanban-count {
    font-size: 0.72rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--nx-ink);
    background: var(--nx-surface);
    border: 1px solid var(--nx-border);
    border-radius: 99px;
    padding: 1px 8px;
}

.lead-card {
    background: var(--nx-surface);
    border: 1px solid var(--nx-border);
    border-radius: var(--radius-sm);
    padding: 12px 13px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
    cursor: grab;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.lead-card:hover { box-shadow: var(--shadow); border-color: var(--nx-border-strong); }
.lead-card:active { cursor: grabbing; }

.lead-card .lead-nome { font-weight: 700; font-size: 0.88rem; color: var(--nx-ink-strong); margin-bottom: 3px; }
.lead-card .lead-tel {
    color: var(--nx-blue-hover);
    font-weight: 600;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    display: flex;
    align-items: center;
    gap: 5px;
}
.lead-card .lead-meta {
    font-size: 0.78rem;
    color: var(--nx-muted);
    margin-top: 3px;
    font-variant-numeric: tabular-nums;
}
.lead-card .lead-link { font-size: 0.78rem; display: inline-block; margin-top: 6px; }

.kanban-col.drag-over {
    outline: 2px dashed var(--nx-blue);
    outline-offset: -4px;
    background: var(--nx-blue-soft);
}

.lead-detalhe-btn {
    background: none;
    border: none;
    color: var(--nx-muted);
    cursor: pointer;
    padding: 2px 4px;
    font-size: 0.9rem;
}
.lead-detalhe-btn:hover { color: var(--nx-blue); }

.mobile-status-select,
.mobile-col-nav {
    display: none;
}

@media (max-width: 768px) {
    .cabecalho-leads {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        width: 100%;
    }

    #mobileTabsContainer {
        position: -webkit-sticky;
        position: sticky;
        top: 53px;
        z-index: 99;
        background: var(--nx-bg);
        margin-bottom: 16px;
    }

    .mobile-col-nav {
        display: flex;
        overflow-x: auto;
        gap: 8px;
        padding: 10px 0 12px;
        border-bottom: 1px solid var(--nx-border);
        scrollbar-width: none;
    }
    .mobile-col-nav::-webkit-scrollbar { display: none; }

    .mobile-col-btn {
        flex-shrink: 0;
        background: var(--nx-surface);
        border: 1px solid var(--nx-border);
        border-radius: 99px;
        padding: 7px 14px;
        font-family: var(--font-sans);
        font-size: 0.84rem;
        font-weight: 600;
        font-variant-numeric: tabular-nums;
        color: var(--nx-ink-soft);
        cursor: pointer;
        transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    }
    .mobile-col-btn:hover {
        border-color: var(--nx-border-strong);
        color: var(--nx-ink-strong);
    }
    .mobile-col-btn.active {
        background: var(--nx-blue);
        color: #FFFFFF;
        border-color: var(--nx-blue);
    }

    .kanban-board { display: block !important; }
    .kanban-col {
        display: none !important;
        width: 100% !important;
        margin: 0 !important;
    }
    .kanban-col.active-col { display: block !important; }

    .mobile-status-select {
        display: block;
        width: 100%;
        margin-top: 12px;
        padding: 8px 10px;
        border: 1px solid var(--nx-border-strong);
        border-radius: var(--radius-sm);
        background: var(--nx-surface);
        font-family: var(--font-sans);
        font-size: 0.86rem;
        color: var(--nx-ink);
    }
    .mobile-status-select:focus {
        border-color: var(--nx-blue);
        outline: none;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
    }
}

.pendentes-card {
    margin-bottom: 24px;
    border-color: #FDE68A;
    background: #FFFDF7;
}
.pendentes-card-title {
    font-size: 1rem;
    margin: 0 0 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.pendentes-card-title i { color: var(--nx-amber); }
.pendentes-card-sub {
    font-size: 0.8rem;
    color: var(--nx-muted);
    margin: 0 0 14px;
}

.pendentes-lista {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pendente-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--nx-surface);
    border: 1px solid var(--nx-border);
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    cursor: pointer;
    font-size: 0.83rem;
    font-variant-numeric: tabular-nums;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.pendente-item:hover { border-color: var(--nx-border-strong); background: var(--nx-bg); }
.pendente-nome { font-weight: 600; color: var(--nx-ink); }

.proximo-contato-wrap:empty { display: none; }
.proximo-contato-wrap { margin-top: 3px; }

/* Lead Origin Badges (aligned with .lm-origem) */
.lead-nome-wrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.lead-nome-link {
    color: var(--nx-ink-strong);
    font-weight: 600;
}
.lead-nome-link:hover { color: var(--nx-blue); }

.origem-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 0.69rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}
.origem-campanha {
    background: var(--nx-purple-soft);
    color: #6D28D9;
    border: 1px solid rgba(139, 92, 246, 0.25);
}
.origem-whatsapp {
    background: var(--nx-bg);
    color: var(--nx-ink-soft);
    border: 1px solid var(--nx-border-strong);
}
.origem-busca {
    background: var(--nx-cyan-soft);
    color: #0E7490;
    border: 1px solid rgba(6, 182, 212, 0.26);
}

/* Leads Admin Filter Bar & Responsive Cards (scoped to avoid collision with etiquetas/consultores) */
.filter-bar { margin-bottom: 20px; }
.filter-bar-top {
    display: flex;
    gap: 12px;
    align-items: center;
    width: 100%;
}
.search-box {
    position: relative;
    flex: 1;
    min-width: 220px;
}
.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--nx-muted);
    font-size: 0.85rem;
    pointer-events: none;
}
.search-box input {
    padding-left: 36px;
    width: 100%;
    height: 42px;
}
.btn-toggle-filters {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 42px;
    white-space: nowrap;
}

.filter-options-container {
    display: none;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 12px;
    background: var(--nx-surface);
    padding: 14px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--nx-border);
    box-shadow: var(--shadow-sm);
}
.filter-options-container.show {
    display: flex;
    animation: filterSlideDown 0.18s ease;
}
@keyframes filterSlideDown {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.filter-select { width: auto; min-width: 150px; }
.filter-actions { display: flex; gap: 8px; }
.mobile-modal-header { display: none; }
.filter-overlay { display: none; }

.leads-admin-card .mobile-view { display: none; }
.leads-admin-card .desktop-view { display: block; }
.leads-admin-card .table-pro td { font-variant-numeric: tabular-nums; }
.leads-admin-card .select-consultor { min-width: 150px; }
.leads-admin-card .lead-meta-col { font-size: 0.82rem; }
.leads-admin-card .lead-actions-col { display: flex; gap: 4px; }

@media (max-width: 860px) {
    .leads-admin-card .desktop-view { display: none !important; }
    .leads-admin-card .mobile-view {
        display: flex !important;
        flex-direction: column;
        gap: 12px;
    }

    .filter-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(11, 31, 68, 0.52);
        backdrop-filter: blur(2px);
        z-index: 1070;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }
    .filter-overlay.show {
        opacity: 1;
        pointer-events: auto;
    }

    .filter-options-container {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--nx-surface);
        z-index: 1080;
        flex-direction: column;
        padding: 20px 20px 28px;
        margin: 0;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        border: 1px solid var(--nx-border);
        border-bottom: none;
        transform: translateY(100%);
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: var(--shadow-lg);
        align-items: stretch;
        gap: 12px;
    }
    .filter-options-container.show {
        transform: translateY(0);
        animation: none;
    }

    .mobile-modal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid var(--nx-border);
        padding-bottom: 12px;
        margin-bottom: 4px;
    }
    .mobile-modal-header h3 {
        margin: 0;
        font-size: 1.05rem;
        color: var(--nx-ink-strong);
    }
    .btn-close-modal {
        background: none;
        border: none;
        font-size: 1.15rem;
        color: var(--nx-muted);
        cursor: pointer;
        padding: 4px;
    }
    .btn-close-modal:hover { color: var(--nx-ink-strong); }

    .filter-select,
    .filter-options-container select {
        width: 100%;
        height: 44px;
    }
    .filter-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
        margin-top: 6px;
    }
    .w-100-mobile {
        width: 100%;
        justify-content: center;
        height: 44px;
    }

    .filter-bar-top {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .btn-toggle-filters {
        width: 100%;
    }

    .lead-mobile-card {
        background: var(--nx-surface);
        border: 1px solid var(--nx-border);
        border-radius: var(--radius);
        padding: 16px;
        box-shadow: var(--shadow-sm);
    }
    .lmc-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 12px;
    }
    .lmc-title {
        font-family: var(--font-sans);
        font-size: 1.02rem;
        font-weight: 700;
        color: var(--nx-ink-strong);
        text-decoration: none;
        line-height: 1.25;
    }
    .lmc-title:hover { color: var(--nx-blue); }
    .lmc-info-row {
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
        font-size: 0.85rem;
        margin-bottom: 6px;
        font-variant-numeric: tabular-nums;
    }
    .lmc-label {
        color: var(--nx-muted);
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        font-weight: 600;
        width: 105px;
        flex-shrink: 0;
    }
    .lmc-categoria-badge {
        display: inline-block;
        flex: 0 1 auto;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: middle;
        font-weight: 500;
    }
    .lmc-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding-top: 12px;
        margin-top: 10px;
        border-top: 1px solid var(--nx-border);
    }
    .lmc-consultor { flex: 1; }
    .lmc-actions { display: flex; gap: 8px; flex-shrink: 0; }
}

.filtros-leads {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 18px;
}

.filtro-busca {
    position: relative;
    flex: 1 1 220px;
    max-width: 280px;
}
.filtro-busca i {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--nx-muted);
    font-size: 0.85rem;
}
.filtro-busca input { padding-left: 32px; width: 100%; }

.filtros-leads .form-select { width: auto; flex: 0 0 auto; }
.filtro-acoes { display: flex; gap: 8px; }

@media (max-width: 640px) {
    .filtros-leads { flex-direction: column; align-items: stretch; }
    .filtro-busca { flex: none; width: 100%; max-width: none; }
    .filtros-leads .form-select { width: 100%; }
    .filtro-acoes { width: 100%; }
    .filtro-acoes .btn-pro { flex: 1; justify-content: center; }
}

/* --- Etiquetas --- */
.etiquetas-card .desktop-view { display: block; }
.etiquetas-card .mobile-view { display: none; }
.mobile-only-btn-wrap { display: none; }
.etiqueta-overlay { display: none; }
.modal-header-mobile { display: none; }
.desktop-title { display: block; font-size: 1.05rem; margin: 0 0 16px; }
.mobile-modal-title { font-size: 1.05rem; margin: 0; }

@media (max-width: 860px) {
    .mobile-only-btn-wrap { display: block; margin-bottom: 20px; }
    .mobile-only-btn-wrap .btn-pro {
        width: 100%;
        justify-content: center;
        height: 46px;
        font-size: 0.95rem;
    }
    .desktop-title { display: none; }
    .etiquetas-card .desktop-view { display: none !important; }
    .etiquetas-card .mobile-view {
        display: flex !important;
        flex-direction: column;
        gap: 10px;
    }

    .etiqueta-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(11, 31, 68, 0.52);
        backdrop-filter: blur(2px);
        z-index: 1070;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }
    .etiqueta-overlay.show { opacity: 1; pointer-events: auto; }

    .etiqueta-form-container {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--nx-surface);
        z-index: 1080;
        flex-direction: column;
        padding: 20px 20px calc(24px + env(safe-area-inset-bottom, 0px));
        margin: 0;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        border: 1px solid var(--nx-border);
        border-bottom: none;
        transform: translateY(100%);
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: var(--shadow-lg);
        max-height: 85vh;
        overflow-y: auto;
    }
    .etiqueta-form-container.show { transform: translateY(0); }

    .modal-header-mobile {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid var(--nx-border);
        padding-bottom: 12px;
        margin-bottom: 16px;
    }
    .mobile-select { height: 44px; }

    .etiqueta-mobile-card {
        background: var(--nx-surface);
        border: 1px solid var(--nx-border);
        border-radius: var(--radius-sm);
        padding: 14px;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    .emc-info {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }
    .emc-action { width: 100%; }
}

/* --- WhatsApp --- */
.wa-status-badge {
    font-size: 0.8rem;
    padding: 5px 12px;
    align-self: flex-start;
}
.wa-heading {
    font-size: 1.08rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.wa-heading-blue i { color: var(--nx-blue); }
.wa-heading-center {
    font-size: 1.08rem;
    text-align: center;
    margin: 0 0 14px;
}
.wa-heading-sub {
    font-size: 1.05rem;
    margin: 0 0 10px;
}
.wa-intro {
    color: var(--nx-ink-soft);
    font-size: 0.87rem;
    margin: 8px 0 16px;
    line-height: 1.5;
}
.wa-hint {
    color: var(--nx-ink-soft);
    font-size: 0.85rem;
    margin: 0 0 14px;
    line-height: 1.5;
}
.wa-subhint {
    color: var(--nx-muted);
    font-size: 0.78rem;
    margin: 10px 0 0;
    line-height: 1.45;
}
.wa-erro-inline {
    color: #B91C1C;
    font-size: 0.84rem;
    font-weight: 500;
    margin: 0 0 12px;
}
.wa-btn-full {
    width: 100%;
    justify-content: center;
}
.wa-painel-qr { text-align: center; }
.wa-painel-codigo { display: none; }
.wa-codigo-erro { display: none; margin: 14px 0 0; }
.wa-cancel-form { margin-top: 16px; text-align: center; }
.wa-card-gap { margin-top: 16px; }
.wa-atividade-card { margin-top: 20px; }

.wa-abas {
    display: flex;
    gap: 6px;
    background: var(--nx-bg);
    border: 1px solid var(--nx-border);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 18px;
}
.wa-aba {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: none;
    background: transparent;
    padding: 9px 10px;
    border-radius: 6px;
    font-family: var(--font-sans);
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--nx-ink-soft);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.wa-aba:hover { color: var(--nx-ink-strong); }
.wa-aba.ativa {
    background: var(--nx-blue);
    color: #FFFFFF;
    box-shadow: var(--shadow-sm);
}

.wa-codigo-box {
    display: none;
    margin-top: 18px;
    text-align: center;
    background: var(--nx-blue-soft);
    border: 1px solid rgba(59, 130, 246, 0.28);
    border-radius: var(--radius);
    padding: 18px 16px;
}
.wa-codigo-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--nx-blue-hover);
    font-weight: 700;
    margin-bottom: 6px;
}
.wa-codigo {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--nx-ink-strong);
    margin-bottom: 12px;
    user-select: all;
    word-break: break-all;
}
.wa-passos-codigo {
    text-align: left;
    margin-top: 14px;
}
.wa-codigo-validade {
    font-size: 0.76rem;
    margin: 8px 0 0;
}

.wa-icone {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--nx-emerald-soft);
    color: #047857;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}
.wa-conn-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.wa-conn-meta {
    min-width: 0;
    font-variant-numeric: tabular-nums;
}
.wa-conn-num {
    font-weight: 700;
    color: var(--nx-ink-strong);
}
.wa-conn-sub { font-size: 0.8rem; }
.wa-conn-msg { font-size: 0.78rem; }
.wa-disconnect-form { margin-top: 16px; }
.wa-checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-weight: 500 !important;
    margin-bottom: 0 !important;
}
.wa-checkbox-label input { width: auto; }
.wa-webhook-code {
    font-size: 0.74rem;
    word-break: break-all;
    display: block;
}

.wa-qr {
    width: 100%;
    max-width: 280px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    border: 1px solid var(--nx-border);
    border-radius: var(--radius);
    background: #FFFFFF;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.wa-qr img {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.wa-qr-msg {
    color: var(--nx-muted);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: center;
    padding: 10px;
}
.wa-passos {
    padding-left: 18px;
    margin: 0;
    font-size: 0.86rem;
    color: var(--nx-ink-soft);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wa-table td { font-variant-numeric: tabular-nums; }
.wa-detalhe-col { font-size: 0.8rem; }
.wa-resultado-wrap {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.wa-payload-cell { padding-top: 0 !important; }
.wa-payload-summary { font-size: 0.76rem; cursor: pointer; }
.wa-json {
    font-family: var(--font-mono);
    background: var(--nx-bg);
    border: 1px solid var(--nx-border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 0.72rem;
    max-width: 100%;
    max-height: 260px;
    overflow: auto;
    margin: 6px 0 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 640px) {
    .wa-json { max-width: calc(100vw - 84px); }
}
@media (max-width: 420px) {
    .wa-codigo { font-size: 1.55rem; letter-spacing: 0.1em; }
    .wa-aba { font-size: 0.78rem; padding: 9px 6px; }
}

/* --- Consultores --- */
.consultores-card .desktop-view { display: block; }
.consultores-card .mobile-view { display: none; }
.consultores-card .table-pro td { font-variant-numeric: tabular-nums; }
.consultor-action-form { width: 100%; }

@media (max-width: 860px) {
    .consultores-card .desktop-view { display: none !important; }
    .consultores-card .mobile-view {
        display: flex !important;
        flex-direction: column;
        gap: 12px;
    }

    .consultor-form-card .field-pro input:not([type="checkbox"]),
    .consultor-form-card .field-pro select {
        min-height: 44px;
    }

    .consultor-mobile-card {
        background: var(--nx-surface);
        border: 1px solid var(--nx-border);
        border-radius: var(--radius-sm);
        padding: 16px;
        display: flex;
        flex-direction: column;
        box-shadow: var(--shadow-sm);
        min-width: 0;
    }
    .cmc-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 12px;
        gap: 10px;
        min-width: 0;
    }
    .cmc-title {
        font-family: var(--font-sans);
        font-size: 1.05rem;
        font-weight: 700;
        color: var(--nx-ink-strong);
        line-height: 1.25;
        min-width: 0;
        overflow-wrap: anywhere;
    }
    .cmc-header .badge-pro { flex-shrink: 0; }
    .cmc-body {
        display: flex;
        flex-direction: column;
        gap: 7px;
        margin-bottom: 14px;
        font-size: 0.85rem;
        min-width: 0;
    }
    .cmc-info-row {
        display: flex;
        align-items: baseline;
        gap: 8px;
        min-width: 0;
        font-variant-numeric: tabular-nums;
    }
    .cmc-label {
        color: var(--nx-muted);
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        font-weight: 600;
        width: 85px;
        flex-shrink: 0;
    }
    .cmc-value {
        min-width: 0;
        overflow-wrap: anywhere;
    }
    .cmc-footer {
        display: flex;
        border-top: 1px solid var(--nx-border);
        padding-top: 12px;
    }
}

/* --- Plataforma --- */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
@media (max-width: 1100px) { .charts-grid { grid-template-columns: 1fr; } }

.chart-card {
    background: var(--nx-surface);
    border: 1px solid var(--nx-border);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    min-width: 0;
}
.chart-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}
.chart-head .stat-label { margin: 0; }
.chart-total {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--nx-ink-strong);
}

.bars { display: flex; align-items: flex-end; gap: 3px; height: 96px; }
.bar-col { flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.bar {
    width: 100%;
    background: var(--nx-blue);
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: opacity 0.15s ease;
}
.bar-zero { background: var(--nx-border-strong); opacity: 0.6; }
.bar-col:hover .bar { opacity: 0.75; }
.bars-purple .bar:not(.bar-zero) { background: var(--nx-purple); }
.bars-cyan .bar:not(.bar-zero) { background: var(--nx-cyan); }
.bars-axis {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--nx-muted);
    margin-top: 7px;
    font-variant-numeric: tabular-nums;
}

.dash-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.dash-cols > * { min-width: 0; }
@media (max-width: 960px) { .dash-cols { grid-template-columns: minmax(0, 1fr); } }

.sbar {
    display: grid;
    grid-template-columns: 110px 1fr 44px;
    align-items: center;
    gap: 10px;
    font-size: 0.83rem;
    margin-bottom: 9px;
    font-variant-numeric: tabular-nums;
}
.sbar-track {
    height: 8px;
    background: var(--nx-bg);
    border: 1px solid var(--nx-border);
    border-radius: 99px;
    overflow: hidden;
}
.sbar-fill { height: 100%; background: var(--nx-blue); border-radius: 99px; }
.sbar b { text-align: right; font-weight: 600; color: var(--nx-ink-strong); }
@media (max-width: 420px) {
    .sbar {
        grid-template-columns: 96px 1fr 38px;
        gap: 8px;
        font-size: 0.8rem;
    }
}

.plat-card-title {
    font-size: 1.05rem;
    margin: 0 0 14px;
    color: var(--nx-ink-strong);
}
.plat-link {
    color: var(--nx-ink-strong);
    font-weight: 600;
}
.plat-link:hover { color: var(--nx-blue); }
.plat-sub {
    font-weight: 400;
    font-size: 0.76rem;
    color: var(--nx-muted);
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}
.plat-erro-msg {
    font-size: 0.76rem;
    color: #B91C1C;
    font-weight: 500;
    margin-top: 2px;
}
.plat-footnote { margin-top: 16px; }
.plat-count {
    font-size: 1rem;
    font-family: var(--font-sans);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}
.plat-table td { font-variant-numeric: tabular-nums; }
.badge-tabular { font-variant-numeric: tabular-nums; }

.empresa-meta-bar {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.empresa-meta-texto {
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}
.topbar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
@media (max-width: 900px) {
    .topbar-actions {
        flex-direction: column;
        width: 100%;
    }
}
.empresa-uso-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.empresa-uso-head .plat-card-title { margin: 0; }
.empresa-uso-meta {
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

/* --- Lead Detail Modal --- */
.lead-modal-overlay {
    display: flex;
    position: fixed;
    inset: 0;
    background: rgba(11, 31, 68, 0.52);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1200;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.lead-modal-overlay.open { opacity: 1; visibility: visible; }

.lead-modal {
    background: var(--nx-surface);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.lead-modal-overlay.open .lead-modal { transform: scale(1) translateY(0); }

@media (max-width: 560px) {
    .lead-modal-overlay { padding: 0; align-items: flex-end; }
    .lead-modal {
        max-width: 100%;
        max-height: 92vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        transform: translateY(100%);
    }
    .lead-modal-overlay.open .lead-modal { transform: translateY(0); }
}

.lead-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 22px 22px 18px;
    border-bottom: 1px solid var(--nx-border);
    position: relative;
    background: var(--nx-surface);
}

.lead-modal-title { display: flex; align-items: center; gap: 12px; }

.lead-modal-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--nx-navy);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 1.05rem;
    box-shadow: var(--shadow-sm);
}

.lead-modal-nome {
    font-family: var(--font-sans);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--nx-ink-strong);
    line-height: 1.25;
}
.lead-modal-sub { font-size: 0.78rem; color: var(--nx-muted); margin-top: 2px; }

.lead-modal-close {
    background: var(--nx-surface);
    border: 1px solid var(--nx-border-strong);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    line-height: 1;
    color: var(--nx-muted);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
    flex-shrink: 0;
}
.lead-modal-close:hover { background: var(--nx-bg); color: var(--nx-ink-strong); transform: rotate(90deg); }

.lead-modal-body { padding: 20px 22px 22px; overflow-y: auto; }

.lead-modal-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
@media (max-width: 420px) { .lead-modal-info { grid-template-columns: 1fr; } }

.lm-info-item {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    background: var(--nx-bg);
    border: 1px solid var(--nx-border);
    border-radius: var(--radius-sm);
    padding: 9px 11px;
    font-size: 0.84rem;
    color: var(--nx-ink);
    min-width: 0;
}
.lm-info-item i { color: var(--nx-blue); margin-top: 2px; flex-shrink: 0; }
.lm-info-item > div { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.lm-info-item span:not(.lm-info-label) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lm-info-label {
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--nx-muted);
    font-weight: 700;
    margin-bottom: 1px;
}

.lm-extras-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 4px;
}

.lm-extra-item {
    background: var(--nx-bg);
    border: 1px solid var(--nx-border);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    font-size: 0.8rem;
    color: var(--nx-ink);
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}
.lm-extra-item span:not(.lm-info-label) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lm-origem {
    margin-top: 14px;
    background: var(--nx-purple-soft);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 0.83rem;
    color: var(--nx-ink);
}
.lm-origem-head {
    font-weight: 700;
    color: #6D28D9;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.lm-origem-corpo { display: flex; flex-direction: column; gap: 6px; }
.lm-origem-corpo .lm-info-label { display: block; }

.lead-modal-timeline-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--nx-muted);
    font-weight: 700;
    margin: 22px 0 10px;
}

.lead-modal-timeline {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
    margin-bottom: 14px;
    padding-right: 2px;
}
.lead-modal-timeline::-webkit-scrollbar { width: 6px; }
.lead-modal-timeline::-webkit-scrollbar-thumb { background: var(--nx-border-strong); border-radius: 99px; }

.lead-modal-timeline-empty {
    color: var(--nx-muted);
    font-size: 0.82rem;
    padding: 18px 0;
    text-align: center;
}

.timeline-item {
    display: flex;
    gap: 10px;
    background: var(--nx-bg);
    border: 1px solid var(--nx-border);
    border-radius: var(--radius-sm);
    padding: 10px 11px;
    transition: opacity 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.timeline-item:hover { border-color: var(--nx-border-strong); }

.timeline-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--nx-blue-soft);
    color: var(--nx-blue-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.timeline-content { flex: 1; min-width: 0; }

.timeline-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.72rem;
    color: var(--nx-muted);
    margin-bottom: 4px;
}
.timeline-meta strong { color: var(--nx-ink-soft); font-weight: 600; }
.timeline-texto { font-size: 0.85rem; color: var(--nx-ink); white-space: pre-wrap; line-height: 1.4; }

.timeline-remove {
    background: none;
    border: none;
    color: var(--nx-muted);
    cursor: pointer;
    padding: 1px 3px;
    font-size: 0.82rem;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}
.timeline-item:hover .timeline-remove { opacity: 1; }
.timeline-remove:hover { color: var(--nx-danger); }

.lead-modal-add { display: flex; gap: 8px; align-items: flex-end; }
.lead-modal-add textarea {
    flex: 1;
    border: 1px solid var(--nx-border-strong);
    border-radius: var(--radius-sm);
    padding: 9px 11px;
    font-size: 0.85rem;
    font-family: var(--font-sans);
    color: var(--nx-ink);
    background: var(--nx-surface);
    resize: vertical;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.lead-modal-add textarea:focus {
    border-color: #3B82F6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

/* Billing Client UI (Ticket 04) */
.billing-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}
.billing-banner i { font-size: 1.25rem; margin-top: 2px; flex-shrink: 0; }
.billing-banner p { margin: 4px 0 0; font-size: 0.85rem; color: var(--nx-ink-soft); }
.billing-banner-info { border-left: 4px solid var(--nx-blue); background: var(--nx-blue-soft); }
.billing-banner-info i { color: var(--nx-blue-hover); }
.billing-banner-warning { border-left: 4px solid var(--nx-amber); background: var(--nx-amber-soft); }
.billing-banner-warning i { color: #B45309; }
.billing-banner-danger { border-left: 4px solid var(--nx-danger); background: var(--nx-danger-soft); }
.billing-banner-danger i { color: var(--nx-danger); }

.billing-meta-line { font-size: 0.85rem; color: var(--nx-ink-soft); margin: 8px 0 12px; }
.billing-meta-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.84rem;
    margin: 10px 0 14px;
}
.billing-sec-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.billing-ciclo-toggle { display: inline-flex; gap: 6px; }
.btn-sm-pro { padding: 6px 12px; font-size: 0.8rem; }

.creditos-resumo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}
.credito-stat-card {
    background: var(--nx-bg);
    border: 1px solid var(--nx-border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}
.credito-stat-label { font-size: 0.78rem; font-weight: 600; color: var(--nx-ink-soft); margin-bottom: 8px; }
.credito-stat-nums {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-variant-numeric: tabular-nums;
}
.credito-stat-nums small { color: var(--nx-muted); font-size: 0.76rem; }
.credito-num-disp { font-weight: 700; font-size: 1.05rem; color: var(--nx-emerald); }
.credito-num-used { font-weight: 700; font-size: 1.05rem; color: var(--nx-ink-strong); }
.credito-num-exp { font-weight: 700; font-size: 1.05rem; color: var(--nx-muted); }
