@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,600&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --primary: #152e73;
    --primary-light: #1f3f96;
    --primary-dark: #0a1b4d;
    --accent: #0086c4;
    --accent-light: #1fa2df;
    --bg-dark: #090e1a;
    --bg-light: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.08);
    --card-border: rgba(255, 255, 255, 0.12);
    --text-light: #edf1ff;
    --text-muted: #8c9bb4;
    --text-dark: #1e293b;
    --text-dark-muted: #64748b;
    
    /* Cores de pêssego premium do site */
    --peach-1: #ffe8e0;
    --peach-2: #ffe1d8;
    --peach-3: #ffd4c0;
    --peach-4: #fcc5ae;
    --peach-gradient: linear-gradient(135deg, #ffe8e0 0%, #fcc5ae 100%);
    --yellow-highlight: #feeab6;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Tokens Oficiais de Cantos Arredondados (Design System Border Radius) */
    --radius-sm: 6px;       /* Micro UI: Badges UF, PJ/PF, tags internas, chips, tooltips, botões de linha */
    --radius-md: 10px;      /* Controles Interativos: Botões, inputs, Omnibox, abas/tabs, dropdowns */
    --radius-lg: 16px;      /* Containers Médios: Cards de KPI, split-view, popovers, blocos de filtro */
    --radius-xl: 20px;      /* Grandes Painéis: Modais, gavetas laterais (drawers), cards de autenticação */
    --radius-pill: 9999px;  /* Pílulas contínuas: Badges de status, pílulas de contagem, avatares redondos */
    
    --radius: var(--radius-lg);
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
    --shadow-premium: 0 40px 60px -20px rgba(21, 46, 115, 0.25);
}

/* Reset Geral */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
    letter-spacing: -0.011em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.dashboard-body {
    background-color: #0d1326;
    background-image: 
        radial-gradient(at 0% 0%, rgba(21, 46, 115, 0.4) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(0, 134, 196, 0.2) 0px, transparent 50%);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.025em;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-light);
}

/* --- Container de Autenticação (Login) --- */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(21, 46, 115, 0.6) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(252, 197, 174, 0.2) 0%, transparent 40%);
}

.auth-card {
    background: rgba(13, 20, 41, 0.65);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 440px;
    padding: 40px;
    box-shadow: var(--shadow-premium);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--peach-3));
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-brand {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.logo-brand span {
    background: linear-gradient(135deg, var(--accent-light) 0%, #fff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-brand .icon-shield {
    color: var(--peach-3);
    font-size: 2rem;
}

.auth-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    color: #fff;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.09);
    box-shadow: 0 0 0 4px rgba(0, 134, 196, 0.15);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-weight: 600;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
    width: 100%;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -6px rgba(0, 134, 196, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.alert {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.88rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- Layout do Painel --- */
.layout-wrapper {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 70px);
}

/* Sidebar (Removida) */
.sidebar {
    display: none;
}

/* --- Top Header Navigation --- */
.top-header {
    background: #080d1a;
    border-bottom: 1px solid var(--card-border);
    padding: 0 40px;
    height: 70px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.top-header-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.top-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: var(--text-muted);
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 550;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    background: none;
}

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

.top-nav-link.active {
    background: var(--accent);
    color: #fff;
}

/* Dropdown Menu */
.top-nav-dropdown {
    position: relative;
    display: inline-block;
}

.top-nav-dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #0f172a;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    min-width: 200px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 150;
    padding: 8px;
    margin-top: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.2s ease;
}

/* Hover bridge invisível para evitar perda do cursor no espaço entre botão e menu */
.top-nav-dropdown .dropdown-menu::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    right: 0;
    height: 15px;
}

.top-nav-dropdown:hover .dropdown-menu,
.top-nav-dropdown:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--text-muted);
    border-radius: 8px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.dropdown-item:hover, .dropdown-item.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.dropdown-item.active {
    background: var(--accent);
}

.top-header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-profile-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--peach-gradient);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.user-name-top {
    font-size: 0.9rem;
    color: #fff;
    font-weight: 600;
}

.btn-logout-top {
    color: #f87171;
    font-size: 1.2rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.btn-logout-top:hover {
    color: #ef4444;
}

.badge-system {
    background: rgba(252, 197, 174, 0.15);
    color: var(--peach-3);
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    margin-left: 5px;
}

.sidebar-logo {
    margin-bottom: 40px;
    padding-left: 10px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 550;
    transition: var(--transition);
}

.nav-link i {
    font-size: 1.15rem;
}

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

.nav-link.active {
    background: var(--accent);
    color: #fff;
}

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

.user-profile-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--peach-gradient);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.user-details {
    overflow: hidden;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f87171;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 8px;
    transition: var(--transition);
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
}

/* Área de Conteúdo Principal */
.main-content {
    flex-grow: 1;
    margin: 0 auto;
    padding: 30px 40px;
    max-width: 1600px;
    width: 100%;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
}

.page-title h1 {
    font-size: 2rem;
    color: #fff;
    margin-bottom: 5px;
}

.page-title p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* --- Cards de Métricas --- */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.metric-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.metric-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow);
}

.metric-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.metric-icon.blue {
    background: rgba(0, 134, 196, 0.15);
    color: var(--accent-light);
}

.metric-icon.peach {
    background: rgba(252, 197, 174, 0.15);
    color: var(--peach-3);
}

.metric-icon.green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.metric-card-info h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.metric-card-info .value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    font-family: var(--font-heading);
}

/* --- Grid de Gráficos --- */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-header h3 {
    font-size: 1.1rem;
    color: #fff;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* --- Tabela Premium --- */
.card-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin-bottom: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h2 {
    font-size: 1.4rem;
    color: #fff;
}

.filters-wrapper {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.01);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.filter-select, .search-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 0.88rem;
    outline: none;
    transition: var(--transition);
}

.filter-select {
    max-width: 240px;
    text-overflow: ellipsis;
}

.filter-select:focus, .search-input:focus {
    border-color: var(--accent);
}

.filter-select option {
    background: #080d1a;
    color: #fff;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table-premium {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    color: var(--text-light);
}

.table-premium th {
    padding: 16px 20px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    vertical-align: middle;
}

.table-premium th .th-sort-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    user-select: none;
}

.table-premium th.text-center .th-sort-label {
    justify-content: center;
    width: 100%;
}

.table-premium th.text-right .th-sort-label {
    justify-content: flex-end;
    width: 100%;
}

.table-premium th .sort-arrow {
    font-size: 0.82rem;
    opacity: 0.45;
    transition: opacity 0.2s ease, transform 0.2s ease;
    display: inline-block;
    line-height: 1;
}

.table-premium th.active-sort .sort-arrow {
    opacity: 1;
    color: var(--accent-light);
    font-weight: 700;
}

.table-premium td {
    padding: 16px 20px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

/* Algarismos Tabulares e Alinhamento Numérico de Alta Precisão */
.table-premium td,
.accordion-subtable td,
.kpi-card,
.kpi-valor,
.badge,
.status-badge,
.drawer-content,
.split-view-panel {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1, "cv02" 1, "cv03" 1, "cv04" 1;
}

.table-premium tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.status-badge.inactive {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

/* Drag & Drop Importador */
.upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius);
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.01);
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--accent);
    background: rgba(0, 134, 196, 0.04);
}

.upload-icon {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 20px;
}

.upload-area h3 {
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 10px;
}

.upload-area p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.import-summary-card {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 30px;
    color: #fff;
}

/* SQL Console */
.sql-console-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sql-editor-textarea {
    width: 100%;
    height: 180px;
    background: #050811;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: #38bdf8;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1rem;
    padding: 20px;
    resize: vertical;
    outline: none;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.5);
}

.sql-editor-textarea:focus {
    border-color: var(--accent);
}

.sql-master-input-group {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.02);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sql-results {
    background: #050811;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px;
    overflow-x: auto;
    font-size: 0.9rem;
    color: #e2e8f0;
}

/* Modal Detalhes do Cliente (Gaveta Lateral) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: flex-end; /* Abre como painel lateral direito */
    transition: var(--transition);
}

.modal-content {
    width: 100%;
    max-width: 850px;
    height: 100%;
    background: #0b101f;
    border-left: 1px solid var(--card-border);
    padding: 40px;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: -10px 0 40px rgba(0,0,0,0.5);
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.modal-close {
    position: absolute;
    top: 24px;
    left: 24px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: #fff;
}

.client-detail-header {
    margin-top: 20px;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 20px;
}

.client-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.detail-item h4 {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.detail-item p {
    font-size: 0.95rem;
    color: #fff;
}

/* Cards Temáticos da Gaveta Lateral */
.client-drawer-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 20px;
    transition: var(--transition);
}

.client-drawer-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
}

.drawer-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.drawer-card-header h3 {
    font-size: 0.92rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

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

/* Linha do Tempo de Notas */
.timeline {
    position: relative;
    padding-left: 20px;
    border-left: 2px solid rgba(255, 255, 255, 0.08);
}

.timeline-item {
    position: relative;
    margin-bottom: 25px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -27px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid #0b101f;
}

.timeline-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.timeline-body {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.88rem;
    color: #e2e8f0;
}

/* Modals CRUD */
.dialog-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 500px;
    background: #0b101f;
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 30px;
    z-index: 250;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    display: none;
}

.dialog-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dialog-modal-header h3 {
    color: #fff;
}

/* Estilos de Paginação */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 25px;
}

.page-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.page-btn:hover, .page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
}

/* Responsividade Mobile */
@media (max-width: 768px) {
    .layout-wrapper {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 20px;
    }
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 20px;
    }
}

/* --- Controles de Acessibilidade no Header --- */
.accessibility-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-ctrl-accessibility {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}

.btn-ctrl-accessibility:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

/* Configuração dos ícones de tema */
.btn-theme-toggle .icon-theme-light {
    display: block;
}
.btn-theme-toggle .icon-theme-dark {
    display: none;
}

