/* ==========================================
   1. CONFIGURAÇÕES GERAIS E RESETS
   ========================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    /* background-color: #f4f6f9; */
    background-color: #0b1f3a;
    color: #333333;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 0;
    margin: 0;
    position: relative;
    min-height: 100vh;
}

/* Marca de d'água / Imagem de Fundo Suave */
body::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 450px;
    height: 450px;
    background-image: url('/img/wpp-image.png?v=2');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.3;
    z-index: -1;
    pointer-events: none;
}

/* Marca d'água maior e mais abaixo apenas para Login e Cadastro */
body.auth-body::before {
    width: 600px !important;
    height: 600px !important;
    top: 60% !important; /* Aumenta este valor para descer a imagem (ex: 55%, 60%, 65%) */
    opacity: 0.15;
}

/* Content Container */
.container {
    padding: 10px 30px;
    max-width: 1350px;
    margin: 0 auto;
}

/* TÍTULOS PRINCIPAIS (H2) */
h2 {
    color: #BDA470; /* Altera para a cor pretendida */
}


/* ==========================================
   2. FAIXA SUPERIOR AZUL (TOP NAVBAR)
   ========================================== */
.top-navbar {
    background-color: #0b1f3a; /* Azul escuro oficial */
    color: #ffffff;
    display: grid;
    grid-template-columns: 1fr auto 1fr; /* 3 Colunas: Esquerda, Centro e Direita */
    align-items: center;
    padding: 0px 30px;
    height: 100px;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 1000;
}

/* Esquerda: Logo Polícia Penal + Título */
.brand-title {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-start;
}

.brand-title span {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
    color: #BDA470;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.header-logo {
    height: 46px;
    width: auto;
    object-fit: contain;
}

/* Centro: Sigla em Cima (Maior) e Nome Completo em Baixo */
.header-center-unit {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.unit-sigla {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
    color: #BDA470;
    margin: 0;
    line-height: 1.1;
    letter-spacing: 1px;
}

.unit-nome {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: #BDA470;
    margin: 4px 0 0 0;
    letter-spacing: 0.5px;
    white-space: nowrap;
}



/* Direita: Perfil do Usuário + Logo do Presídio */
.header-right-logo {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
}

.header-logo-presidio {
    height: 80px;
    width: auto;
    object-fit: contain;
    border-radius: 50%;
}

.user-info-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 15px;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.user-details {
    display: flex !important;
    flex-direction: column !important; 
    text-align: right !important;
}

.user-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.80rem;
    font-weight: 700;
    color: #BDA470;
    line-height: 1.2;
    white-space: nowrap;
    display: block !important;
}

.user-role {
    font-size: 0.70rem;
    font-weight: 600;
    color: #64b5f6 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
    display: block !important;
    white-space: nowrap;
}

.btn-logout {
    background: rgba(220, 53, 69, 0.2) !important;
    border: 1px solid rgba(220, 53, 69, 0.5) !important;
    color: #ff6b6b !important;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: #dc3545 !important;
    color: #ffffff !important;
    border-color: #dc3545 !important;
}

/* ==========================================
   3. MENU LATERAL (SIDEBAR)
   ========================================== */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background-color: #0b1f3a;
    color: #ffffff;
    z-index: 1100;
    transition: left 0.3s ease;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
}

.sidebar.open {
    left: 0;
}

.sidebar-header {
    padding: 20px;
    background-color: #0b1f3a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
}

.sidebar-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-close-sidebar {
    font-size: 1.5rem;
    cursor: pointer;
    color: #aaa;
}

.btn-close-sidebar:hover {
    color: #fff;
}

.sidebar-menu ul {
    list-style: none;
    padding: 0;
}

