@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --bg-main: #080c14;
    --bg-card: rgba(16, 23, 38, 0.78);
    --bg-card-hover: rgba(22, 32, 54, 0.85);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.18);
    
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-glow: rgba(99, 102, 241, 0.3);
    
    --accent: #06b6d4;
    --accent-light: #22d3ee;
    
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.25);
    
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.25);
    
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.25);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;
    
    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(255, 255, 255, 0.05);
    --shadow-glow: 0 0 25px -5px rgba(99, 102, 241, 0.35);
}

/* ============================================================ */
/* BASE & RESET */
/* ============================================================ */

* {
    box-sizing: border-box;
}

/* ============================================================ */
/* ESTILIZAÇÃO DA SCROLLBAR (BARRA DE ROLAGEM MODERNA) */
/* ============================================================ */

/* Padrão W3C (Firefox e navegadores modernos) */
html, body {
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.45) rgba(8, 12, 20, 0.7);
}

/* Motores WebKit (Chrome, Edge, Opera, Brave, Safari) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(8, 12, 20, 0.7);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.35);
    border-radius: var(--radius-full);
    border: 2px solid rgba(8, 12, 20, 0.7);
    background-clip: padding-box;
    transition: all 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #6366f1 0%, #06b6d4 100%);
    border: 1px solid rgba(8, 12, 20, 0.5);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

::-webkit-scrollbar-thumb:active {
    background: #4f46e5;
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Scrollbar ainda mais fina para elementos internos (tabelas, textareas, modais) */
.table-responsive,
.modal-body,
textarea {
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.4) transparent;
}

.table-responsive::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
textarea::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.table-responsive::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
textarea::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-full);
}