/* --- TEMA MODO CLARO (LIGHT-MODE) PREMIUM --- */
html.light-mode, html.light-mode body {
    --bg-dark: #f8fafc;
    --bg-light: #ffffff;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --text-light: #1e293b;
    --text-muted: #64748b;
    --text-main: #0f172a;
    --text-dark: #0f172a;
    --accent-light: #0284c7;
    --peach-1: #c2410c;
    --peach-2: #ea580c;
    --peach-3: #ea580c;
    --peach-4: #c2410c;
    --yellow-highlight: #d97706;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    
    background-color: #f8fafc !important;
    background-image: 
        radial-gradient(at 0% 0%, rgba(21, 46, 115, 0.04) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(0, 134, 196, 0.04) 0px, transparent 50%) !important;
    color: #1e293b !important;
}

html.light-mode body.dashboard-body {
    background-color: #f8fafc !important;
    background-image: 
        radial-gradient(at 0% 0%, rgba(21, 46, 115, 0.04) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(0, 134, 196, 0.04) 0px, transparent 50%) !important;
}

/* Controles de Acessibilidade no Modo Claro */
html.light-mode .accessibility-controls {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
}

html.light-mode .btn-ctrl-accessibility {
    color: #64748b;
}

html.light-mode .btn-ctrl-accessibility:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.05);
}

html.light-mode .btn-theme-toggle .icon-theme-light {
    display: none;
}
html.light-mode .btn-theme-toggle .icon-theme-dark {
    display: block;
    color: #0f172a;
}

/* Elementos de topo no Modo Claro */
html.light-mode .top-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}

html.light-mode .logo-brand span {
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

html.light-mode .logo-brand .icon-shield {
    color: var(--accent);
}

html.light-mode .top-nav-link {
    color: #475569;
}

html.light-mode .top-nav-link:hover, 
html.light-mode .top-nav-link.active {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.04);
}

html.light-mode .top-nav-link.active {
    background: var(--primary);
    color: #fff;
}

html.light-mode .dropdown-menu {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

html.light-mode .dropdown-item {
    color: #475569;
}

html.light-mode .dropdown-item:hover, 
html.light-mode .dropdown-item.active {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.04);
}

html.light-mode .dropdown-item.active {
    background: var(--primary);
    color: #fff;
}

html.light-mode .user-name-top {
    color: #1e293b;
}

html.light-mode .user-avatar-small,
html.light-mode .user-avatar {
    color: #fff;
    background: var(--primary);
}

/* Page titles no Modo Claro */
html.light-mode .page-title h1 {
    color: #0f172a;
}

/* Cards no Modo Claro */
html.light-mode .metric-card,
html.light-mode .chart-card,
html.light-mode .card-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.04), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
}

html.light-mode .metric-card:hover,
html.light-mode .chart-card:hover,
html.light-mode .card-section:hover {
    border-color: #cbd5e1;
    box-shadow: 0 12px 20px -8px rgba(15, 23, 42, 0.08);
}

html.light-mode .metric-card-info .value {
    color: #0f172a;
}

html.light-mode .chart-header h3 {
    color: #0f172a;
}

html.light-mode .card-section h2,
html.light-mode .card-section h3 {
    color: #0f172a !important;
}

html.light-mode .card-section p {
    color: #475569;
}

/* =========================================================
   Página Importação & Sincronização do CRM – light mode
   ========================================================= */

/* Card do CRM Seguros (fundo gradiente escuro roxo + borda roxa) */
html.light-mode .card-section[style*="rgba(30, 27, 75"],
html.light-mode .card-section[style*="rgba(30,27,75"],
html.light-mode .card-section[style*="linear-gradient(135deg, rgba(30"] {
    background: linear-gradient(135deg, #f3f0ff 0%, #eff6ff 100%) !important;
    border: 1px solid #c4b5fd !important;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.08) !important;
}

html.light-mode .card-section[style*="rgba(30, 27, 75"] h2,
html.light-mode .card-section[style*="linear-gradient(135deg, rgba(30"] h2 {
    color: #3b0764 !important;
}

html.light-mode .card-section[style*="rgba(30, 27, 75"] p,
html.light-mode .card-section[style*="linear-gradient(135deg, rgba(30"] p {
    color: #4c1d95 !important;
}

html.light-mode .card-section[style*="rgba(30, 27, 75"] code,
html.light-mode .card-section[style*="linear-gradient(135deg, rgba(30"] code {
    color: #6d28d9 !important;
    background: rgba(109, 40, 217, 0.1) !important;
    padding: 1px 5px;
    border-radius: 3px;
}

html.light-mode .card-section[style*="rgba(30, 27, 75"] strong,
html.light-mode .card-section[style*="linear-gradient(135deg, rgba(30"] strong {
    color: #3b0764 !important;
}

html.light-mode .card-section[style*="rgba(30, 27, 75"] em,
html.light-mode .card-section[style*="linear-gradient(135deg, rgba(30"] em {
    color: #4c1d95 !important;
}

/* Badge "Sincronização Direta 1-Clique" (roxo translúcido) */
html.light-mode span[style*="rgba(139, 92, 246, 0.2)"],
html.light-mode span[style*="rgba(139,92,246,0.2)"] {
    background: #ede9fe !important;
    color: #6d28d9 !important;
    border: 1px solid #c4b5fd !important;
}

/* Rótulo e data da última sincronização */
html.light-mode #labelUltimaSync {
    color: #64748b !important;
}
html.light-mode #dataUltimaSync {
    color: #3730a3 !important;
    font-weight: 700 !important;
}

/* Sub-cards "Arquivos Aceitos" (fundo rgba preto translúcido) */
html.light-mode .card-section *[style*="background: rgba(0,0,0,0.2)"],
html.light-mode .card-section *[style*="background: rgba(0, 0, 0, 0.2)"],
html.light-mode .card-section *[style*="background:rgba(0,0,0,0.2)"] {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
}

/* Textos brancos dentro dos sub-cards de arquivo */
html.light-mode .card-section *[style*="background: rgba(0,0,0,0.2)"] strong,
html.light-mode .card-section *[style*="background: rgba(0, 0, 0, 0.2)"] strong,
html.light-mode .card-section *[style*="background:rgba(0,0,0,0.2)"] strong {
    color: #0f172a !important;
}

/* Divisor dashed "Envio Múltiplo em Lote Ativado" */
html.light-mode .card-section *[style*="border-top: 1px dashed rgba(255,255,255"],
html.light-mode .card-section *[style*="border-top:1px dashed rgba(255,255,255"] {
    border-top: 1px dashed #cbd5e1 !important;
}

/* Import Summary Card (resultado por arquivo processado) */
html.light-mode .import-summary-card {
    background: #f0fdf4 !important;
    border: 1px solid #bbf7d0 !important;
    color: #14532d !important;
}
html.light-mode .import-summary-card strong[style*="color: #fff"],
html.light-mode .import-summary-card strong[style*="color:#fff"] {
    color: #14532d !important;
}

/* Sub-métricas Novos/Atualizados/Inalterados/Erros */
html.light-mode .summary-metrics-grid *[style*="background: rgba(0,0,0,0.2)"],
html.light-mode .summary-metrics-grid *[style*="background: rgba(0, 0, 0, 0.2)"],
html.light-mode .summary-metrics-grid *[style*="background:rgba(0,0,0,0.2)"] {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

/* Box de erros detalhados (fundo vermelho translúcido) */
html.light-mode .import-summary-card *[style*="background: rgba(239, 68, 68"],
html.light-mode .import-summary-card *[style*="background: rgba(239,68,68"],
html.light-mode .import-summary-card *[style*="background:rgba(239,68,68"] {
    background: #fef2f2 !important;
    border: 1px solid #fecaca !important;
}
html.light-mode .import-summary-card h4[style*="#fca5a5"],
html.light-mode .import-summary-card ul[style*="#fca5a5"] {
    color: #dc2626 !important;
}

/* Histórico de Uploads – itens do log */
html.light-mode .chart-card *[style*="background: rgba(255,255,255,0.02)"],
html.light-mode .chart-card *[style*="background:rgba(255,255,255,0.02)"] {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
}
html.light-mode .chart-card *[style*="font-weight: 600; color: #fff"],
html.light-mode .chart-card *[style*="font-weight:600;color:#fff"],
html.light-mode .chart-card div[style*="color: #fff"] {
    color: #0f172a !important;
}

/* Box de progresso/status da sincronização (#statusSyncCrm) */
html.light-mode #statusSyncCrm {
    background: #f5f3ff !important;
    border: 1px solid #c4b5fd !important;
    color: #4c1d95 !important;
}
html.light-mode #statusSyncText {
    color: #4c1d95 !important;
}
html.light-mode #spinnerSyncCrm {
    border-color: rgba(109, 40, 217, 0.2) !important;
    border-top-color: #7c3aed !important;
}

html.light-mode .table-premium th {
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
}

html.light-mode .table-premium td {
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

html.light-mode .table-premium tr:hover td {
    background: #f8fafc;
}

.client-name-link {
    color: var(--accent-light);
    font-weight: 600;
    transition: color 0.15s ease;
    cursor: pointer;
}
.client-name-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

html.light-mode .table-premium td strong,
html.light-mode .client-name-link,
html.light-mode .table-premium td strong.client-name-link,
html.light-mode .table-premium td strong[onclick*="abrirDetalhes"],
html.light-mode .table-premium td strong[onclick*="inspecionarCliente"],
html.light-mode #tabelaClientes td strong,
html.light-mode #tabelaUltimosClientes td strong {
    color: #0f172a !important;
    font-weight: 700 !important;
}
html.light-mode .table-premium td strong:hover,
html.light-mode .client-name-link:hover,
html.light-mode .table-premium td strong.client-name-link:hover,
html.light-mode .table-premium td strong[onclick*="abrirDetalhes"]:hover,
html.light-mode .table-premium td strong[onclick*="inspecionarCliente"]:hover,
html.light-mode #tabelaClientes td strong:hover,
html.light-mode #tabelaUltimosClientes td strong:hover {
    color: #0284c7 !important;
    text-decoration: underline !important;
}

/* Correções de contraste para tema claro (sobreposição de estilos inline brancos) */
html.light-mode .card-section *[style*="color: #fff"],
html.light-mode .card-section *[style*="color:#fff"],
html.light-mode .chart-card *[style*="color: #fff"],
html.light-mode .chart-card *[style*="color:#fff"],
html.light-mode .table-premium *[style*="color: #fff"],
html.light-mode .table-premium *[style*="color:#fff"] {
    color: #0f172a !important;
}

