﻿
    /* =========================================================
   DASHBOARD MODERNO - GINFOR UI (MUDBLAZOR EDITION)
   ========================================================= */
    /* =========================================================
   THEME ENGINE (VARIÁVEIS CONFIGURADAS)
========================================================= */
    :root {
        --modern-primary: #1e293b;
        --modern-primary-hover: #0f172a;
        --modern-success: #10b981;
        --modern-warning: #f59e0b;
        --modern-danger: #ef4444;
        --modern-secondary: #64748b;
        --modern-bg: #f4f7fb;
        --modern-card: #ffffff;
        --modern-border: #e5e7eb;
        --modern-text: #334155;
        --modern-text-light: #64748b;
        --modern-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
        --modern-radius: 18px;
        --modern-transition: all .25s ease;
        --theme-start: #1e293b;
        --theme-end: #0f172a;
    }
    /* =========================================================
   FORÇAR O MUDBLAZOR A USAR O ENGINE DA GINFOR UI
========================================================= */
    .mud-theme-default {
        --mud-palette-primary: var(--modern-primary);
        --mud-palette-secondary: var(--modern-secondary);
        --mud-palette-success: var(--modern-success);
        --mud-palette-warning: var(--modern-warning);
        --mud-palette-error: var(--modern-danger);
        --mud-palette-background: var(--modern-bg);
        --mud-palette-surface: var(--modern-card);
        --mud-palette-text-primary: var(--modern-text);
        --mud-palette-text-secondary: var(--modern-text-light);
        /* Trocado 'transparent' por rgba puro para evitar falhas no C# do MudBlazor */
        --mud-palette-appbar-background: rgba(255, 255, 255, 0.8);
    }
    /* CLASSES DE CONTEXTO DO SEU SISTEMA DE TEMAS */
    body.sidebar-theme-default {
        --theme-start: #1e293b;
        --theme-end: #0f172a;
        --modern-primary: #1e293b;
        --modern-primary-hover: #0f172a;
    }

    body.sidebar-theme-dark {
        --theme-start: #111827;
        --theme-end: #030712;
        --modern-primary: #111827;
        --modern-primary-hover: #030712;
    }

    body.sidebar-theme-purple {
        --theme-start: #7c3aed;
        --theme-end: #312e81;
        --modern-primary: #7c3aed;
        --modern-primary-hover: #312e81;
    }

    body.sidebar-theme-green {
        --theme-start: #065f46;
        --theme-end: #022c22;
        --modern-primary: #065f46;
        --modern-primary-hover: #022c22;
    }
    /* Font Smoothing Global */
    html, body {
        font-family: 'Inter', sans-serif !important;
        background-color: #fff;
        -webkit-font-smoothing: antialiased;
        text-rendering: optimizeLegibility;
    }
    /* =========================================================
   1. REESTRUTURAÇÃO DO LAYOUT PADRÃO (MainLayout)
========================================================= */
    .modern-layout {
        display: flex;
        min-height: 100vh;
        background-color: var(--modern-bg);
    }
    /* Sidebar Customizada baseada na estrutura MudDrawer */
    .mud-drawer.modern-sidebar {
        background: linear-gradient(135deg, var(--theme-start) 0%, var(--theme-end) 100%) !important;
        border-right: 1px solid rgba(255, 255, 255, 0.04) !important;
        transition: var(--modern-transition);
    }
    /* Topbar Customizada baseada na MudAppBar com Glassmorphism real */
    .mud-appbar.modern-topbar {
        background: rgba(255, 255, 255, 0.8) !important;
        backdrop-filter: blur(18px) !important;
        -webkit-backdrop-filter: blur(18px) !important;
        border-bottom: 1px solid var(--modern-border) !important;
        color: var(--modern-text) !important;
    }
    /* Customização para os itens de navegação interna da Sidebar MudBlazor */
    .modern-nav-item .mud-nav-link {
        color: rgba(255, 255, 255, 0.75) !important;
        border-radius: 12px !important;
        margin-bottom: 4px !important;
        transition: var(--modern-transition);
    }

        .modern-nav-item .mud-nav-link:hover,
        .modern-nav-item .mud-nav-link.active {
            background: rgba(255, 255, 255, 0.12) !important;
            color: #ffffff !important;
        }

        .modern-nav-item .mud-nav-link .mud-nav-link-icon {
            color: inherit !important;
        }
    /* =========================================================
   2. CUSTOMIZAÇÃO DE COMPONENTES PADRÕES DO MUDBLAZOR
========================================================= */
    /* --- CARDS (MudCard) --- */
    .mud-card.modern-card, .modern-stat-card {
        background: var(--modern-card) !important;
        border-radius: var(--modern-radius) !important;
        border: 1px solid var(--modern-border) !important;
        box-shadow: var(--modern-shadow) !important;
        transition: var(--modern-transition) !important;
    }

        .mud-card.modern-card:hover, .modern-stat-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08) !important;
        }
    /* --- BOTÕES (MudButton) --- */
    .mud-button-root.btn-modern-primary {
        background: linear-gradient(135deg, var(--modern-primary), #3b82f6) !important;
        color: #ffffff !important;
        border-radius: 14px !important;
        font-weight: 600 !important;
        padding: 10px 22px !important;
        box-shadow: 0 10px 25px rgba(37, 99, 235, 0.2) !important;
        transition: var(--modern-transition) !important;
    }

        .mud-button-root.btn-modern-primary:hover {
            transform: translateY(-2px);
            background: linear-gradient(135deg, var(--modern-primary-hover), var(--modern-primary)) !important;
        }
    /* --- INPUTS E CAMPOS DE TEXTO (MudTextField / MudSelect) --- */
    .mud-input-control .mud-input-root-outlined {
        border-radius: 12px !important;
        background-color: #ffffff !important;
        transition: var(--modern-transition);
    }

    .mud-input-label.mud-input-label-animated {
        font-size: 13px !important;
        font-weight: 600 !important;
        color: var(--modern-text-light) !important;
    }
/* =========================================================
   2. CUSTOMIZAÇÃO DE COMPONENTES PADRÕES DO MUDBLAZOR
========================================================= */

/* --- TABELAS PREMIUM E COMPACTAS (MudTable) --- */
.mud-table.modern-table {
    border-radius: var(--modern-radius) !important;
    box-shadow: var(--modern-shadow) !important;
    background-color: #ffffff !important;
    border: 1px solid var(--modern-border) !important;
    overflow: hidden !important; /* Garante que os cantos arredondados cortem o fundo perfeitamente */
}

    /* REMOVIDO: transform: scale e efeitos de elevação individuais por linha */
    .mud-table.modern-table .mud-table-row {
        transition: background-color .15s ease-in-out !important; /* Transição suave apenas de cor */
    }

        /* Transição elegante de cor ao passar o mouse sem mexer fisicamente na estrutura da linha */
        .mud-table.modern-table .mud-table-row:hover {
            background-color: rgba(37, 99, 235, 0.03) !important; /* Um tom azul/slate extremamente sutil */
        }

    /* Estilização do cabeçalho da tabela */
    .mud-table.modern-table .mud-table-head .mud-table-cell {
        font-size: 0.75rem !important;
        font-weight: 700 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.06em !important;
        color: var(--modern-text-light) !important;
        background-color: #f8fafc !important; /* Fundo limpo para destacar o header */
        padding: 14px 16px !important;
        border-bottom: 1px solid var(--modern-border) !important;
    }

    /* Estilização estável e compacta das células de dados */
    .mud-table.modern-table .mud-table-body .mud-table-cell {
        font-size: 0.875rem !important;
        font-weight: 500 !important;
        color: var(--modern-text) !important;
        padding: 12px 16px !important;
        border-bottom: 1px solid rgba(229, 231, 235, 0.6) !important; /* Linhas divisórias finas e discretas */
    }

        /* Força a célula de ações do MudBlazor a se comportar de forma reta e centralizada */
.mud-table-cell.d-flex.align-center {
    height: 100% !important;
    align-items: center !important;
    justify-content: flex-end !important;
    display: inline-flex !important;
}

/* Evita que botões herdem margens estranhas dentro da tabela */
.mud-table-cell .mud-button-root, 
.mud-table-cell .mud-icon-root {
    margin: 0 !important;
}
    /* --- PAGINAÇÃO (MudTable Pager / MudPagination) --- */
    .mud-table-pager .mud-button-root {
        border-radius: 10px !important;
        margin: 0 2px;
    }

    .mud-pagination-item.mud-pagination-item-active {
        background: linear-gradient(135deg, var(--modern-primary), var(--modern-primary-hover)) !important;
        color: #ffffff !important;
        font-weight: 700 !important;
        box-shadow: 0 6px 15px rgba(37, 99, 235, 0.2) !important;
    }
    /* --- MODAIS E DIÁLOGOS PREMIUM (MudDialog) --- */
    .mud-dialog.modern-modal {
        border-radius: 24px !important;
        box-shadow: 0 25px 70px rgba(15, 23, 42, 0.18) !important;
        border: 1px solid var(--modern-border) !important;
        background-color: var(--modern-card) !important;
        overflow: hidden;
    }

    .mud-overlay.mud-overlay-side-sheet {
        background-color: rgba(15, 23, 42, 0.4) !important;
        backdrop-filter: blur(5px) !important;
        -webkit-backdrop-filter: blur(5px) !important;
    }
    /* --- TABS MODERNAS (MudTabs) --- */
    .mud-tabs-panels.modern-tabs-content {
        background: #ffffff !important;
        border-radius: var(--modern-radius) !important;
        padding: 24px !important;
        border: 1px solid var(--modern-border) !important;
        box-shadow: var(--modern-shadow) !important;
    }

    .mud-tab {
        font-weight: 600 !important;
        border-radius: 12px 12px 0 0 !important;
        transition: var(--modern-transition) !important;
    }

    .mud-tab-active {
        color: var(--modern-primary) !important;
    }
    /* =========================================================
   3. ELEMENTOS UTILITÁRIOS DA SUA IDENTIDADE VISUAL
========================================================= */
    .modern-status-badge {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 6px 14px;
        border-radius: 999px;
        font-size: .78rem;
        font-weight: 700;
    }

    .modern-status-success {
        background: rgba(16,185,129,.12);
        color: #059669;
    }

    .modern-status-danger {
        background: rgba(239,68,68,.12);
        color: #dc2626;
    }

    .modern-status-warning {
        background: rgba(245,158,11,.14);
        color: #d97706;
    }

    .modern-status-info {
        background: rgba(37,99,235,.12);
        color: #2563eb;
    }
    /* Micro-animações de Feedback */
    .feedback-icon-wrapper {
        width: 80px;
        height: 80px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 2.5rem;
        margin-bottom: 20px;
    }

        .feedback-icon-wrapper.success {
            background: rgba(16, 185, 129, 0.1);
            color: var(--modern-success);
            animation: pulseSuccess 2s infinite cubic-bezier(0.66, 0, 0, 1);
        }

    @keyframes pulseSuccess {
        to {
            box-shadow: 0 0 0 25px rgba(16, 185, 129, 0);
        }
    }
    /* Scrollbar fina para as tabelas do MudBlazor */
    .mud-table-container::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    .mud-table-container::-webkit-scrollbar-track {
        background: #f8fafc;
    }

    .mud-table-container::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 10px;
    }

