/* assets/style.css */

/* ===== ESCALA GLOBAL DO PORTAL - EQUIVALENTE A ZOOM 80% ===== */
html {
    font-size: 80%; /* Reduz o tamanho base da fonte para simular zoom 80% */
}

body {
    transform: scale(1); /* Mantém scale normal, mas com font-size reduzido */
    transform-origin: top left; /* Ponto de origem do scale */
}

/* Compensações para manter proporções corretas */
.main-container {
    margin-top: 3.1rem; /* 70px * 0.8 = 56px = 5.6rem (com base font-size 80%) */
    min-height: calc(100vh - 3.1rem);
}

.sidebar {
    top: 3.1rem; /* 70px * 0.8 = 56px ajustado para nova escala */
    width: 14rem; /* Mantém proporção */
}

.sidebar.mini {
    width: 3rem; /* Mantém proporção */
}

.content {
    margin-left: 14rem;
    margin-top: 0.5rem;
    padding: 0rem 1rem;
}

.content.mini {
    margin-left: 3rem;
}

.content-no-sidebar {
    margin-top: 3.1rem;
    padding: 1rem 2rem;
}

/* Ajuste da barra de simulação se existir */
.simulation-banner {
    top: 3.1rem; /* Ajustado para nova escala */
    font-size: 1.2rem; /* Ligeiramente maior para compensar a redução global */
}

.simulation-active .content-no-sidebar,
.simulation-active .content {
    padding-top: 0.5rem !important; /* Header (5.6rem) + Banner (~4rem) */
}