.sidebar-menu .menu-category {
    padding: 15px 20px 5px 20px;
    font-size: 0.72rem;
    font-weight: bold;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.sidebar-menu li {
    background: transparent;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: #BDA470;
    background-color: transparent;
    text-decoration: none;
    font-size: 0.88rem;
    transition: background 0.2s, color 0.2s;
}

.sidebar-menu li a:hover,
.sidebar-menu li.active > a {
    background-color: rgba(14, 70, 143, 0.486) !important;
    color: #ffffff !important;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

/* ==========================================
   4. CABEÇALHOS E AÇÕES DA PÁGINA
   ========================================== */
.header-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header-title-container {
    display: flex;
    align-items: center;
    gap: 15px;
}


.btn-sandwich {
    order: -1 !important; /* Força o botão a ser o primeiro elemento da esquerda */
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute !important;
    left: 40px !important;    /* Distância da margem esquerda */
    top: 120px !important;   /* Aumentado para descer e alinhar com o título */
    z-index: 10 !important;
    background: transparent !important;
    border: none !important;
}

/* ==========================================
   5. TABELAS E CARTÕES
   ========================================== */
.card-table {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table th {
    background-color: #f8f9fa;
    color: #495057;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 12px 15px;
    border-bottom: 2px solid #dee2e6;
}

.table td {
    padding: 12px 15px;
    font-size: 0.88rem;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: #f1f5f9;
}

.text-center {
    text-align: center;
}

/* ==========================================
   6. BADGES DE STATUS
   ========================================== */
.badge-status, .badge-estado {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
}

.badge-status.status-disponivel { background-color: #00a8ff; }
.badge-estado.estado-ativo { background-color: #198754; }
.badge-estado.estado-inativo { background-color: #dc3545; }

/* ==========================================
   7. BOTÕES E COMPONENTES
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s;
}

.btn:hover { opacity: 0.9; }
.btn-primary { background-color: #0066ff; color: #fff; }
.btn-secondary { background-color: #6c757d; color: #fff; }
.btn-success { background-color: #198754; color: #fff; }
.btn-info { background-color: #0dcaf0; color: #000; }
.btn-warning { background-color: #ffc107; color: #000; }
.btn-danger { background-color: #dc3545; color: #fff; }

.acoes-container {
    display: flex;
    justify-content: center;
    gap: 5px;
}

/* ==========================================
   8. MODAIS (POP-UPS)
   ========================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1200;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #ffffff;
    padding: 24px;
    border-radius: 8px;
    width: 90%;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 4px;
    color: #333;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.85rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ==========================================
   MODAL DE CONFIRMAÇÃO DE LOGOUT
   ========================================== */
.modal-logout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(11, 31, 58, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-logout-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-logout-card {
    background: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    padding: 28px 24px 20px 24px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid #e2e8f0;
    transform: translateY(-20px);
    transition: transform 0.25s ease;
}

.modal-logout-overlay.active .modal-logout-card {
    transform: translateY(0);
}

.modal-logout-icon {
    width: 56px;
    height: 56px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
    color: #dc3545;
    font-size: 1.8rem;
}

.modal-logout-card h4 {
    font-family: 'Montserrat', sans-serif;
    color: #0b1f3a;
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0 0 8px 0;
}

.modal-logout-card p {
    color: #64748b;
    font-size: 0.88rem;
    margin: 0 0 24px 0;
}

.modal-logout-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-logout-actions .btn {
    flex: 1;
    justify-content: center;
    padding: 10px 16px;
    font-size: 0.88rem;
}

/* ==========================================
   MODAL DE ALERTA DE CADASTRO
   ========================================== */
.modal-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(11, 31, 58, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-alert-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-alert-card {
    background: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    padding: 28px 24px 20px 24px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid #e2e8f0;
    transform: translateY(-20px);
    transition: transform 0.25s ease;
}

.modal-alert-overlay.active .modal-alert-card {
    transform: translateY(0);
}

.modal-alert-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
    font-size: 1.8rem;
}

.modal-alert-icon.sucesso {
    background: rgba(25, 135, 84, 0.1);
    color: #198754;
}

.modal-alert-icon.erro {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.modal-alert-card h4 {
    font-family: 'Montserrat', sans-serif;
    color: #0b1f3a;
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0 0 8px 0;
}

.modal-alert-card p {
    color: #64748b;
    font-size: 0.88rem;
    margin: 0 0 24px 0;
}

/* ==========================================
   MÓDULO DE GESTÃO DE TAREFAS
   ========================================== */

/* Badges de Prioridade */
.badge-prioridade { 
    padding: 4px 10px; 
    border-radius: 12px; 
    font-weight: bold; 
    font-size: 0.75rem; 
    text-transform: uppercase; 
}
.prioridade-urgente { background: #dc3545; color: white; }
.prioridade-alta { background: #fd7e14; color: white; }
.prioridade-media { background: #ffc107; color: #212529; }
.prioridade-baixa { background: #0d6efd; color: white; }

/* Badges de Status */
.badge-status { 
    padding: 4px 10px; 
    border-radius: 12px; 
    font-weight: bold; 
    font-size: 0.75rem; 
}
.status-afazer { background: #e2e8f0; color: #475569; }
.status-emandamento { background: #cff4fc; color: #055160; }
.status-concluida { background: #d1e7dd; color: #0f5132; }

/* Alerta de Atraso na Tabela */
.linha-atrasada { background-color: rgba(220, 53, 69, 0.08) !important; }

/* Sininho Flutuante de Notificações (Canto Inferior Esquerdo) */
.notification-bell-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 999;
}

.btn-bell-floating {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: #0b1f3a;
    color: #ffffff;
    border: 2px solid #ffc107;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease, background 0.2s ease;
}

.btn-bell-floating:hover {
    transform: scale(1.08);
    background: #162f52;
}

.bell-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #dc3545;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 10px;
    padding: 2px 7px;
    border: 2px solid #ffffff;
    animation: pulse-bell 2s infinite;
}

@keyframes pulse-bell {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* Popup de Alertas do Sininho */
.bell-popup-card {
    position: absolute;
    bottom: 68px;
    right: 0;
    width: 320px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    border: 1px solid #cbd5e1;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: fadeIn 0.2s ease-in-out;
}

.bell-popup-card.active { display: flex; }

.bell-popup-header {
    background: #0b1f3a;
    color: white;
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bell-popup-body {
    max-height: 280px;
    overflow-y: auto;
    padding: 10px;
}

.bell-item-alert {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.82rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bell-item-alert:last-child { border-bottom: none; }
.bell-item-alert .title { font-weight: bold; color: #0b1f3a; }
.bell-item-alert .sub { color: #64748b; font-size: 0.75rem; }

/* ESTILO DOS CARDS KPI (FUNDO BRANCO COM BORDA ARREDONDADA E SOMBRA) */
.card-dash-kpi {
    background: #ffffff;
    border-radius: 10px;
    padding: 16px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-dash-kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ==========================================
   COR DAS LETRAS NA TABELA DE TAREFAS
   ========================================== */

/* Força o texto do cabeçalho da tabela a ser visível */
table thead tr th {
    color: #475569 !important;
    font-weight: 700 !important;
}

/* Força a cor BRANCA em todas as letras das tarefas cadastradas */
#tabela-tarefas-body,
#tabela-tarefas-body tr,
#tabela-tarefas-body td {
    color: #000000 !important;
}

/* Se houver elementos de texto/links/spans dentro das células */
#tabela-tarefas-body td * {
    color: #ffffff !important;
}

/* Mantém os menus de seleção (dropdowns) de Status legíveis com fundo claro */
#tabela-tarefas-body select {
    color: #000000 !important;
    background-color: #ffffff !important;
}

#tabela-tarefas-body .bi-trash,
#tabela-tarefas-body .bi-trash-fill {
    color: #dc3545 !important;
}


/* RESPONSIVIDADE */
/* RESPONSIVIDADE */
/* RESPONSIVIDADE */
/* RESPONSIVIDADE */

/* ==========================================
   REGRA GERAL E AJUSTES RESPONSIVOS (MOBILE)
   ========================================== */

/* Ajustes para ecrãs até 992px (Tablets e ecras médios) */
@media (max-width: 992px) {
    .container {
        padding: 10px 15px;
    }

    /* Top Navbar passa para coluna ou grelha adaptável */
    .top-navbar {
        height: auto;
        padding: 15px;
        grid-template-columns: 1fr;
        gap: 12px;
        text-align: center;
    }

    .brand-title {
        justify-content: center;
    }

    .header-center-unit {
        order: 1;
    }

    .header-right-logo {
        justify-content: center;
        order: 2;
    }

    .unit-nome {
        white-space: normal;
        text-align: center;
    }

    /* Ajuste de Grelhas de Indicadores/Cards */
    .cards-dashboard, 
    .grid-indicadores, 
    .cards-summary, 
    .cards-req {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }

    .grid-graficos,
    .grid-estoque-colunas {
        grid-template-columns: 1fr !important;
    }
}

/* Ajustes para ecrãs até 768px (Smartphones na vertical) */
@media (max-width: 768px) {
    /* Botão Sanduíche Reposicionado */
    .btn-sandwich {
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        margin-bottom: 15px;
    }

    .header-action {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header-action > div {
        width: 100%;
        flex-direction: column;
        align-items: stretch !important;
    }

    /* Formulários e Filtros em linha passam a pilha vertical */
    .filters-bar,
    .search-container,
    div[style*="display: flex; gap"] {
        flex-direction: column;
        align-items: stretch !important;
    }

    .filters-bar input, 
    .filters-bar select,
    .search-container input, 
    .search-container select {
        width: 100% !important;
    }

    /* Cartões e Indicadores a 1 coluna no telemóvel */
    .cards-dashboard, 
    .grid-indicadores, 
    .cards-summary, 
    .cards-req {
        grid-template-columns: 1fr !important;
    }

    /* Torna todas as tabelas com rolagem horizontal interna suave */
    .card-table {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 600px; /* Garante que a tabela não esmague e permita scroll */
    }

    /* Modais adaptadas para ecrãs pequenos */
    .modal-content,
    .modal-logout-card,
    .modal-alert-card {
        width: 95% !important;
        max-width: 100% !important;
        padding: 16px !important;
        margin: 10px auto;
    }

    /* Ajustes na Barra do Utilizador */
    .user-info-bar {
        border-right: none;
        padding-right: 0;
    }

    /* Ajustes na Sidebar */
    .sidebar {
        width: 250px;
    }
}

/* AJUSTE EXCLUSIVO PARA TELEMÓVEIS (Até 768px) */
@media (max-width: 768px) {
    /* Reposiciona o sininho no telemóvel para não ficar em cima dos botões da tabela */
    .notification-bell-container {
        bottom: 12px !important;
        right: 12px !important;
    }

    .btn-bell-floating {
        width: 44px !important;
        height: 44px !important;
        font-size: 1.2rem !important;
    }

    /* Adiciona uma folga no fundo da página no telemóvel para poder rolar até ao fim sem tapar nada */
    .container {
        padding-bottom: 70px !important;
    }
}
/* Adicione estas regras no css/style.css para ajustar o layout da página de internos */

.search-container { 
  display: flex; 
  gap: 10px; 
  margin-bottom: 20px; 
  background: #fff; 
  padding: 12px; 
  border-radius: 8px; 
  border: 1px solid #e0e0e0; 
}

.search-container input, 
.search-container select { 
  padding: 8px 12px; 
  border: 1px solid #ccc; 
  border-radius: 4px; 
  font-size: 0.9rem; 
}

.cards-summary {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.card-sum-item {
  background: #fff;
  border-radius: 8px;
  padding: 15px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.card-sum-item h5 {
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.card-sum-item .val {
  font-size: 1.5rem;
  font-weight: bold;
  color: #0b1f3a;
}

.acoes-container {
  display: flex;
  gap: 5px;
  justify-content: center;
}

/* Cards de Tempo */
.cards-tempo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-bottom: 25px;
}

.card-tempo {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.card-tempo.item-blue { border-color: #3b82f6; }
.card-tempo.item-blue h5, .card-tempo.item-blue .val { color: #2563eb; }

.card-tempo.item-dark { border-color: #334155; }
.card-tempo.item-dark h5, .card-tempo.item-dark .val { color: #0f172a; }

.card-tempo.item-cyan { border-color: #06b6d4; }
.card-tempo.item-cyan h5, .card-tempo.item-cyan .val { color: #0891b2; }

.card-tempo.item-gray { border-color: #94a3b8; }
.card-tempo.item-gray h5, .card-tempo.item-gray .val { color: #64748b; }

.card-tempo h5 {
  font-size: 0.75rem;
  margin: 0 0 6px 0;
  text-transform: uppercase;
  font-weight: 800;
}

.card-tempo .val {
  font-size: 1.3rem;
  font-weight: 900;
  margin-bottom: 4px;
}

.card-tempo small {
  color: #94a3b8;
  font-size: 0.75rem;
  display: block;
}

/* Dropdown Pecúlio */
.dropdown-peculio-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #ffffff;
  min-width: 210px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-radius: 6px;
  padding: 6px 0;
  z-index: 1000;
  border: 1px solid #e2e8f0;
}

.dropdown-peculio-menu.show {
  display: block;
}

.dropdown-peculio-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  color: #1e293b;
  text-decoration: none;
  font-size: 0.85rem;
}

.dropdown-peculio-menu a:hover {
  background: #f1f5f9;
}

/* ==========================================
   ESTILO EXCLUSIVO DO FILTRO DE INTERNOS
   ========================================== */
.filtro-internos-container {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.filtro-internos-container .form-control {
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.875rem;
  width: 100%;
  background-color: #ffffff;
  color: #1e293b;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.filtro-internos-container .form-control:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.filtro-internos-container .btn-filtrar {
  background-color: #334155;
  color: #ffffff;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.2s;
}

.filtro-internos-container .btn-filtrar:hover {
  background-color: #1e293b;
}

/* Estilo base idêntico para todos os badges de Status Operacional */
.badge-status {
    display: inline-block;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 800;
    color: #ffffff !important;
    border-radius: 20px; /* Arredondado cápsula igual ao 'Disponível' */
    text-align: center;
    white-space: nowrap;
    text-shadow: none;
}

/* Cores específicas conforme o Status Operacional */
.badge-status.status-disponivel,
.badge-status.status-disponível {
    background-color: #00aaff !important; /* Azul claro ciano idêntico à imagem */
}

.badge-status.status-manutencao,
.badge-status.status-manutenção {
    background-color: #d97706 !important; /* Laranja/Amarelo de aviso */
    /* Se preferires em vermelho como indicação de parado: background-color: #dc2626 !important; */
}

.badge-status.status-indisponivel,
.badge-status.status-indisponível {
    background-color: #dc2626 !important; /* Vermelho alerta */
}

/* ==========================================================================
   MODAL DE CONFIRMAÇÃO DE EXCLUSÃO (POPUP CUSTOMIZADO)
   ========================================================================== */

/* Overlay de fundo escuro com transparência */
.modal-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

/* Estado ativo exibido via JS (.classList.add('active')) */
.modal-alert-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Card Container do Modal */
.modal-confirm-card {
    max-width: 450px;
    width: 90%;
    text-align: left;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    transform: translateY(-10px);
    transition: transform 0.25s ease;
}

.modal-alert-overlay.active .modal-confirm-card {
    transform: translateY(0);
}

/* Cabeçalho do Modal */
.modal-confirm-header {
    background: #1e293b;
    color: #ffffff;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-confirm-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #ffffff !important; /* Força a cor branca no título */
}

.btn-close-modal {
    color: #ffffff;
    font-size: 1.4rem;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.btn-close-modal:hover {
    opacity: 1;
}

/* Corpo com a Mensagem de Aviso */
.modal-confirm-body {
    padding: 20px;
    color: #1e293b;
}

.modal-confirm-body p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #334155;
}

/* Rodapé com os Botões de Ação */
.modal-confirm-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 12px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.btn-danger-modal {
    background: #ef4444;
    color: #ffffff;
    border: none;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-danger-modal:hover {
    background: #dc2626;
}

/* ==========================================================================
   MODAL DE AUDITORIA DE FOLHA DE PAGAMENTO (SEAP)
   ========================================================================== */

.modal-auditoria-card {
    max-width: 650px;
    width: 90%;
    text-align: left;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.modal-auditoria-header {
    background: #0066ff;
    color: #ffffff;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-auditoria-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-template-excel {
    background: #ffffff;
    color: #0066ff;
    border: none;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.2s;
}

.btn-template-excel:hover {
    background: #f1f5f9;
}

.modal-auditoria-body {
    padding: 20px;
    color: #1e293b;
}

.form-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.margin-top-md {
    margin-top: 15px;
}

.modal-auditoria-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 12px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.btn-success-modal {
    background: #10b981;
    color: #ffffff;
    border: none;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-success-modal:hover {
    background: #059669;
}

/* ==========================================================================
   PAINEL DE BALANÇO DE COTAS E AUDITORIA DE FOLHA (APURAÇÃO)
   ========================================================================== */

.box-balanco {
    background: #ffffff;
    border: 1px solid #ffffff;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.box-balanco-header {
    background: #2563eb;
    color: #ffffff;
    padding: 10px 16px;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.grid-indicadores {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 15px;
    text-align: center;
    gap: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.stat-item h5 {
    font-size: 0.72rem;
    text-transform: uppercase;
    color: #555555;
    margin-bottom: 4px;
}

.stat-item .val {
    font-size: 1.3rem;
    font-weight: 800;
}

.tbl-interrompidas {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.tbl-interrompidas th, 
.tbl-interrompidas td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #eeeeee;
}

/* Modal Auditoria (SEAP) */
.modal-auditoria-card {
    max-width: 650px;
    width: 90%;
    text-align: left;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.modal-auditoria-header {
    background: #2563eb;
    color: #ffffff;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-auditoria-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-template-excel {
    background: #ffffff;
    color: #2563eb;
    border: none;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-template-excel:hover {
    background: #f1f5f9;
}

.modal-auditoria-body {
    padding: 20px;
    color: #1e293b;
}

.form-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.margin-top-md {
    margin-top: 15px;
}

.modal-auditoria-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 12px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.btn-success-modal {
    background: #10b981;
    color: #ffffff;
    border: none;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-success-modal:hover {
    background: #059669;
}

/* ==========================================================================
   PADRONIZAÇÃO GLOBAL DOS POP-UPS E MODAIS
   Mantém a estrutura e os comportamentos existentes; unifica a apresentação.
   ========================================================================== */

.modal {
    background: rgba(11, 31, 58, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    box-sizing: border-box;
    border: 1px solid #e2e8f0;
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    color: #1e293b;
    animation: modalPadraoEntrada 0.22s ease-out;
}

.modal-content h3,
.modal-content h4 {
    color: #0b1f3a;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

.modal-content .close-modal {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 12px;
    right: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #475569;
    font-size: 1.35rem;
    line-height: 1;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.modal-content .close-modal:hover {
    background: #0b1f3a;
    border-color: #0b1f3a;
    color: #ffffff;
}

.modal-alert-card {
    box-sizing: border-box;
    border-radius: 12px !important;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

@keyframes modalPadraoEntrada {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 768px) {
    .modal {
        padding: 12px;
    }

    .modal-content,
    .modal-alert-card {
        max-height: calc(100vh - 24px);
        border-radius: 12px !important;
    }
}


/* ==========================================================================
   CONFIRMAÇÕES DE AÇÃO — PADRÃO GLOBAL
   ========================================================================== */
.confirmacao-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(7, 20, 38, 0.72);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    animation: confirmacaoFadeIn .18s ease-out;
}
.confirmacao-card {
    width: min(100%, 430px);
    padding: 30px 28px 24px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
    text-align: center;
    animation: confirmacaoCardIn .22s ease-out;
}
.confirmacao-icone {
    display: flex;
    width: 62px;
    height: 62px;
    margin: 0 auto 17px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.65rem;
}
.confirmacao-icone-exclusao {
    color: #dc3545;
    background: #fff0f1;
}
.confirmacao-icone-atualizacao {
    color: #0b63ce;
    background: #eaf3ff;
}
.confirmacao-card h2 {
    margin: 0 0 9px;
    color: #0b1f3a;
    font-family: 'Montserrat', 'Segoe UI', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
}
.confirmacao-card p {
    margin: 0;
    color: #64748b;
    font-size: .92rem;
    line-height: 1.55;
}
.confirmacao-acoes {
    display: flex;
    justify-content: center;
    gap: 11px;
    margin-top: 25px;
}
.confirmacao-btn {
    min-width: 125px;
    min-height: 42px;
    padding: 10px 17px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font: 700 .88rem 'Segoe UI', sans-serif;
    transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.confirmacao-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(15, 23, 42, .12);
}
.confirmacao-btn:focus-visible {
    outline: 3px solid rgba(13, 110, 253, .28);
    outline-offset: 2px;
}
.confirmacao-btn-cancelar {
    color: #334155;
    border-color: #cbd5e1;
    background: #f8fafc;
}
.confirmacao-btn-cancelar:hover { background: #eaf0f6; }
.confirmacao-btn-confirmar {
    color: #fff;
    background: #0d6efd;
}
.confirmacao-btn-confirmar:hover { background: #0b5ed7; }
.confirmacao-btn-excluir {
    color: #fff;
    background: #dc3545;
}
.confirmacao-btn-excluir:hover { background: #bb2d3b; }

@keyframes confirmacaoFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes confirmacaoCardIn {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Uniformiza também os popups de confirmação personalizados já existentes. */
.modal-alert-overlay .modal-alert-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
}
.modal-alert-overlay .modal-alert-card > div:last-child {
    display: flex;
    justify-content: center;
    gap: 11px;
}
.modal-alert-overlay .modal-alert-card > div:last-child .btn {
    min-width: 115px;
    min-height: 40px;
    justify-content: center;
    border-radius: 8px;
    font-weight: 700;
}
@media (max-width: 480px) {
    .confirmacao-card { padding: 25px 19px 20px; }
    .confirmacao-acoes { flex-direction: column-reverse; }
    .confirmacao-btn { width: 100%; }
}


/* ==========================================================================
   RESPONSIVIDADE GLOBAL — PADRÃO ADAPTÁVEL PARA TODAS AS TELAS
   Regras complementares para manter formulários, cards, tabelas e ações
   utilizáveis em desktop, tablet e celular sem alterar o layout desktop.
   ========================================================================== */

@media (max-width: 992px) {
    .container {
        width: 100%;
        max-width: 100%;
        padding-left: 16px;
        padding-right: 16px;
    }

    .top-navbar {
        min-height: 0;
        height: auto;
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        padding: 14px 16px;
    }

    .brand-title,
    .header-center-unit,
    .header-right-logo {
        min-width: 0;
        justify-content: center;
        text-align: center;
    }

    .brand-title span,
    .unit-nome,
    .user-name,
    .user-role {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .header-logo-presidio {
        max-height: 64px;
    }

    .cards-summary,
    .cards-dashboard,
    .cards-req,
    .grid-indicadores {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .form-row-grid,
    .cards-tempo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px 12px 76px !important;
    }

    .header-action {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 16px;
    }

    .header-title-container {
        width: 100%;
        min-width: 0;
        flex-wrap: wrap;
        gap: 10px;
    }

    .header-action > button,
    .header-action > .btn,
    .header-action > div > .btn {
        width: 100%;
        max-width: 100%;
        justify-content: center;
    }

    .header-action h2 {
        font-size: clamp(1.15rem, 4.5vw, 1.55rem);
        overflow-wrap: anywhere;
    }

    .filters-bar,
    .search-container,
    .form-actions,
    .modal-logout-actions,
    .modal-alert-overlay .modal-alert-card > div:last-child {
        flex-wrap: wrap;
        gap: 9px;
    }

    .filters-bar,
    .search-container {
        align-items: stretch !important;
    }

    .filters-bar input,
    .filters-bar select,
    .search-container input,
    .search-container select {
        min-width: 0;
        width: 100% !important;
        max-width: 100%;
    }

    .cards-summary,
    .cards-dashboard,
    .cards-req,
    .grid-indicadores,
    .cards-tempo-grid,
    .form-row-grid,
    .grid-graficos,
    .grid-estoque-colunas {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .card-table {
        max-width: 100%;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .card-table table,
    .table {
        width: max-content;
        min-width: 620px;
        max-width: none;
    }

    .card-table th,
    .card-table td,
    .table th,
    .table td {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .acoes-container {
        flex-wrap: wrap;
    }

    .modal {
        padding: 12px;
        align-items: center;
    }

    .modal-content,
    .modal-alert-card,
    .modal-logout-card {
        width: 100% !important;
        max-width: 100% !important;
        max-height: calc(100dvh - 24px);
        overflow-y: auto;
        margin: 0;
        padding: 16px !important;
    }

    .form-actions {
        justify-content: stretch;
    }

    .form-actions .btn,
    .modal-logout-actions .btn,
    .modal-alert-overlay .modal-alert-card > div:last-child .btn {
        flex: 1 1 130px;
        justify-content: center;
    }

    input,
    select,
    textarea {
        max-width: 100%;
    }

    .notification-bell-container {
        right: 12px !important;
        bottom: 12px !important;
    }
}

@media (max-width: 480px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    .top-navbar {
        padding: 12px 10px;
    }

    .header-logo {
        max-height: 38px;
    }

    .header-logo-presidio {
        max-height: 48px;
    }

    .brand-title {
        gap: 8px;
    }

    .brand-title span {
        font-size: .82rem;
    }

    .unit-sigla {
        font-size: 1.25rem;
    }

    .unit-nome {
        font-size: .68rem;
        line-height: 1.35;
    }

    .cards-summary,
    .card-sum-item,
    .card-dash-kpi {
        min-width: 0;
    }

    .card-sum-item,
    .card-dash-kpi {
        padding: 12px;
    }

    .card-sum-item .val {
        font-size: 1.25rem;
        overflow-wrap: anywhere;
    }

    .form-actions,
    .modal-logout-actions,
    .confirmacao-acoes {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .form-actions .btn,
    .modal-logout-actions .btn,
    .confirmacao-btn {
        width: 100%;
    }

    .bell-popup-card {
        width: min(320px, calc(100vw - 24px));
        right: 0;
    }
}


/* Popup de sucesso da passagem de plantão */
.popup-sucesso-plantao {
    z-index: 10060;
}
.confirmacao-icone-sucesso-plantao {
    color: #198754;
    background: #e8f5ee;
    border: 1px solid #cce8d8;
}
.confirmacao-btn-sucesso-plantao {
    min-width: 190px;
    color: #ffffff;
    background: #0b1f3a;
}
.confirmacao-btn-sucesso-plantao:hover {
    background: #16385f;
}


/* Ajustes visuais do modal de detalhes da solicitação */
#modal-detalhes-chamado-integrado .chamado-modal-card {
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    max-height: 90vh;
    max-height: 90dvh;
    border-radius: 12px;
}
#modal-detalhes-chamado-integrado .chamado-modal-conteudo {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #9ca3af #f1f5f9;
}
#modal-detalhes-chamado-integrado .chamado-modal-conteudo::-webkit-scrollbar {
    width: 9px;
}
#modal-detalhes-chamado-integrado .chamado-modal-conteudo::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 0 0 8px 0;
}
#modal-detalhes-chamado-integrado .chamado-modal-conteudo::-webkit-scrollbar-thumb {
    background: #9ca3af;
    border: 2px solid #f1f5f9;
    border-radius: 10px;
}
#modal-detalhes-chamado-integrado .chamado-modal-conteudo::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}
#modal-detalhes-chamado-integrado .chamado-modal-card > div:first-child,
#modal-detalhes-chamado-integrado .chamado-modal-card > div:last-child {
    flex: 0 0 auto;
}
@media (max-width: 768px) {
    #modal-detalhes-chamado-integrado .chamado-modal-card {
        max-height: calc(100dvh - 24px) !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0;
    }
}


/* Modal de detalhes da passagem de plantão: reduz o espaço interno externo */
.modal-detalhes-plantao {
    padding: 0 !important;
    overflow: hidden;
}

.modal-detalhes-plantao .modal-confirm-header {
    padding: 11px 16px;
}

.modal-detalhes-plantao .modal-confirm-body {
    padding: 12px 16px;
}

.modal-detalhes-plantao .modal-confirm-footer {
    padding: 9px 16px;
}


/* Avisos de sucesso e erro no padrão global de confirmações */
.confirmacao-icone-sucesso {
    color: #198754;
    background: #e8f5ee;
}
.confirmacao-acoes-aviso {
    justify-content: center;
}


/* Botão de confirmação compacto quando o texto for curto */
.confirmacao-btn-compacto {
    min-width: 0;
    width: auto;
    padding-left: 20px;
    padding-right: 20px;
}


/* Popup de consulta das informações da viatura */
.modal-detalhes-viatura {
    width: min(95%, 680px);
    padding: 0 !important;
    overflow: hidden;
    text-align: left;
}
.modal-detalhes-viatura .modal-confirm-body { padding: 18px 20px; }
.detalhes-viatura-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.detalhe-viatura-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}
.detalhe-viatura-item span {
    color: #64748b;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
}
.detalhe-viatura-item strong {
    color: #1e293b;
    font-size: .92rem;
    overflow-wrap: anywhere;
}
@media (max-width: 560px) {
    .detalhes-viatura-grid { grid-template-columns: 1fr; }
    .modal-detalhes-viatura .modal-confirm-body { padding: 14px; }
}


/* A etiqueta da placa abre os dados da respectiva viatura */
.badge-placa-clicavel {
    cursor: pointer;
    transition: filter .15s ease, transform .15s ease;
}
.badge-placa-clicavel:hover {
    filter: brightness(.92);
    transform: translateY(-1px);
}
.badge-placa-clicavel:focus-visible {
    outline: 2px solid #0b1f3a;
    outline-offset: 3px;
}

/* Logos do cabeçalho: mesmo tamanho e recorte circular */
.brand-title .header-logo-unidade,
.header-logo-presidio {
    display: block;
    height: 46px;
    width: 46px;
    min-width: 46px;
    max-height: 46px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    overflow: hidden;
    flex: 0 0 46px;
}

 
/* ==========================================================================
   CABEÇALHO — NOVA DISTRIBUIÇÃO INSTITUCIONAL (PRÉVIA NA PÁGINA PRINCIPAL)
   Aplicado às telas internas do sistema.
   ========================================================================== */
body.header-layout-standard .top-navbar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    min-height: 116px;
    height: auto;
    padding: 12px 30px;
    column-gap: 20px;
}
body.header-layout-standard .brand-title {
    min-width: 0;
    gap: 14px;
}
body.header-layout-standard .brand-title .header-logo-unidade {
    width: 76px;
    height: 76px;
    min-width: 76px;
    max-height: 76px;
    flex: 0 0 76px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
}
body.header-layout-standard .brand-title .brand-title-text {
    display: block;
    white-space: normal;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.08rem;
    line-height: 1.28;
    font-weight: 800;
    color: #BDA470;
    letter-spacing: .45px;
}
body.header-layout-standard .header-center-unit {
    grid-column: 2;
    min-width: 0;
    width: 100%;
    justify-self: center;
}
body.header-layout-standard .unit-sigla {
    font-size: 1.65rem;
    margin-bottom: 3px;
}
body.header-layout-standard .unit-nome {
    display: flex;
    flex-direction: column;
    gap: 2px;
    white-space: normal;
    font-size: .72rem;
    line-height: 1.3;
    text-align: center;
    margin: 0;
}
body.header-layout-standard .header-right-logo {
    min-width: 0;
    gap: 13px;
}
body.header-layout-standard .header-right-logo .user-info-bar {
    flex: 0 1 auto;
    padding-right: 13px;
}
/* Nas telas de login e cadastro, o brasão acompanha o tamanho da logo da unidade */
body.auth-body.header-layout-standard .header-logo-policia {
    width: 76px;
    height: 76px;
    min-width: 76px;
    max-height: 76px;
    flex: 0 0 76px;
}

body.header-layout-standard .header-logo-policia {
    width: 46px;
    height: 46px;
    min-width: 46px;
    max-height: 46px;
    flex: 0 0 46px;
    border-radius: 50%;
    object-fit: contain;
}
@media (max-width: 1100px) and (min-width: 993px) {
    body.header-layout-standard .top-navbar {
        padding-left: 18px;
        padding-right: 18px;
        column-gap: 12px;
    }
    body.header-layout-standard .brand-title .header-logo-unidade {
        width: 66px;
        height: 66px;
        min-width: 66px;
        flex-basis: 66px;
    }
    body.header-layout-standard .brand-title .brand-title-text { font-size: .94rem; }
    body.header-layout-standard .unit-nome { font-size: .64rem; }
    body.header-layout-standard .header-right-logo { gap: 8px; }
    body.header-layout-standard .header-logo-policia {
        width: 42px;
        height: 42px;
        min-width: 42px;
        flex-basis: 42px;
    }
}
@media (max-width: 992px) {
    body.header-layout-standard .top-navbar {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        padding: 14px 16px;
    }
    body.header-layout-standard .brand-title {
        justify-content: center;
    }
    body.header-layout-standard .brand-title .header-logo-unidade {
        width: 68px;
        height: 68px;
        min-width: 68px;
        flex-basis: 68px;
    }
    body.header-layout-standard .header-center-unit {
        grid-column: 1;
        grid-row: 2;
    }
    body.header-layout-standard .header-right-logo {
        grid-row: 3;
        justify-content: center;
    }
}
@media (max-width: 480px) {
    body.header-layout-standard .brand-title .brand-title-text { font-size: .88rem; }
    body.header-layout-standard .brand-title .header-logo-unidade {
        width: 60px;
        height: 60px;
        min-width: 60px;
        flex-basis: 60px;
    }
    body.header-layout-standard .unit-nome { font-size: .62rem; }
}

/* ==========================================================================
   ESPAÇAMENTO GLOBAL DO CONTEÚDO — AFASTA AS PÁGINAS DO CABEÇALHO
   Mantém o cabeçalho padronizado e cria uma margem visual antes do conteúdo.
   ========================================================================== */
body.header-layout-standard > .container {
    margin-top: 24px;
}

/* Ajustes finos de espaçamento para os painéis */
body.dashboard-tarefas-page > .container {
    margin-top: 8px;
}
body.seplag-dashboard-page > .container {
    margin-top: 46px;
}


/* ==========================================================================
   DASHBOARD PRINCIPAL — AJUSTES DE RESPONSIVIDADE
   Afeta somente a tela Painel Principal / Dashboard.
   ========================================================================== */
@media (max-width: 768px) {
    body.dashboard-tarefas-page > .container {
        width: 100%;
        max-width: 100%;
        padding: 10px 14px 76px;
    }

    body.dashboard-tarefas-page .dashboard-header-action {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        margin-bottom: 16px;
    }

    body.dashboard-tarefas-page .dashboard-header-action .header-title-container {
        width: 100%;
        gap: 10px;
    }

    body.dashboard-tarefas-page .dashboard-header-action h2 {
        font-size: clamp(1.15rem, 4.8vw, 1.45rem);
        line-height: 1.25;
    }

    body.dashboard-tarefas-page .dashboard-acoes {
        width: 100%;
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px;
    }

    body.dashboard-tarefas-page .btn-toggle-grp {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        margin: 0;
    }

    body.dashboard-tarefas-page .btn-toggle-item {
        min-width: 0;
        justify-content: center;
        text-align: center;
        padding: 9px 7px;
        font-size: .72rem;
        line-height: 1.25;
        white-space: normal;
    }

    body.dashboard-tarefas-page .dashboard-acoes > .btn {
        width: 100%;
        min-height: 42px;
        justify-content: center;
    }

    body.dashboard-tarefas-page .cards-dashboard {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
        margin-bottom: 14px;
    }

    body.dashboard-tarefas-page .card-dash-item {
        min-width: 0;
        padding: 11px 10px;
        gap: 6px;
    }

    body.dashboard-tarefas-page .card-dash-item h5 {
        font-size: .63rem;
        line-height: 1.3;
        overflow-wrap: anywhere;
    }

    body.dashboard-tarefas-page .card-dash-item .val {
        font-size: 1.35rem;
        line-height: 1.15;
    }

    body.dashboard-tarefas-page .icon-dash {
        flex: 0 0 auto;
        font-size: 1.35rem;
    }

    body.dashboard-tarefas-page .dashboard-filtros {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 9px;
        padding: 10px;
        margin-bottom: 14px;
    }

    body.dashboard-tarefas-page .dashboard-filtros select,
    body.dashboard-tarefas-page .dashboard-filtros input,
    body.dashboard-tarefas-page .dashboard-filtros button {
        width: 100%;
        min-width: 0 !important;
        min-height: 40px;
        flex: 1 1 auto;
    }

    body.dashboard-tarefas-page .dashboard-tabela {
        width: 100%;
        overflow: hidden;
    }

    body.dashboard-tarefas-page .dashboard-tabela-scroll {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    body.dashboard-tarefas-page .dashboard-tabela-header {
        width: max-content;
        min-width: 1050px;
        box-sizing: border-box;
    }

    body.dashboard-tarefas-page .dashboard-tabela table {
        width: max-content;
        min-width: 1050px;
    }

    body.dashboard-tarefas-page .dashboard-tabela th,
    body.dashboard-tarefas-page .dashboard-tabela td {
        white-space: nowrap;
        overflow-wrap: normal;
    }
}

@media (max-width: 380px) {
    body.dashboard-tarefas-page .cards-dashboard {
        grid-template-columns: minmax(0, 1fr);
    }

    body.dashboard-tarefas-page .btn-toggle-grp {
        grid-template-columns: minmax(0, 1fr);
    }

    body.dashboard-tarefas-page .btn-toggle-item {
        min-height: 38px;
    }
}


/* ==========================================================================
   MENU INTEGRADO — TESTE PILOTO SOMENTE NO PAINEL PRINCIPAL
   Desktop: sidebar ocupa espaço próprio e desloca o conteúdo.
   Tablet/celular: mantém o menu deslizante sobreposto já existente.
   ========================================================================== */
@media (min-width: 993px) {
    body.dashboard-tarefas-page .dashboard-layout {
        display: flex;
        align-items: stretch;
        width: 100%;
        min-height: calc(100vh - 116px);
        overflow: clip;
    }

    body.dashboard-tarefas-page .dashboard-layout > .sidebar {
        position: relative;
        inset: auto;
        flex: 0 0 0;
        width: 0;
        height: calc(100vh - 116px);
        min-height: 520px;
        z-index: 1;
        overflow-x: hidden;
        overflow-y: auto;
        box-shadow: none;
        visibility: hidden;
        transition: width .28s ease, flex-basis .28s ease, visibility .28s ease;
    }

    body.dashboard-tarefas-page .dashboard-layout > .sidebar.open {
        flex-basis: 280px;
        width: 280px;
        visibility: visible;
        box-shadow: 2px 0 10px rgba(0, 0, 0, .18);
    }

    body.dashboard-tarefas-page .dashboard-layout > .container {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
        max-width: 1350px;
        margin: 0 auto;
        transition: max-width .28s ease, padding .28s ease;
    }

    body.dashboard-tarefas-page .dashboard-layout > .container .btn-sandwich {
        position: static !important;
        inset: auto !important;
        margin: 0;
        flex: 0 0 auto;
    }

    body.dashboard-tarefas-page #sidebar-overlay {
        display: none !important;
    }
}

@media (max-width: 992px) {
    body.dashboard-tarefas-page .dashboard-layout {
        display: block;
        width: 100%;
        min-height: 0;
        overflow: visible;
    }

    body.dashboard-tarefas-page .dashboard-layout > .sidebar {
        position: fixed;
        top: 0;
        left: -250px;
        width: 250px;
        height: 100%;
        min-height: 0;
        z-index: 1100;
        visibility: visible;
        transition: left .3s ease;
    }

    body.dashboard-tarefas-page .dashboard-layout > .sidebar.open {
        left: 0;
        width: 250px;
    }

    body.dashboard-tarefas-page .dashboard-layout > .container {
        width: 100%;
        max-width: 1350px;
        margin-left: auto;
        margin-right: auto;
    }

    body.dashboard-tarefas-page .dashboard-layout > .container .btn-sandwich {
        position: static !important;
        inset: auto !important;
        margin: 0;
    }
}


/* Botão do menu do painel: ícone alternável em azul-escuro e dourado */
body.dashboard-tarefas-page .dashboard-menu-toggle {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(189, 164, 112, .55) !important;
    border-radius: 9px;
    background: #0b1f3a !important;
    color: #BDA470;
    box-shadow: 0 2px 6px rgba(11, 31, 58, .16);
    transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

body.dashboard-tarefas-page .dashboard-menu-toggle:hover {
    background: #132d4d !important;
    border-color: #BDA470 !important;
    box-shadow: 0 3px 9px rgba(11, 31, 58, .24);
}

body.dashboard-tarefas-page .dashboard-menu-toggle i {
    color: #BDA470;
    font-size: 1.2rem;
    line-height: 1;
    transition: transform .22s ease, opacity .18s ease;
}

body.dashboard-tarefas-page .dashboard-menu-toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}


/* MENU GLOBAL DA APLICAÇÃO — botão abaixo da logo e painel sobreposto */
body.header-layout-standard .top-navbar {
    position: relative;
    overflow: visible;
}

body.header-layout-standard .app-menu-toggle {
    position: absolute;
    left: 30px;
    top: calc(100% + 7px);
    z-index: 1200;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0 !important;
    outline: 0;
    background: transparent !important;
    box-shadow: none !important;
    color: #BDA470;
    cursor: pointer;
}

body.header-layout-standard .app-menu-toggle i {
    color: #BDA470;
    font-size: 1.55rem;
    line-height: 1;
    transition: transform .22s ease, color .2s ease;
}

body.header-layout-standard .app-menu-toggle:hover i {
    color: #0b1f3a;
}

body.header-layout-standard .app-menu-toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}

/* O menu sempre flutua sobre a página; nunca participa do fluxo do conteúdo. */
body.dashboard-tarefas-page .dashboard-layout {
    display: block !important;
    width: 100%;
    min-height: 0 !important;
    overflow: visible !important;
}

body.header-layout-standard #sidebar,
body.header-layout-standard .dashboard-layout > #sidebar {
    position: fixed !important;
    top: 0 !important;
    left: -280px !important;
    flex: none !important;
    width: 280px !important;
    height: 100vh !important;
    min-height: 0 !important;
    margin: 0 !important;
    z-index: 1300 !important;
    visibility: visible !important;
    overflow-x: hidden;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, .3);
    transition: left .3s ease !important;
}

body.header-layout-standard #sidebar.open,
body.header-layout-standard .dashboard-layout > #sidebar.open {
    left: 0 !important;
}

body.header-layout-standard #sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 1250;
}

body.header-layout-standard .dashboard-layout > .container {
    width: 100%;
    max-width: 1350px;
    margin-left: auto;
    margin-right: auto;
    transition: none !important;
}

body.header-layout-standard .btn-sandwich {
    display: none !important;
}

@media (max-width: 992px) {
    body.header-layout-standard .app-menu-toggle {
        left: 16px;
        top: calc(100% + 4px);
    }
}


/* AJUSTE FINO DO BOTÃO GLOBAL DO MENU */
body.header-layout-standard .app-menu-toggle {
    left: 51px;
    top: calc(100% + 14px);
    width: 30px;
    height: 30px;
}

body.header-layout-standard .app-menu-toggle i {
    font-size: 1.35rem;
}

@media (max-width: 992px) {
    body.header-layout-standard .app-menu-toggle {
        left: 50%;
        top: calc(100% + 12px);
        transform: translateX(-50%);
    }
}