/* =========================================================
   TELA DE LOGIN DIVIDIDA COM IMAGEM DE FUNDO
========================================================= */
.login-split-container {
    display: flex;
    min-height: 100vh;
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    background-color: var(--modern-bg);
}

/* Lado Visual */
.login-visual-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    position: relative;
    overflow: hidden;
    /* Caso a imagem falhe, mantém o gradiente do tema como fallback */
    background: linear-gradient(135deg, var(--theme-start) 0%, var(--theme-end) 100%);
}

/* Configuração da Tag de Imagem para cobrir o lado esquerdo */
.login-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Faz a imagem cobrir todo o espaço sem distorcer */
    z-index: 1;
    opacity: 0.85; /* Dá uma leve transparência para misturar com o fundo/gradiente se quiser */
}

/* Filtro escuro por cima da imagem para garantir leitura dos textos brancos */
.login-visual-side::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%);
    z-index: 2;
}

.visual-content {
    max-width: 440px;
    color: #ffffff;
    position: relative;
    z-index: 10; /* Fica acima do overlay da imagem */
}

.visual-title {
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}

.visual-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
    line-height: 1.5;
}

.visual-footer {
    position: absolute;
    bottom: -120px;
    left: 0;
    color: rgba(255, 255, 255, 0.5);
}