html.light-mode .card-section *[style*="background: rgba(255,255,255"],
html.light-mode .card-section *[style*="background:rgba(255,255,255"],
html.light-mode .chart-card *[style*="background: rgba(255,255,255"],
html.light-mode .chart-card *[style*="background:rgba(255,255,255"],
html.light-mode .table-premium *[style*="background: rgba(255,255,255"],
html.light-mode .table-premium *[style*="background:rgba(255,255,255"] {
    background: rgba(15, 23, 42, 0.04) !important;
}

html.light-mode .card-section *[style*="border-color: rgba(255,255,255"],
html.light-mode .card-section *[style*="border: 1px solid rgba(255,255,255"],
html.light-mode .card-section *[style*="border:1px solid rgba(255,255,255"],
html.light-mode .chart-card *[style*="border-color: rgba(255,255,255"],
html.light-mode .chart-card *[style*="border: 1px solid rgba(255,255,255"],
html.light-mode .chart-card *[style*="border:1px solid rgba(255,255,255"],
html.light-mode .table-premium *[style*="border-color: rgba(255,255,255"],
html.light-mode .table-premium *[style*="border: 1px solid rgba(255,255,255"],
html.light-mode .table-premium *[style*="border:1px solid rgba(255,255,255"] {
    border-color: rgba(15, 23, 42, 0.08) !important;
}

html.light-mode .search-input,
html.light-mode .filter-select {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

html.light-mode .search-input::placeholder {
    color: #94a3b8;
}

html.light-mode .filter-select option {
    background: #ffffff;
    color: #0f172a;
}

html.light-mode .pagination .page-btn {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #1e293b !important;
    font-weight: 600 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

html.light-mode .pagination .page-btn:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}

html.light-mode .pagination .page-btn.active {
    background: #0284c7 !important;
    border-color: #0284c7 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 1px 4px rgba(2, 132, 199, 0.3) !important;
}

html.light-mode .pagination span {
    color: #64748b !important;
    font-weight: 600 !important;
}

/* Paginação Inteligente dos Repasses (Dashboard) */
html.light-mode .repasses-pagination-bar {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}
html.light-mode .repasses-pagination-info {
    color: #475569 !important;
    font-weight: 500 !important;
}
html.light-mode .repasses-pagination-info strong {
    color: #0369a1 !important;
    font-weight: 700 !important;
}
html.light-mode .btn-rep-action {
    background: #e0f2fe !important;
    border: 1px solid #bae6fd !important;
    color: #0369a1 !important;
    font-weight: 700 !important;
}
html.light-mode .btn-rep-action:hover {
    background: #0284c7 !important;
    color: #ffffff !important;
    border-color: #0284c7 !important;
}
html.light-mode .repasses-page-nav {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
}
html.light-mode .btn-rep-page-nav {
    color: #1e293b !important;
}
html.light-mode .btn-rep-page-nav:hover:not(:disabled) {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}
html.light-mode .btn-rep-page-nav:disabled {
    color: #94a3b8 !important;
    opacity: 0.35 !important;
}
html.light-mode .rep-page-badge {
    color: #0f172a !important;
    font-weight: 700 !important;
}

/* --- Selects e Filtros de Alta Visibilidade --- */
.select-competencia {
    font-weight: 600;
    color: var(--accent-light);
    border: 1px solid rgba(56, 189, 248, 0.4);
    background: rgba(15, 23, 42, 0.6);
}
html.light-mode .select-competencia,
html.light-mode select.select-competencia {
    background: #ffffff !important;
    color: #0284c7 !important;
    border: 1px solid #0284c7 !important;
}
html.light-mode .select-competencia option {
    background: #ffffff !important;
    color: #0f172a !important;
}

.select-status-destaque {
    font-weight: 600;
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}
html.light-mode .select-status-destaque,
html.light-mode select.select-status-destaque {
    color: #0f172a !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
}
html.light-mode .select-status-destaque option {
    background: #ffffff !important;
    color: #0f172a !important;
}

/* --- Botão de Exportação Peach / Laranja (Alto Contraste WCAG AA 5.2:1) --- */
.btn-export-peach {
    background: var(--peach-3);
    color: var(--primary-dark);
    font-weight: 600;
}
html.light-mode .btn-export-peach,
html.light-mode a.btn-export-peach,
html.light-mode a[style*="background: var(--peach-3)"],
html.light-mode a[style*="background:var(--peach-3)"],
html.light-mode button[style*="background: var(--peach-3)"],
html.light-mode button[style*="background:var(--peach-3)"],
html.light-mode .btn[style*="background: var(--peach-3)"],
html.light-mode .btn[style*="background:var(--peach-3)"] {
    background: #c2410c !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

/* --- Menu Dropdown de Exportação Financeira --- */
html.light-mode .dropdown-menu-export {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12) !important;
}
html.light-mode .dropdown-menu-export a {
    color: #1e293b !important;
}
html.light-mode .dropdown-menu-export a:hover {
    background: #f1f5f9 !important;
}
html.light-mode .dropdown-menu-export strong {
    color: #0f172a !important;
}
html.light-mode .dropdown-menu-export span {
    color: #64748b !important;
}
html.light-mode .dropdown-menu-export div[style*="border-top"] {
    border-top-color: #e2e8f0 !important;
}

/* --- Cards de Métricas e Cascata Financeira (Modo Claro) --- */
.resultado-destaque-h3 {
    color: #fff;
}
html.light-mode .resultado-destaque-h3,
html.light-mode .metric-card.resultado-destaque h3 {
    color: #0f172a !important;
}
.metric-val-green {
    color: #10b981;
}
html.light-mode .metric-val-green,
html.light-mode .metric-card .value[style*="color: #10b981"],
html.light-mode .metric-card .value[style*="color:#10b981"] {
    color: #16a34a !important;
    font-weight: 700 !important;
}
.metric-val-pendente {
    color: #fca5a5;
}
html.light-mode .metric-val-pendente,
html.light-mode .metric-card .value[style*="color: #fca5a5"],
html.light-mode .metric-card .value[style*="color:#fca5a5"] {
    color: #dc2626 !important;
    font-weight: 700 !important;
}

html.light-mode .cascata-row-title,
html.light-mode .cascata-row-title span,
html.light-mode .cascata-row-title a {
    color: #0284c7 !important;
}
html.light-mode .cascata-row-title.receita {
    color: #16a34a !important;
}
html.light-mode .cascata-row-title.deducoes {
    color: #ea580c !important;
}
html.light-mode .cascata-row-title.resultado {
    color: #0284c7 !important;
}
html.light-mode .cascata-row-title[style*="color: #38bdf8"],
html.light-mode .cascata-row-title *[style*="color: #38bdf8"] {
    color: #0284c7 !important;
}

/* --- Badges de Status e Periodicidade (Vibrantes, Vivos e Saturados no Modo Claro) --- */
html.light-mode span[style*="color: #34d399"],
html.light-mode span[style*="color:#34d399"],
html.light-mode .badge[style*="color: #34d399"],
html.light-mode .badge[style*="color:#34d399"],
html.light-mode .status-badge-confirmed {
    color: #15803d !important;
    background: #dcfce7 !important;
    border: 1px solid #86efac !important;
    font-weight: 700 !important;
}

html.light-mode span[style*="color: #38bdf8"],
html.light-mode span[style*="color:#38bdf8"],
html.light-mode .badge[style*="color: #38bdf8"],
html.light-mode .badge[style*="color:#38bdf8"] {
    color: #1d4ed8 !important;
    background: #dbeafe !important;
    border: 1px solid #93c5fd !important;
    font-weight: 700 !important;
}

html.light-mode span[style*="color: #cbd5e1"],
html.light-mode span[style*="color:#cbd5e1"],
html.light-mode .badge[style*="color: #cbd5e1"],
html.light-mode .badge[style*="color:#cbd5e1"] {
    color: #334155 !important;
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    font-weight: 600 !important;
}

html.light-mode span[style*="color: #fbbf24"],
html.light-mode span[style*="color:#fbbf24"],
html.light-mode .badge[style*="color: #fbbf24"],
html.light-mode .badge[style*="color:#fbbf24"],
html.light-mode .status-badge-pending {
    color: #b45309 !important;
    background: #fef3c7 !important;
    border: 1px solid #fcd34d !important;
    font-weight: 700 !important;
}

html.light-mode span[style*="color: #f87171"],
html.light-mode span[style*="color:#f87171"],
html.light-mode .badge[style*="color: #f87171"],
html.light-mode .badge[style*="color:#f87171"],
html.light-mode .status-badge-overdue {
    color: #dc2626 !important;
    background: #fee2e2 !important;
    border: 1px solid #fca5a5 !important;
    font-weight: 700 !important;
}

html.light-mode span[style*="color: #c084fc"],
html.light-mode span[style*="color:#c084fc"],
html.light-mode .badge[style*="color: #c084fc"],
html.light-mode .badge[style*="color:#c084fc"] {
    color: #7e22ce !important;
    background: #f3e8ff !important;
    border: 1px solid #d8b4fe !important;
    font-weight: 700 !important;
}

html.light-mode span[style*="color: #60a5fa"],
html.light-mode span[style*="color:#60a5fa"],
html.light-mode .badge[style*="color: #60a5fa"],
html.light-mode .badge[style*="color:#60a5fa"],
html.light-mode .badge-pf {
    color: #1d4ed8 !important;
    background: #dbeafe !important;
    border: 1px solid #93c5fd !important;
    font-weight: 700 !important;
}

html.light-mode *[style*="color: #4ade80"],
html.light-mode *[style*="color:#4ade80"] {
    color: #15803d !important;
    font-weight: 700 !important;
}

/* Ícones com Cores Saturadas no Modo Claro */
html.light-mode i[style*="color: #60a5fa"],
html.light-mode i[style*="color:#60a5fa"],
html.light-mode i[style*="color: #38bdf8"],
html.light-mode i[style*="color:#38bdf8"] {
    color: #0284c7 !important;
}
html.light-mode i[style*="color: #4ade80"],
html.light-mode i[style*="color:#4ade80"],
html.light-mode i[style*="color: #34d399"],
html.light-mode i[style*="color:#34d399"] {
    color: #15803d !important;
}
html.light-mode i[style*="color: #f87171"],
html.light-mode i[style*="color:#f87171"] {
    color: #dc2626 !important;
}
html.light-mode i[style*="color: #c084fc"],
html.light-mode i[style*="color:#c084fc"] {
    color: #7e22ce !important;
}

/* Botão Sincronizar Asaas Global */
html.light-mode #btnSyncAsaasGlobal,
html.light-mode .btn-sync-asaas-global {
    background: #dcfce7 !important;
    color: #15803d !important;
    border: 1px solid #86efac !important;
    font-weight: 700 !important;
}
html.light-mode #btnSyncAsaasGlobal:hover,
html.light-mode .btn-sync-asaas-global:hover {
    background: #bbf7d0 !important;
    color: #166534 !important;
    border-color: #4ade80 !important;
}

/* Destaques de KPIs Operacionais */
html.light-mode .kpi-pct-corretor {
    color: #475569 !important;
    font-weight: 600 !important;
}
html.light-mode .kpi-maior-ticket-nome {
    color: #0369a1 !important;
    font-weight: 600 !important;
}

/* Coluna Financeira Líquido na Tabela */
html.light-mode .table-premium td[style*="color: var(--success)"],
html.light-mode .table-premium td[style*="color:var(--success)"] {
    color: #15803d !important;
    font-weight: 700 !important;
}

/* --- Modais PIX Asaas (Individual e Lote) no Modo Claro --- */
html.light-mode .modal-pix-backdrop {
    background: rgba(15, 23, 42, 0.45) !important;
}

html.light-mode .modal-pix-dialog {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25) !important;
}