/* ===== NOTIFICAÇÕES - ESTILOS PARA MODAL DE VISUALIZAÇÃO ===== */
.notification-card {
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.notification-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.notification-unread {
    border-left-color: #007bff !important;
    background-color: #f8f9ff !important;
}

.notification-title {
    font-size: 1.1em;
}

.notification-message {
    color: #6c757d;
    line-height: 1.4;
}

.notification-actions {
    margin-top: 0.5rem;
}

.notification-actions .btn {
    margin-right: 0.5rem;
    margin-bottom: 0.25rem;
}

@media (max-width: 960px) { /* 768px / 0.8 = 960px para compensar a escala */
    .notification-actions .btn {
        display: block;
        width: 100%;
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
}

.modal-body details {
    margin-top: 1rem;
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background-color: #f8f9fa;
}

.modal-body details summary {
    cursor: pointer;
    user-select: none;
}

.modal-body details summary:hover {
    color: #007bff;
}

.modal-body code {
    font-size: 0.9em;
    word-break: break-all;
}
/* ===== FIM ESTILOS NOTIFICAÇÕES ===== */

/* Estilos para formulários O2 */
.o2-form-container .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.o2-form-container .form-control, .o2-form-container .form-select {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.o2-form-container .form-control:focus, .o2-form-container .form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.o2-form-container .form-text {
    font-size: 0.875rem;
    color: #6c757d;
}

.o2-form-container textarea {
    resize: vertical;
    min-height: 80px;
}

/* Contador de caracteres */
.char-counter {
    font-size: 0.75rem;
    color: #6c757d;
    float: right;
    margin-top: 0.25rem;
}

.char-counter.warning {
    color: #fd7e14;
}

.char-counter.danger {
    color: #dc3545;
}

/* Rich Text Editor Styles */
.rich-editor-container {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.rich-editor-container:focus-within {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.quill-editor {
    min-height: 200px !important;
    height: auto !important;
    background-color: white !important;
}

/* Forçar visibilidade do container Quill */
.ql-container {
    min-height: 150px !important;
    height: auto !important;
    background-color: white !important;
    border: none !important;
    font-family: inherit !important;
    font-size: 14px !important;
}

/* Área editável do Quill */
.ql-editor {
    min-height: 150px !important;
    height: auto !important;
    padding: 12px 15px !important;
    background-color: white !important;
    color: #495057 !important;
    line-height: 1.5 !important;
}

/* Placeholder do Quill */
.ql-editor.ql-blank::before {
    color: #6c757d !important;
    font-style: italic !important;
}

.ql-toolbar {
    border: none !important;
    border-bottom: 1px solid #e9ecef !important;
    border-radius: 0.375rem 0.375rem 0 0;
    background-color: #f8f9fa;
    padding: 0.5rem 0.75rem;
}

.ql-container {
    border: none !important;
    border-radius: 0 0 0.375rem 0.375rem;
    font-size: 14px;
    line-height: 1.5;
}

.ql-editor {
    padding: 0.75rem;
    min-height: 150px;
    max-height: 400px;
    overflow-y: auto;
}

.ql-editor::before {
    color: #6c757d;
    font-style: italic;
}

.ql-toolbar .ql-formats {
    margin-right: 0.75rem;
}

.ql-toolbar .ql-formats:last-child {
    margin-right: 0;
}

.ql-toolbar button {
    padding: 0.25rem;
    margin: 0 0.125rem;
    border-radius: 0.25rem;
    transition: background-color 0.15s ease-in-out;
}

.ql-toolbar button:hover {
    background-color: #e9ecef;
}

.ql-toolbar button.ql-active {
    background-color: #007bff;
    color: white;
}

.ql-color-picker .ql-picker-options {
    border-radius: 0.25rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.ql-tooltip {
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border: 1px solid #dee2e6;
}

.ql-tooltip input {
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.ql-tooltip a.ql-action,
.ql-tooltip a.ql-remove {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.ql-tooltip a.ql-action {
    background-color: #007bff;
    color: white;
}

.ql-tooltip a.ql-remove {
    background-color: #dc3545;
    color: white;
}

/* Rich Editor Character Counter */
.rich-editor-counter {
    font-size: 0.75rem;
    color: #6c757d;
    text-align: right;
    margin-top: 0.25rem;
    padding-right: 0.75rem;
}

.rich-editor-counter.warning {
    color: #fd7e14;
}

.rich-editor-counter.danger {
    color: #dc3545;
}

/* Custom color palette for Quill */
.ql-snow .ql-color .ql-picker-options [data-value="#000000"]::before { background-color: #000000; }
.ql-snow .ql-color .ql-picker-options [data-value="#e60000"]::before { background-color: #e60000; }
.ql-snow .ql-color .ql-picker-options [data-value="#ff9900"]::before { background-color: #ff9900; }
.ql-snow .ql-color .ql-picker-options [data-value="#ffcc00"]::before { background-color: #ffcc00; }
.ql-snow .ql-color .ql-picker-options [data-value="#008a00"]::before { background-color: #008a00; }
.ql-snow .ql-color .ql-picker-options [data-value="#0066cc"]::before { background-color: #0066cc; }
.ql-snow .ql-color .ql-picker-options [data-value="#9933ff"]::before { background-color: #9933ff; }

.ql-snow .ql-background .ql-picker-options [data-value="#000000"]::before { background-color: #000000; }
.ql-snow .ql-background .ql-picker-options [data-value="#e60000"]::before { background-color: #e60000; }
.ql-snow .ql-background .ql-picker-options [data-value="#ff9900"]::before { background-color: #ff9900; }
.ql-snow .ql-background .ql-picker-options [data-value="#ffcc00"]::before { background-color: #ffcc00; }
.ql-snow .ql-background .ql-picker-options [data-value="#008a00"]::before { background-color: #008a00; }
.ql-snow .ql-background .ql-picker-options [data-value="#0066cc"]::before { background-color: #0066cc; }
.ql-snow .ql-background .ql-picker-options [data-value="#9933ff"]::before { background-color: #9933ff; }

/* Modal responsivo */
@media (max-width: 768px) {
    .modal-lg {
        max-width: 95%;
    }
    
    .o2-form-container .row {
        margin: 0;
    }
    
    .o2-form-container .col-md-12 {
        padding: 0 0.5rem;
    }
}

body {
    background-color: #f8f9fa; /* Um fundo cinza claro para a área de conteúdo */
    margin: 0;
    padding: 0;
}

/* Layout principal para manter footer no fundo */
#react-entry-point {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-container {
    flex: 1;
    display: flex;
    min-height: calc(100vh - 60px); /* Altura total menos altura do header */
}

.main-container.simulation-active {
    min-height: calc(100vh - 100px); /* Altura total menos header e banner de simulação */
}

.content, .content-no-sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content > div, .content-no-sidebar > div {
    flex: 1;
}

/* Para páginas sem sidebar */
#page-content {
    min-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
}

#page-content.simulation-active {
    min-height: calc(100vh - 100px);
}

#page-content > div:not(.footer) {
    flex: 1;
}

/* Para divs criadas dinamicamente pelo Dash */
div[id*="dynamic-content"] {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

div[id*="dynamic-content"] > div:not(.footer) {
    flex: 1;
}

/* --- NOTIFICAÇÕES --- */
.notification-card {
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.notification-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.notification-unread {
    border-left: 4px solid #007bff;
    background-color: #f8f9ff;
}

.notification-title {
    color: #495057;
    font-size: 1.1rem;
}

.notification-message {
    color: #6c757d;
    line-height: 1.4;
}

.notification-actions .btn {
    margin-right: 0.5rem;
}

.page-title {
    color: #495057;
    border-bottom: 2px solid #007bff;
    padding-bottom: 0.5rem;
}

/* --- MODAL DE NOTIFICAÇÕES --- */
.notification-btn {
    transition: all 0.2s ease;
}

.notification-btn:hover {
    transform: scale(1.1);
    color: #ffc107 !important;
}

.badge-notification {
    font-size: 0.6rem !important;
    min-width: 16px;
    height: 16px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.translate-middle {
    transform: translate(-60%, -20%) !important;
}

.notification-item {
    display: flex;
    padding: 0.75rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    background-color: #ffffff;
    border: 1px solid #f0f0f0;
}

.notification-item:hover {
    background-color: #f8f9fa;
    transform: translateX(2px);
}

.notification-item-unread {
    background-color: #f8f9ff;
    border-color: #007bff;
}

.notification-item-unread:hover {
    background-color: #e7f3ff;
}

.unread-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #007bff;
    margin-right: 0.75rem;
    margin-top: 0.5rem;
    flex-shrink: 0;
}

.unread-indicator.read {
    background-color: transparent;
}

.notification-content {
    flex-grow: 1;
}

.notification-title {
    font-size: 0.95rem;
    color: #495057;
    margin: 0;
}

.notification-message {
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.4;
    margin: 0;
}

.notification-time {
    font-size: 0.75rem;
    color: #adb5bd;
}

.notification-actions .btn-sm {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* ===== MODAL DE NOTIFICAÇÕES - POSICIONAMENTO FIXO ===== */
#notifications-modal .modal-dialog {
    position: fixed !important;
    top: calc(3.1rem + 10vh) !important; /* Header height + 10% da viewport */
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin: 0 !important;
    max-width: 90vw !important;
    width: 800px !important; /* Largura fixa para consistência */
    z-index: 1055 !important; /* Acima de outros elementos */
}

/* Garantir que o backdrop não interfira */
#notifications-modal .modal-backdrop {
    z-index: 1050 !important;
}

/* Ajustes para diferentes tamanhos de tela */
@media (max-width: 960px) { /* 768px / 0.8 = 960px para compensar a escala */
    #notifications-modal .modal-dialog {
        width: 95vw !important;
        top: calc(3.1rem + 5vh) !important; /* Mais próximo do topo em telas pequenas */
    }
}

@media (max-width: 600px) { /* 480px / 0.8 = 600px para compensar a escala */
    #notifications-modal .modal-dialog {
        width: 98vw !important;
        top: calc(3.1rem + 2vh) !important; /* Ainda mais próximo em telas muito pequenas */
    }
}

.notification-modal-body {
    padding: 1rem;
}

.notification-modal-body .modal-body {
    padding: 0;
}

.btn-filter.active {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.btn-close-custom {
    color: #6c757d;
    border: none;
    background: none;
    font-size: 1.2rem;
    padding: 0.25rem;
}

.btn-close-custom:hover {
    color: #495057;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.alert-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

.notifications-container {
    max-height: 400px;
    overflow-y: auto;
}

.notifications-container::-webkit-scrollbar {
    width: 4px;
}

.notifications-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.notifications-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.notifications-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* --- CABEÇALHO FIXO --- */
.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background-color: #002060;
    border-bottom: 1px solid #dee2e6;
    z-index: 1001;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

.header-brand {
    display: flex;
    align-items: center;
}

.brand-link, .brand-link:hover {
    font-size: 1.5rem;
    font-weight: bold;
    color: #efefef;
    text-decoration: none;
}

.header-user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* --- AVATAR E MENU DO USUÁRIO --- */
.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.user-avatar-img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    border: 0.5px solid #fff;
    box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.15);
}

.user-name {
    color: #bebebe;
    font-weight: 600;
    font-size: 1rem;
}

.user-dropdown {
    position: relative;
}

.user-dropdown .dropdown-toggle {
    display: flex !important;
    align-items: center;
    padding: 0.5rem !important;
    border-radius: 8px;
    transition: all 0.2s;
    text-decoration: none !important;
}

.user-dropdown .dropdown-toggle:hover {
    background-color: rgba(44, 62, 80, 0.1) !important;
}

.user-dropdown .dropdown-toggle::after {
    margin-left: 0.75rem;
    vertical-align: middle;
}

.user-avatar {
    margin-right: 0.5rem !important;
}

/* --- DROPDOWN MENUS DO HEADER --- */
.header-dropdown .dropdown-toggle {
    color: #cccccc !important;
    font-weight: 500;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.header-dropdown .dropdown-toggle:hover {
    background-color: rgba(89, 113, 136, 0.338);
    color: #cccccc !important;
}

.header-dropdown .dropdown-menu {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
}

.user-dropdown .dropdown-menu {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    min-width: 180px;
    right: 0;
    left: auto;
    margin-top: 0.5rem;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    transition: all 0.2s;
    color: #495057;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #2C3E50;
}

.dropdown-item:focus {
    background-color: #f8f9fa;
    color: #2C3E50;
}

/* --- ESTILOS MODERNOS PARA O DASHBOARD --- */

.dashboard-title {
    color: #2C3E50;
    font-weight: 700;
    font-size: 1.8rem;
}

.dashboard-subtitle {
    font-size: 1rem;
    margin-bottom: 0;
}

.section-title {
    color: #2C3E50;
    font-weight: 600;
    border-bottom: 3px solid rgb(120, 114, 184);
    display: inline-block;
    padding-bottom: 0.5rem;
}

/* Cards dos KPIs */
.kpi-card {
    border: none;
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

/* Cards compactos dos KPIs */
.kpi-card-compact {
    border: none;
    border-radius: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    min-height: 120px;
}

.kpi-card-compact:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12) !important;
}

.kpi-card-compact .card-body {
    padding: 0.75rem !important;
}

.kpi-card-compact .card-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #6c757d;
}

.kpi-card-compact .card-text {
    font-size: 1.2rem;
    font-weight: 700;
    cursor: help;
}

/* Cards dos gráficos */
.chart-card {
    border: none;
    border-radius: 12px;
    transition: box-shadow 0.2s;
}

.chart-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
}

/* Filtros */
.filter-card {
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
}

.filter-header {
    background: linear-gradient(135deg, rgb(120, 114, 184) 0%, #667eea 100%);
    color: white;
    font-weight: 600;
    border-radius: 12px 12px 0 0 !important;
}

.modern-dropdown .Select__control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.2s;
}

.modern-dropdown .Select__control:hover {
    border-color: rgb(120, 114, 184);
}

.modern-dropdown .Select__control--is-focused {
    border-color: rgb(120, 114, 184);
    box-shadow: 0 0 0 0.2rem rgba(120, 114, 184, 0.25);
}

/* Loading personalizado */
#loading-dashboard .dash-spinner {
    border-top-color: rgb(120, 114, 184) !important;
}

/* Responsividade aprimorada - ajustada para escala 80% */
@media (max-width: 960px) { /* 768px / 0.8 = 960px para compensar a escala */
    .dashboard-title {
        font-size: 1.875rem; /* 1.5rem / 0.8 = 1.875rem para manter proporção visual */
    }

    .kpi-card, .kpi-card-compact {
        margin-bottom: 1rem;
    }

    .kpi-card-compact {
        min-height: 125px; /* 100px / 0.8 = 125px */
    }

    .kpi-card-compact .card-text {
        font-size: 1.375rem; /* 1.1rem / 0.8 = 1.375rem */
    }

    .section-title {
        font-size: 1.625rem; /* 1.3rem / 0.8 = 1.625rem */
    }
}

/* Animações suaves */
.chart-card, .kpi-card, .kpi-card-compact, .filter-card {
    animation: fadeIn 0.5s ease-in-out;
}

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

.sidebar-toggle-btn {
    background-color: transparent !important;
    border: 1px solid #2C3E50 !important;
    color: #2C3E50 !important;
}

.sidebar-toggle-btn:hover {
    background-color: #2C3E50 !important;
    color: white !important;
}

/* --- CONTAINER PRINCIPAL --- */
.main-container {
    /* Valores já redefinidos na seção de escala global acima */
    display: flex;
}

/* Títulos das páginas - garantir espaçamento do header */
.content h1:first-child,
.content-no-sidebar h1:first-child,
.content h2:first-child,
.content-no-sidebar h2:first-child {
    margin-top: 0.5rem !important; /* Espaçamento mínimo para não ficar colado */
}

/* Containers do DBC dentro do conteúdo também precisam do espaçamento */
.content .container:first-child h1:first-child,
.content-no-sidebar .container:first-child h1:first-child,
.content .container:first-child h2:first-child,
.content-no-sidebar .container:first-child h2:first-child {
    margin-top: 0.5rem !important; /* Reduz o espaço */
    padding-top: 0.25rem !important; /* Padding mínimo */
}


/* --- CABEÇALHO DA SIDEBAR --- */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.sidebar-toggle-icon {
    color: #BDC3C7;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 1.1rem;
}

.sidebar-toggle-icon:hover {
    background-color: #34495E;
    color: white;
}

/* No modo mini, centraliza o ícone toggle */
.sidebar.mini .sidebar-header {
    justify-content: center;
    margin-bottom: 1rem;
}

.sidebar.mini .sidebar-toggle-icon {
    margin: 0;
}

/* --- ESTRUTURA PRINCIPAL COM SIDEBAR --- */
.sidebar {
    /* Valores de posicionamento já redefinidos na seção de escala global acima */
    position: fixed;
    left: 0;
    bottom: 0;
    padding: 0.5rem;
    background-color: #003d7bb5; /* #2C3E50; /* Cor escura do tema */
    transition: all 0.3s;
    z-index: 1000;
    overflow-x: hidden;
}

/* Mini sidebar - apenas ícones */
.sidebar.mini {
    /* Largura já redefinida na seção de escala global acima */
    padding: 1rem 0.5rem;
}

.sidebar.mini .sidebar-title,
.sidebar.mini .sidebar-divider {
    display: none;
}

.sidebar.mini .sidebar-text {
    display: none;
}

.sidebar.mini .sidebar-nav-link {
    text-align: center;
    padding: 0.75rem 0.5rem !important;
    margin: 0.25rem 0;
    border-radius: 8px !important;
}

.sidebar.mini .sidebar-icon {
    margin: 0 !important;
    font-size: 1.2rem;
}

/* Estados do conteúdo */
.content {
    /* Valores de margem e posicionamento já redefinidos na seção de escala global acima */
    transition: all 0.3s;
    flex: 1;
}

.content.mini {
    /* Margem já redefinida na seção de escala global acima */
}

/* Conteúdo sem sidebar */
.content-no-sidebar {
    /* Valores de margem e posicionamento já redefinidos na seção de escala global acima */
    margin-left: 0;
    flex: 1;
    transition: all 0.3s;
}

/* Estilos dos links da sidebar */
.sidebar-nav-link {
    color: #BDC3C7 !important;
    margin-bottom: 0.25rem;
    border-radius: 8px !important;
    padding: 0.75rem !important;
    transition: all 0.2s;
}

.sidebar-nav-link:hover {
    background-color: #34495E !important;
    color: white !important;
}

.sidebar-nav-link.active {
    background-color: rgb(120, 114, 184) !important;
    color: white !important;
}

.sidebar-icon {
    margin-right: 0.75rem;
    width: 1.2rem;
    text-align: center;
}

.sidebar-text {
    transition: all 0.3s;
}

/* Tooltips para mini sidebar */
.sidebar.mini .sidebar-nav-item {
    position: relative;
}

.sidebar.mini .sidebar-nav-item:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background-color: #2C3E50;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 1003;
    margin-left: 10px;
    font-size: 0.875rem;
    border: 1px solid #34495E;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sidebar.mini .sidebar-nav-item:hover::before {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: #2C3E50;
    z-index: 1003;
    margin-left: 5px;
}

/* --- ESTILOS DE NAVEGAÇÃO --- */

.nav-link, .nav-link:hover {
    color: #495057;
    text-decoration: none;
    font-weight: 500;
}

.logout-button, .logout-button:hover {
    color: #e74c3c;
    text-decoration: none;
    font-weight: bold;
}

/* --- RODAPÉ --- */
.footer {
    padding: 1.0rem 0;
    background-color: white; /* Mesmo fundo do header para consistência */
    border-top: 1px solid #dee2e6;
    margin-top: auto; /* Empurra o footer para baixo */
    flex-shrink: 0; /* Impede que o footer encolha */
}

/* TELA DE LOGIN */
.welcome-container {
    padding: 2rem;
}

/* --- NOVO ESTILO (MAIS FORTE) PARA CONTROLAR A ALTURA DOS FILTROS --- */

/* Alvo: O container principal do componente Dropdown */
.multi-select-dropdown .Select__control {
    min-height: 38px !important; /* Garante uma altura mínima */
}

/* Alvo: O container interno onde os itens selecionados ("pills") aparecem */
.multi-select-dropdown .Select__value-container--is-multi {
    /* Esta é a regra mais importante */
    max-height: 34px; /* Define a altura máxima para os itens */
    overflow-y: auto !important; /* Adiciona a barra de rolagem e força a aplicação do estilo */
}

/* --- BOTÕES DE AÇÃO MODERNOS PARA TABELAS --- */

.btn-action {
    border: none;
    background: none;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    margin: 0 auto;
}

/* Centralizar botões de ação nas células da tabela */
td .btn-action {
    display: block;
    margin: 0 auto;
}

.btn-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Botão Editar - Azul */
.edit-button {
    color: #007bff;
    background-color: rgba(0, 123, 255, 0.1);
}

.edit-button:hover {
    background-color: rgba(0, 123, 255, 0.2);
    color: #0056b3;
}

/* Botão Excluir/Inativar - Vermelho */
.delete-button {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

.delete-button:hover {
    background-color: rgba(220, 53, 69, 0.2);
    color: #c82333;
}

/* Botão Reativar - Verde */
.success-button {
    color: #28a745;
    background-color: rgba(40, 167, 69, 0.1);
}

.success-button:hover {
    background-color: rgba(40, 167, 69, 0.2);
    color: #1e7e34;
}

/* Ícones de visualização */
.text-muted i {
    font-size: 14px;
    padding: 6px;
}

/* Dropdown de 3 pontos para ações das tabelas */
.actions-dropdown {
    position: relative;
    display: inline-block;
}

.dots-menu {
    background: none;
    border: none;
    font-size: 18px;
    color: #6c757d;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.dots-menu:hover {
    background-color: #f8f9fa;
    color: #495057;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    min-width: 120px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.dropdown-content a {
    color: #495057;
    padding: 8px 12px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.dropdown-content a:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

.dropdown-content a.danger:hover {
    background-color: #f8d7da;
    color: #721c24;
}

.actions-dropdown:hover .dropdown-content {
    display: block;
}

.actions-dropdown .dropdown-content {
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- ESTILOS PARA SISTEMA DE SIMULAÇÃO --- */

/* Banner de simulação no topo da página */
.simulation-banner {
    /* Valores de posicionamento e tamanho já redefinidos na seção de escala global acima */
    position: fixed;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
    padding: 0.75rem 2rem;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    animation: pulse-simulation 2s infinite;
}

.simulation-banner a {
    color: #fff !important;
    text-decoration: underline !important;
    font-weight: bold;
}

.simulation-banner a:hover {
    color: #f8f9fa !important;
}

/* Animação de pulso para chamar atenção */
@keyframes pulse-simulation {
    0% {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 0 2px 15px rgba(231, 76, 60, 0.4);
    }
    100% {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
}

/* Avatar do usuário em modo simulação */
.simulation-avatar {
    background: linear-gradient(45deg, #ffc107, #f39c12) !important;
    border: 2px solid #e67e22 !important;
    animation: glow-simulation 2s infinite alternate;
}

.user-avatar-img.simulation-avatar {
    border: 2px solid #e67e22 !important;
    animation: glow-simulation 2s infinite alternate;
    filter: sepia(0.3) saturate(1.5) hue-rotate(15deg);
}

@keyframes glow-simulation {
    from {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
    to {
        box-shadow: 0 2px 15px rgba(255, 193, 7, 0.6);
    }
}

/* Nome do usuário em simulação */
.simulation-name {
    color: #ffc107 !important;
    font-weight: 700 !important;
}

/* Ajustar o padding do conteúdo quando banner de simulação estiver ativo */
.simulation-active .content-no-sidebar,
.simulation-active .content {
    /* Valores já redefinidos na seção de escala global acima */
}

/* === POPOVERS CUSTOMIZADOS DOS INDICADORES O2 === */
.tooltip-indicador-o2.popover {
    max-width: 400px !important;
    min-width: 280px !important;
    width: max-content !important;
    z-index: 9999 !important;
    border: 1px solid #fbbf24 !important;
    border-radius: 10px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
    font-family: inherit !important;
    padding: 5px !important;
}

.tooltip-indicador-o2 .popover-body {
    padding: 15px 18px !important;
    background-color: #fefce8 !important; /* Amarelo bem clarinho */
    color: #374151 !important;
    border-radius: 8px !important;
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
    white-space: normal !important;
    word-wrap: break-word !important;
}

.tooltip-indicador-o2.bs-popover-top .popover-arrow::before {
    border-top-color: #fbbf24 !important;
}

.tooltip-indicador-o2.bs-popover-bottom .popover-arrow::before {
    border-bottom-color: #fbbf24 !important;
}

.tooltip-indicador-o2.bs-popover-left .popover-arrow::before {
    border-left-color: #fbbf24 !important;
}

.tooltip-indicador-o2.bs-popover-right .popover-arrow::before {
    border-right-color: #fbbf24 !important;
}

.tooltip-indicador-o2.bs-popover-top .popover-arrow::after {
    border-top-color: #fefce8 !important;
}

.tooltip-indicador-o2.bs-popover-bottom .popover-arrow::after {
    border-bottom-color: #fefce8 !important;
}

.tooltip-indicador-o2.bs-popover-left .popover-arrow::after {
    border-left-color: #fefce8 !important;
}

.tooltip-indicador-o2.bs-popover-right .popover-arrow::after {
    border-right-color: #fefce8 !important;
}

/* Específicos para cards de indicadores */
#card-circulos-principais,
#card-subcirculos,
#card-papeis-energizados,
#card-papeis-nao-energizados,
#card-restricoes,
#card-colaboradores {
    cursor: help !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

#card-circulos-principais:hover,
#card-subcirculos:hover,
#card-papeis-energizados:hover,
#card-papeis-nao-energizados:hover,
#card-restricoes:hover,
#card-colaboradores:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

/* Botão de simulação na admin */
.btn-warning.btn-sm {
    font-size: 0.775rem;
    padding: 0.25rem 0.5rem;
}

/* Estilo especial para indicar que algo é relacionado à simulação */
.simulation-indicator {
    color: #ffc107;
    font-weight: bold;
}

/* ===== MÓDULO DE DOCUMENTOS ===== */

/* Botões de ação nas tabelas de documentos */
.btn-edit, .btn-delete, .btn-edit-cat {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem 0.5rem;
    transition: transform 0.2s ease;
}

.btn-edit:hover, .btn-edit-cat:hover {
    transform: scale(1.2);
}

.btn-delete:hover {
    transform: scale(1.2);
}

/* Upload area hover effect */
.dash-upload:hover {
    border-color: #0d6efd !important;
    background-color: #f8f9fa;
}

/* Estilos para área de upload de documentos */
#upload-documento {
    transition: all 0.3s ease;
    overflow: hidden;
}

#upload-documento:hover {
    border-color: #0d6efd !important;
    background-color: #f0f8ff;
}

/* Prevenir overflow no modal */
#div-upload-area {
    overflow: hidden;
    max-height: 150px;
}

.modal-body {
    overflow-y: auto;
    max-height: 70vh;
}

/* Modal de upload de documentos - permitir scroll adequado */
#modal-upload-doc .modal-body {
    overflow-y: auto;
    max-height: 75vh;
    padding: 1.5rem;
}

#modal-upload-doc .modal-dialog {
    max-width: 900px;
}

/* Alertas acima do modal */
#alert-doc-admin-status,
#alert-doc-admin-error {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999 !important;
    min-width: 400px;
    max-width: 600px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Modal backdrop z-index (dash bootstrap padrão é 1050) */
.modal-backdrop {
    z-index: 1040 !important;
}

.modal {
    z-index: 1050 !important;
}

/* Cards de métricas do módulo de documentos */
.card .fa-file-pdf,
.card .fa-eye,
.card .fa-users,
.card .fa-clock {
    display: block;
    margin: 0 auto 0.5rem;
}

/* Tabela de documentos - responsividade */
@media (max-width: 768px) {
    .tabela-documentos {
        font-size: 0.85rem;
    }
}

/* Cards de documentos - página pública */
.hover-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2) !important;
}

.hover-card .card-header {
    padding: 1.5rem 1rem;
}

.hover-card .fa-2x {
    display: block;
    margin: 0 auto;
}

/* Badge de proteção de documentos */
.badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.6rem;
}

/* ===== PROTEÇÃO DE DOCUMENTOS - APENAS LEITURA ===== */

/* Desabilita seleção de texto e interações no iframe e seu conteúdo */
.doc-protected,
.doc-protected * {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important; /* Desabilita seleção em iOS */
}

/* Desabilita seleção mas permite scroll em documentos protegidos */
#pdf-viewer-frame.doc-protected {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* Container do visualizador de PDF */
.pdf-viewer-container {
    position: relative;
    width: 100%;
    overflow-y: auto !important; /* Permite scroll no container */
}

/* Overlay de proteção - controlado dinamicamente por JavaScript */
.protection-overlay-layer {
    pointer-events: none; /* Inicialmente transparente, JS ativa quando necessário */
    cursor: not-allowed;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* Desabilitar seleção apenas no container do documento, não no body inteiro */
.doc-viewer-container {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* Esconder controles de impressão do PDF viewer nativo */
#pdf-viewer-frame.doc-protected::-webkit-media-controls,
#pdf-viewer-frame.doc-protected::-webkit-media-controls-enclosure {
    display: none !important;
}

/* Container do documento viewer */
.doc-viewer-container {
    position: relative;
}

/* Mensagem de proteção */
.doc-viewer-container .text-center.mt-3 {
    font-style: italic;
    color: #6c757d;
}

/* ===== VISUALIZADOR EM SLIDES - PROTEÇÃO DE IMAGENS ===== */

/* Proteção de imagens de documentos */
.doc-protected-image {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-user-drag: none !important;
    -khtml-user-drag: none !important;
    -moz-user-drag: none !important;
    -o-user-drag: none !important;
    user-drag: none !important;
    pointer-events: none !important;
}

/* Container do visualizador em slide */
#slide-viewer-container {
    padding: 1rem 0;
}

/* Botões de navegação */
#slide-viewer-container .btn-group {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Contador de páginas */
#page-counter {
    font-weight: 500;
    font-size: 1rem;
    color: #495057;
    margin-left: 1rem;
}

/* Área da imagem com sombra */
#slide-viewer-container .text-center {
    background-color: #f8f9fa;
    padding: 2rem 1rem;
    border-radius: 8px;
}

/* Animação suave ao trocar de página */
#page-image {
    transition: opacity 0.2s ease-in-out;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Desabilitar seleção em todo o container de slides */
#slide-viewer-container * {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}


/* ==================================================
   CARDS DE DOCUMENTOS - VERSÃO COMPACTA
   ================================================== */

.doc-card-compact {
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.doc-card-compact:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15) !important;
}

/* V2 - Cards mais compactos */
.doc-card-compact-v2 {
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    height: 100%;
}

.doc-card-compact-v2:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15) !important;
}

.doc-card-icon-corner {
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 0.3;
    font-size: 1.2rem;
}

.doc-card-icon-corner-left {
    position: absolute;
    top: 8px;
    left: 8px;
    opacity: 0.3;
    font-size: 1rem;
}

.doc-card-version {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 0.7rem;
    padding: 2px 8px;
    background: rgba(255,255,255,0.9);
    border-radius: 10px;
    font-weight: 600;
}

.doc-card-protection-badge {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}

.doc-card-protection-badge.danger {
    background-color: #dc3545;
}

.doc-card-protection-badge.warning {
    background-color: #ffc107;
}

.doc-card-protection-badge.success {
    background-color: #28a745;
}

/* Bolinha de proteção no canto superior direito */
.doc-card-protection-badge-corner {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    opacity: 0.45;
}

.doc-card-protection-badge-corner.danger {
    background-color: #dc3545;
}

.doc-card-protection-badge-corner.warning {
    background-color: #ffc107;
}

.doc-card-protection-badge-corner.success {
    background-color: #28a745;
}

.doc-card-compact .card-body {
    padding: 1rem;
}

.doc-card-compact .card-footer {
    padding: 0.5rem;
}

/* ===== PROTEÇÃO DE IMPRESSÃO PARA DOCUMENTOS ===== */

/* Bloquear impressão de documentos protegidos */
@media print {
    /* Esconder todo o conteúdo do visualizador de documentos */
    .doc-viewer-container,
    .doc-viewer-content,
    #slide-viewer-container,
    .doc-protected-image,
    #pdf-iframe-viewer,
    iframe[src*="/api/serve-documento/"],
    iframe[src*="/api/documento-pagina/"] {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }

    /* Mostrar mensagem de bloqueio ao tentar imprimir */
    body::before {
        content: "🔒 IMPRESSÃO BLOQUEADA" !important;
        display: block !important;
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        font-size: 48px !important;
        font-weight: bold !important;
        color: #dc3545 !important;
        text-align: center !important;
        z-index: 99999 !important;
        width: 100% !important;
    }

    body::after {
        content: "Este documento não pode ser impresso. A impressão está desabilitada por medidas de segurança." !important;
        display: block !important;
        position: fixed !important;
        top: 60% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        font-size: 24px !important;
        color: #6c757d !important;
        text-align: center !important;
        z-index: 99999 !important;
        width: 80% !important;
        max-width: 600px !important;
    }

    /* Forçar fundo branco na página de impressão */
    body {
        background-color: white !important;
    }

    /* Esconder todos os outros elementos */
    * {
        display: none !important;
    }

    /* Apenas os pseudo-elementos ::before e ::after ficam visíveis */
    body::before,
    body::after {
        display: block !important;
    }
}

/* Proteção adicional: desabilitar user-select em imagens de documentos */
.doc-protected-image {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    pointer-events: none !important;
    -webkit-touch-callout: none !important;
}

/* Proteção contra drag and drop de imagens */
.doc-protected-image {
    -webkit-user-drag: none !important;
    -khtml-user-drag: none !important;
    -moz-user-drag: none !important;
    -o-user-drag: none !important;
    user-drag: none !important;
}

/* Desabilitar seleção de texto em toda área do visualizador protegido */
#slide-viewer-container {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

/* ===== FIM PROTEÇÃO DE DOCUMENTOS ===== */