/* Lado do Formulário */
.login-form-side {
    width: 550px;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.03);
}

.form-wrapper {
    width: 100%;
    max-width: 360px;
}

.login-logo-header img {
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.06));
}

/* Responsividade: Mobile esconde o lado visual */
@media (max-width: 959px) {
    .login-visual-side {
        display: none;
    }

    .login-form-side {
        width: 100%;
        padding: 2rem;
    }
}



/* =========================================================
   MELHORIAS EXTRA PARA DATA GRID (ALTA DENSIDADE)
========================================================= */
.mud-table-cell .modern-action-icon {
    transition: var(--modern-transition);
}

    .mud-table-cell .modern-action-icon:hover {
        background-color: rgba(239, 68, 68, 0.1) !important;
        transform: translateY(-1px);
    }

/* Força os botões e chips de ação dentro do grid a não quebrarem linha */
.mud-table-cell * {
    white-space: nowrap !important;
}

/* Garante o arredondamento perfeito dos botões secundários das células */
.mud-table-cell .mud-button-outlined {
    border: 1px solid var(--modern-border) !important;
    font-weight: 600 !important;
    transition: var(--modern-transition);
}

    .mud-table-cell .mud-button-outlined:hover {
        background-color: rgba(37, 99, 235, 0.05) !important;
        border-color: var(--modern-primary) !important;
    }

