/* ============================================
   DARK PREMIUM THEME - Tema Escuro Premium
   ============================================
   Estilos premium escuros alinhados à página de login
   com fundo de galáxia e visual tecnológico
   ============================================ */

/* ============================================
   1. VARIÁVEIS E TOKENS DE DESIGN ESCURO
   ============================================ */
:root {
    /* Cores Premium Escuras */
    --dark-primary: var(--mud-palette-primary);
    --dark-primary-dark: var(--mud-palette-primary-darken);
    --dark-primary-light: var(--mud-palette-primary-lighten);
    --dark-secondary: var(--mud-palette-primary);
    --dark-success: var(--mud-palette-success);
    --dark-warning: var(--mud-palette-warning);
    --dark-error: var(--mud-palette-error);
    --dark-info: var(--mud-palette-info);
    
    /* Tons Escuros Premium (Galáxia) */
    --dark-bg-base: var(--mud-palette-background);
    --dark-bg-surface: var(--mud-palette-surface);
    --dark-bg-card: var(--mud-palette-surface);
    --dark-bg-hover: rgba(255, 255, 255, 0.08);
    --dark-bg-active: rgba(var(--mud-palette-primary-rgb), 0.25);
    
    /* Textos Escuros */
    --dark-text-primary: rgba(255, 255, 255, 0.9);
    --dark-text-secondary: rgba(255, 255, 255, 0.7);
    --dark-text-disabled: rgba(255, 255, 255, 0.4);
    
    /* Bordas e Divisores Escuros */
    --dark-border: var(--mud-palette-lines-default);
    --dark-divider: var(--mud-palette-divider);
    
    /* Sombras Escuras Premium */
    --dark-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --dark-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --dark-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --dark-shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.6);
    --dark-shadow-glow: none;
}

/* ============================================
   2. CARDS PREMIUM (Glassmorphism) - Modo Escuro e Claro
   ============================================ */
.dark-premium-card {
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modo Escuro */
.mud-theme-dark .dark-premium-card,
.main-content-dark .dark-premium-card {
    background: var(--mud-palette-surface) !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--dark-shadow-md), 0 0 30px rgba(var(--mud-palette-primary-rgb), 0.1);
    color: var(--dark-text-primary);
}

.mud-theme-dark .dark-premium-card:hover,
.main-content-dark .dark-premium-card:hover {
    background: var(--mud-palette-surface) !important;
    box-shadow: var(--dark-shadow-lg), 0 0 40px rgba(var(--mud-palette-primary-rgb), 0.15);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Modo Claro */
.mud-theme-light .dark-premium-card,
.main-content-light .dark-premium-card {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 0 20px rgba(var(--mud-palette-primary-rgb), 0.05);
    color: rgba(0, 0, 0, 0.87);
}

.mud-theme-light .dark-premium-card:hover,
.main-content-light .dark-premium-card:hover {
    background: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 30px rgba(var(--mud-palette-primary-rgb), 0.1);
    transform: translateY(-2px);
    border-color: rgba(var(--mud-palette-primary-rgb), 0.3);
}

/* Modo Escuro */

/* Modo Claro */

/* ============================================
   3. FORMULÁRIOS ESCUROS PREMIUM
   ============================================ */

/* Inputs escuros premium */
.dark-premium-input .mud-input-control {
    color: var(--dark-text-primary) !important;
}

.dark-premium-input .mud-input-label {
    color: var(--dark-text-secondary) !important;
}

.dark-premium-input .mud-input-outlined {
    border-color: var(--dark-border) !important;
}

.dark-premium-input .mud-input-outlined:hover {
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.dark-premium-input .mud-input-outlined.mud-input-outlined-focused {
    border-color: var(--dark-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--mud-palette-primary-rgb), 0.2);
}

/* ============================================
   4. BOTÕES ESCUROS PREMIUM
   ============================================ */
.dark-premium-button {
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.025em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: none;
    box-shadow: var(--dark-shadow-sm);
    padding: 0.75rem 1.5rem;
}

.dark-premium-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--dark-shadow-md);
}

.dark-premium-button:active {
    transform: translateY(0);
    box-shadow: var(--dark-shadow-sm);
}

.dark-premium-button-primary {
    background: var(--mud-palette-primary) !important;
    color: white !important;
}

.mud-theme-dark .dark-premium-button-primary,
.main-content-dark .dark-premium-button-primary {
    box-shadow: var(--dark-shadow-md), var(--dark-shadow-glow);
}

.mud-theme-dark .dark-premium-button-primary:hover,
.main-content-dark .dark-premium-button-primary:hover {
    background: var(--mud-palette-primary-darken) !important;
    box-shadow: var(--dark-shadow-lg), 0 0 30px rgba(var(--mud-palette-primary-rgb), 0.4);
}

.mud-theme-light .dark-premium-button-primary,
.main-content-light .dark-premium-button-primary {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 0 20px rgba(var(--mud-palette-primary-rgb), 0.2);
}

.mud-theme-light .dark-premium-button-primary:hover,
.main-content-light .dark-premium-button-primary:hover {
    background: var(--mud-palette-primary-darken) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), 0 0 30px rgba(var(--mud-palette-primary-rgb), 0.3);
}

/* Modo Escuro */
.mud-theme-dark .dark-premium-button-secondary,
.main-content-dark .dark-premium-button-secondary {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--dark-text-primary) !important;
    border: 1px solid var(--dark-border);
}

.mud-theme-dark .dark-premium-button-secondary:hover,
.main-content-dark .dark-premium-button-secondary:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Modo Claro */
.mud-theme-light .dark-premium-button-secondary,
.main-content-light .dark-premium-button-secondary {
    background: rgba(var(--mud-palette-primary-rgb), 0.08) !important;
    color: rgba(0, 0, 0, 0.87) !important;
    border: 1px solid rgba(0, 0, 0, 0.23);
}

.mud-theme-light .dark-premium-button-secondary:hover,
.main-content-light .dark-premium-button-secondary:hover {
    background: rgba(var(--mud-palette-primary-rgb), 0.12) !important;
    border-color: rgba(var(--mud-palette-primary-rgb), 0.4);
}

/* ============================================
   5. TABELAS PREMIUM - Modo Escuro e Claro
   ============================================ */
.dark-premium-table {
    border-radius: 12px;
    overflow: hidden;
}

/* Modo Escuro */
.mud-theme-dark .dark-premium-table,
.main-content-dark .dark-premium-table {
    background: var(--mud-palette-surface) !important;
    box-shadow: var(--dark-shadow-sm);
    border: 1px solid var(--dark-border);
}

/* Modo Claro */
.mud-theme-light .dark-premium-table,
.main-content-light .dark-premium-table {
    background: #ffffff !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.12);
}

/* Estilos específicos para tabelas MudBlazor */
.dark-premium-table .mud-table-container {
    background: transparent !important;
    border-radius: 12px;
    overflow: hidden;
}

/* Modo Escuro */
.mud-theme-dark .dark-premium-table .mud-table-head,
.main-content-dark .dark-premium-table .mud-table-head {
    background: rgba(var(--mud-palette-primary-rgb), 0.3) !important;
    color: var(--dark-text-primary) !important;
}

.mud-theme-dark .dark-premium-table .mud-table-head th,
.main-content-dark .dark-premium-table .mud-table-head th {
    color: var(--dark-text-primary) !important;
    font-weight: 600;
    border-bottom: 2px solid rgba(var(--mud-palette-primary-rgb), 0.3);
}

.mud-theme-dark .dark-premium-table .mud-table-body tr,
.main-content-dark .dark-premium-table .mud-table-body tr {
    background: var(--mud-palette-surface) !important;
    transition: all 0.2s ease;
    color: var(--dark-text-primary);
}

.mud-theme-dark .dark-premium-table .mud-table-body tr:hover,
.main-content-dark .dark-premium-table .mud-table-body tr:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

.mud-theme-dark .dark-premium-table .mud-table-body tr:nth-child(even),
.main-content-dark .dark-premium-table .mud-table-body tr:nth-child(even) {
    background: var(--mud-palette-surface) !important;
}

.mud-theme-dark .dark-premium-table .mud-table-body td,
.main-content-dark .dark-premium-table .mud-table-body td {
    color: var(--dark-text-primary) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mud-theme-dark .dark-premium-table .mud-table-toolbar,
.main-content-dark .dark-premium-table .mud-table-toolbar {
    background: transparent !important;
    color: var(--dark-text-primary) !important;
}

.mud-theme-dark .dark-premium-table .mud-table-pager,
.main-content-dark .dark-premium-table .mud-table-pager {
    background: transparent !important;
    color: var(--dark-text-primary) !important;
}

/* Modo Claro - Preservar estilo escuro dos cabeçalhos de tabela */
.mud-theme-light .dark-premium-table .mud-table-head,
.main-content-light .dark-premium-table .mud-table-head {
    background: var(--fv-header-bg) !important;
    color: rgba(255, 255, 255, 0.95) !important;
}

.mud-theme-light .dark-premium-table .mud-table-head th,
.main-content-light .dark-premium-table .mud-table-head th {
    color: rgba(255, 255, 255, 0.95) !important;
    font-weight: 600;
    border-bottom: 2px solid rgba(var(--mud-palette-primary-rgb), 0.5);
}

.mud-theme-light .dark-premium-table .mud-table-body tr,
.main-content-light .dark-premium-table .mud-table-body tr {
    background: #ffffff !important;
    transition: all 0.2s ease;
    color: rgba(0, 0, 0, 0.87);
}

.mud-theme-light .dark-premium-table .mud-table-body tr:hover,
.main-content-light .dark-premium-table .mud-table-body tr:hover {
    background: rgba(var(--mud-palette-primary-rgb), 0.05) !important;
}

.mud-theme-light .dark-premium-table .mud-table-body tr:nth-child(even),
.main-content-light .dark-premium-table .mud-table-body tr:nth-child(even) {
    background: rgba(249, 250, 251, 1) !important;
}

.mud-theme-light .dark-premium-table .mud-table-body td,
.main-content-light .dark-premium-table .mud-table-body td {
    color: rgba(0, 0, 0, 0.87) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.mud-theme-light .dark-premium-table .mud-table-toolbar,
.main-content-light .dark-premium-table .mud-table-toolbar {
    background: transparent !important;
    color: rgba(0, 0, 0, 0.87) !important;
}

.mud-theme-light .dark-premium-table .mud-table-pager,
.main-content-light .dark-premium-table .mud-table-pager {
    background: transparent !important;
    color: rgba(0, 0, 0, 0.87) !important;
}

/* ============================================
   6. HEADERS E TÍTULOS PREMIUM - Modo Escuro e Claro
   ============================================ */
.dark-premium-header {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Modo Escuro */
.mud-theme-dark .dark-premium-header,
.main-content-dark .dark-premium-header {
    background: rgba(var(--mud-palette-primary-rgb), 0.25);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    color: var(--dark-text-primary);
    box-shadow: var(--dark-shadow-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Modo Claro - Preservar estilo escuro dos cabeçalhos */
.mud-theme-light .dark-premium-header,
.main-content-light .dark-premium-header {
    background: var(--fv-header-bg) !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    color: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Modo Claro - Preservar estilo escuro dos títulos de página */

/* Modo Claro - Preservar estilo escuro dos títulos de seção */

/* ============================================
   7. PAPERS E CONTAINERS PREMIUM - Modo Escuro e Claro
   ============================================ */
/* Modo Escuro */
.mud-theme-dark .mud-paper.dark-premium-paper,
.main-content-dark .mud-paper.dark-premium-paper {
    background: var(--mud-palette-surface) !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--dark-shadow-md);
    color: var(--dark-text-primary);
}

.mud-theme-dark .mud-paper.dark-premium-paper .mud-text,
.main-content-dark .mud-paper.dark-premium-paper .mud-text {
    color: var(--dark-text-primary) !important;
}

/* Modo Claro */
.mud-theme-light .mud-paper.dark-premium-paper,
.main-content-light .mud-paper.dark-premium-paper {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.87);
}

.mud-theme-light .mud-paper.dark-premium-paper .mud-text,
.main-content-light .mud-paper.dark-premium-paper .mud-text {
    color: rgba(0, 0, 0, 0.87) !important;
}

/* ============================================
   8. TEXTFIELDS PREMIUM - Modo Escuro e Claro
   ============================================ */
/* Modo Escuro */
.mud-theme-dark .mud-input-outlined.dark-premium-input-field,
.main-content-dark .mud-input-outlined.dark-premium-input-field {
    background: var(--mud-palette-surface) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.mud-theme-dark .mud-input-outlined.dark-premium-input-field:hover,
.main-content-dark .mud-input-outlined.dark-premium-input-field:hover {
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.mud-theme-dark .mud-input-outlined.dark-premium-input-field.mud-input-outlined-focused,
.main-content-dark .mud-input-outlined.dark-premium-input-field.mud-input-outlined-focused {
    border-color: var(--dark-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--mud-palette-primary-rgb), 0.2);
}

/* Modo Claro */
.mud-theme-light .mud-input-outlined.dark-premium-input-field,
.main-content-light .mud-input-outlined.dark-premium-input-field {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.23) !important;
}

.mud-theme-light .mud-input-outlined.dark-premium-input-field:hover,
.main-content-light .mud-input-outlined.dark-premium-input-field:hover {
    border-color: rgba(0, 0, 0, 0.4) !important;
}

.mud-theme-light .mud-input-outlined.dark-premium-input-field.mud-input-outlined-focused,
.main-content-light .mud-input-outlined.dark-premium-input-field.mud-input-outlined-focused {
    border-color: var(--mud-palette-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--mud-palette-primary-rgb), 0.15);
}

/* Garantir que o texto dentro dos inputs seja legível */
.mud-theme-light .mud-input-outlined.dark-premium-input-field .mud-input,
.main-content-light .mud-input-outlined.dark-premium-input-field .mud-input {
    color: rgba(0, 0, 0, 0.87) !important;
}

.mud-theme-light .mud-input-outlined.dark-premium-input-field input,
.main-content-light .mud-input-outlined.dark-premium-input-field input {
    color: rgba(0, 0, 0, 0.87) !important;
}

.mud-theme-light .mud-input-outlined.dark-premium-input-field textarea,
.main-content-light .mud-input-outlined.dark-premium-input-field textarea {
    color: rgba(0, 0, 0, 0.87) !important;
}

/* ============================================
   9. RESPONSIVIDADE
   ============================================ */
@media (max-width: 768px) {
    .dark-premium-card{
        padding: 1rem;
        border-radius: 12px;
    }

}

/* ============================================
   10. UTILITÁRIOS ESCUROS PREMIUM
   ============================================ */

/* ============================================
   11. SCROLLBAR PREMIUM - Modo Escuro e Claro
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

/* Modo Escuro */
.mud-theme-dark ::-webkit-scrollbar-track,
.main-content-dark ::-webkit-scrollbar-track {
    background: rgba(10, 10, 10, 0.5);
    border-radius: 8px;
}

.mud-theme-dark ::-webkit-scrollbar-thumb,
.main-content-dark ::-webkit-scrollbar-thumb {
    background: rgba(var(--mud-palette-primary-rgb), 0.5);
    border-radius: 8px;
    transition: background 0.3s ease;
}

.mud-theme-dark ::-webkit-scrollbar-thumb:hover,
.main-content-dark ::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--mud-palette-primary-rgb), 0.7);
}