html.light-mode #modalPixLote .modal-pix-dialog > div:first-child,
html.light-mode #modalPixIndividual .modal-pix-dialog > div:first-child {
    background: linear-gradient(135deg, #ecfdf5 0%, #f0f9ff 100%) !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

html.light-mode .modal-pix-dialog h3 {
    color: #0f172a !important;
}

html.light-mode .modal-pix-dialog p {
    color: #475569 !important;
}

html.light-mode .modal-pix-dialog button[title="Fechar"] {
    color: #64748b !important;
}
html.light-mode .modal-pix-dialog button[title="Fechar"]:hover {
    color: #0f172a !important;
}

html.light-mode .modal-pix-dialog div[style*="background: rgba(255, 255, 255, 0.03)"],
html.light-mode .modal-pix-dialog div[style*="background:rgba(255, 255, 255, 0.03)"],
html.light-mode .modal-pix-dialog div[style*="background: rgba(255,255,255,0.03)"],
html.light-mode .modal-pix-dialog div[style*="background: rgba(14, 165, 233, 0.08)"],
html.light-mode .modal-pix-dialog div[style*="background:rgba(14, 165, 233, 0.08)"],
html.light-mode .modal-pix-dialog div[style*="background: rgba(0, 0, 0, 0.25)"],
html.light-mode .modal-pix-dialog div[style*="background:rgba(0, 0, 0, 0.25)"] {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

html.light-mode .modal-pix-dialog div[style*="border-top: 1px solid rgba(255,255,255"] {
    border-top: 1px solid #e2e8f0 !important;
}

html.light-mode .modal-pix-dialog span[style*="color: #94a3b8"],
html.light-mode .modal-pix-dialog span[style*="color: #64748b"] {
    color: #64748b !important;
}

html.light-mode #pix_ind_nome,
html.light-mode #pix_lote_total {
    color: #0f172a !important;
}

html.light-mode #pix_ind_chave {
    color: #0284c7 !important;
    font-weight: 700 !important;
}

html.light-mode #pix_ind_valor,
html.light-mode #pix_lote_saldo {
    color: #15803d !important;
    font-weight: 800 !important;
}

html.light-mode .modal-pix-dialog label {
    color: #0f172a !important;
}

html.light-mode #pix_ind_senha,
html.light-mode #pix_lote_senha {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

html.light-mode #pix_ind_senha::placeholder,
html.light-mode #pix_lote_senha::placeholder {
    color: #94a3b8 !important;
}

html.light-mode #pix_ind_senha:focus,
html.light-mode #pix_lote_senha:focus {
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}

html.light-mode .modal-pix-dialog button:has(.bx-show),
html.light-mode .modal-pix-dialog button:has(.bx-hide),
html.light-mode .modal-pix-dialog button[onclick*="toggleVisibilidadeSenha"] {
    color: #64748b !important;
}

html.light-mode .modal-pix-dialog button[onclick*="fecharModal"] {
    background: #f1f5f9 !important;
    color: #334155 !important;
    border: 1px solid #cbd5e1 !important;
}
html.light-mode .modal-pix-dialog button[onclick*="fecharModal"]:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

html.light-mode #pix_lote_aviso_saldo {
    background: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    color: #dc2626 !important;
}

html.light-mode #pix_lote_aviso_sem_chave {
    background: #fffbeb !important;
    border: 1px solid #fde68a !important;
    color: #b45309 !important;
}

html.light-mode #pix_lote_sem_chave_lista {
    color: #475569 !important;
}

html.light-mode #pix_lote_aviso_retidos {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #475569 !important;
}
html.light-mode #pix_lote_aviso_retidos strong {
    color: #1e293b !important;
}

html.light-mode #pix_lote_log_container {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}

html.light-mode #pix_lote_status_titulo {
    color: #0f172a !important;
}

html.light-mode #pix_lote_status_sub {
    color: #64748b !important;
}

html.light-mode #pix_ind_feedback {
    background: #ecfdf5 !important;
    color: #15803d !important;
    border: 1px solid #86efac !important;
}

/* --- Badges de Plataforma na Tabela --- */
.badge-plataforma-corretor {
    background: rgba(255, 255, 255, 0.05);
    color: var(--peach-3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 500;
}
html.light-mode .badge-plataforma-corretor,
html.light-mode .table-premium span[style*="color: var(--peach-3)"],
html.light-mode .table-premium span[style*="color:var(--peach-3)"] {
    background: #ffedd5 !important;
    color: #c2410c !important;
    border: 1px solid #fdba74 !important;
    font-weight: 700 !important;
}

/* --- Seção Asaas e Botões de Ação no Modo Claro --- */
html.light-mode #btnSyncAsaasCliente {
    background: #e0f2fe !important;
    color: #0369a1 !important;
    border: 1px solid #7dd3fc !important;
    font-weight: 600 !important;
}
html.light-mode #btnSyncAsaasCliente:hover {
    background: #bae6fd !important;
    color: #0284c7 !important;
}
html.light-mode #m_secao_asaas {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}
html.light-mode #m_secao_asaas h3 {
    color: #0284c7 !important;
}
html.light-mode #m_asaas_sub_id {
    color: #0f172a !important;
}
html.light-mode #m_valor_liquido_premio {
    color: #0f172a !important;
}
html.light-mode #m_total_liquido_empresa {
    color: #047857 !important;
}
html.light-mode .client-drawer-card h3[style*="color: #cbd5e1"],
html.light-mode .client-drawer-card h3[style*="color:#cbd5e1"] {
    color: #334155 !important;
}
html.light-mode .link-asaas-doc,
html.light-mode a[style*="color: #38bdf8"],
html.light-mode a[style*="color:#38bdf8"] {
    color: #0284c7 !important;
}
html.light-mode .link-asaas-doc:hover {
    color: #0369a1 !important;
    text-decoration: underline !important;
}

/* Modais e Gavetas Laterais no Modo Claro */
html.light-mode .modal-content,
html.light-mode .dialog-modal {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-left: 1px solid #cbd5e1 !important;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15) !important;
    color: #1e293b !important;
}

/* --- Tabela de Usuários / Operadores (usuarios.php) --- */
.user-subtext {
    font-size: 0.75rem;
    color: var(--text-muted);
}
html.light-mode .user-subtext {
    color: #475569 !important;
    font-weight: 500 !important;
}

.badge-role-admin {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    font-size: 0.65rem;
    border: 1px solid rgba(16, 185, 129, 0.25);
}
html.light-mode .badge-role-admin {
    background: #dcfce7 !important;
    color: #15803d !important;
    border: 1px solid #86efac !important;
    font-weight: 700 !important;
}

.badge-role-operacional {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    font-size: 0.65rem;
    border: 1px solid rgba(59, 130, 246, 0.25);
}
html.light-mode .badge-role-operacional {
    background: #dbeafe !important;
    color: #1d4ed8 !important;
    border: 1px solid #93c5fd !important;
    font-weight: 700 !important;
}

