
html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a {
    color: var(--fv-primary);
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: darkyellow;
    color: black;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2L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content: "An error has occurred."
    }

.mud-table-container {
    min-height: 43px;
}

th {
    font-weight: bold !important;
}

.mud-dialog-title > h6 {
    font-weight: bold !important;
}

.mud-table-cell:last-of-type .mud-tooltip-root:nth-of-type(1) .mud-svg-icon {
    fill: green;
}

.mud-table-cell:last-of-type .mud-tooltip-root .mud-primary-text .mud-icon-button-label .mud-svg-icon {
    fill: var(--mud-palette-primary);
}

.mud-table-cell:last-of-type .mud-tooltip-root:nth-of-type(2) .mud-svg-icon {
    fill: rgb(11, 75, 138);
}

.negrito {
    font-weight: bold !important;
}

.erro {
    color: #D32F2F;
}

/* Modo Escuro - mantém cores atuais */
.mud-theme-dark td[data-value],
.main-content-dark td[data-value] {
    color: #2dcc3d !important;
    font-weight: bold !important;
}

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

.mud-theme-dark td[data-value="0,00"],
.main-content-dark td[data-value="0,00"] {
    color: #000 !important;
    font-weight: normal !important;
}

/* Modo Claro - ajustar cores para legibilidade */
.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;
}

w-100 {
    width: 100% !important;
}

.mud-select-extended {
    margin-top: 6.4px !important;
}

/* ============================================
   FIX PROFISSIONAL: Scroll + Sobreposição em Tabelas Blazor
   ============================================
   Container universal para scroll de tabelas com header sticky
   Otimizado para performance em máquinas menos potentes
   ============================================ */

/* ============================================
   TABLE-SCROLL-CONTAINER OTIMIZADO
   Ajustado para 1360x768 e 1600x900:
   - max-height aumentado de 60vh para 70vh (+~10% de linhas visíveis)
   - Scrollbar padrão; media queries reduzem espessura em resoluções menores
   ============================================ */
.table-scroll-container {
    /* Aumentado de 60vh para 70vh para mostrar mais linhas sem rolagem em 1360x768/1600x900 */
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: auto !important; /* Forçar scroll horizontal */
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    /* Garantir que o scroll horizontal funcione */
    width: 100%;
    /* Otimizações de performance: contain para isolar renderização */
    contain: layout style paint;
    /* Aceleração de hardware para scroll suave */
    transform: translateZ(0);
    -webkit-overflow-scrolling: touch; /* Scroll suave no iOS */
}

.table-scroll-container .mud-table-root {
    overflow: visible;
    min-width: max-content !important; /* Forçar largura mínima baseada no conteúdo */
    width: max-content !important; /* Garantir que a tabela tenha largura baseada no conteúdo */
}

.table-scroll-container .mud-table-container {
    overflow: visible !important;
    min-width: max-content !important; /* Forçar largura mínima */
    width: max-content !important; /* Garantir largura baseada no conteúdo */
}

/* Garantir que a tabela dentro do container tenha largura adequada */
.table-scroll-container table {
    min-width: max-content !important;
    width: max-content !important;
}

.table-scroll-container .mud-table-head {
    position: sticky !important;
    top: 0 !important;
    z-index: 10;
    background: var(--mud-palette-surface);
    /* Otimização: will-change para animações suaves */
    will-change: transform;
    /* Aceleração de hardware */
    transform: translateZ(0);
}

.table-scroll-container .mud-table-fixed-header .mud-table-head {
    position: sticky !important;
    top: 0 !important;
}

.table-scroll-container .mud-table-fixed-footer .mud-table-foot {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 10;
    background: var(--mud-palette-surface);
}

.mud-dark .table-scroll-container .mud-table-foot {
    background: var(--mud-palette-surface-dark);
}

/* Fix para theme dark */
.mud-dark .table-scroll-container .mud-table-head {
    background: var(--mud-palette-surface-dark);
}

/* Scrollbar customizada para melhor visual */
.table-scroll-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-scroll-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.table-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.table-scroll-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsivo mobile */
@media (max-width: 768px) {
    .table-scroll-container {
        max-height: 50vh;
        /* Reduzir complexidade de renderização em mobile */
        contain: strict;
    }
}

/* ============================================
   MEDIA QUERIES DE SCROLLBAR - 1600x900 e 1360x768
   Scrollbar mais fina em resoluções menores para economizar espaço visual
   ============================================ */

/* 1600x900: scrollbar moderadamente fina */
@media (max-width: 1600px) {
    .table-scroll-container::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }
}

/* 1360x768: scrollbar bem fina para maximizar área de dados */
@media (max-width: 1360px) {
    .table-scroll-container::-webkit-scrollbar {
        width: 4px;
        height: 4px;
    }

    .table-scroll-container::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.25);
        border-radius: 2px;
    }
}

/* Otimizações para máquinas menos potentes */
@media (prefers-reduced-motion: reduce) {
    .table-scroll-container,
    .table-scroll-container * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Melhorar performance de scroll em dispositivos com baixa potência */
@media (max-width: 1024px) {
    .table-scroll-container {
        /* Reduzir qualidade de renderização em tablets para melhor performance */
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Fix para MudTable com FixedHeader - scroll no container pai */
.mud-table-fixed-header {
    height: auto !important;
}

.mud-table-fixed-header .mud-table-container {
    max-height: none !important;
    overflow: visible !important;
}

/* Garantir que tabelas dentro de containers de scroll tenham largura mínima */
.table-scroll-container table {
    min-width: max-content !important;
    width: max-content !important;
}

/* Forçar scroll horizontal em todas as células da tabela */
.table-scroll-container .mud-table-cell,
.table-scroll-container .mud-table-head .mud-table-cell,
.table-scroll-container .mud-table-body .mud-table-cell {
    white-space: nowrap !important; /* Evitar quebra de linha nas células */
}

/* Garantir que o MudTable não limite a largura */
.table-scroll-container .mud-table {
    min-width: max-content !important;
    width: max-content !important;
}

/* Garantir que o scroll seja visível */
.mud-table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.mud-table-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.mud-table-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.mud-table-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   CORREÇÃO CRÍTICA: Scroll Horizontal em Tabelas
   ============================================
   Garantir que tabelas com muitas colunas tenham scroll horizontal
   ============================================ */

/* Forçar que o container pai não limite a largura */
.dark-premium-paper .table-scroll-container,
.dark-premium-card .table-scroll-container {
    overflow-x: auto !important;
    overflow-y: auto !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Garantir que o MudPaper não limite a largura */
.dark-premium-paper,
.dark-premium-card {
    overflow: visible !important;
}

/* Forçar largura mínima na tabela baseada no conteúdo */
.table-scroll-container .mud-table-root,
.table-scroll-container .mud-table-container,
.table-scroll-container .mud-table,
.table-scroll-container table {
    min-width: max-content !important;
    width: max-content !important;
}

/* Garantir que células não quebrem linha */
.table-scroll-container .mud-table-cell {
    white-space: nowrap !important;
    overflow: visible !important;
}