/* Modo Claro */
.mud-theme-light ::-webkit-scrollbar-track,
.main-content-light ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}

.mud-theme-light ::-webkit-scrollbar-thumb,
.main-content-light ::-webkit-scrollbar-thumb {
    background: rgba(var(--mud-palette-primary-rgb), 0.4);
    border-radius: 8px;
    transition: background 0.3s ease;
}

.mud-theme-light ::-webkit-scrollbar-thumb:hover,
.main-content-light ::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--mud-palette-primary-rgb), 0.6);
}

/* ============================================
   12. FOCUS STATES ESCUROS PREMIUM
   ============================================ */

/* ============================================
   13. CARDS DE MARGEM PREMIUM (Padronizados)
   ============================================
   CONFIGURAÇÃO: Cards de margem com design único e consistente
   usando variações sutis de roxo/azul para diferenciar tipos
   ============================================ */

/* Variáveis CSS para cores dos cards de margem */
:root {
    /* Margem Bruta - Azul/Roxo principal */
    --margin-bruta-bg: var(--mud-palette-surface);
    --margin-bruta-header: rgba(var(--mud-palette-primary-rgb), 0.3);
    --margin-bruta-accent: rgba(var(--mud-palette-primary-rgb), 0.4);
    --margin-bruta-border: rgba(var(--mud-palette-primary-rgb), 0.3);
    
    /* Margem Reservada - Roxo/Amber suave */
    --margin-reservada-bg: var(--mud-palette-surface);
    --margin-reservada-header: linear-gradient(135deg, rgba(var(--mud-palette-primary-rgb), 0.3) 0%, rgba(245, 158, 11, 0.2) 100%);
    --margin-reservada-accent: rgba(var(--mud-palette-primary-rgb), 0.4);
    --margin-reservada-border: rgba(var(--mud-palette-primary-rgb), 0.3);
    
    /* Margem Disponível - Azul/Verde suave */
    --margin-disponivel-bg: var(--mud-palette-surface);
    --margin-disponivel-header: linear-gradient(135deg, rgba(var(--mud-palette-primary-rgb), 0.3) 0%, rgba(16, 185, 129, 0.2) 100%);
    --margin-disponivel-accent: rgba(16, 185, 129, 0.4);
    --margin-disponivel-border: rgba(16, 185, 129, 0.3);
}

/* Classe base para todos os cards de margem */
.margin-card-premium {
    border-radius: 16px;
    padding: 0;
    margin-bottom: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Modo Escuro */
.mud-theme-dark .margin-card-premium,
.main-content-dark .margin-card-premium {
    background: var(--mud-palette-surface) !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 30px rgba(var(--mud-palette-primary-rgb), 0.1);
}

.mud-theme-dark .margin-card-premium:hover,
.main-content-dark .margin-card-premium:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 40px rgba(var(--mud-palette-primary-rgb), 0.15);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Modo Claro */
.mud-theme-light .margin-card-premium,
.main-content-light .margin-card-premium {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 0 20px rgba(var(--mud-palette-primary-rgb), 0.05);
}

.mud-theme-light .margin-card-premium:hover,
.main-content-light .margin-card-premium:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 30px rgba(var(--mud-palette-primary-rgb), 0.1);
    transform: translateY(-2px);
    border-color: rgba(var(--mud-palette-primary-rgb), 0.3);
}

/* Header do card de margem */
.margin-card-premium-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
}