.col-ultimo-acesso {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.col-ultimo-acesso .acesso-data {
    color: #e2e8f0;
    font-weight: 500;
}
html.light-mode .col-ultimo-acesso .acesso-data {
    color: #0f172a !important;
    font-weight: 600 !important;
}

.col-ultimo-acesso .ip-subtext {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.col-ultimo-acesso .ip-subtext i {
    font-size: 0.82rem;
    color: var(--accent);
}
html.light-mode .col-ultimo-acesso .ip-subtext {
    color: #475569 !important;
    font-weight: 500 !important;
}
html.light-mode .col-ultimo-acesso .ip-subtext i {
    color: #0284c7 !important;
}

/* Botões de Ação na Tabela de Operadores */
.btn-action-edit {
    width: auto;
    padding: 6px 11px;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-light);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.btn-action-edit:hover {
    background: rgba(56, 189, 248, 0.15);
    color: #ffffff;
}
html.light-mode .btn-action-edit {
    background: #e0f2fe !important;
    color: #0284c7 !important;
    border: 1px solid #bae6fd !important;
    font-weight: 600 !important;
}
html.light-mode .btn-action-edit:hover {
    background: #0284c7 !important;
    color: #ffffff !important;
    border-color: #0284c7 !important;
}

.btn-action-logout {
    width: auto;
    padding: 6px 10px;
    font-size: 0.75rem;
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.btn-action-logout:hover {
    background: rgba(245, 158, 11, 0.25);
    color: #ffffff;
}
html.light-mode .btn-action-logout {
    background: #fffbeb !important;
    color: #b45309 !important;
    border: 1px solid #fde68a !important;
    font-weight: 600 !important;
}
html.light-mode .btn-action-logout:hover {
    background: #d97706 !important;
    color: #ffffff !important;
    border-color: #d97706 !important;
}

.btn-action-delete {
    width: auto;
    padding: 6px 10px;
    font-size: 0.75rem;
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.btn-action-delete:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #ffffff;
}
html.light-mode .btn-action-delete {
    background: #fee2e2 !important;
    color: #dc2626 !important;
    border: 1px solid #fca5a5 !important;
    font-weight: 600 !important;
}
html.light-mode .btn-action-delete:hover {
    background: #dc2626 !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
}

.btn-action-disabled {
    width: auto;
    padding: 6px 10px;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: not-allowed;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
html.light-mode .btn-action-disabled {
    background: #f1f5f9 !important;
    color: #cbd5e1 !important;
    border: 1px solid #e2e8f0 !important;
}

html.light-mode .modal-content h2,
html.light-mode .modal-content h3,
html.light-mode .modal-content h4,
html.light-mode .modal-content h5,
html.light-mode .modal-content .modal-title,
html.light-mode .dialog-modal-header h3,
html.light-mode #m_plat_nome,
html.light-mode #m_nome,
html.light-mode #m_nome_corretor,
html.light-mode #m_endereco {
    color: #0f172a !important;
}

html.light-mode .modal-content .client-detail-header {
    border-bottom: 1px solid #e2e8f0 !important;
}

html.light-mode .modal-content label {
    color: #334155 !important;
    font-weight: 600;
}

html.light-mode .modal-content p,
html.light-mode .modal-content span {
    color: #475569;
}

html.light-mode .modal-content strong {
    color: #0f172a !important;
}

html.light-mode .modal-content .modal-close {
    color: #64748b !important;
}
html.light-mode .modal-content .modal-close:hover {
    color: #0f172a !important;
}

/* Blocos de resumo, módulos e configurações dentro de gavetas/modais */
html.light-mode .client-drawer-card,
html.light-mode .plat-config-box,
html.light-mode .corr-config-box,
html.light-mode .plat-summary-card,
html.light-mode .client-finance-box,
html.light-mode .modal-content div[style*="background: rgba(255,255,255"],
html.light-mode .modal-content div[style*="background: rgba(255, 255, 255"],
html.light-mode .modal-content div[style*="background:rgba(255,255,255"] {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}

html.light-mode .client-drawer-card:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06) !important;
}

/* Divisores internos e cabeçalhos dos módulos da gaveta */
html.light-mode .drawer-card-header {
    border-bottom: 1px solid #e2e8f0 !important;
}

html.light-mode .client-detail-header {
    border-bottom: 1px solid #e2e8f0 !important;
}

html.light-mode .drawer-card-header h3 {
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
}

html.light-mode .drawer-card-header h3[style*="#cbd5e1"],
html.light-mode .drawer-card-header h3[style*="cbd5e1"] {
    color: #1e293b !important;
}

/* Boxes especiais dentro de gavetas (PIX e Asaas) */
html.light-mode #box_repasse_pix_drawer,
html.light-mode #box_repasse_pix_drawer_plat,
html.light-mode #m_secao_asaas {
    background: #f0f9ff !important;
    border: 1px solid #bae6fd !important;
    border-radius: 12px !important;
}

html.light-mode #m_secao_asaas h3 {
    color: #0284c7 !important;
}

html.light-mode #m_secao_asaas #btnSyncAsaasCliente {
    background: #e0f2fe !important;
    color: #0284c7 !important;
    border: 1px solid #7dd3fc !important;
}

html.light-mode #m_secao_asaas #btnSyncAsaasCliente:hover {
    background: #0284c7 !important;
    color: #ffffff !important;
}

html.light-mode #m_secao_asaas h4 {
    color: #0369a1 !important;
}

html.light-mode #m_secao_asaas #m_asaas_alerta_atraso {
    background: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    color: #dc2626 !important;
}

/* Badge de Retroatividade e Destaques no Light Mode */
html.light-mode #m_badge_retroatividade {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    border: 1px solid #bfdbfe !important;
}

html.light-mode #m_plano_atual {
    color: #0284c7 !important;
    font-weight: 700 !important;
}

html.light-mode #m_lmi_cobertura {
    color: #16a34a !important;
    font-weight: 700 !important;
}

html.light-mode #m_total_liquido_empresa {
    color: #059669 !important;
    font-weight: 700 !important;
}

html.light-mode #m_numero_apolice {
    color: #0284c7 !important;
}

/* Forçar substituição de estilos inline de texto branco ou cores claras em modais (exceto botões de ação) */
html.light-mode .modal-content *[style*="color: #fff"]:not(.btn):not(.btn-primary):not(.btn-success):not(.btn-danger):not(#btn_gerar_certificado),
html.light-mode .modal-content *[style*="color:#fff"]:not(.btn):not(.btn-primary):not(.btn-success):not(.btn-danger):not(#btn_gerar_certificado),
html.light-mode .modal-content *[style*="color: #ffffff"]:not(.btn):not(.btn-primary):not(.btn-success):not(.btn-danger):not(#btn_gerar_certificado),
html.light-mode .modal-content *[style*="color:#ffffff"]:not(.btn):not(.btn-primary):not(.btn-success):not(.btn-danger):not(#btn_gerar_certificado) {
    color: #0f172a !important;
}

/* Preservar texto branco nítido em botões primários e de ação dentro e fora de modais */
html.light-mode .btn-primary,
html.light-mode .btn-primary *,
html.light-mode #btn_gerar_certificado,
html.light-mode #btn_gerar_certificado *,
html.light-mode .modal-content .btn-primary,
html.light-mode .modal-content .btn-primary *,
html.light-mode .modal-content #btn_gerar_certificado,
html.light-mode .modal-content #btn_gerar_certificado *,
html.light-mode .modal-content .btn-success,
html.light-mode .modal-content .btn-success *,
html.light-mode .modal-content .btn-danger,
html.light-mode .modal-content .btn-danger * {
    color: #ffffff !important;
}

html.light-mode .modal-content *[style*="color: var(--peach-3)"] {
    color: #ea580c !important;
}

html.light-mode .modal-content *[style*="color: var(--accent-light)"] {
    color: #0284c7 !important;
}

html.light-mode .modal-content *[style*="color: var(--yellow-highlight)"] {
    color: #d97706 !important;
}

html.light-mode .modal-content *[style*="color: var(--text-muted)"] {
    color: #64748b !important;
}

html.light-mode .modal-content *[style*="color: var(--success)"] {
    color: #047857 !important;
}

html.light-mode .modal-content *[style*="color: #e2e8f0"],
html.light-mode .modal-content *[style*="color:#e2e8f0"],
html.light-mode .modal-content *[style*="color: #cbd5e1"],
html.light-mode .modal-content *[style*="color:#cbd5e1"] {
    color: #1e293b !important;
}

html.light-mode .modal-content *[style*="color: #34d399"],
html.light-mode .modal-content *[style*="color:#34d399"] {
    color: #047857 !important;
}

html.light-mode .modal-content *[style*="color: #4ade80"],
html.light-mode .modal-content *[style*="color:#4ade80"] {
    color: #16a34a !important;
}

html.light-mode .modal-content *[style*="color: #38bdf8"],
html.light-mode .modal-content *[style*="color:#38bdf8"] {
    color: #0284c7 !important;
}

/* Inputs e formulários dentro de gavetas no Light Mode */
html.light-mode .modal-content .search-input,
html.light-mode .modal-content input.search-input {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}
html.light-mode .modal-content .search-input:focus,
html.light-mode .modal-content input.search-input:focus {
    background: #ffffff !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(0, 134, 196, 0.15) !important;
}

/* Tabelas dentro de gavetas no Light Mode */
html.light-mode .modal-content .table-premium th {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}
html.light-mode .modal-content .table-premium td {
    background: #ffffff !important;
    color: #334155 !important;
    border-bottom: 1px solid #f1f5f9 !important;
}
html.light-mode .modal-content .table-premium td strong {
    color: #0f172a !important;
}
html.light-mode .modal-content .table-premium tr:hover td {
    background: #f8fafc !important;
}
html.light-mode .detail-item h4 {
    color: #64748b !important;
    font-weight: 700 !important;
}

html.light-mode .detail-item p {
    color: #0f172a !important;
    font-weight: 600;
}

html.light-mode .timeline-body {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #1e293b !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}

html.light-mode .timeline-body div[style*="color: #fff"],
html.light-mode .timeline-body div[style*="color:#fff"] {
    color: #0f172a !important;
}

html.light-mode .timeline {
    border-left: 2px solid #cbd5e1 !important;
}

html.light-mode .timeline-item::before {
    background: #0284c7 !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 0 0 1px #cbd5e1 !important;
}

html.light-mode .timeline-date {
    color: #64748b !important;
    font-weight: 600 !important;
}

/* --- AJUSTES EXCLUSIVOS DE ACESSIBILIDADE E ALTO CONTRASTE (LIGHT MODE) --- */

/* 1. Ajustes Financeiros Individuais e Inputs do Segurado */
html.light-mode .client-finance-box {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
}
html.light-mode .form-control,
html.light-mode select.form-control {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}
html.light-mode .form-control:focus {
    background: #ffffff !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 4px rgba(0, 134, 196, 0.15) !important;
}
html.light-mode .client-finance-box label {
    color: #334155 !important;
}
html.light-mode .client-finance-box span {
    color: #0f172a !important;
}

/* 2. Correção de Cores Claras e Ilegíveis nas Tags da Timeline */
html.light-mode .timeline-body strong[style*="var(--peach-3)"],
html.light-mode .timeline-body strong[style*="--peach"] {
    color: #ea580c !important; /* Laranja escuro / Âmbar de alta visibilidade */
}
html.light-mode .timeline-body strong[style*="var(--accent-light)"] {
    color: #0284c7 !important; /* Azul escuro premium */
}
html.light-mode .timeline-body strong[style*="var(--yellow-highlight)"] {
    color: #d97706 !important; /* Dourado / Ouro escuro */
}
html.light-mode .timeline-body strong[style*="var(--text-light)"] {
    color: #475569 !important; /* Slate / Cinza escuro */
}

/* 3. Drag & Drop Upload Area (Enviar Novo Arquivo) */
html.light-mode .upload-area {
    border: 2px dashed #94a3b8 !important;
    background: #f8fafc !important;
}
html.light-mode .upload-area h3 {
    color: #0f172a !important;
}
html.light-mode .upload-area p {
    color: #475569 !important;
}
html.light-mode .upload-area:hover, 
html.light-mode .upload-area.dragover {
    border-color: var(--accent) !important;
    background: rgba(0, 134, 196, 0.05) !important;
}

/* Exclusão do bloco duplicado div[style*="color: #fff"] já abrangido pela regra universal acima */

/* Links de corretores premium */
.corretor-link-premium {
    color: var(--accent-light);
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}
.corretor-link-premium:hover {
    color: #fff !important;
}
html.light-mode .corretor-link-premium {
    color: var(--primary);
}
html.light-mode .corretor-link-premium:hover {
    color: var(--accent) !important;
}

/* Destaque para Repasses do Dia Corrente (Hoje) */
.repasse-hoje td {
    background: rgba(245, 158, 11, 0.08) !important;
}
.repasse-hoje:hover td {
    background: rgba(245, 158, 11, 0.12) !important;
}
.repasse-hoje td:first-child {
    border-left: 4px solid var(--warning) !important;
}
.repasse-hoje td strong.corretor-link-premium {
    color: var(--warning) !important;
}
.repasse-hoje td span {
    color: var(--warning) !important;
}

/* Modo Claro - Destaque Hoje */
html.light-mode .repasse-hoje td {
    background: rgba(245, 158, 11, 0.1) !important;
}
html.light-mode .repasse-hoje:hover td {
    background: rgba(245, 158, 11, 0.14) !important;
}
html.light-mode .repasse-hoje td strong.corretor-link-premium {
    color: #d97706 !important;
}
html.light-mode .repasse-hoje td span {
    color: #d97706 !important;
}

/* Accordion Repasses Detail Row */
.repasse-row {
    cursor: pointer;
    transition: var(--transition);
}
.repasse-details-row > td {
    padding: 0 !important; /* Remove td padding for accordion wrapper */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.accordion-subtable-wrapper {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.35s ease-out, padding 0.35s ease-out;
    background: rgba(0, 0, 0, 0.15);
    padding: 0 20px;
}
.accordion-subtable-wrapper.open {
    max-height: 500px;
    padding: 15px 20px 20px 20px;
}

.accordion-subtable {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    overflow: hidden;
}
.accordion-subtable th {
    padding: 10px 15px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
}
.accordion-subtable td {
    padding: 10px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.accordion-subtable tr:last-child td {
    border-bottom: none;
}

.accordion-client-name {
    color: var(--text-light);
}
.accordion-plan-name {
    color: var(--text-muted);
}
.accordion-value-success {
    color: var(--success);
}

.badge-tipo-repasse {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    white-space: nowrap;
}
.badge-tipo-adesao {
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.badge-tipo-mensalidade {
    background: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.10);
}

/* Light mode overrides for accordion subtable */
html.light-mode .accordion-subtable-wrapper {
    background: rgba(0, 0, 0, 0.02);
}
html.light-mode .accordion-subtable {
    background: #ffffff;
    color: #334155;
    border: 1px solid #e2e8f0;
}
html.light-mode .accordion-subtable th {
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
}
html.light-mode .accordion-subtable td {
    border-bottom: 1px solid #f1f5f9;
}
html.light-mode .accordion-client-name {
    color: #0f172a;
}
html.light-mode .accordion-plan-name {
    color: #475569;
}
html.light-mode .badge-tipo-adesao {
    background: #e2e8f0;
    color: #0f172a;
    border: 1px solid #cbd5e1;
}
html.light-mode .badge-tipo-mensalidade {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

/* ==================================================================================
   📱 MENU DE NAVEGAÇÃO MOBILE (DRAWER & RESPONSIVIDADE)
   ================================================================================== */

/* Botão Menu Mobile Hambúrguer */
.btn-mobile-menu {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: var(--transition);
    align-items: center;
    justify-content: center;
}
.btn-mobile-menu:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}
html.light-mode .btn-mobile-menu:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.04);
}

/* Overlay Escuro */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.mobile-menu-overlay.show {
    display: block;
    opacity: 1;
}

/* Gaveta Lateral (Drawer) */
.mobile-menu-drawer {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background: #080d1a;
    border-left: 1px solid var(--card-border);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 24px;
}
.mobile-menu-drawer.open {
    right: 0;
}
html.light-mode .mobile-menu-drawer {
    background: #ffffff;
    border-left: 1px solid #e2e8f0;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.05);
}

/* Cabeçalho do Drawer */
.mobile-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}
.btn-close-drawer {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
}
.btn-close-drawer:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}
html.light-mode .btn-close-drawer:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.04);
}