.mud-picker-calendar-header {
    background-color: var(--modern-card) !important;
}

    .mud-picker-calendar-header .mud-typography {
        color: var(--modern-text) !important;
        font-weight: 700 !important;
    }

.mud-day.mud-day-selected {
    background-color: var(--modern-primary) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border-radius: 10px !important;
}

.mud-day:hover {
    background-color: rgba(99, 102, 241, 0.08) !important;
    color: var(--modern-primary) !important;
}

.mud-day.mud-current {
    color: var(--modern-primary) !important;
    border: 1px solid var(--modern-primary) !important;
    font-weight: 700 !important;
}

    .mud-day.mud-current.mud-day-selected {
        color: #ffffff !important;
        background-color: var(--modern-primary) !important;
    }

.mud-picker-toolbar {
    background: linear-gradient(135deg, var(--theme-start) 0%, var(--theme-end) 100%) !important;
    color: #ffffff !important;
}

    .mud-button-year, .mud-picker-toolbar .mud-typography {
        color: #ffffff !important;
    }

.mud-picker-view-selector .mud-icon-button-root {
    color: var(--modern-text) !important;
}

.mud-input-control .mud-input-root-outlined {
    --mud-palette-primary: var(--modern-primary) !important;
}

.mud-selected {
    background: linear-gradient(135deg, var(--theme-start) 0%, var(--theme-end) 100%) !important;
    color: #fff !important;
}