/* Modo Escuro */
.mud-theme-dark .margin-card-premium-header,
.main-content-dark .margin-card-premium-header {
    background: rgba(var(--mud-palette-primary-rgb), 0.3);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mud-theme-dark .margin-card-premium-header .mud-text,
.main-content-dark .margin-card-premium-header .mud-text {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.01em;
}

.mud-theme-dark .margin-card-premium-header .mud-icon,
.main-content-dark .margin-card-premium-header .mud-icon {
    color: rgba(255, 255, 255, 0.9) !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.mud-theme-dark .margin-card-premium-header .mud-icon-button,
.main-content-dark .margin-card-premium-header .mud-icon-button {
    color: rgba(255, 255, 255, 0.9) !important;
}

.mud-theme-dark .margin-card-premium-header .mud-icon-button:hover,
.main-content-dark .margin-card-premium-header .mud-icon-button:hover {
    color: rgba(255, 255, 255, 1) !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Modo Claro - Preservar estilo escuro dos cabeçalhos */
.mud-theme-light .margin-card-premium-header,
.main-content-light .margin-card-premium-header {
    background: var(--fv-header-bg) !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.mud-theme-light .margin-card-premium-header .mud-text,
.main-content-light .margin-card-premium-header .mud-text,
.mud-theme-light .margin-card-premium-header .mud-stack .mud-text,
.main-content-light .margin-card-premium-header .mud-stack .mud-text,
.mud-theme-light .margin-card-premium-header * .mud-text,
.main-content-light .margin-card-premium-header * .mud-text,
.mud-theme-light .margin-card-premium-header .mud-typography,
.main-content-light .margin-card-premium-header .mud-typography {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.01em;
}

.mud-theme-light .margin-card-premium-header .mud-icon,
.main-content-light .margin-card-premium-header .mud-icon {
    color: rgba(255, 255, 255, 0.9) !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.mud-theme-light .margin-card-premium-header .mud-icon-button,
.main-content-light .margin-card-premium-header .mud-icon-button {
    color: rgba(255, 255, 255, 0.9) !important;
}

.mud-theme-light .margin-card-premium-header .mud-icon-button:hover,
.main-content-light .margin-card-premium-header .mud-icon-button:hover {
    color: rgba(255, 255, 255, 1) !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Informação de última atualização */
.margin-card-premium-update {
    padding: 0.75rem 1.5rem;
    font-size: 0.75rem;
    margin: 0;
}

.mud-theme-dark .margin-card-premium-update,
.main-content-dark .margin-card-premium-update {
    background: var(--mud-palette-surface);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
}

.mud-theme-light .margin-card-premium-update,
.main-content-light .margin-card-premium-update {
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.6);
}

/* Corpo do card */
.margin-card-premium-body {
    padding: 1.5rem;
    background: transparent;
}

/* Tabela dentro do card de margem */
.margin-card-premium-table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
}

/* Modo Escuro */
.mud-theme-dark .margin-card-premium-table thead,
.main-content-dark .margin-card-premium-table thead {
    background: var(--mud-palette-surface);
}

.mud-theme-dark .margin-card-premium-table thead th,
.main-content-dark .margin-card-premium-table thead th {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 600 !important;
    padding: 0.75rem 1rem !important;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.875rem;
    letter-spacing: 0.025em;
}

.mud-theme-dark .margin-card-premium-table tbody tr,
.main-content-dark .margin-card-premium-table tbody tr {
    background: var(--mud-palette-surface);
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mud-theme-dark .margin-card-premium-table tbody tr:hover,
.main-content-dark .margin-card-premium-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.01);
}

.mud-theme-dark .margin-card-premium-table tbody tr:nth-child(even),
.main-content-dark .margin-card-premium-table tbody tr:nth-child(even) {
    background: var(--mud-palette-surface);
}

.mud-theme-dark .margin-card-premium-table tbody td,
.main-content-dark .margin-card-premium-table tbody td {
    padding: 0.875rem 1rem !important;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
}

.mud-theme-dark .margin-card-premium-table tbody td:first-child,
.main-content-dark .margin-card-premium-table tbody td:first-child {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.mud-theme-dark .margin-card-premium-table tbody td:last-child,
.main-content-dark .margin-card-premium-table tbody td:last-child {
    font-weight: 600;
    color: rgba(16, 185, 129, 0.9); /* Verde suave para valores */
    font-size: 0.9375rem;
}

/* Modo Claro - Preservar estilo escuro dos cabeçalhos de tabela */
.mud-theme-light .margin-card-premium-table thead,
.main-content-light .margin-card-premium-table thead {
    background: var(--fv-header-bg) !important;
}

.mud-theme-light .margin-card-premium-table thead th,
.main-content-light .margin-card-premium-table thead th {
    color: rgba(255, 255, 255, 0.95) !important;
    font-weight: 600 !important;
    padding: 0.75rem 1rem !important;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.875rem;
    letter-spacing: 0.025em;
}

.mud-theme-light .margin-card-premium-table tbody tr,
.main-content-light .margin-card-premium-table tbody tr {
    background: #ffffff;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.mud-theme-light .margin-card-premium-table tbody tr:hover,
.main-content-light .margin-card-premium-table tbody tr:hover {
    background: rgba(var(--mud-palette-primary-rgb), 0.05);
    transform: scale(1.01);
}

.mud-theme-light .margin-card-premium-table tbody tr:nth-child(even),
.main-content-light .margin-card-premium-table tbody tr:nth-child(even) {
    background: rgba(249, 250, 251, 1);
}

.mud-theme-light .margin-card-premium-table tbody td,
.main-content-light .margin-card-premium-table tbody td {
    padding: 0.875rem 1rem !important;
    color: rgba(0, 0, 0, 0.87);
    font-size: 0.875rem;
}

.mud-theme-light .margin-card-premium-table tbody td:first-child,
.main-content-light .margin-card-premium-table tbody td:first-child {
    font-weight: 600;
    color: rgba(0, 0, 0, 0.87);
}

.mud-theme-light .margin-card-premium-table tbody td:last-child,
.main-content-light .margin-card-premium-table tbody td:last-child {
    font-weight: 600;
    color: #10b981; /* Verde para valores */
    font-size: 0.9375rem;
}

/* Variações específicas por tipo de margem */
.margin-card-premium.margin-card-bruta {
    border-color: var(--margin-bruta-border);
}

.margin-card-premium.margin-card-bruta .margin-card-premium-header {
    background: var(--margin-bruta-header);
}

.margin-card-premium.margin-card-bruta:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 40px rgba(var(--mud-palette-primary-rgb), 0.2);
    border-color: var(--margin-bruta-accent);
}

.margin-card-premium.margin-card-reservada {
    border-color: var(--margin-reservada-border);
}

.margin-card-premium.margin-card-reservada .margin-card-premium-header {
    background: var(--margin-reservada-header);
}

.margin-card-premium.margin-card-reservada:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 40px rgba(var(--mud-palette-primary-rgb), 0.2);
    border-color: var(--margin-reservada-accent);
}

.margin-card-premium.margin-card-disponivel {
    border-color: var(--margin-disponivel-border);
}

.margin-card-premium.margin-card-disponivel .margin-card-premium-header {
    background: var(--margin-disponivel-header);
}

.margin-card-premium.margin-card-disponivel:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 40px rgba(16, 185, 129, 0.2);
    border-color: var(--margin-disponivel-accent);
}

/* Responsividade */
@media (max-width: 768px) {
    .margin-card-premium {
        border-radius: 12px;
        margin-bottom: 1rem;
    }
    
    .margin-card-premium-header {
        padding: 0.875rem 1rem;
    }
    
    .margin-card-premium-body {
        padding: 1rem;
    }
    
    .margin-card-premium-table tbody td {
        padding: 0.75rem 0.875rem !important;
        font-size: 0.8125rem;
    }
}

/* ============================================
   14. ANIMAÇÕES ESCURAS PREMIUM
   ============================================ */
@keyframes dark-premium-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes dark-premium-slide-in {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   15. AJUSTES GLOBAIS PARA MODO CLARO
   ============================================ */
/* Garantir que todos os textos sejam legíveis no modo claro */
.mud-theme-light .mud-text,
.main-content-light .mud-text {
    color: rgba(0, 0, 0, 0.87) !important;
}

.mud-theme-light .mud-typography-body1,
.main-content-light .mud-typography-body1 {
    color: rgba(0, 0, 0, 0.87) !important;
}

.mud-theme-light .mud-typography-body2,
.main-content-light .mud-typography-body2 {
    color: rgba(0, 0, 0, 0.6) !important;
}

/* Ajustar ícones para modo claro */
.mud-theme-light .mud-icon,
.main-content-light .mud-icon {
    color: rgba(0, 0, 0, 0.54) !important;
}

.mud-theme-light .mud-icon-button,
.main-content-light .mud-icon-button {
    color: rgba(0, 0, 0, 0.54) !important;
}

/* Ajustar selects e comboboxes */
.mud-theme-light .mud-select,
.main-content-light .mud-select {
    color: rgba(0, 0, 0, 0.87) !important;
}

.mud-theme-light .mud-select .mud-input,
.main-content-light .mud-select .mud-input {
    color: rgba(0, 0, 0, 0.87) !important;
}

.mud-theme-light .mud-combobox,
.main-content-light .mud-combobox {
    color: rgba(0, 0, 0, 0.87) !important;
}

.mud-theme-light .mud-combobox .mud-input,
.main-content-light .mud-combobox .mud-input {
    color: rgba(0, 0, 0, 0.87) !important;
}

/* Ajustar checkboxes e switches */
.mud-theme-light .mud-checkbox,
.main-content-light .mud-checkbox {
    color: rgba(0, 0, 0, 0.87) !important;
}

.mud-theme-light .mud-switch,
.main-content-light .mud-switch {
    color: rgba(0, 0, 0, 0.87) !important;
}

/* Ajustar tooltips */
.mud-theme-light .mud-tooltip,
.main-content-light .mud-tooltip {
    color: rgba(0, 0, 0, 0.87) !important;
}

/* Ajustar dialogs */
.mud-theme-light .mud-dialog,
.main-content-light .mud-dialog {
    background: #ffffff !important;
    color: rgba(0, 0, 0, 0.87) !important;
}

.mud-theme-light .mud-dialog-title,
.main-content-light .mud-dialog-title {
    color: rgba(0, 0, 0, 0.87) !important;
}

.mud-theme-light .mud-dialog-content,
.main-content-light .mud-dialog-content {
    color: rgba(0, 0, 0, 0.87) !important;
}

/* Ajustar snackbars */
.mud-theme-light .mud-snackbar,
.main-content-light .mud-snackbar {
    color: rgba(0, 0, 0, 0.87) !important;
}

/* Ajustar progress indicators */
.mud-theme-light .mud-progress-linear,
.main-content-light .mud-progress-linear {
    background: rgba(0, 0, 0, 0.1) !important;
}

.mud-theme-light .mud-progress-circular,
.main-content-light .mud-progress-circular {
    color: var(--mud-palette-primary) !important;
}

/* Ajustar chips */
.mud-theme-light .mud-chip,
.main-content-light .mud-chip {
    color: rgba(0, 0, 0, 0.87) !important;
    background: rgba(0, 0, 0, 0.08) !important;
}

/* Ajustar dividers */
.mud-theme-light .mud-divider,
.main-content-light .mud-divider {
    border-color: rgba(0, 0, 0, 0.12) !important;
}

/* Garantir que links sejam visíveis */
.mud-theme-light a,
.main-content-light a {
    color: var(--mud-palette-primary) !important;
}

.mud-theme-light a:hover,
.main-content-light a:hover {
    color: var(--mud-palette-primary-darken) !important;
}

/* Ajustar placeholders */
.mud-theme-light input::placeholder,
.main-content-light input::placeholder,
.mud-theme-light textarea::placeholder,
.main-content-light textarea::placeholder {
    color: rgba(0, 0, 0, 0.4) !important;
}

/* Ajustar valores de dados em tabelas */
.mud-theme-light td[data-value],
.main-content-light td[data-value] {
    color: #10b981 !important;
    font-weight: bold !important;
}

.mud-theme-light td[data-value^="-" i],
.main-content-light td[data-value^="-" i] {
    color: #ef4444 !important;
}

.mud-theme-light td[data-value="0,00"],
.main-content-light td[data-value="0,00"] {
    color: rgba(0, 0, 0, 0.6) !important;
    font-weight: normal !important;
}

/* ============================================
   16. CABEÇALHOS GENÉRICOS DE TABELAS - Sempre estilo escuro
   ============================================ */
/* Garantir que todos os cabeçalhos de tabela tenham estilo escuro, mesmo no modo claro */
.mud-theme-light .mud-table-head,
.main-content-light .mud-table-head,
.mud-theme-light .mud-simple-table thead,
.main-content-light .mud-simple-table thead,
.mud-theme-light table thead,
.main-content-light table thead {
    background: var(--fv-header-bg) !important;
}

.mud-theme-light .mud-table-head th,
.main-content-light .mud-table-head th,
.mud-theme-light .mud-simple-table thead th,
.main-content-light .mud-simple-table thead th,
.mud-theme-light table thead th,
.main-content-light table thead th {
    color: rgba(255, 255, 255, 0.95) !important;
    font-weight: 600;
    border-bottom: 2px solid rgba(var(--mud-palette-primary-rgb), 0.5) !important;
}

.mud-theme-light .mud-table-head .mud-table-cell,
.main-content-light .mud-table-head .mud-table-cell,
.mud-theme-light .mud-simple-table thead .mud-table-cell,
.main-content-light .mud-simple-table thead .mud-table-cell {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Cabeçalhos de tabelas em containers de scroll */
.mud-theme-light .table-scroll-container .mud-table-head,
.main-content-light .table-scroll-container .mud-table-head,
.mud-theme-light .table-scroll-container thead,
.main-content-light .table-scroll-container thead {
    background: var(--fv-header-bg) !important;
}

.mud-theme-light .table-scroll-container .mud-table-head th,
.main-content-light .table-scroll-container .mud-table-head th,
.mud-theme-light .table-scroll-container thead th,
.main-content-light .table-scroll-container thead th,
.mud-theme-light .table-scroll-container .mud-table-head .mud-table-cell,
.main-content-light .table-scroll-container .mud-table-head .mud-table-cell {
    color: rgba(255, 255, 255, 0.95) !important;
}

/* ============================================
   17. CLASSES ESPECÍFICAS - modern-header-purple e search-card
   ============================================ */
/* Modo Escuro - mantém comportamento atual */
.mud-theme-dark .modern-header-purple,
.main-content-dark .modern-header-purple {
    background: rgba(var(--mud-palette-primary-rgb), 0.25);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 20px rgba(var(--mud-palette-primary-rgb), 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mud-theme-dark .modern-header-purple .mud-text,
.main-content-dark .modern-header-purple .mud-text {
    color: rgba(255, 255, 255, 0.9) !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.mud-theme-dark .modern-header-purple .mud-icon,
.main-content-dark .modern-header-purple .mud-icon {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Modo Claro - Preservar estilo escuro dos cabeçalhos modernos */
.mud-theme-light .modern-header-purple,
.main-content-light .modern-header-purple {
    background: var(--fv-header-bg) !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    color: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 15px rgba(var(--mud-palette-primary-rgb), 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.mud-theme-light .modern-header-purple .mud-text,
.main-content-light .modern-header-purple .mud-text {
    color: rgba(255, 255, 255, 0.9) !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.mud-theme-light .modern-header-purple .mud-icon,
.main-content-light .modern-header-purple .mud-icon {
    color: rgba(255, 255, 255, 0.9) !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* search-card */
.mud-theme-dark .search-card,
.main-content-dark .search-card {
    background: var(--mud-palette-surface) !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 30px rgba(var(--mud-palette-primary-rgb), 0.1);
}

.mud-theme-light .search-card,
.main-content-light .search-card {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 0 20px rgba(var(--mud-palette-primary-rgb), 0.05);
}

/* search-header dentro de search-card */
.mud-theme-dark .search-header .mud-input-outlined,
.main-content-dark .search-header .mud-input-outlined {
    background: var(--mud-palette-surface) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.mud-theme-dark .search-header .mud-input-outlined:hover,
.main-content-dark .search-header .mud-input-outlined:hover {
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.mud-theme-dark .search-header .mud-input-label,
.main-content-dark .search-header .mud-input-label {
    color: rgba(255, 255, 255, 0.7) !important;
}

.mud-theme-dark .search-header .mud-input,
.main-content-dark .search-header .mud-input {
    color: rgba(255, 255, 255, 0.9) !important;
}

.mud-theme-light .search-header .mud-input-outlined,
.main-content-light .search-header .mud-input-outlined {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.23) !important;
}

.mud-theme-light .search-header .mud-input-outlined:hover,
.main-content-light .search-header .mud-input-outlined:hover {
    border-color: rgba(0, 0, 0, 0.4) !important;
}

.mud-theme-light .search-header .mud-input-label,
.main-content-light .search-header .mud-input-label {
    color: rgba(0, 0, 0, 0.6) !important;
}

.mud-theme-light .search-header .mud-input,
.main-content-light .search-header .mud-input {
    color: rgba(0, 0, 0, 0.87) !important;
}

/* modern-button */
.mud-theme-light .modern-button-primary,
.main-content-light .modern-button-primary {
    background: var(--mud-palette-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 0 20px rgba(var(--mud-palette-primary-rgb), 0.2);
}

.mud-theme-light .modern-button-primary:hover,
.main-content-light .modern-button-primary:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), 0 0 30px rgba(var(--mud-palette-primary-rgb), 0.3);
    background: var(--mud-palette-primary-darken) !important;
}

/* Ajustar textos com cores fixas brancas */
.mud-theme-light .mud-text[style*="color: rgba(255, 255, 255"],
.main-content-light .mud-text[style*="color: rgba(255, 255, 255"],
.mud-theme-light .mud-text[style*="color: white"],
.main-content-light .mud-text[style*="color: white"],
.mud-theme-light .mud-text[style*="color:#fff"],
.main-content-light .mud-text[style*="color:#fff"] {
    color: rgba(0, 0, 0, 0.87) !important;
}

/* Ajustar ProgressCircular em modo claro */
.mud-theme-light .mud-progress-circular,
.main-content-light .mud-progress-circular {
    color: var(--mud-palette-primary) !important;
}

/* Ajustar textos de loading */
.mud-theme-dark .loading-text-theme,
.main-content-dark .loading-text-theme {
    color: rgba(255, 255, 255, 0.9) !important;
}

.mud-theme-light .loading-text-theme,
.main-content-light .loading-text-theme {
    color: rgba(0, 0, 0, 0.87) !important;
}

/* Ajustar textos de botões */
.mud-theme-dark .button-text-theme,
.main-content-dark .button-text-theme {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.mud-theme-light .button-text-theme,
.main-content-light .button-text-theme {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ============================================
   17. CORREÇÃO DE TEXTOS COM CORES FIXAS
   ============================================ */
/* Sobrescrever textos com cores brancas fixas em modo claro */
.mud-theme-light [style*="color: rgba(255, 255, 255"],
.main-content-light [style*="color: rgba(255, 255, 255"],
.mud-theme-light [style*="color: white"],
.main-content-light [style*="color: white"],
.mud-theme-light [style*="color:#fff"],
.main-content-light [style*="color:#fff"],
.mud-theme-light [style*="color: #fff"],
.main-content-light [style*="color: #fff"],
.mud-theme-light [style*="color:#ffffff"],
.main-content-light [style*="color:#ffffff"],
.mud-theme-light [style*="color: #ffffff"],
.main-content-light [style*="color: #ffffff"] {
    color: rgba(0, 0, 0, 0.87) !important;
}

/* Ajustar textos com rgba(255, 255, 255, 0.9) em modo claro */
.mud-theme-light [style*="color: rgba(255, 255, 255, 0.9)"],
.main-content-light [style*="color: rgba(255, 255, 255, 0.9)"] {
    color: rgba(0, 0, 0, 0.87) !important;
}

/* Ajustar textos com rgba(255, 255, 255, 0.7) em modo claro */
.mud-theme-light [style*="color: rgba(255, 255, 255, 0.7)"],
.main-content-light [style*="color: rgba(255, 255, 255, 0.7)"] {
    color: rgba(0, 0, 0, 0.6) !important;
}

/* Exceção: textos dentro de botões primários devem permanecer brancos */
.mud-theme-light .dark-premium-button-primary [style*="color"],
.main-content-light .dark-premium-button-primary [style*="color"],
.mud-theme-light .modern-button-primary [style*="color"],
.main-content-light .modern-button-primary [style*="color"] {
    color: #ffffff !important;
}

/* ============================================
   18. AJUSTES ESPECÍFICOS PARA SELECTS E COMBOBOXES
   ============================================ */
.mud-theme-light .mud-select.dark-premium-input-field,
.main-content-light .mud-select.dark-premium-input-field {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.23) !important;
}

.mud-theme-light .mud-select.dark-premium-input-field .mud-input,
.main-content-light .mud-select.dark-premium-input-field .mud-input {
    color: rgba(0, 0, 0, 0.87) !important;
}

.mud-theme-light .mud-select.dark-premium-input-field .mud-input-label,
.main-content-light .mud-select.dark-premium-input-field .mud-input-label {
    color: rgba(0, 0, 0, 0.6) !important;
}

.mud-theme-light .mud-select.dark-premium-input-field .mud-input-label.mud-input-label-shrink,
.main-content-light .mud-select.dark-premium-input-field .mud-input-label.mud-input-label-shrink {
    color: var(--mud-palette-primary) !important;
}

.mud-theme-light .mud-combobox.dark-premium-input-field,
.main-content-light .mud-combobox.dark-premium-input-field {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.23) !important;
}

.mud-theme-light .mud-combobox.dark-premium-input-field .mud-input,
.main-content-light .mud-combobox.dark-premium-input-field .mud-input {
    color: rgba(0, 0, 0, 0.87) !important;
}

.mud-theme-light .mud-autocomplete.dark-premium-input-field,
.main-content-light .mud-autocomplete.dark-premium-input-field {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.23) !important;
}

.mud-theme-light .mud-autocomplete.dark-premium-input-field .mud-input,
.main-content-light .mud-autocomplete.dark-premium-input-field .mud-input {
    color: rgba(0, 0, 0, 0.87) !important;
}

/* Ajustar popover/dropdown de selects em modo escuro - texto visível (html = onde MudBlazor aplica tema) */
html.mud-theme-dark .mud-popover,
.mud-theme-dark .mud-popover,
.main-content-dark .mud-popover {
    background: rgba(30, 41, 59, 0.98) !important;
    color: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

html.mud-theme-dark .mud-popover .mud-list-item,
.mud-theme-dark .mud-popover .mud-list-item,
.main-content-dark .mud-popover .mud-list-item {
    color: rgba(255, 255, 255, 0.95) !important;
}

html.mud-theme-dark .mud-popover .mud-list-item:hover,
.mud-theme-dark .mud-popover .mud-list-item:hover,
.main-content-dark .mud-popover .mud-list-item:hover {
    background: rgba(var(--mud-palette-primary-rgb), 0.25) !important;
    color: #fff !important;
}

html.mud-theme-dark .mud-popover .mud-list-item.mud-selected-item,
.mud-theme-dark .mud-popover .mud-list-item.mud-selected-item,
.main-content-dark .mud-popover .mud-list-item.mud-selected-item {
    background: rgba(var(--mud-palette-primary-rgb), 0.35) !important;
    color: rgba(255, 255, 255, 0.95) !important;
}

/* Ajustar popover/dropdown de selects em modo claro */
.mud-theme-light .mud-popover,
.main-content-light .mud-popover {
    background: #ffffff !important;
    color: rgba(0, 0, 0, 0.87) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.mud-theme-light .mud-popover .mud-list-item,
.main-content-light .mud-popover .mud-list-item {
    color: rgba(0, 0, 0, 0.87) !important;
}

.mud-theme-light .mud-popover .mud-list-item:hover,
.main-content-light .mud-popover .mud-list-item:hover {
    background: rgba(var(--mud-palette-primary-rgb), 0.08) !important;
}

.mud-theme-light .mud-popover .mud-list-item.mud-selected-item,
.main-content-light .mud-popover .mud-list-item.mud-selected-item {
    background: rgba(var(--mud-palette-primary-rgb), 0.12) !important;
    color: var(--mud-palette-primary) !important;
}

/* Ajustar NumericField */
.mud-theme-light .mud-numeric-field.dark-premium-input-field,
.main-content-light .mud-numeric-field.dark-premium-input-field {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.23) !important;
}

.mud-theme-light .mud-numeric-field.dark-premium-input-field .mud-input,
.main-content-light .mud-numeric-field.dark-premium-input-field .mud-input {
    color: rgba(0, 0, 0, 0.87) !important;
}

/* Ajustar DatePicker */
.mud-theme-light .mud-picker,
.main-content-light .mud-picker {
    background: #ffffff !important;
    color: rgba(0, 0, 0, 0.87) !important;
}

.mud-theme-light .mud-picker .mud-input,
.main-content-light .mud-picker .mud-input {
    color: rgba(0, 0, 0, 0.87) !important;
}

/* Ajustar checkboxes em modo claro */
.mud-theme-light .mud-checkbox .mud-checkbox-label,
.main-content-light .mud-checkbox .mud-checkbox-label {
    color: rgba(0, 0, 0, 0.87) !important;
}

/* Ajustar switches em modo claro */
.mud-theme-light .mud-switch .mud-switch-label,
.main-content-light .mud-switch .mud-switch-label {
    color: rgba(0, 0, 0, 0.87) !important;
}

/* Ajustar Radzen components em modo claro */
.mud-theme-light .rz-dialog,
.main-content-light .rz-dialog {
    background: #ffffff !important;
    color: rgba(0, 0, 0, 0.87) !important;
}

/* Modo Claro - Preservar estilo escuro dos cabeçalhos de diálogo */
.mud-theme-light .rz-dialog-header,
.main-content-light .rz-dialog-header {
    background: var(--fv-header-bg) !important;
    color: rgba(255, 255, 255, 0.95) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.mud-theme-light .rz-dialog-content,
.main-content-light .rz-dialog-content {
    color: rgba(0, 0, 0, 0.87) !important;
}

.mud-theme-light .rz-inputtext,
.main-content-light .rz-inputtext {
    background: #ffffff !important;
    color: rgba(0, 0, 0, 0.87) !important;
    border-color: rgba(0, 0, 0, 0.23) !important;
}

.mud-theme-light .rz-dropdown,
.main-content-light .rz-dropdown {
    background: #ffffff !important;
    color: rgba(0, 0, 0, 0.87) !important;
    border-color: rgba(0, 0, 0, 0.23) !important;
}

/* ============================================
   19. AJUSTES PARA ELEMENTOS COM BACKGROUNDS FIXOS
   ============================================ */
/* Garantir que elementos com background escuro fixo funcionem em modo claro */
.mud-theme-light [style*="background: rgba(22, 33, 62"],
.main-content-light [style*="background: rgba(22, 33, 62"],
.mud-theme-light [style*="background: rgba(26, 26, 46"],
.main-content-light [style*="background: rgba(26, 26, 46"],
.mud-theme-light [style*="background: #0a0a0a"],
.main-content-light [style*="background: #0a0a0a"],
.mud-theme-light [style*="background:#0a0a0a"],
.main-content-light [style*="background:#0a0a0a"] {
    background: #ffffff !important;
}

/* Ajustar containers com background transparent em modo claro */
.mud-theme-light [style*="background: transparent"],
.main-content-light [style*="background: transparent"] {
    background: transparent !important;
}

/* Ajustar MudSimpleTable em modo claro */
.mud-theme-light .mud-simple-table,
.main-content-light .mud-simple-table {
    background: #ffffff !important;
}

.mud-theme-light .mud-simple-table th,
.main-content-light .mud-simple-table th {
    background: rgba(249, 250, 251, 1) !important;
    color: rgba(0, 0, 0, 0.87) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12) !important;
}

.mud-theme-light .mud-simple-table td,
.main-content-light .mud-simple-table td {
    color: rgba(0, 0, 0, 0.87) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.mud-theme-light .mud-simple-table tr:hover,
.main-content-light .mud-simple-table tr:hover {
    background: rgba(var(--mud-palette-primary-rgb), 0.05) !important;
}

.mud-theme-light .mud-simple-table tr:nth-child(even),
.main-content-light .mud-simple-table tr:nth-child(even) {
    background: rgba(249, 250, 251, 1) !important;
}

/* Ajustar MudStack e MudGrid em modo claro */
.mud-theme-light .mud-stack,
.main-content-light .mud-stack {
    color: rgba(0, 0, 0, 0.87) !important;
}

/* Ajustar MudItem em modo claro */
.mud-theme-light .mud-item,
.main-content-light .mud-item {
    color: rgba(0, 0, 0, 0.87) !important;
}

/* Garantir que ícones em modo claro sejam visíveis */
.mud-theme-light .mud-svg-icon,
.main-content-light .mud-svg-icon {
    color: rgba(0, 0, 0, 0.54) !important;
    fill: rgba(0, 0, 0, 0.54) !important;
}

.mud-theme-light .mud-icon,
.main-content-light .mud-icon {
    color: rgba(0, 0, 0, 0.54) !important;
}

/* Ajustar tooltips em modo claro */
.mud-theme-light .mud-tooltip,
.main-content-light .mud-tooltip {
    background: rgba(97, 97, 97, 0.9) !important;
    color: #ffffff !important;
}

/* Ajustar snackbars em modo claro */
.mud-theme-light .mud-snackbar,
.main-content-light .mud-snackbar {
    background: #323232 !important;
    color: #ffffff !important;
}

.mud-theme-light .mud-snackbar-content,
.main-content-light .mud-snackbar-content {
    color: #ffffff !important;
}

/* Ajustar MudFab em modo claro */
.mud-theme-light .mud-fab,
.main-content-light .mud-fab {
    background: var(--mud-palette-primary) !important;
    color: #ffffff !important;
}

.mud-theme-light .mud-fab:hover,
.main-content-light .mud-fab:hover {
    background: var(--mud-palette-primary-darken) !important;
}

/* Ajustar MudBadge em modo claro */
.mud-theme-light .mud-badge,
.main-content-light .mud-badge {
    color: #ffffff !important;
}

/* Ajustar MudChip em modo claro */
.mud-theme-light .mud-chip,
.main-content-light .mud-chip {
    background: rgba(0, 0, 0, 0.08) !important;
    color: rgba(0, 0, 0, 0.87) !important;
}

.mud-theme-light .mud-chip.mud-chip-color-primary,
.main-content-light .mud-chip.mud-chip-color-primary {
    background: rgba(var(--mud-palette-primary-rgb), 0.12) !important;
    color: var(--mud-palette-primary) !important;
}

/* ============================================
   18. GARANTIR CABEÇALHOS ESCUROS NO MODO CLARO - ESPECIFICIDADE MÁXIMA
   ============================================ */
/* Sobrescrever qualquer estilo que possa estar interferindo */
.mud-theme-light .mud-simple-table thead,
.main-content-light .mud-simple-table thead,
.mud-theme-light .mud-simple-table thead tr,
.main-content-light .mud-simple-table thead tr,
.mud-theme-light .mud-simple-table thead th,
.main-content-light .mud-simple-table thead th {
    background: var(--fv-header-bg) !important;
    color: rgba(255, 255, 255, 0.95) !important;
}

.mud-theme-light table thead,
.main-content-light table thead,
.mud-theme-light table thead tr,
.main-content-light table thead tr,
.mud-theme-light table thead th,
.main-content-light table thead th {
    background: var(--fv-header-bg) !important;
    color: rgba(255, 255, 255, 0.95) !important;
    border-bottom: 2px solid rgba(var(--mud-palette-primary-rgb), 0.5) !important;
}

/* Garantir que cabeçalhos dentro de dark-premium-paper também sejam escuros */
.mud-theme-light .dark-premium-paper thead,
.main-content-light .dark-premium-paper thead,
.mud-theme-light .dark-premium-paper thead th,
.main-content-light .dark-premium-paper thead th,
.mud-theme-light .dark-premium-paper .mud-simple-table thead,
.main-content-light .dark-premium-paper .mud-simple-table thead,
.mud-theme-light .dark-premium-paper .mud-simple-table thead th,
.main-content-light .dark-premium-paper .mud-simple-table thead th {
    background: var(--fv-header-bg) !important;
    color: rgba(255, 255, 255, 0.95) !important;
}

/* ============================================
   ESTILOS COMPACTOS PARA CARDS ANALÍTICOS
   Reduz espaços internos mantendo aparência visual idêntica
   ============================================ */
.compact-analytics-card,
.dark-premium-card[style*="padding: 0"],
.dark-premium-card.compact-analytics-card {
    padding: 0 !important;
}

.compact-analytics-card .modern-header-purple,
.dark-premium-card.compact-analytics-card .modern-header-purple,
.dark-premium-card .modern-header-purple {
    padding: 8px 12px !important;
    margin-bottom: 0 !important;
}

.dark-premium-card .modern-header-purple .mud-text {
    margin: 0 !important;
    line-height: 1.2 !important;
    padding: 0 !important;
}

.dark-premium-card .modern-header-purple .mud-icon {
    margin-right: 8px !important;
}

.dark-premium-card .dark-premium-table {
    margin: 0 !important;
}

.compact-analytics-card .dark-premium-table .mud-table-head th,
.compact-analytics-card .dark-premium-table .mud-table-body td,
.compact-analytics-card .dark-premium-table .mud-table-footer td,
.compact-analytics-card .dark-premium-table .mud-table-head .mud-table-cell,
.compact-analytics-card .dark-premium-table .mud-table-body .mud-table-cell,
.compact-analytics-card .dark-premium-table .mud-table-footer .mud-table-cell,
.dark-premium-card.compact-analytics-card .dark-premium-table .mud-table-head th,
.dark-premium-card.compact-analytics-card .dark-premium-table .mud-table-body td,
.dark-premium-card.compact-analytics-card .dark-premium-table .mud-table-footer td,
.dark-premium-card .dark-premium-table .mud-table-head th,
.dark-premium-card .dark-premium-table .mud-table-body td,
.dark-premium-card .dark-premium-table .mud-table-footer td,
.dark-premium-card .dark-premium-table .mud-table-head .mud-table-cell,
.dark-premium-card .dark-premium-table .mud-table-body .mud-table-cell,
.dark-premium-card .dark-premium-table .mud-table-footer .mud-table-cell {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    line-height: 1.35 !important;
}

.compact-analytics-card .dark-premium-table .mud-table-head th,
.compact-analytics-card .dark-premium-table .mud-table-head .mud-table-cell,
.dark-premium-card.compact-analytics-card .dark-premium-table .mud-table-head th,
.dark-premium-card .dark-premium-table .mud-table-head th,
.dark-premium-card .dark-premium-table .mud-table-head .mud-table-cell {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
}

.compact-analytics-card .dark-premium-table .mud-table-body td,
.compact-analytics-card .dark-premium-table .mud-table-body .mud-table-cell,
.dark-premium-card.compact-analytics-card .dark-premium-table .mud-table-body td,
.dark-premium-card .dark-premium-table .mud-table-body td,
.dark-premium-card .dark-premium-table .mud-table-body .mud-table-cell {
    padding-top: 3px !important;
    padding-bottom: 3px !important;
}

.compact-analytics-card .dark-premium-table .mud-table-footer td,
.compact-analytics-card .dark-premium-table .mud-table-footer .mud-table-cell,
.dark-premium-card.compact-analytics-card .dark-premium-table .mud-table-footer td,
.dark-premium-card .dark-premium-table .mud-table-footer td,
.dark-premium-card .dark-premium-table .mud-table-footer .mud-table-cell {
    padding-top: 5px !important;
    padding-bottom: 5px !important;
}

.dark-premium-card .table-scroll-container {
    padding: 0 !important;
    margin: 0 !important;
}

.dark-premium-card .dark-premium-table .mud-table-root,
.dark-premium-card .dark-premium-table .mud-table-container,
.dark-premium-card .dark-premium-table .mud-table-root *,
.dark-premium-card .dark-premium-table .mud-table-container * {
    padding: 0 !important;
    margin: 0 !important;
}

.dark-premium-card .dark-premium-table .mud-table {
    margin: 0 !important;
}

.dark-premium-card .dark-premium-table .mud-table-toolbar {
    padding: 4px 8px !important;
    margin: 0 !important;
}

.dark-premium-card .dark-premium-table .mud-table-pager {
    padding: 4px 8px !important;
    margin: 0 !important;
}

/* Forçar estilos inline para sobrescrever MudBlazor */
.mud-paper.dark-premium-card[style*="padding: 0"] .mud-table-head th,
.mud-paper.dark-premium-card[style*="padding: 0"] .mud-table-body td,
.mud-paper.dark-premium-card[style*="padding: 0"] .mud-table-footer td {
    padding-top: 3px !important;
    padding-bottom: 3px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    line-height: 1.35 !important;
}

.mud-paper.dark-premium-card[style*="padding: 0"] .mud-table-head th {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
}

/* ============================================
   ESTILOS ULTRA ESPECÍFICOS PARA FORÇAR APLICAÇÃO
   ============================================ */
.mud-paper.mud-paper-elevation-0.dark-premium-paper.dark-premium-card.compact-analytics-card .mud-table-head th,
.mud-paper.mud-paper-elevation-0.dark-premium-paper.dark-premium-card.compact-analytics-card .mud-table-body td,
.mud-paper.mud-paper-elevation-0.dark-premium-paper.dark-premium-card.compact-analytics-card .mud-table-footer td {
    padding-top: 3px !important;
    padding-bottom: 3px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    line-height: 1.35 !important;
}

.mud-paper.mud-paper-elevation-0.dark-premium-paper.dark-premium-card.compact-analytics-card .mud-table-head th {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
}

.mud-paper.mud-paper-elevation-0.dark-premium-paper.dark-premium-card.compact-analytics-card .mud-table-body td {
    padding-top: 3px !important;
    padding-bottom: 3px !important;
}

.mud-paper.mud-paper-elevation-0.dark-premium-paper.dark-premium-card.compact-analytics-card .mud-table-footer td {
    padding-top: 5px !important;
    padding-bottom: 5px !important;
}

/* Forçar aplicação em células com estilos inline */
.mud-paper.dark-premium-card.compact-analytics-card .mud-table-cell[style*="padding"],
.mud-paper.dark-premium-card.compact-analytics-card th[style*="padding"],
.mud-paper.dark-premium-card.compact-analytics-card td[style*="padding"] {
    padding-top: 3px !important;
    padding-bottom: 3px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
}

.mud-paper.dark-premium-card.compact-analytics-card .mud-table-head th[style*="padding"],
.mud-paper.dark-premium-card.compact-analytics-card .mud-table-head .mud-table-cell[style*="padding"] {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
}

/* ============================================
   OTIMIZAÇÃO DE ESPAÇO - LAYOUT DENSO E RESPONSIVO
   Aplicado em: Proposta, Proposta Analítico, Consulta-Limite,
   Usuario-Automacao e Usuarios
   
   DECISÕES DE DESIGN:
   - Padding reduzido ~50% para +20% de linhas visíveis sem rolagem
   - Coluna de botões fixa (sticky right) para sempre acessível
   - Primeira coluna de identificação fixa (sticky left) para contexto
   - Media queries progressivas: 1600px (intermediário) e 1360px (agressivo)
   - Font-size 12px mantém legibilidade com melhor densidade
   ============================================ */

/* ============================================
   TABELA DENSA PADRONIZADA - Todas as páginas
   Padrão: padding 8px horizontal, 2px vertical, font-size 12px, line-height 1.2
   ============================================ */
.dark-premium-table .mud-table-body td,
.dark-premium-table .mud-table-body .mud-table-cell {
    padding-top: 2px !important;
    padding-bottom: 2px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
}

.dark-premium-table .mud-table-head th,
.dark-premium-table .mud-table-head .mud-table-cell {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
}

/* ============================================
   COLUNA FIXA (STICKY) - BOTÃO DE EDIÇÃO (ÚLTIMA COLUNA)
   Garante que o botão de editar esteja sempre visível sem rolagem horizontal
   Aplicado em: Proposta, Usuario-Automacao, Usuarios
   ============================================ */
/* Última coluna (botão de edição) - sticky à direita */
.proposta-table .mud-table-body tr td:last-child,
.proposta-table .mud-table-head tr th:last-child,
.usuario-automacao-table .mud-table-body tr td:last-child,
.usuario-automacao-table .mud-table-head tr th:last-child,
.usuario-table .mud-table-body tr td:last-child,
.usuario-table .mud-table-head tr th:last-child {
    position: sticky !important;
    right: 0 !important;
    z-index: 20 !important;
    /* Background para manter legibilidade ao rolar */
    background: inherit !important;
}

/* Garantir fundo escuro nas linhas striped/hover para a coluna sticky */
.mud-theme-dark .proposta-table .mud-table-body tr:nth-child(even) td:last-child,
.main-content-dark .proposta-table .mud-table-body tr:nth-child(even) td:last-child,
.mud-theme-dark .usuario-automacao-table .mud-table-body tr:nth-child(even) td:last-child,
.main-content-dark .usuario-automacao-table .mud-table-body tr:nth-child(even) td:last-child,
.mud-theme-dark .usuario-table .mud-table-body tr:nth-child(even) td:last-child,
.main-content-dark .usuario-table .mud-table-body tr:nth-child(even) td:last-child {
    background: rgba(30, 40, 70, 0.9) !important;
}

.mud-theme-dark .proposta-table .mud-table-body tr:nth-child(odd) td:last-child,
.main-content-dark .proposta-table .mud-table-body tr:nth-child(odd) td:last-child,
.mud-theme-dark .usuario-automacao-table .mud-table-body tr:nth-child(odd) td:last-child,
.main-content-dark .usuario-automacao-table .mud-table-body tr:nth-child(odd) td:last-child,
.mud-theme-dark .usuario-table .mud-table-body tr:nth-child(odd) td:last-child,
.main-content-dark .usuario-table .mud-table-body tr:nth-child(odd) td:last-child {
    background: var(--mud-palette-surface) !important;
}

.mud-theme-dark .proposta-table .mud-table-body tr:hover td:last-child,
.main-content-dark .proposta-table .mud-table-body tr:hover td:last-child,
.mud-theme-dark .usuario-automacao-table .mud-table-body tr:hover td:last-child,
.main-content-dark .usuario-automacao-table .mud-table-body tr:hover td:last-child,
.mud-theme-dark .usuario-table .mud-table-body tr:hover td:last-child,
.main-content-dark .usuario-table .mud-table-body tr:hover td:last-child {
    background: rgba(var(--mud-palette-primary-rgb), 0.15) !important;
}

/* Header sticky para coluna de botão */
.mud-theme-dark .proposta-table .mud-table-head tr th:last-child,
.main-content-dark .proposta-table .mud-table-head tr th:last-child,
.mud-theme-dark .usuario-automacao-table .mud-table-head tr th:last-child,
.main-content-dark .usuario-automacao-table .mud-table-head tr th:last-child,
.mud-theme-dark .usuario-table .mud-table-head tr th:last-child,
.main-content-dark .usuario-table .mud-table-head tr th:last-child {
    background: var(--fv-header-bg) !important;
}

/* ============================================
   COLUNA FIXA (STICKY) - PRIMEIRA COLUNA (IDENTIFICAÇÃO)
   Mantém o contexto ao rolar horizontalmente
   Aplicado em: Proposta (coluna Número), Consulta-Limite (coluna CPF)
   ============================================ */
.proposta-table .mud-table-body tr td:first-child,
.proposta-table .mud-table-head tr th:first-child,
.consulta-limite-table .mud-table-body tr td:first-child,
.consulta-limite-table .mud-table-head tr th:first-child {
    position: sticky !important;
    left: 0 !important;
    z-index: 15 !important;
    background: inherit !important;
}

/* Background para manter legibilidade na coluna sticky esquerda */
.mud-theme-dark .proposta-table .mud-table-body tr:nth-child(even) td:first-child,
.main-content-dark .proposta-table .mud-table-body tr:nth-child(even) td:first-child,
.mud-theme-dark .consulta-limite-table .mud-table-body tr:nth-child(even) td:first-child,
.main-content-dark .consulta-limite-table .mud-table-body tr:nth-child(even) td:first-child {
    background: rgba(30, 40, 70, 0.9) !important;
}

.mud-theme-dark .proposta-table .mud-table-body tr:nth-child(odd) td:first-child,
.main-content-dark .proposta-table .mud-table-body tr:nth-child(odd) td:first-child,
.mud-theme-dark .consulta-limite-table .mud-table-body tr:nth-child(odd) td:first-child,
.main-content-dark .consulta-limite-table .mud-table-body tr:nth-child(odd) td:first-child {
    background: var(--mud-palette-surface) !important;
}

.mud-theme-dark .proposta-table .mud-table-body tr:hover td:first-child,
.main-content-dark .proposta-table .mud-table-body tr:hover td:first-child,
.mud-theme-dark .consulta-limite-table .mud-table-body tr:hover td:first-child,
.main-content-dark .consulta-limite-table .mud-table-body tr:hover td:first-child {
    background: rgba(var(--mud-palette-primary-rgb), 0.15) !important;
}

/* Linha de sombra separadora na coluna sticky esquerda */
.proposta-table .mud-table-body tr td:first-child,
.proposta-table .mud-table-head tr th:first-child,
.consulta-limite-table .mud-table-body tr td:first-child,
.consulta-limite-table .mud-table-head tr th:first-child {
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.3) !important;
}

/* Linha de sombra separadora na coluna sticky direita */
.proposta-table .mud-table-body tr td:last-child,
.proposta-table .mud-table-head tr th:last-child,
.usuario-automacao-table .mud-table-body tr td:last-child,
.usuario-automacao-table .mud-table-head tr th:last-child,
.usuario-table .mud-table-body tr td:last-child,
.usuario-table .mud-table-head tr th:last-child {
    box-shadow: -2px 0 4px rgba(0, 0, 0, 0.3) !important;
}

/* ============================================
   ESTILOS ANALÍTICOS OTIMIZADOS
   compact-analytics-card aprimorado para +20% de linhas visíveis
   ============================================ */
/* Tabela analítica compactada */
.analitico-table .mud-table-body td,
.analitico-table .mud-table-body .mud-table-cell {
    padding-top: 2px !important;
    padding-bottom: 2px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
}

.analitico-table .mud-table-head th,
.analitico-table .mud-table-head .mud-table-cell {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
}

/* Grid analítico: espaçamento entre cards reduzido */
.analitico-grid .mud-grid-item {
    padding: 4px !important;
}

/* ============================================
   ESTILOS GLASSMORPHISM PARA CAMPOS DE INPUT EM EDIÇÃO
   Aplicado em: Usuarios (RowEditingTemplate)
   Campos redimensionados para UX melhor, glassmorphism preservado.
   ============================================ */
.usuario-edit-field.mud-input-control,
.usuario-edit-field .mud-input-slot,
.usuario-edit-field {
    min-width: 160px !important;
    width: 100% !important;
}

/* Glassmorphism aprimorado para campos em modo de edição */
.usuario-table .mud-table-body tr .mud-input-outlined .mud-input-slot {
    background: rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
    font-size: 14px !important;
}

.usuario-table .mud-table-body tr .mud-input-outlined:hover .mud-input-slot,
.usuario-table .mud-table-body tr .mud-input-outlined.mud-focused .mud-input-slot {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(var(--mud-palette-primary-rgb), 0.6) !important;
    box-shadow: 0 0 12px rgba(var(--mud-palette-primary-rgb), 0.2) !important;
}

/* Altura padrão dos campos: 40-48px para conforto */
.usuario-table .mud-table-body tr .mud-input-outlined .mud-input-slot {
    min-height: 40px !important;
    padding: 8px 12px !important;
}

/* Labels dos campos de edição */
.usuario-table .mud-table-body tr .mud-input-label {
    font-size: 13px !important;
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Espaçamento uniforme entre células de edição */
.usuario-table .mud-table-body tr.mud-table-edit-row td {
    padding: 6px 8px !important;
    vertical-align: middle !important;
}

/* ============================================
   MEDIA QUERIES - RESOLUÇÃO 1600x900
   Ajustes intermediários para melhor uso de espaço
   ============================================ */
@media (max-width: 1600px) {
    /* Redução moderada dos paddings nas células */
    .dark-premium-table .mud-table-body td,
    .dark-premium-table .mud-table-body .mud-table-cell {
        padding-top: 2px !important;
        padding-bottom: 2px !important;
        padding-left: 7px !important;
        padding-right: 7px !important;
        font-size: 12px !important;
    }

    .dark-premium-table .mud-table-head th,
    .dark-premium-table .mud-table-head .mud-table-cell {
        padding-top: 3px !important;
        padding-bottom: 3px !important;
        padding-left: 7px !important;
        padding-right: 7px !important;
        font-size: 12px !important;
    }

    /* Container de scroll: usar mais espaço vertical disponível */
    .table-scroll-container {
        max-height: 70vh !important;
    }

    /* Cards analíticos: manter grid 2x2 mas com espaçamentos reduzidos */
    .analitico-grid .mud-grid-item {
        padding: 3px !important;
    }

    /* Campos de input de edição em 1600x900: responsivos */
    .usuario-edit-field.mud-input-control,
    .usuario-edit-field {
        min-width: 140px !important;
    }
}

/* ============================================
   MEDIA QUERIES - RESOLUÇÃO 1360x768
   Ajustes agressivos para máximo aproveitamento de espaço
   ============================================ */
@media (max-width: 1360px) {
    /* Redução máxima dos paddings nas células para +20% de linhas visíveis */
    .dark-premium-table .mud-table-body td,
    .dark-premium-table .mud-table-body .mud-table-cell {
        padding-top: 1px !important;
        padding-bottom: 1px !important;
        padding-left: 6px !important;
        padding-right: 6px !important;
        font-size: 11px !important;
        line-height: 1.15 !important;
    }

    .dark-premium-table .mud-table-head th,
    .dark-premium-table .mud-table-head .mud-table-cell {
        padding-top: 2px !important;
        padding-bottom: 2px !important;
        padding-left: 6px !important;
        padding-right: 6px !important;
        font-size: 11px !important;
        line-height: 1.15 !important;
    }

    /* Container de scroll: maximizar espaço vertical em 1360x768 */
    .table-scroll-container {
        max-height: 72vh !important;
    }

    /* Scrollbar mais fina em resoluções menores */
    .table-scroll-container::-webkit-scrollbar {
        width: 5px !important;
        height: 5px !important;
    }

    /* Cards analíticos em 1360px: grid 2x2 mais compacto */
    .analitico-grid .mud-grid-item {
        padding: 2px !important;
    }

    /* Tabelas analíticas: redução máxima */
    .analitico-table .mud-table-body td,
    .analitico-table .mud-table-body .mud-table-cell {
        padding-top: 1px !important;
        padding-bottom: 1px !important;
        padding-left: 6px !important;
        padding-right: 6px !important;
        font-size: 11px !important;
        line-height: 1.15 !important;
    }

    .analitico-table .mud-table-head th,
    .analitico-table .mud-table-head .mud-table-cell {
        padding-top: 2px !important;
        padding-bottom: 2px !important;
        padding-left: 6px !important;
        padding-right: 6px !important;
        font-size: 10px !important;
        line-height: 1.15 !important;
    }

    /* Headers dos cards analíticos: mais compactos em 1360px */
    .compact-analytics-card .modern-header-purple,
    .dark-premium-card.compact-analytics-card .modern-header-purple {
        padding: 4px 8px !important;
    }

    /* Campos de input de edição em 1360x768: full-width, sem quebra */
    .usuario-edit-field.mud-input-control,
    .usuario-edit-field {
        min-width: 120px !important;
        width: 100% !important;
    }

    /* Toolbar da tabela: mais compacta em 1360px */
    .dark-premium-table .mud-table-toolbar,
    .dark-premium-table .mud-toolbar {
        padding: 4px 6px !important;
        min-height: 40px !important;
    }

    /* Pager: mais compacto em 1360px */
    .dark-premium-table .mud-table-pager {
        padding: 2px 6px !important;
    }

    /* Reduzir padding do container interno pa-4 em 1360px */
    .dark-premium-paper .pa-4 {
        padding: 8px !important;
    }
}

/* ============================================
   MEDIA QUERIES - CARDS ANALÍTICOS EM 1360px
   Grid de cards analíticos adaptativo
   ============================================ */
@media (max-width: 1360px) {
    /* Em 1360px, considerar que os cards analíticos fiquem em coluna única
       para melhor uso do espaço vertical disponível */
    .analitico-grid-item.mud-grid-item {
        /* Manter 2 colunas mas com espaçamento mínimo */
        padding: 2px !important;
    }
}

/* ============================================
   ESTILOS ESPECÍFICOS - CONSULTA-LIMITE
   Padronizado: +20% linhas em 1360x768 (mesmos padrões de Proposta)
   ============================================ */
.consulta-limite-table .mud-table-body td,
.consulta-limite-table .mud-table-body .mud-table-cell {
    padding-top: 2px !important;
    padding-bottom: 2px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
}

.consulta-limite-table .mud-table-head th,
.consulta-limite-table .mud-table-head .mud-table-cell {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
}

/* ============================================
   ESTILOS ESPECÍFICOS - USUARIO-AUTOMACAO
   Padronizado: +20% linhas em 1360x768 (mesmos padrões de Proposta)
   ============================================ */
.usuario-automacao-table .mud-table-body td,
.usuario-automacao-table .mud-table-body .mud-table-cell {
    padding-top: 2px !important;
    padding-bottom: 2px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
}

.usuario-automacao-table .mud-table-head th,
.usuario-automacao-table .mud-table-head .mud-table-cell {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
}

/* ============================================
   ESTILOS ESPECÍFICOS - USUARIO (TABELA)
   Padronizado com glassmorphism nos campos de edição
   ============================================ */
.usuario-table .mud-table-body td,
.usuario-table .mud-table-body .mud-table-cell {
    padding-top: 2px !important;
    padding-bottom: 2px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
}

.usuario-table .mud-table-head th,
.usuario-table .mud-table-head .mud-table-cell {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
}

/* Linhas em modo de edição: altura mínima para campos */
.usuario-table .mud-table-body tr.mud-table-edit-row td {
    padding: 6px 8px !important;
    vertical-align: top !important;
}

/* ============================================
   RESPONSIVIDADE DOS CAMPOS DE INPUT EM EDIÇÃO
   Aplicado em: Usuarios
   Full-width em 1360x768, largura responsiva em 1600x900
   ============================================ */
@media (max-width: 1600px) {
    /* Em 1600x900: campos largos e confortáveis */
    .usuario-table .mud-table-body tr .mud-input-outlined .mud-input-slot {
        padding: 6px 10px !important;
        font-size: 13px !important;
    }

    .usuario-table .mud-table-body tr.mud-table-edit-row td {
        padding: 4px 6px !important;
    }
}

@media (max-width: 1360px) {
    /* Em 1360x768: campos full-width no container, sem quebra */
    .usuario-table .mud-table-body tr .mud-input-outlined .mud-input-slot {
        padding: 4px 8px !important;
        font-size: 12px !important;
        min-height: 36px !important;
    }

    .usuario-table .mud-table-body tr.mud-table-edit-row td {
        padding: 3px 5px !important;
    }

    .usuario-edit-field.mud-input-control,
    .usuario-edit-field {
        min-width: 100px !important;
        width: 100% !important;
    }
}

/* ============================================
   ESTILOS GLASSMORPHISM PARA CAMPOS - MODO CLARO
   Compatibilidade com modo claro preservando glassmorphism
   ============================================ */
.mud-theme-light .usuario-table .mud-table-body tr .mud-input-outlined .mud-input-slot,
.main-content-light .usuario-table .mud-table-body tr .mud-input-outlined .mud-input-slot {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(var(--mud-palette-primary-rgb), 0.3) !important;
}

.mud-theme-light .usuario-table .mud-table-body tr .mud-input-outlined:hover .mud-input-slot,
.main-content-light .usuario-table .mud-table-body tr .mud-input-outlined:hover .mud-input-slot,
.mud-theme-light .usuario-table .mud-table-body tr .mud-input-outlined.mud-focused .mud-input-slot,
.main-content-light .usuario-table .mud-table-body tr .mud-input-outlined.mud-focused .mud-input-slot {
    border-color: var(--mud-palette-primary) !important;
    box-shadow: 0 0 8px rgba(var(--mud-palette-primary-rgb), 0.15) !important;
}

/* ============================================================
   CARDS FULL-HEIGHT — propostaAnalitico
   Cards full-height: conteúdo ocupa 100% do espaço interno.
   Corrige a cadeia flex quebrada que deixava conteúdo flutuando
   no topo com grande espaço vazio abaixo.
   ============================================================ */

/* 1. MudGrid (.analitico-grid): garantir align-items: stretch para
      igualar altura de todos os MudItems em cada linha do grid */
.analitico-grid.mud-grid {
    align-items: stretch !important;
    align-content: flex-start !important;
}

/* 2. MudItem (.analitico-grid-item): transformar em container flex
      para que o filho MudPaper possa crescer até 100% da altura */
.analitico-grid-item.mud-grid-item {
    display: flex !important;
    flex-direction: column !important;
    align-self: stretch !important;
    box-sizing: border-box !important;
}

/* 3. MudPaper (.compact-analytics-card) filho direto do MudItem:
      flex: 1 garante que o card estique até preencher o MudItem */
.analitico-grid-item.mud-grid-item > .mud-paper,
.analitico-grid-item.mud-grid-item > .compact-analytics-card {
    flex: 1 1 auto !important;
    min-height: 0 !important;
}

/* ============================================================
   ALTURA MÍNIMA + TABLE-SCROLL-CONTAINER
   Impede que cards com poucos registros fiquem minúsculos.
   min-height de 300px garante visual sempre substancial.
   ============================================================ */
.compact-analytics-card {
    min-height: 300px !important;
    transition: box-shadow 0.2s ease, transform 0.2s ease !important;
}

/* table-scroll-container dentro dos cards analíticos:
   min-height assegura área de dados visualmente preenchida */
.compact-analytics-card .table-scroll-container {
    min-height: 220px !important;
    display: flex !important;
    flex-direction: column !important;
}

/* ============================================================
   TABELA FULL-WIDTH
   Elimina colunas/espaços em branco laterais dentro dos cards.
   ============================================================ */
.compact-analytics-card .mud-table-root,
.compact-analytics-card .mud-table-container,
.compact-analytics-card .mud-table,
.compact-analytics-card table {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    table-layout: auto !important;
}

/* Colunas que se expandem igualmente para preencher a largura */
.compact-analytics-card .analitico-table .mud-table-head th:first-child,
.compact-analytics-card .analitico-table .mud-table-body td:first-child {
    width: 70% !important;
}
.compact-analytics-card .analitico-table .mud-table-head th:last-child,
.compact-analytics-card .analitico-table .mud-table-body td:last-child {
    width: 30% !important;
}

/* ============================================================
   VISUAL MODERNO — DARK THEME MANTIDO
   Hover glow roxo, header com sombra separadora,
   footer sticky e transições suaves.
   ============================================================ */

/* Hover glow: destaca card ao passar o mouse */
.compact-analytics-card:hover {
    box-shadow:
        0 8px 24px rgba(var(--mud-palette-primary-rgb), 0.25),
        0 0 0 1px rgba(var(--mud-palette-primary-rgb), 0.15) !important;
    transform: translateY(-2px) !important;
}

/* Header com sombra inferior para separar do conteúdo */
.compact-analytics-card .modern-header-purple.dark-premium-header {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

/* Footer "Total:" sticky — sempre visível ao rolar a tabela */
.compact-analytics-card .analitico-table .mud-table-foot,
.compact-analytics-card .analitico-table tfoot {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 5 !important;
    background: rgba(var(--mud-palette-primary-rgb), 0.9) !important;
}
.compact-analytics-card .analitico-table .mud-table-foot td,
.compact-analytics-card .analitico-table tfoot td {
    background: transparent !important;
    color: rgba(255, 255, 255, 0.95) !important;
    font-weight: 700 !important;
    font-size: 12px !important;
    padding: 4px 8px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
}

/* Zebra stripes aprimoradas para cards analíticos */
.compact-analytics-card .analitico-table .mud-table-body tr:nth-child(odd) td {
    background: rgba(255, 255, 255, 0.03) !important;
}
.compact-analytics-card .analitico-table .mud-table-body tr:hover td {
    background: rgba(var(--mud-palette-primary-rgb), 0.12) !important;
    transition: background 0.15s ease !important;
}

/* ============================================================
   MEDIA QUERIES — CARDS FULL-HEIGHT
   1600x900: min-height ligeiramente reduzido, gap 4px
   1360x768: min-height mais compacto, gap 2px
   ============================================================ */

/* Resolução 1600x900 */
@media (max-width: 1600px) {
    /* Cards: altura mínima reduzida em 1600px */
    .compact-analytics-card {
        min-height: 280px !important;
    }
    .compact-analytics-card .table-scroll-container {
        min-height: 200px !important;
    }
    /* Grid gap levemente reduzido */
    .analitico-grid.mud-grid {
        gap: 4px !important;
    }
}

/* Resolução 1360x768 */
@media (max-width: 1360px) {
    /* Cards: altura mínima mais compacta */
    .compact-analytics-card {
        min-height: 260px !important;
    }
    .compact-analytics-card .table-scroll-container {
        min-height: 180px !important;
    }
    /* Grid gap mínimo para maximizar espaço dos cards */
    .analitico-grid.mud-grid {
        gap: 2px !important;
    }
    /* Hover: remover transform para evitar layout shift em telas menores */
    .compact-analytics-card:hover {
        transform: none !important;
    }
}

/* =============== MODO CLARO - Harmonização dos cards de detalhe (Proposta Analítico) =============== */
.mud-theme-light .analitico-section-card-detalhe,
.main-content-light .analitico-section-card-detalhe {
  background: #ffffff !important;
  color: rgba(17, 24, 39, 0.92) !important;
  border: 1px solid rgba(0,0,0,0.12) !important;
  box-shadow: 0 2px 10px rgba(17,24,39,0.06) !important;
}

.mud-theme-light .analitico-section-card-detalhe .analitico-section-title,
.main-content-light .analitico-section-card-detalhe .analitico-section-title {
  background: #ffffff !important;
  color: rgba(17, 24, 39, 0.95) !important;
  border-bottom: 1px solid rgba(0,0,0,0.08) !important;
}

.mud-theme-light .analitico-section-card-detalhe .analitico-grid-header,
.main-content-light .analitico-section-card-detalhe .analitico-grid-header {
  background: #f3f4f6 !important;
  color: rgba(17,24,39,0.92) !important;
  border-bottom: 1px solid rgba(0,0,0,0.08) !important;
}

.mud-theme-light .analitico-section-card-detalhe .analitico-grid-body,
.main-content-light .analitico-section-card-detalhe .analitico-grid-body {
  background: #ffffff !important;
  color: rgba(17, 24, 39, 0.92) !important;
  overflow-x: hidden !important;
}
.mud-theme-light .analitico-section-card-detalhe .analitico-grid-body > div,
.main-content-light .analitico-section-card-detalhe .analitico-grid-body > div {
  border-bottom: 1px solid rgba(0,0,0,0.06) !important;
}
.mud-theme-light .analitico-section-card-detalhe .analitico-grid-body > div:nth-child(4n + 1),
.mud-theme-light .analitico-section-card-detalhe .analitico-grid-body > div:nth-child(4n + 2),
.main-content-light .analitico-section-card-detalhe .analitico-grid-body > div:nth-child(4n + 1),
.main-content-light .analitico-section-card-detalhe .analitico-grid-body > div:nth-child(4n + 2) {
  background: #ffffff !important;
}
.mud-theme-light .analitico-section-card-detalhe .analitico-grid-body > div:nth-child(4n + 3),
.mud-theme-light .analitico-section-card-detalhe .analitico-grid-body > div:nth-child(4n + 4),
.main-content-light .analitico-section-card-detalhe .analitico-grid-body > div:nth-child(4n + 3),
.main-content-light .analitico-section-card-detalhe .analitico-grid-body > div:nth-child(4n + 4) {
  background: #f9fafb !important;
}

.mud-theme-light .analitico-section-card-detalhe .analitico-qty-col,
.main-content-light .analitico-section-card-detalhe .analitico-qty-col {
  color: rgba(17,24,39,0.92) !important;
  text-align: right !important;
}

.mud-theme-light .analitico-section-card-detalhe .analitico-grid-footer,
.main-content-light .analitico-section-card-detalhe .analitico-grid-footer {
  background: #f3f4f6 !important;
  color: rgba(17,24,39,0.95) !important;
  border-top: 1px solid rgba(0,0,0,0.08) !important;
  border-bottom: none !important;
  font-weight: 700 !important;
}

.mud-theme-light .analitico-section-card-detalhe .analitico-grid-body::-webkit-scrollbar,
.main-content-light .analitico-section-card-detalhe .analitico-grid-body::-webkit-scrollbar {
  width: 10px;
}
.mud-theme-light .analitico-section-card-detalhe .analitico-grid-body::-webkit-scrollbar-thumb,
.main-content-light .analitico-section-card-detalhe .analitico-grid-body::-webkit-scrollbar-thumb {
  background: rgba(17,24,39,0.25);
  border-radius: 6px;
}
.mud-theme-light .analitico-section-card-detalhe .analitico-grid-body::-webkit-scrollbar-track,
.main-content-light .analitico-section-card-detalhe .analitico-grid-body::-webkit-scrollbar-track {
  background: rgba(17,24,39,0.06);
}

.mud-theme-light .analitico-section-card-detalhe .analitico-cell-text,
.main-content-light .analitico-section-card-detalhe .analitico-cell-text {
  white-space: normal !important;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* ============================
   MODO CLARO — Página Configurações
   Corrige textos brancos invisíveis no claro dentro do search-card
   e elementos tipográficos/ícones associados.
   ============================ */
.mud-theme-light .search-card .mud-typography,
.mud-theme-light .search-card .mud-text,
.main-content-light .search-card .mud-typography,
.main-content-light .search-card .mud-text {
  color: rgba(17, 24, 39, 0.92) !important;
}
.mud-theme-light .search-card .mud-icon,
.main-content-light .search-card .mud-icon {
  color: rgba(55, 65, 81, 0.95) !important;
}
.mud-theme-light .search-card .mud-input-label,
.mud-theme-light .search-card .mud-helper-text,
.main-content-light .search-card .mud-input-label,
.main-content-light .search-card .mud-helper-text {
  color: rgba(17, 24, 39, 0.75) !important;
}
.mud-theme-light .search-card .mud-input-input::placeholder,
.main-content-light .search-card .mud-input-input::placeholder {
  color: rgba(55, 65, 81, 0.6) !important;
}

/* ============================
   MODO CLARO — Campos de pesquisa nas páginas:
   - Arquivos (/arquivos)
   - Usuários (/usuarios)
   - Usuário Automação (/usuario-automacao)
   Corrige placeholder e cor de texto dos inputs para não ficar branco
   ============================ */
.mud-theme-light .mud-input-root input,
.main-content-light .mud-input-root input {
  color: rgba(17, 24, 39, 0.92) !important;
}
.mud-theme-light .mud-input-root input::placeholder,
.mud-theme-light input::placeholder,
.mud-theme-light textarea::placeholder,
.main-content-light .mud-input-root input::placeholder,
.main-content-light input::placeholder,
.main-content-light textarea::placeholder {
  color: rgba(55, 65, 81, 0.6) !important;
  opacity: 1 !important;
}
/* Adornos (ícone de lupa) legíveis no claro */
.mud-theme-light .mud-input-adornment .mud-icon-button,
.mud-theme-light .mud-input-adornment .mud-icon,
.main-content-light .mud-input-adornment .mud-icon-button,
.main-content-light .mud-input-adornment .mud-icon {
  color: rgba(55, 65, 81, 0.85) !important;
}
/* ================================
   MODO CLARO - Correções de contraste
   Escopo seguro: .mud-theme-light / .main-content-light
   ================================ */

/* Texto base e títulos legíveis no claro */
.mud-theme-light, .main-content-light {
  color: rgba(17, 24, 39, 0.92);
}
.mud-theme-light .mud-typography-h6,
.main-content-light .mud-typography-h6,
.mud-theme-light .mud-typography-subtitle1,
.main-content-light .mud-typography-subtitle1 {
  color: rgba(17, 24, 39, 0.95);
}
.mud-theme-light .mud-icon-root, .main-content-light .mud-icon-root {
  color: rgba(55, 65, 81, 0.95);
}

/* Cards premium no claro (fundo branco e texto escuro) */
.mud-theme-light .dark-premium-card,
.main-content-light .dark-premium-card {
  background: #ffffff !important;
  color: rgba(17, 24, 39, 0.92) !important;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 2px 10px rgba(17, 24, 39, 0.06);
}

/* Headers premium no claro */
.mud-theme-light .modern-header-purple,
.main-content-light .modern-header-purple {
  background: linear-gradient(135deg, rgba(var(--mud-palette-primary-rgb), 0.12) 0%, rgba(var(--mud-palette-primary-rgb), 0.12) 100%) !important;
  color: rgba(17, 24, 39, 0.92) !important;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.mud-theme-light .modern-header-purple .mud-icon,
.main-content-light .modern-header-purple .mud-icon {
  color: rgba(55, 65, 81, 0.95) !important;
}

/* Search-card no claro */
.mud-theme-light .search-card,
.main-content-light .search-card {
  background: #ffffff !important;
  color: rgba(17, 24, 39, 0.92) !important;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

/* Tabelas no claro: cabeçalho claro e texto escuro */
.mud-theme-light .table-scroll-container .mud-table-head,
.main-content-light .table-scroll-container .mud-table-head,
.mud-theme-light .table-scroll-container thead,
.main-content-light .table-scroll-container thead {
  background: #f7f7fb !important;
}
.mud-theme-light .table-scroll-container .mud-table-head th,
.main-content-light .table-scroll-container .mud-table-head th,
.mud-theme-light .table-scroll-container thead th,
.main-content-light .table-scroll-container thead th {
  color: rgba(17, 24, 39, 0.95) !important;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

/* Colunas sticky no claro: manter fundo sólido */
.mud-theme-light .proposta-table .mud-table-head tr th:last-child,
.mud-theme-light .usuario-automacao-table .mud-table-head tr th:last-child,
.main-content-light .proposta-table .mud-table-head tr th:last-child,
.main-content-light .usuario-automacao-table .mud-table-head tr th:last-child {
  background: #f7f7fb !important;
}
.mud-theme-light .proposta-table .mud-table-body tr td:last-child,
.main-content-light .proposta-table .mud-table-body tr td:last-child,
.mud-theme-light .usuario-automacao-table .mud-table-body tr td:last-child,
.main-content-light .usuario-automacao-table .mud-table-body tr td:last-child {
  background: #ffffff !important;
}

/* Inputs no claro: bordas, foco e placeholders */
.mud-theme-light .mud-input-root, .main-content-light .mud-input-root {
  color: rgba(17, 24, 39, 0.92);
}
.mud-theme-light .mud-input-input::placeholder,
.main-content-light .mud-input-input::placeholder {
  color: rgba(55, 65, 81, 0.6);
}
.mud-theme-light .mud-input-outlined, .main-content-light .mud-input-outlined {
  border-color: rgba(0,0,0,0.16);
}
.mud-theme-light .mud-input-outlined.mud-input-focused,
.main-content-light .mud-input-outlined.mud-input-focused {
  box-shadow: 0 0 0 2px rgba(var(--mud-palette-primary-rgb), 0.28);
  border-color: rgba(var(--mud-palette-primary-rgb), 0.6);
}

/* Botões no claro: contraste e hover */
.mud-theme-light .mud-button-root,
.main-content-light .mud-button-root {
  color: rgba(17, 24, 39, 0.92);
}
.mud-theme-light .mud-button-filled.mud-primary,
.main-content-light .mud-button-filled.mud-primary {
  background-color: var(--mud-palette-primary); /* roxo */
  color: #fff;
}
.mud-theme-light .mud-button-filled.mud-primary:hover,
.main-content-light .mud-button-filled.mud-primary:hover {
  background-color: #6d28d9;
}
.mud-theme-light .mud-button-filled.mud-success,
.main-content-light .mud-button-filled.mud-success {
  background-color: #16a34a;
  color: #fff;
}
.mud-theme-light .mud-button-filled.mud-success:hover,
.main-content-light .mud-button-filled.mud-success:hover {
  background-color: #15803d;
}

/* Links e estados */
.mud-theme-light a, .main-content-light a {
  color: #2563eb;
}
.mud-theme-light a:hover, .main-content-light a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* Snackbars no claro */
.mud-theme-light .mud-snackbar .mud-alert-message,
.main-content-light .mud-snackbar .mud-alert-message {
  color: rgba(17, 24, 39, 0.95);
}
.mud-theme-light .mud-snackbar-root .mud-paper,
.main-content-light .mud-snackbar-root .mud-paper {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.08);
}

/* Tooltips no claro */
.mud-theme-light .mud-tooltip-root .mud-tooltip,
.main-content-light .mud-tooltip-root .mud-tooltip {
  background: #111827;
  color: #fff;
}

/* Dialogs no claro */
.mud-theme-light .mud-dialog,
.main-content-light .mud-dialog {
  background: #ffffff !important;
  color: rgba(17, 24, 39, 0.95);
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 10px 25px rgba(17, 24, 39, 0.12);
}

/* Barras de rolagem discretas no claro */
.mud-theme-light *::-webkit-scrollbar,
.main-content-light *::-webkit-scrollbar {
  height: 10px; width: 10px;
}
.mud-theme-light *::-webkit-scrollbar-thumb,
.main-content-light *::-webkit-scrollbar-thumb {
  background: rgba(17, 24, 39, 0.25);
  border-radius: 6px;
}
.mud-theme-light *::-webkit-scrollbar-track,
.main-content-light *::-webkit-scrollbar-track {
  background: rgba(17, 24, 39, 0.06);
}

/* Linhas alternativas de tabela no claro */
.mud-theme-light .mud-table .mud-table-body tr:nth-child(even) td,
.main-content-light .mud-table .mud-table-body tr:nth-child(even) td {
  background-color: #fafafa;
}
.mud-theme-light .mud-table .mud-table-body tr:hover td,
.main-content-light .mud-table .mud-table-body tr:hover td {
  background-color: #f3f4f6;
}

/* Corrigir textos que ficaram brancos no claro por herança */
.mud-theme-light .dark-premium-card, 
.mud-theme-light .search-card,
.mud-theme-light .analitico-section-title,
.mud-theme-light .analitico-resumo-valor,
.mud-theme-light .analitico-resumo-label,
.mud-theme-light .analitico-grid-header,
.mud-theme-light .analitico-grid-footer,
.mud-theme-light .analitico-grid-body,
.main-content-light .dark-premium-card, 
.main-content-light .search-card,
.main-content-light .analitico-section-title,
.main-content-light .analitico-resumo-valor,
.main-content-light .analitico-resumo-label,
.main-content-light .analitico-grid-header,
.main-content-light .analitico-grid-footer,
.main-content-light .analitico-grid-body {
  color: rgba(17, 24, 39, 0.92) !important;
}

/* ============================================
   DARK THEME – AJUSTES FINOS GLOBAIS
   Escopo apenas em .mud-theme-dark / .main-content-dark
   ============================================ */

.mud-theme-dark, .main-content-dark {
  --dark-bg-base: var(--mud-palette-background);
  --dark-bg-surface: var(--mud-palette-surface);
  --dark-bg-card: var(--mud-palette-surface);
  --dark-text-primary: var(--mud-palette-text-primary);
  --dark-text-secondary: var(--mud-palette-text-secondary);
  --dark-text-disabled: var(--mud-palette-text-disabled);
  --dark-border: var(--mud-palette-lines-default);
}

.mud-theme-dark .dark-premium-card,
.main-content-dark .dark-premium-card {
  background: var(--dark-bg-card) !important;
  border: 1px solid var(--dark-border);
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}

.mud-theme-dark .modern-header-purple,
.main-content-dark .modern-header-purple {
  background: linear-gradient(135deg,
              rgba(var(--mud-palette-primary-rgb), 0.20) 0%,
              rgba(var(--mud-palette-primary-rgb), 0.18) 100%) !important;
  border: 1px solid rgba(255,255,255,0.10);
}

.mud-theme-dark .mud-typography,
.main-content-dark .mud-typography {
  color: var(--dark-text-primary);
}
.mud-theme-dark .mud-secondary-text,
.main-content-dark .mud-secondary-text {
  color: var(--dark-text-secondary) !important;
}

.mud-theme-dark .mud-table-root,
.main-content-dark .mud-table-root {
  color: var(--dark-text-primary);
  border-color: var(--dark-border);
}
.mud-theme-dark .mud-table-head,
.main-content-dark .mud-table-head {
  background: rgba(31,41,55,0.85) !important;
  border-bottom: 1px solid var(--dark-border);
}
.mud-theme-dark .mud-table-body .mud-table-row:nth-child(odd),
.main-content-dark .mud-table-body .mud-table-row:nth-child(odd) {
  background: rgba(15, 23, 42, 0.35);
}
.mud-theme-dark .mud-table-body .mud-table-row:hover,
.main-content-dark .mud-table-body .mud-table-row:hover {
  background: rgba(var(--mud-palette-primary-rgb), 0.10) !important;
}

.mud-theme-dark .mud-input-root,
.main-content-dark .mud-input-root {
  background: rgba(31,41,55,0.55) !important;
  border-color: var(--dark-border) !important;
}
.mud-theme-dark .mud-button.mud-button-filled,
.main-content-dark .mud-button.mud-button-filled {
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}

/* Utilitários globais para tabelas compactas e colunas padrão */
.table-compact .mud-table-cell { padding: 4px 6px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.table-compact .col-curta { width: 6% !important; }
.table-compact .col-media { width: 10% !important; }
.table-compact .col-longa { width: 22% !important; }
.table-compact .col-acoes { width: 8% !important; white-space: nowrap; overflow: visible !important; }

/* ============================================
   CORREÇÃO PAGER - "Linhas por página" (MudBlazor 6.21)
   Classes reais: mud-table-pagination-toolbar, mud-table-pagination-select
   ============================================ */
.dark-premium-card .dark-premium-table .mud-table-pagination-toolbar .mud-table-pagination-select,
.dark-premium-card .dark-premium-table .mud-table-pagination-toolbar .mud-table-pagination-select.mud-select {
    width: auto !important;
    min-width: 64px !important;
    max-width: 80px !important;
    flex: 0 0 auto !important;
}

.dark-premium-card .dark-premium-table .mud-table-pagination-toolbar .mud-table-pagination-select .mud-input-slot,
.dark-premium-card .dark-premium-table .mud-table-pagination-toolbar .mud-table-pagination-select .mud-select-input {
    padding-right: 26px !important;
}

.dark-premium-card .dark-premium-table .mud-table-pagination-toolbar .mud-table-pagination-select .mud-input-adornment {
    position: static !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
}