/* Perfil do Usuário no Drawer */
.mobile-drawer-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    margin-bottom: 25px;
}
html.light-mode .mobile-drawer-profile {
    background: rgba(0, 0, 0, 0.01);
    border: 1px solid #e2e8f0;
}
.user-avatar-medium {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}
.user-profile-info {
    display: flex;
    flex-direction: column;
}
.user-name-drawer {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
}
html.light-mode .user-name-drawer {
    color: #0f172a;
}
.user-role-drawer {
    color: var(--text-muted);
    font-size: 0.78rem;
}

/* Links do Drawer */
.mobile-drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 20px;
}
.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 550;
    transition: var(--transition);
    text-decoration: none;
}
.mobile-nav-link:hover, .mobile-nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}
.mobile-nav-link.active {
    background: var(--accent);
    color: #fff;
}
html.light-mode .mobile-nav-link:hover, html.light-mode .mobile-nav-link.active {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.04);
}
html.light-mode .mobile-nav-link.active {
    background: var(--primary);
    color: #fff;
}

/* Submenu de Configurações */
.mobile-nav-group {
    display: flex;
    flex-direction: column;
    margin-top: 8px;
    border-top: 1px solid var(--card-border);
    padding-top: 12px;
}
html.light-mode .mobile-nav-group {
    border-top: 1px solid #e2e8f0;
}
.mobile-nav-group-title {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.mobile-nav-group-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 12px;
    margin-top: 6px;
}
.mobile-nav-sublink {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-muted);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
}
.mobile-nav-sublink:hover, .mobile-nav-sublink.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}
.mobile-nav-sublink.active {
    background: rgba(0, 134, 196, 0.15);
    color: var(--accent-light);
}
html.light-mode .mobile-nav-sublink:hover, html.light-mode .mobile-nav-sublink.active {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.03);
}
html.light-mode .mobile-nav-sublink.active {
    background: rgba(0, 134, 196, 0.08);
    color: var(--primary);
}

/* Rodapé do Drawer */
.mobile-drawer-footer {
    border-top: 1px solid var(--card-border);
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
html.light-mode .mobile-drawer-footer {
    border-top: 1px solid #e2e8f0;
}
.mobile-accessibility-container {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
html.light-mode .mobile-accessibility-container {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid #e2e8f0;
}
.mobile-accessibility-container .btn-ctrl-accessibility {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}
.btn-logout-drawer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition);
    text-decoration: none;
    text-align: center;
}
.btn-logout-drawer:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fff;
}

/* Ativação do Menu Responsivo & Header Mobile */
@media (max-width: 1024px) {
    .top-header {
        padding: 0 16px;
    }
    .top-nav {
        display: none !important;
    }
    .top-header-right {
        display: none !important;
    }
    .btn-mobile-menu {
        display: flex;
    }
}

/* ==========================================================================
   OTIMIZAÇÃO MOBILE COMPLETA (JusProtectMed Mobile-First Enhancements)
   ========================================================================== */