.modern-vault-card {
    background: linear-gradient(135deg, #71717a 0%, #52525b 50%, #3f3f46 100%) !important;
    border: 3px solid #b1b1b6 !important;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.4), inset 0 -4px 10px rgba(0,0,0,0.3), 0 10px 25px rgba(0,0,0,0.15) !important;
    position: relative;
    overflow: hidden;
}

.vault-door-header {
    border-top: 1px solid rgba(0, 0, 0, 0.15) !important;
    background: rgba(0, 0, 0, 0.08) !important;
    padding: 14px !important;
}

.vault-dial-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: radial-gradient(circle, #f4f4f5 0%, #d4d4d8 100%);
    border: 3px double #71717a;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2), inset 0 2px 4px #ffffff;
    margin: 0 auto 15px auto;
}

.vault-dial-wheel {
    color: #27272a !important;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.modern-vault-card:hover .vault-dial-wheel {
    transform: rotate(120deg);
}

.vault-status-light {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981;
    box-shadow: 0 0 10px #10b981;
}

/* BOTÕES ESTILO DÍGITO/TECLADO DE COFRE */
.vault-digit-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    background: linear-gradient(180deg, #f4f4f5 0%, #e4e4e7 100%) !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 3px 0 #a1a1aa, 0 4px 6px rgba(0,0,0,0.1) !important;
    transition: all 0.1s ease !important;
    padding: 0 !important;
}

    /* Efeito de clique físico (afunda o dígito) */
    .vault-digit-btn:active {
        transform: translateY(3px) !important;
        box-shadow: 0 0px 0 #a1a1aa, 0 1px 3px rgba(0,0,0,0.2) !important;
    }

    /* Cores dos ícones dentro dos dígitos */
    .vault-digit-btn.edit-btn .mud-icon-root {
        color: #d97706 !important; /* Laranja/Aviso */
    }

    .vault-digit-btn.delete-btn .mud-icon-root {
        color: #ef4444 !important; /* Vermelho/Danger */
    }

    .vault-digit-btn:hover {
        background: #ffffff !important;
    }

.modern-page-header {
    background: linear-gradient(135deg, var(--theme-start) 0%, var(--theme-end) 100%) !important;
    border-radius: var(--modern-radius) !important;
    padding: 24px 32px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05), inset 0 1px 1px rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    color: #ffffff !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

    .modern-page-header .header-title-group {
        display: flex;
        align-items: center;
        gap: 16px;
    }

        .modern-page-header .header-title-group .mud-icon-root {
            color: #ffffff !important;
            opacity: 0.9;
        }

    .modern-page-header h4 {
        color: #ffffff !important;
        letter-spacing: -0.02em;
        margin: 0;
    }

/* =========================================================
   CORREÇÃO CIRÚRGICA PARA O SELETOR DE CORES (MODAL LABELS)
========================================================= */

/* Garante o contraste dos textos e itens dentro do dropdown do MudSelect */
.mud-list-item {
    color: #334155 !important; /* Cor cinza-escura para leitura garantida */
}

    /* Destaca o texto das cores ao passar o mouse por cima */
    .mud-list-item:hover {
        background-color: #f1f5f9 !important;
    }

/* Corrige a visibilidade e opacidade das bolinhas/chips dentro da lista */
.mud-select-item .mud-chip-text {
    opacity: 1 !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    padding: 4px 12px !important;
}

/* Se as cores forem exibidas como pequenos círculos/ícones */
.mud-select-item .mud-icon-root {
    opacity: 1 !important;
}

.color-preview-circle {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15), inset 0 1px 2px rgba(255,255,255,0.2);
    flex-shrink: 0;
}

/* =========================================================
   REFINAMENTO COMPONENTES STEPPER DO MUDBLAZOR
========================================================= */
.mud-stepper.modern-stepper {
    background-color: transparent !important;
}

.modern-stepper .mud-step-icon-completed,
.modern-stepper .mud-step-icon-active {
    background-color: var(--modern-primary) !important;
    color: #ffffff !important;
}

.modern-stepper .mud-step-connector-line {
    border-color: var(--modern-primary) !important;
    opacity: 0.3;
}

/* Garante que o botão de texto do rodapé acompanhe a cor primária do tema escolhido */
.mud-button-root.btn-modern-text {
    color: var(--modern-primary) !important;
    font-weight: 600 !important;
    transition: var(--modern-transition) !important;
}

    .mud-button-root.btn-modern-text:hover {
        background-color: rgba(99, 102, 241, 0.05) !important; /* Efeito hover sutil baseado na cor do tema */
    }

    /* Garante que o botão quando desabilitado fique discreto */
    .mud-button-root.btn-modern-text:disabled {
        color: var(--modern-secondary) !important;
        opacity: 0.4 !important;
        background: transparent !important;
    }

mud-step-label mud-step-label-active {
    background-color: var(--modern-primary) !important;
}

/* Corrige o bug do chip selecionado dentro do input do MudSelect */
.mud-input-slot .mud-chip {
    background-color: transparent !important; /* Remove o fundo agressivo que buga no input */
    color: var(--modern-text) !important; /* Força o texto a usar a cor padrão do input do sistema */
    padding: 0 !important;
    height: auto !important;
    box-shadow: none !important;
}

/* Caso o MudBlazor use a estrutura interna de texto padrão no slot */
.mud-input-select .mud-chip-text {
    color: var(--modern-text) !important;
}