.table-responsive::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover,
textarea::-webkit-scrollbar-thumb:hover {
    background: #6366f1;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 85% 75%, rgba(6, 182, 212, 0.06) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.03) 0%, transparent 55%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================ */
/* TOPBAR HEADER */
/* ============================================================ */

.topbar {
    background: rgba(13, 19, 33, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    font-size: 1.2rem;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.5px;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.brand-logo:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: url('../img/logo-icon.svg') no-repeat center center / contain !important;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 18px rgba(220, 38, 38, 0.45);
    flex-shrink: 0;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.brand-logo:hover .brand-icon {
    transform: scale(1.05);
    box-shadow: 0 6px 22px rgba(239, 68, 68, 0.65);
}

.brand-icon i {
    display: none !important;
}

.brand-badge {
    width: 68px;
    height: 68px;
    background: url('../img/logo-icon.svg') no-repeat center center / contain !important;
    border-radius: 20px;
    margin: 0 auto 1.25rem;
    box-shadow: 0 10px 30px rgba(220, 38, 38, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease;
}

.brand-badge:hover {
    transform: scale(1.05);
}

.brand-badge i {
    display: none !important;
}

.brand-title-accent {
    background: linear-gradient(135deg, #ff4d4d 0%, #ef4444 60%, #b91c1c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
}

.brand-tag {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    background: rgba(220, 38, 38, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(220, 38, 38, 0.35);
    padding: 2px 7px;
    border-radius: var(--radius-full);
    margin-left: 0.4rem;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: nowrap;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.42rem 0.55rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    border: 1px solid transparent;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.nav-link i {
    font-size: 0.82rem;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.nav-link:hover i {
    color: var(--primary-light);
}

.nav-link.active {
    color: #fff;
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.35);
}

.nav-link.active i {
    color: var(--primary-light);
}

@media (max-width: 1400px) {
    .topbar-nav {
        display: none !important;
    }
    .btn-hamburger {
        display: inline-flex !important;
    }
}

@media (max-width: 1024px) {
    .topbar-user-name {
        display: none !important;
    }
    .topbar-user-badge {
        padding: 0.25rem !important;
    }
}

/* ============================================================ */
/* CARDS & CONTAINERS */
/* ============================================================ */

.container {
    max-width: 1650px;
    width: 95%;
    margin: 2rem auto;
    padding: 0 1rem;
    flex: 1;
}

.container-widescreen {
    max-width: 1650px;
    width: 95%;
    margin: 2rem auto;
    padding: 0 1rem 4rem 1rem;
    flex: 1;
}

.form-layout-widescreen {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem;
    align-items: stretch;
}

.form-layout-widescreen > .form-section-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-bottom: 0;
    box-sizing: border-box;
}

@media (max-width: 1100px) {
    .form-layout-widescreen {
        grid-template-columns: 1fr;
    }
}

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: all 0.25s ease;
}

.glass-card:hover {
    border-color: var(--border-hover);
}

/* ============================================================ */
/* METRIC CARDS (STATS) */
/* ============================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.35rem 1.6rem;
    text-decoration: none;
    color: inherit;
    display: block;
    box-shadow: var(--shadow-card);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    transition: background 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-hover);
    box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.6);
}

.stat-card.stat-total:hover::before { background: var(--primary); }
.stat-card.stat-active:hover::before { background: var(--success); }
.stat-card.stat-vence-24h:hover::before { background: #f97316; }
.stat-card.stat-vence-3d:hover::before { background: #eab308; }
.stat-card.stat-expired:hover::before { background: var(--danger); }
.stat-card.stat-trial:hover::before { background: var(--warning); }
.stat-card.stat-courtesy:hover::before { background: #a855f7; }
.stat-card.stat-revenue:hover::before { background: var(--accent); }

.stats-grid.stats-grid-clientes {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 0.9rem;
}
.stats-grid.stats-grid-clientes .stat-card {
    padding: 1.1rem 1.15rem;
}
.stats-grid.stats-grid-clientes .stat-value {
    font-size: 1.55rem;
}
@media (max-width: 1680px) {
    .stats-grid.stats-grid-clientes {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1rem;
    }
}
@media (max-width: 900px) {
    .stats-grid.stats-grid-clientes {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 520px) {
    .stats-grid.stats-grid-clientes {
        grid-template-columns: 1fr;
    }
}

.stat-card.active-filter {
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.25);
    background: rgba(22, 30, 52, 0.9);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.9rem;
}

.stat-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-value {
    font-size: clamp(1.45rem, 1.85vw, 2rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 0.35rem;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.stat-value small,
.stat-value .currency-prefix {
    font-size: 0.6em;
    font-weight: 700;
    opacity: 0.85;
    margin-right: 3px;
    letter-spacing: 0;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}

.stat-subtext {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ============================================================ */
/* BOTÕES MODERNOS */
/* ============================================================ */

.btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.7rem 1.4rem;
    font-size: 0.92rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
    transition: all 0.2s ease;
    white-space: nowrap !important;
    flex-shrink: 0;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-action-icon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.btn-action-icon:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--border-hover);
    color: #fff;
    transform: translateY(-1px);
}

.btn-renovar {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.35);
    color: #34d399;
}

.btn-renovar:hover {
    background: rgba(16, 185, 129, 0.28);
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-whatsapp {
    background: rgba(37, 211, 102, 0.15);
    border-color: rgba(37, 211, 102, 0.35);
    color: #4ade80;
}

.btn-whatsapp:hover {
    background: rgba(37, 211, 102, 0.3);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

/* ============================================================ */
/* TABELA DE CLIENTES ELEGANTE */
/* ============================================================ */

.table-container {
    background: var(--bg-card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
    font-size: 0.9rem;
}

th {
    color: var(--text-muted);
    font-weight: 700;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    background: rgba(15, 23, 42, 0.3);
}

td {
    padding: 1.15rem 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
    transition: background 0.15s ease;
}

tr.cliente-row:hover td {
    background: rgba(255, 255, 255, 0.025);
}

/* Previne quebra indesejada em células de preço, datas e tags */
td.td-valor, th.th-valor, .cell-valor,
td.td-vencimento, th.th-vencimento,
td.td-status, th.th-status,
td.td-acoes, th.th-acoes,
.badge-valor, .nowrap {
    white-space: nowrap !important;
}

/* Avatar de Cliente */
.client-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #ffffff;
    flex-shrink: 0;
}

/* Tabela de Clientes Widescreen Otimizada (Zero Overflow) */
.container-clientes-full {
    width: 98% !important;
    max-width: 1840px !important;
    margin: 1.25rem auto !important;
    padding: 0 0.5rem !important;
}

.tabela-clientes {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.tabela-clientes th {
    padding: 0.8rem 0.55rem !important;
    font-size: 0.73rem !important;
    font-weight: 700 !important;
    color: var(--text-muted) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border-bottom: 1px solid var(--border-subtle) !important;
    background: rgba(15, 23, 42, 0.4) !important;
    white-space: nowrap !important;
}

.tabela-clientes td {
    padding: 0.82rem 0.55rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
    vertical-align: middle !important;
}

.action-buttons-group {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0.28rem !important;
    flex-wrap: nowrap !important;
}

.action-buttons-group .btn-action-icon {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    font-size: 0.82rem !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

/* Caixa de Credenciais IPTV */
.cred-box {
    background: rgba(11, 17, 30, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.6rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    color: #a5b4fc;
}

/* Status Chips */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.badge-ativo {
    background: rgba(16, 185, 129, 0.14);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-vencido {
    background: rgba(239, 68, 68, 0.14);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.badge-teste {
    background: rgba(245, 158, 11, 0.14);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-bloqueado {
    background: rgba(148, 163, 184, 0.14);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

/* Indicador de Pulso */
.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.badge-ativo .pulse-dot { background: #10b981; box-shadow: 0 0 8px #10b981; }
.badge-vencido .pulse-dot { background: #ef4444; box-shadow: 0 0 8px #ef4444; }
.badge-teste .pulse-dot { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }

/* ============================================================ */
/* FILTROS & BUSCA */
/* ============================================================ */

.filter-pills {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.filter-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.5rem 0.95rem;
    border-radius: var(--radius-sm);
    font-size: 0.83rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.filter-pill:hover, .filter-pill.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.5);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.search-box {
    position: relative;
    min-width: 280px;
}

.search-box input {
    width: 100%;
    background: rgba(11, 17, 30, 0.9);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.7rem 1rem 0.7rem 2.5rem;
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: rgba(11, 17, 30, 1);
}

.search-box i {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Barra de Pesquisa Pro em Tempo Real */
.search-box-pro {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    height: 48px;
    padding: 0 1rem;
    gap: 0.75rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25);
}

.search-box-pro:hover {
    border-color: rgba(56, 189, 248, 0.35);
    background: rgba(15, 23, 42, 0.9);
}

.search-box-pro:focus-within {
    border-color: #38bdf8;
    background: rgba(11, 17, 30, 0.98);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.2), inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.search-box-pro input::placeholder {
    color: #64748b;
    font-size: 0.88rem;
}

.search-box-pro #btnClearSearch:hover {
    color: #ef4444 !important;
}

/* ============================================================ */
/* FORMULÁRIOS MODERNOS */
/* ============================================================ */

.form-card {
    background: var(--bg-card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2.2rem;
    box-shadow: var(--shadow-card);
}

.form-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--accent-light);
    margin: 2rem 0 1.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0.65rem;
    letter-spacing: -0.2px;
}

.form-section-title:first-of-type {
    margin-top: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.35rem;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.25rem;
}

.col-span-2 {
    grid-column: span 2;
}

.col-span-full {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }
    .col-span-2,
    .col-span-full {
        grid-column: span 1;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #cbd5e1;
}

.form-group label span.req {
    color: var(--danger);
}

.form-control {
    width: 100%;
    background: rgba(11, 17, 30, 0.9);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.8rem 1rem;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.92rem;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: rgba(11, 17, 30, 1);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

select.form-control option {
    background: #0f172a;
    color: #f8fafc;
}

.btn-inline {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: var(--primary-light);
    border-radius: var(--radius-md);
    padding: 0 1rem;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: inherit;
    white-space: nowrap;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-inline:hover {
    background: rgba(99, 102, 241, 0.3);
    color: #fff;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

/* ============================================================ */
/* ALERTAS */
/* ============================================================ */

.alert-custom {
    border-radius: var(--radius-md);
    padding: 0.9rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.alert-danger-custom {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.alert-success-custom {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
}

/* ============================================================ */
/* MODAL EXPANDIDO & ESPAÇOSO */
/* ============================================================ */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 7, 14, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 100005;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #0f172a;
    border: 1px solid var(--border-hover);
    border-radius: 20px;
    max-width: 980px;
    width: 95%;
    max-height: 90vh;
    box-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.85), 0 0 50px rgba(99, 102, 241, 0.18);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalScale 0.22s ease-out;
}

@keyframes modalScale {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    padding: 1.35rem 2rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.85);
    flex-shrink: 0;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #fff;
    letter-spacing: -0.3px;
}

.modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

/* Layout em Grid do Modal Amplo */
.modal-grid-2col {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.75rem;
}

@media (max-width: 820px) {
    .modal-grid-2col {
        grid-template-columns: 1fr;
    }
}

.modal-side-card {
    background: rgba(11, 17, 30, 0.8);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

/* Seletor de Campos para Captura do WhatsApp */
.zap-field-toggle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.82rem;
    color: #cbd5e1;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.4rem 0.65rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.15s ease;
    user-select: none;
}

.zap-field-toggle:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.35);
    color: #fff;
}

.zap-field-toggle input[type="checkbox"] {
    accent-color: #22c55e;
    cursor: pointer;
    width: 16px;
    height: 16px;
    margin: 0;
}

.zap-field-toggle span {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.zap-field-toggle span i {
    width: 15px;
    font-size: 0.78rem;
    color: #94a3b8;
    text-align: center;
}

/* Badges de Variáveis Dinâmicas do WhatsApp */
.zap-var-badge {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
    font-size: 0.76rem;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.zap-var-badge:hover {
    background: rgba(99, 102, 241, 0.3);
    color: #fff;
    border-color: rgba(99, 102, 241, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

/* ============================================================ */
/* MENU RESPONSIVO, GAVETA MOBILE & BOTTOM BAR                  */
/* ============================================================ */

/* Botão Hamburger */
.btn-hamburger {
    display: none;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.btn-hamburger:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
    color: var(--primary-light);
}

/* Gaveta Lateral Mobile (Off-Canvas) */
.mobile-drawer {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    height: 100vh;
    height: 100dvh;
    background: #090e1a;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    box-shadow: 15px 0 40px rgba(0, 0, 0, 0.85);
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-drawer.open {
    left: 0;
}

.mobile-drawer-header {
    padding: 1.25rem 1.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-drawer-close {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
}

.mobile-drawer-close:hover {
    color: #fff;
    background: rgba(239, 68, 68, 0.2);
}

.mobile-drawer-user {
    padding: 1.2rem 1.4rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.mobile-drawer-nav {
    padding: 1rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
}

.mobile-drawer-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.8rem 1rem;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.15s ease;
}

.mobile-drawer-link i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    color: var(--text-muted);
}

.mobile-drawer-link:hover,
.mobile-drawer-link.active {
    background: rgba(99, 102, 241, 0.15);
    color: #fff;
}

.mobile-drawer-link:hover i,
.mobile-drawer-link.active i {
    color: #818cf8;
}

.mobile-drawer-footer {
    padding: 1.2rem 1.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Backdrop Escuro */
.mobile-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1990;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

/* Barra de Navegação Inferior Mobile (App Style) */
.mobile-bottom-bar {
    display: none;
}

@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
    }

    body {
        padding-bottom: 95px !important;
    }

    .topbar {
        padding: 0.65rem 0.85rem !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        text-align: left !important;
    }

    .topbar > div:first-child {
        display: flex !important;
        justify-content: flex-start !important;
        align-items: center !important;
        width: auto !important;
        margin: 0 !important;
        gap: 0.5rem !important;
    }

    .topbar > div:last-child {
        display: flex !important;
        justify-content: flex-end !important;
        align-items: center !important;
        width: auto !important;
        margin: 0 !important;
        gap: 0.4rem !important;
    }

    .topbar .brand-logo {
        margin: 0 !important;
        justify-content: flex-start !important;
        text-align: left !important;
        gap: 0.5rem !important;
    }

    .topbar .brand-icon {
        width: 32px !important;
        height: 32px !important;
    }

    .topbar .brand-logo span {
        max-width: 140px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        font-size: 1rem !important;
    }

    /* Ocultar elementos volumosos no mobile, mantendo atalhos rápidos essenciais */
    .topbar .topbar-user-badge,
    .topbar .btn-novo-cliente-top,
    .topbar .topbar-credit-pill,
    .dashboard-header-actions,
    .clientes-header-actions,
    .d-none-mob {
        display: none !important;
    }

    /* O botão hambúrguer fica sempre visível e com toque agradável no mobile */
    .topbar .btn-hamburger,
    .btn-hamburger {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 38px !important;
        height: 38px !important;
        border-radius: 10px !important;
    }

    /* Barra de busca e filtros horizontais touch no mobile */
    .search-box {
        width: 100% !important;
    }

    .filter-pills {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px !important;
        width: 100% !important;
        gap: 0.35rem !important;
    }

    .filter-pill {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        padding: 0.4rem 0.75rem !important;
        font-size: 0.78rem !important;
    }

    /* Bottom Bar Fixa */
    .mobile-bottom-bar {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 62px;
        background: rgba(10, 15, 28, 0.94);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        z-index: 1000;
        justify-content: space-around;
        align-items: center;
        padding: 0 0.25rem;
    }

    .mob-bottom-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 0.68rem;
        font-weight: 600;
        padding: 0.35rem 0.6rem;
        border-radius: 8px;
        transition: all 0.15s ease;
        flex: 1;
        text-align: center;
    }

    .mob-bottom-item i {
        font-size: 1.15rem;
        transition: transform 0.15s ease;
    }

    .mob-bottom-item.active {
        color: #38bdf8;
    }

    .mob-bottom-item.active i {
        transform: translateY(-1px);
        color: #38bdf8;
    }

    .mob-bottom-center {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: linear-gradient(135deg, #6366f1, #06b6d4);
        color: #fff !important;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.25rem;
        box-shadow: 0 4px 15px rgba(99, 102, 241, 0.45);
        transform: translateY(-8px);
        flex: none;
        border: 2px solid #060913;
    }

    .mob-bottom-center:active {
        transform: translateY(-6px) scale(0.95);
    }

    /* Container e Grids Responsivos com espaço livre para a barra inferior */
    main,
    .container, 
    .container-widescreen {
        padding-left: 0.85rem !important;
        padding-right: 0.85rem !important;
        padding-bottom: 80px !important;
        margin: 0.5rem auto 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    /* Otimização Mobile do Cabeçalho e Botões de Formulários */
    .page-header-widescreen {
        margin-bottom: 1rem !important;
        padding-bottom: 0.75rem !important;
        gap: 0.75rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .page-header-actions {
        display: flex !important;
        gap: 0.5rem !important;
        align-items: stretch !important;
        flex-wrap: wrap !important;
        width: 100% !important;
    }

    .page-header-actions > * {
        flex: 1 1 auto !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 0.65rem 0.85rem !important;
        font-size: 0.85rem !important;
    }

    .page-header-actions .btn-primary {
        flex: 1 1 100% !important;
        order: -1 !important;
    }

    .form-mobile-sticky-bar {
        display: none !important;
    }

    /* Cards de Formulário Otimizados no Mobile com Respiração Lateral e Sem Fugir da Tela */
    .form-section-card {
        padding: 1.15rem 1rem !important;
        border-radius: 14px !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        background: rgba(15, 23, 42, 0.75) !important;
        margin-bottom: 0.85rem !important;
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow: hidden !important;
        height: auto !important;
    }

    .form-layout-widescreen {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.85rem !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    .form-section-title {
        font-size: 0.95rem !important;
        margin: 0 0 0.85rem 0 !important;
        padding-bottom: 0.5rem !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Em telas mobile, os grids de formulário viram fluxo vertical confortável de 100% de largura */
    .form-grid-2,
    .form-grid-3,
    .form-grid-2.mob-paired,
    .mob-row-paired {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.85rem !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    .form-group,
    .col-span-2,
    .col-span-full {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        margin-bottom: 0 !important;
    }

    .form-group label {
        font-size: 0.78rem !important;
        margin-bottom: 0.25rem !important;
        color: #94a3b8 !important;
        display: block !important;
        white-space: normal !important;
        word-break: break-word !important;
    }

    .form-control,
    select.form-control,
    input.form-control,
    .flatpickr-input,
    .input-valor-final {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding: 0.72rem 0.85rem !important;
        font-size: 0.88rem !important;
        border-radius: 9px !important;
        background: rgba(11, 17, 30, 0.95) !important;
        border-color: rgba(255, 255, 255, 0.1) !important;
        box-sizing: border-box !important;
    }

    .input-btn-group {
        display: flex !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        gap: 0.5rem !important;
    }

    .input-btn-group .form-control {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        width: auto !important;
    }

    .input-btn-group .btn-inline,
    .input-btn-group .btn-gen {
        flex: 0 0 auto !important;
    }

    .glass-card,
    .stat-card,
    .table-container {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    canvas {
        max-width: 100% !important;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
        margin-bottom: 1.25rem !important;
    }

    .stat-card {
        padding: 1rem !important;
    }

    .stat-value {
        font-size: 1.45rem !important;
    }

    .table-container {
        padding: 1rem !important;
        border-radius: 14px !important;
    }

    .modal > div {
        width: 95% !important;
        max-width: 95% !important;
        padding: 1.25rem !important;
        margin: 0.5rem auto !important;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
    }
    .stat-header {
        margin-bottom: 0.5rem !important;
    }
    .stat-icon-wrapper {
        width: 34px !important;
        height: 34px !important;
        font-size: 1rem !important;
    }
}

/* ============================================================ */
/* ALTERNADOR DE VISÃO (CARDS VS TABELA)                        */
/* ============================================================ */
.view-mode-toggle {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 3px;
    gap: 3px;
    align-items: center;
}

.btn-view-mode {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.45rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap !important;
}

.btn-view-mode:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.btn-view-mode.active {
    background: rgba(99, 102, 241, 0.25) !important;
    color: #818cf8 !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

/* Grade de Cards de Clientes */
.clientes-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.1rem;
}

.cliente-card:hover {
    border-color: rgba(99, 102, 241, 0.4) !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45) !important;
}

@media (max-width: 768px) {
    .table-container {
        padding: 0.85rem 0.65rem !important;
        border-radius: 12px !important;
        overflow-x: hidden !important;
    }
    .clientes-cards-grid {
        grid-template-columns: 1fr !important;
        gap: 0.85rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .cliente-card {
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    .view-mode-toggle button {
        padding: 0.45rem 0.65rem !important;
    }
    .view-mode-toggle .d-none-mob {
        display: none !important;
    }
    .stat-card.stat-revenue {
        grid-column: span 2 !important;
    }
}

/* ==========================================================================
   Barra de Paginação de Clientes (12 por página)
   ========================================================================== */
.pagination-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-width: 36px;
    height: 36px;
    padding: 0 0.65rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    user-select: none;
}

.btn-page:hover:not(.disabled):not(.active) {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.35);
    color: #fff;
    transform: translateY(-1px);
}

.btn-page.active {
    background: linear-gradient(135deg, #4f46e5, #6366f1) !important;
    border-color: #6366f1 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
}

.btn-page.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-ellipsis {
    color: var(--text-muted);
    padding: 0 0.25rem;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .pagination-wrapper {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.85rem;
    }
    .pagination-controls {
        width: 100%;
        justify-content: center;
    }
    .btn-page {
        min-width: 34px;
        height: 34px;
        padding: 0 0.5rem;
        font-size: 0.78rem;
    }
}

/* ==========================================================================
   DROPDOWNS MODERNOS DA TOPBAR & SUBMENUS
   ========================================================================== */
.nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0.42rem 0.6rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    user-select: none;
}

.nav-dropdown-toggle:hover,
.nav-dropdown.open .nav-dropdown-toggle,
.nav-dropdown.active .nav-dropdown-toggle {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.nav-dropdown-toggle .fa-chevron-down {
    font-size: 0.65rem;
    opacity: 0.7;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-dropdown.open .nav-dropdown-toggle .fa-chevron-down {
    transform: rotate(180deg);
    opacity: 1;
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.35rem;
    background: #090d16;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 0.5rem;
    min-width: 225px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(99, 102, 241, 0.15);
    display: none;
    flex-direction: column;
    gap: 0.2rem;
    z-index: 99999;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: fadeIn 0.15s ease;
}

/* Ponte invisível para o cursor não perder o hover no espaçamento de 0.35rem */
.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 14px;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    display: flex !important;
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    color: #cbd5e1;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}

.nav-dropdown-item:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #fff;
    transform: translateX(3px);
}

.nav-dropdown-item i {
    width: 18px;
    text-align: center;
    font-size: 0.88rem;
    flex-shrink: 0;
}

.nav-dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0.3rem 0;
}

/* ============================================================
   AJUSTE FINO PARA NOTEBOOKS 1366x768 (SEM AFETAR OUTRAS TELAS)
   ============================================================ */
@media (max-width: 1400px) and (min-width: 1025px) {
    .topbar {
        padding: 0 1rem !important;
        height: 60px !important;
    }
    .topbar .btn-action-icon {
        padding: 0.42rem 0.65rem !important;
        font-size: 0.78rem !important;
    }
    .topbar-credit-pill {
        padding: 0.4rem 0.7rem !important;
        font-size: 0.78rem !important;
    }
    .topbar-user-name {
        display: none !important;
    }
    .container,
    .container-widescreen,
    .container-clientes-full {
        padding: 1.1rem 1.2rem;
    }
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
        gap: 0.85rem;
    }
    .stat-card {
        padding: 0.95rem 1.05rem;
    }
    .stat-value {
        font-size: 1.52rem;
    }
    .table-container {
        padding: 1rem 1.1rem;
    }
    table th,
    table td {
        padding: 0.62rem 0.7rem;
        font-size: 0.82rem;
    }
}

@media (max-height: 800px) and (min-width: 1025px) {
    .modal-card,
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
}