/* Ajustes Universais para Mobile (<= 768px) */
@media (max-width: 768px) {
    /* Previne zoom automático e indesejado no iOS Safari */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    input[type="date"],
    input[type="search"],
    select,
    textarea,
    .form-control,
    .search-input {
        font-size: 16px !important;
    }

    /* Container e Espaçamentos do Layout */
    .app-container,
    .main-content,
    .dashboard-container {
        padding: 16px 12px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .page-title h1 {
        font-size: 1.45rem !important;
        line-height: 1.25;
    }

    /* Cards e Containers */
    .card,
    .metric-card,
    .import-summary-card {
        padding: 16px !important;
        border-radius: 12px;
    }

    .auth-card {
        padding: 24px 18px !important;
        border-radius: 16px;
    }

    .upload-area {
        padding: 30px 16px !important;
    }

    .upload-icon {
        font-size: 2.2rem !important;
        margin-bottom: 12px;
    }

    /* Modais em Dispositivos Móveis (Comportamento Fluido / Fullscreen) */
    .modal {
        padding: 0 !important;
        align-items: flex-end;
    }

    .modal-content {
        max-width: 100% !important;
        width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        padding: 20px 16px calc(24px + env(safe-area-inset-bottom, 16px)) 16px !important;
        border-left: none !important;
        border-top: 1px solid var(--card-border);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-close {
        top: calc(14px + env(safe-area-inset-top, 0px)) !important;
        left: auto !important;
        right: 16px !important;
        width: 44px !important;
        height: 44px !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        font-size: 1.6rem;
        background: rgba(255, 255, 255, 0.08) !important;
        border-radius: 50% !important;
        z-index: 10;
    }

    html.light-mode .modal-close {
        background: rgba(0, 0, 0, 0.06) !important;
    }

    .dialog-modal {
        width: calc(100% - 24px) !important;
        max-width: 100% !important;
        padding: 20px 16px !important;
        border-radius: 16px !important;
    }

    /* Grids e Flexíveis */
    .client-detail-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(100%, 1fr)) !important;
        gap: 12px;
    }

    .section-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px;
    }

    .filters-wrapper {
        flex-direction: column !important;
        width: 100% !important;
    }

    .filter-select,
    .search-input {
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Touch Targets Confortáveis (Mínimo 44px) */
    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-action,
    .page-btn,
    .tab-btn,
    .btn-close-drawer,
    .btn-ctrl-accessibility {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .page-btn {
        padding: 10px 14px !important;
        min-width: 44px;
    }

    /* Gaveta de Navegação Adaptativa */
    .mobile-menu-drawer {
        width: min(320px, calc(100vw - 45px)) !important;
        padding-top: max(20px, env(safe-area-inset-top, 20px)) !important;
        padding-bottom: max(20px, env(safe-area-inset-bottom, 20px)) !important;
    }

    .btn-close-drawer {
        width: 44px;
        height: 44px;
    }

    /* Scroll Horizontal Seguro para Tabelas */
    .table-responsive {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        margin-bottom: 15px;
        border-radius: 10px;
    }
}

/* Telas Ultra Estreitas (<= 480px) */
@media (max-width: 480px) {
    .dashboard-tabs-header {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .dashboard-tabs-group,
    .dashboard-actions-group {
        width: 100% !important;
        justify-content: stretch;
    }

    .tab-btn {
        flex: 1;
        text-align: center;
        padding: 10px 8px !important;
        font-size: 0.8rem !important;
    }

    .btn-group-mobile-stack {
        flex-direction: column !important;
        width: 100% !important;
    }

    .btn-group-mobile-stack > * {
        width: 100% !important;
    }
}

/* Suporte a Safe-Area em dispositivos com Notch / Dynamic Island */
@supports (padding: max(0px)) {
    .top-header {
        padding-top: env(safe-area-inset-top, 0px);
    }
    .mobile-drawer-footer {
        padding-bottom: max(15px, env(safe-area-inset-bottom, 0px));
    }
}

/* ==================================================================================
   🚀 MODAL POP-UP DE NOVIDADES & CHANGELOG (WHAT'S NEW)
   ================================================================================== */

.modal-whatsnew-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 8, 19, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-whatsnew-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-whatsnew-dialog {
    background: #0c1326;
    background-image: 
        radial-gradient(at 0% 0%, rgba(21, 46, 115, 0.45) 0px, transparent 60%),
        radial-gradient(at 100% 100%, rgba(0, 134, 196, 0.18) 0px, transparent 60%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 22px;
    width: 100%;
    max-width: 660px;
    max-height: 88vh;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 35px rgba(0, 134, 196, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.92) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-whatsnew-overlay.show .modal-whatsnew-dialog {
    transform: scale(1) translateY(0);
}

/* Cabeçalho */
.modal-whatsnew-header {
    padding: 24px 26px 16px 26px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.whatsnew-header-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.whatsnew-badge-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #ffffff;
    box-shadow: 0 8px 20px -4px rgba(0, 134, 196, 0.5);
    flex-shrink: 0;
    animation: whatsnewPulse 2.5s infinite ease-in-out;
}

@keyframes whatsnewPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.whatsnew-version-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.whatsnew-tag-app {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.whatsnew-version-pill {
    background: rgba(0, 134, 196, 0.2);
    border: 1px solid rgba(0, 134, 196, 0.4);
    color: var(--accent-light);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.whatsnew-date-pill {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.modal-whatsnew-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
    margin: 0;
}

.btn-close-whatsnew {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-size: 1.4rem;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-close-whatsnew:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

/* Sub-cabeçalho */
.modal-whatsnew-subheader {
    padding: 10px 26px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.83rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-whatsnew-subheader i {
    font-size: 1.05rem;
    color: var(--accent-light);
}

/* Abas de Versões */
.modal-whatsnew-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 26px 6px 26px;
    background: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    overflow-x: auto;
    scrollbar-width: thin;
}

.whatsnew-tab-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.whatsnew-tab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-light);
}

.whatsnew-tab-btn.active {
    background: var(--primary);
    border-color: var(--accent);
    color: #ffffff;
    box-shadow: 0 4px 12px -2px rgba(0, 134, 196, 0.3);
}

.tab-badge-atual {
    background: var(--accent);
    color: #ffffff;
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Corpo e Itens de Novidades */
.modal-whatsnew-body {
    padding: 20px 26px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(88vh - 240px);
}

.whatsnew-version-pane {
    display: none;
}

.whatsnew-version-pane.active {
    display: block;
    animation: fadeInPane 0.25s ease-out;
}

@keyframes fadeInPane {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.whatsnew-items-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.whatsnew-item-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    transition: var(--transition);
}

.whatsnew-item-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.whatsnew-item-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.whatsnew-item-icon.color-accent {
    background: rgba(0, 134, 196, 0.18);
    color: var(--accent-light);
    border: 1px solid rgba(0, 134, 196, 0.3);
}

.whatsnew-item-icon.color-primary {
    background: rgba(31, 63, 150, 0.25);
    color: #93c5fd;
    border: 1px solid rgba(31, 63, 150, 0.4);
}

.whatsnew-item-icon.color-success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.whatsnew-item-icon.color-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.whatsnew-item-icon.color-info {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.whatsnew-item-content {
    flex: 1;
}

.whatsnew-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.whatsnew-item-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.whatsnew-item-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.whatsnew-item-badge.tag-novo {
    background: rgba(0, 134, 196, 0.2);
    color: var(--accent-light);
    border: 1px solid rgba(0, 134, 196, 0.35);
}

.whatsnew-item-badge.tag-melhoria {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.whatsnew-item-badge.tag-correcao {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.whatsnew-item-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.45;
    margin: 0;
}

/* Rodapé do Modal */
.modal-whatsnew-footer {
    padding: 16px 26px;
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.whatsnew-footer-tip {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.whatsnew-footer-tip i {
    color: var(--warning);
}

.btn-whatsnew-confirm {
    padding: 10px 22px !important;
    font-size: 0.88rem !important;
    font-weight: 600 !important;
    border-radius: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 4px 15px -3px rgba(0, 134, 196, 0.4) !important;
    cursor: pointer !important;
    transition: var(--transition) !important;
}

.btn-whatsnew-confirm:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px -4px rgba(0, 134, 196, 0.6) !important;
}

/* Botão de Atalho no Header (Badge de Novidades) */
.btn-whatsnew-nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 134, 196, 0.12);
    border: 1px solid rgba(0, 134, 196, 0.28);
    color: var(--accent-light);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 5px 11px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-whatsnew-nav:hover {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 134, 196, 0.3);
}

.btn-whatsnew-nav i {
    font-size: 0.95rem;
}

/* ==================================================================================
   ☀️ LIGHT MODE OVERRIDES PARA O MODAL DE NOVIDADES
   ================================================================================== */
html.light-mode .modal-whatsnew-dialog {
    background: #ffffff;
    background-image: 
        radial-gradient(at 0% 0%, rgba(224, 242, 254, 0.6) 0px, transparent 60%),
        radial-gradient(at 100% 100%, rgba(241, 245, 249, 0.8) 0px, transparent 60%);
    border: 1px solid #e2e8f0;
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.2), 0 0 35px rgba(0, 134, 196, 0.08);
}

html.light-mode .modal-whatsnew-header {
    border-bottom: 1px solid #e2e8f0;
}

html.light-mode .modal-whatsnew-title {
    color: #0f172a;
}

html.light-mode .whatsnew-tag-app {
    color: #64748b;
}

html.light-mode .whatsnew-version-pill {
    background: #e0f2fe;
    border-color: #bae6fd;
    color: #0284c7;
}

html.light-mode .btn-close-whatsnew {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #64748b;
}

html.light-mode .btn-close-whatsnew:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #ef4444;
}

html.light-mode .modal-whatsnew-subheader {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    color: #475569;
}

html.light-mode .modal-whatsnew-tabs {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

html.light-mode .whatsnew-tab-btn {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #475569;
}

html.light-mode .whatsnew-tab-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

html.light-mode .whatsnew-tab-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

html.light-mode .whatsnew-item-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

html.light-mode .whatsnew-item-card:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

html.light-mode .whatsnew-item-title {
    color: #0f172a;
}

html.light-mode .whatsnew-item-desc {
    color: #475569;
}

html.light-mode .modal-whatsnew-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

html.light-mode .whatsnew-footer-tip {
    color: #64748b;
}

html.light-mode .btn-whatsnew-nav {
    background: #e0f2fe;
    border-color: #bae6fd;
    color: #0369a1;
}

html.light-mode .btn-whatsnew-nav:hover {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

/* Responsividade do Modal no Mobile */
@media (max-width: 640px) {
    .modal-whatsnew-dialog {
        max-height: 94vh;
        border-radius: 18px;
    }

    .modal-whatsnew-header {
        padding: 18px 18px 14px 18px;
    }

    .whatsnew-badge-icon {
        width: 44px;
        height: 44px;
        font-size: 1.5rem;
    }

    .modal-whatsnew-title {
        font-size: 1.1rem;
    }

    .modal-whatsnew-subheader {
        padding: 8px 18px;
        font-size: 0.78rem;
    }

    .modal-whatsnew-tabs {
        padding: 10px 18px 6px 18px;
    }

    .modal-whatsnew-body {
        padding: 14px 18px;
        max-height: calc(94vh - 230px);
    }

    .whatsnew-item-card {
        padding: 12px;
        gap: 10px;
    }

    .whatsnew-item-icon {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }

    .whatsnew-item-title {
        font-size: 0.85rem;
    }

    .whatsnew-item-desc {
        font-size: 0.78rem;
    }

    .modal-whatsnew-footer {
        padding: 12px 18px;
        flex-direction: column;
        align-items: stretch;
    }

    .whatsnew-footer-actions {
        width: 100%;
    }

    .btn-whatsnew-confirm {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* Modais Flutuantes Centralizados Globais (JusProtectMed) */
.modal-overlay-center {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.78) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    z-index: 10050 !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}

.modal-dialog-center {
    width: 100% !important;
    max-width: 780px !important;
    max-height: 90vh !important;
    height: auto !important;
    background: #0d1527 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 14px !important;
    padding: 28px 32px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75) !important;
    position: relative !important;
    margin: auto !important;
    animation: popCenterModal 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes popCenterModal {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-dialog-center .modal-close {
    position: absolute !important;
    top: 18px !important;
    right: 18px !important;
    left: auto !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: none !important;
    color: var(--text-muted) !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.35rem !important;
    line-height: 1 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
}

.modal-dialog-center .modal-close:hover {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
}

html.light-mode .modal-dialog-center {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2) !important;
}

#btn_gerar_certificado,
#btn_gerar_certificado:hover,
#btn_gerar_certificado:focus,
#btn_gerar_certificado:active,
#btn_gerar_certificado:visited {
    text-decoration: none !important;
    outline: none !important;
    width: auto !important;
    max-width: 100% !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

#detalhesModal .client-detail-header {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.modal-dialog-center select,
.modal-dialog-center input,
.modal-dialog-center textarea {
    color: #f8fafc;
    background: #111a2e;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color-scheme: dark;
}

.modal-dialog-center select option {
    background: #0d1527 !important;
    color: #f8fafc !important;
    color-scheme: dark;
}

html.light-mode .modal-dialog-center select,
html.light-mode .modal-dialog-center input,
html.light-mode .modal-dialog-center textarea {
    color: #0f172a !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color-scheme: light !important;
}

html.light-mode .modal-dialog-center select option {
    background: #ffffff !important;
    color: #0f172a !important;
    color-scheme: light !important;
}

/* Regras Universais de Compatibilidade de Tema para Dropdowns Select & Options */
select {
    color-scheme: dark;
}

select option,
.search-input option,
.filter-select option,
.form-control option {
    color-scheme: dark;
    background-color: #0d1527 !important;
    color: #f8fafc !important;
}

html.light-mode select,
html.light-mode select option,
html.light-mode .search-input option,
html.light-mode .filter-select option,
html.light-mode .form-control option {
    color-scheme: light !important;
    background: #ffffff !important;
    color: #0f172a !important;
}

/* ==========================================================================
   🛡️ JUSPROTECTMED - DESIGN SYSTEM OFICIAL DE HARMONIZAÇÃO DE UI 🛡️
   ==========================================================================
   Padronização de Cantos Arredondados, Espaçamentos, Alturas, Controles,
   Abas, Tabelas, Badges, Modais e Ícones (Dark Mode & Light Mode).
   ========================================================================== */

/* 1. CARDS DE KPI & MÉTRICAS */
.metric-card,
.kpi-card {
    border-radius: var(--radius-lg) !important;
    padding: 20px 24px !important;
}

.metric-icon {
    width: 52px !important;
    height: 52px !important;
    border-radius: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* 2. BOTÕES DE AÇÃO SUPERIOR DO CABEÇALHO (HEADER ACTIONS) */
.header-actions-wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
}

.header-actions-wrapper .btn,
.page-header .btn,
.btn-sync-asaas-global {
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 18px !important;
    border-radius: var(--radius-md) !important;
    font-size: 0.88rem !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.header-actions-wrapper .btn:hover,
.page-header .btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

/* 3. BARRA DE CONTROLES: BUSCA, FILTROS E COLUNAS (GRID 40PX) */
.modern-control-bar {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    margin-bottom: 16px !important;
}

.search-omnibox {
    position: relative !important;
    flex: 1 !important;
    min-width: 260px !important;
}

.search-omnibox input {
    height: 40px !important;
    border-radius: var(--radius-md) !important;
    padding-left: 42px !important;
    padding-right: 48px !important;
    font-size: 0.88rem !important;
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    transition: all 0.2s ease !important;
}

.search-omnibox input:focus {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2) !important;
}

.btn-popover-ctrl,
.btn-filter-trigger,
.btn-columns-trigger {
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 16px !important;
    border-radius: var(--radius-md) !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: var(--text-light) !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.btn-popover-ctrl:hover,
.btn-filter-trigger:hover,
.btn-columns-trigger:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
}

/* 4. ABAS DE SEGMENTAÇÃO (TABS) E CONTROLES DE LAYOUT */
.seg-tabs-group {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
}

.seg-tab {
    height: 34px !important;
    padding: 0 13px !important;
    border-radius: var(--radius-md) !important;
    font-size: 0.82rem !important;
    font-weight: 500 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    transition: all 0.2s ease !important;
}

.seg-count {
    padding: 1px 7px !important;
    border-radius: var(--radius-pill) !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
}

.dot-status {
    width: 7px !important;
    height: 7px !important;
    border-radius: var(--radius-pill) !important;
    display: inline-block !important;
    flex-shrink: 0 !important;
}

.btn-layout {
    height: 34px !important;
    padding: 0 12px !important;
    border-radius: var(--radius-md) !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: all 0.2s ease !important;
}

/* 5. TABELA: LINHAS, CÉLULAS E ESPAÇAMENTO */
.table-premium th {
    padding: 14px 18px !important;
    font-size: 0.76rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
}

.table-premium td {
    padding: 14px 18px !important;
    vertical-align: middle !important;
}

/* 6. BADGES DA TABELA: UF, PERFIL, PLATAFORMA E STATUS */
.uf-badge-btn,
.uf-tag {
    height: 24px !important;
    min-height: 24px !important;
    padding: 0 8px !important;
    border-radius: var(--radius-sm) !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
}

.badge-pf,
.badge-pj {
    height: 24px !important;
    min-height: 24px !important;
    padding: 0 8px !important;
    border-radius: var(--radius-sm) !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
}

.badge-plataforma-corretor {
    height: 24px !important;
    min-height: 24px !important;
    line-height: 22px !important;
    padding: 0 8px !important;
    border-radius: var(--radius-sm) !important;
    font-size: 0.74rem !important;
    font-weight: 600 !important;
    display: inline-block !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
}

.status-badge {
    border-radius: var(--radius-pill) !important;
    padding: 4px 12px !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
}

/* 7. BOTÕES DE AÇÃO NA LINHA DA TABELA (WHATSAPP E DETALHES) */
.btn-action-round {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    border-radius: var(--radius-sm) !important;
    font-size: 1rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-action-round:hover {
    transform: scale(1.05) !important;
}

/* 8. POPOVERS, MENUS DROPDOWN E MODAIS */
.modern-popover {
    border-radius: var(--radius-lg) !important;
    padding: 8px !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5) !important;
}

.popover-item {
    border-radius: var(--radius-sm) !important;
    padding: 8px 12px !important;
}

.submenu-opt {
    border-radius: var(--radius-sm) !important;
    padding: 6px 10px !important;
}

.dropdown-menu-export {
    border-radius: var(--radius-md) !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4) !important;
}

.modal-dialog-center {
    border-radius: var(--radius-xl) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* 9. HARMONIZAÇÃO PARA O LIGHT MODE */
html.light-mode .search-omnibox input {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

html.light-mode .btn-popover-ctrl,
html.light-mode .btn-filter-trigger,
html.light-mode .btn-columns-trigger {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

html.light-mode .btn-popover-ctrl:hover,
html.light-mode .btn-filter-trigger:hover,
html.light-mode .btn-columns-trigger:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
}

html.light-mode .seg-tab {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}

html.light-mode .seg-tab:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

html.light-mode .seg-tab.active {
    background: rgba(2, 132, 199, 0.12) !important;
    border-color: rgba(2, 132, 199, 0.4) !important;
    color: #0284c7 !important;
}

html.light-mode .seg-count {
    background: #e2e8f0 !important;
    color: #475569 !important;
}

html.light-mode .seg-tab.active .seg-count {
    background: rgba(2, 132, 199, 0.2) !important;
    color: #0284c7 !important;
}

html.light-mode .modern-popover {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12) !important;
}

html.light-mode .popover-item {
    color: #334155 !important;
}

html.light-mode .popover-item:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

html.light-mode .dropdown-menu-export {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12) !important;
}

html.light-mode .dropdown-menu-export a {
    color: #0f172a !important;
}

html.light-mode .dropdown-menu-export a:hover {
    background: #f8fafc !important;
}






/* ==========================================================================
   PADRONIZAÃ‡ÃƒO UNIVERSAL DE MODO CLARO (LIGHT-MODE) - JP Med
   ========================================================================== */
html.light-mode .card-kpi-rbac {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04) !important;
}
html.light-mode .kpi-rbac-label {
    color: #64748b !important;
}
html.light-mode .kpi-rbac-value.val-total {
    color: #0f172a !important;
}
html.light-mode .card-policy-rbac {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04) !important;
}
html.light-mode .card-policy-rbac .policy-title {
    color: #0f172a !important;
}
html.light-mode .card-policy-rbac .policy-desc {
    color: #64748b !important;
}
html.light-mode .card-table-rbac {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05) !important;
}
html.light-mode .table-header-bar-rbac {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}
html.light-mode .repasses-pagination-bar {
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
}
html.light-mode .repasses-pagination-info {
    color: #64748b !important;
}
html.light-mode .tab-container {
    background: rgba(0, 0, 0, 0.03) !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

/* ==========================================================================
   LINKS CRUZADOS & GAVETA DINÂMICA DE PERFIL (v1.49.0)
   ========================================================================== */
.jpm-cross-link {
    color: var(--accent-light, #38bdf8);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s ease, opacity 0.15s ease;
    line-height: 1.3;
    max-width: 100%;
}
.jpm-cross-link:hover {
    color: #ffffff;
    text-decoration: underline;
}
.jpm-cross-link .jpm-cross-icon {
    font-size: 0.8em;
    opacity: 0.55;
    flex-shrink: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.jpm-cross-link:hover .jpm-cross-icon {
    opacity: 1;
    transform: translate(1px, -1px);
}
.jpm-cross-link-muted {
    color: #cbd5e1;
    font-weight: 500;
}
.jpm-cross-link-muted:hover {
    color: var(--accent-light, #38bdf8);
}

html.light-mode .jpm-cross-link,
html.light-mode .table-premium td a.jpm-cross-link,
html.light-mode .modal-content .table-premium td a.jpm-cross-link {
    color: #0284c7 !important;
    font-weight: 600;
}
html.light-mode .jpm-cross-link:hover,
html.light-mode .table-premium td a.jpm-cross-link:hover,
html.light-mode .modal-content .table-premium td a.jpm-cross-link:hover {
    color: #0369a1 !important;
    text-decoration: underline !important;
}
html.light-mode .jpm-cross-link-muted,
html.light-mode .table-premium td a.jpm-cross-link-muted,
html.light-mode .modal-content .table-premium td a.jpm-cross-link-muted {
    color: #334155 !important;
    font-weight: 500;
}
html.light-mode .jpm-cross-link-muted:hover,
html.light-mode .table-premium td a.jpm-cross-link-muted:hover,
html.light-mode .modal-content .table-premium td a.jpm-cross-link-muted:hover {
    color: #0284c7 !important;
    text-decoration: underline !important;
}

.jpm-cross-rateio-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.jpm-cross-rateio-item {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 0.84rem;
}
.jpm-cross-rateio-pct {
    font-size: 0.7rem;
    font-weight: 600;
    color: #c084fc;
    background: rgba(168, 85, 247, 0.14);
    border: 1px solid rgba(168, 85, 247, 0.28);
    padding: 0 5px;
    border-radius: 4px;
}
html.light-mode .jpm-cross-rateio-pct {
    color: #7e22ce;
    background: #f3e8ff;
    border-color: #d8b4fe;
}
