/* ================================
   Fonte Global
================================ */
body {
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif !important;
    font-size: 15px;
    color: #111;
    margin: 0;
    height: 100%;
}

html, body {
    height: 100%;
}

/* ================================
   Layout geral
================================ */
.wrap {
    min-height: 100%;
    height: auto;
    margin: 0;              /* ocupa tela toda */
    padding: 0 0 60px;
    width: 100%;            /* garante largura full */
}

.wrap > .container {
    padding: 10px 10px 20px;
}

.footer {
    height: 60px;
    background-color: #f5f5f5;
    border-top: 1px solid #ddd;
    padding-top: 20px;
}

/* ================================
   Cabeçalhos de seção (títulos de páginas)
================================ */
.titulo-consulta {
    color: #025C3E;
    font-weight: 700;
    font-size: 1.8rem;
    margin: 12px 0 22px;
    text-align: center;
}

/* ================================
   Grid / Tabelas
================================ */
.grid-epamig thead th {
    background: #025C3E !important;
    color: #fff !important;
    font-weight: 700;
    font-size: 15px;
    border-color: #025C3E;
    text-align: center;
    vertical-align: middle !important;
}

.grid-epamig thead th a {
    color: #fff !important;
    font-weight: 700;
    text-decoration: none !important;
}

.grid-epamig thead th input,
.grid-epamig thead th select {
    color: #025C3E;
    background: #fff;
    border: 1px solid #025C3E;
    font-weight: 600;
}

.grid-epamig .filters td,
.grid-epamig thead tr.filters th {
    background: #fff !important;
    color: #025C3E;
    font-weight: 600;
}

.grid-epamig tbody tr:hover {
    background: #eaf5ee !important;
}

.grid-epamig {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px #0001;
    margin-bottom: 24px;
}

/* ================================
   Botões Globais
================================ */
.btn-xs,
.btn-epamig-green,
.btn-epamig-blue {
    font-size: 1.18rem !important;
    padding: 10px 22px !important;
    font-weight: 600 !important;
    border-radius: 7px !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none !important;
    box-shadow: 0 2px 8px #025C3E20;
    transition: background 0.16s, transform 0.16s;
}

.btn-success,
.btn-success:focus,
.btn-success:active {
    background: #025C3E !important;
    color: #fff !important;
    border: none !important;
    font-weight: 600;
    box-shadow: 0 2px 8px #025C3E20;
    transition: background 0.16s, transform 0.16s;
}
.btn-success:hover {
    background: #013826 !important;
    color: #fff !important;
    transform: translateY(-1px);
}

.btn-info.btn-xs {
    background: #1c6eaa !important;
    color: #fff !important;
    border: none !important;
}
.btn-info.btn-xs:hover {
    background: #145081 !important;
    transform: translateY(-1px);
}

/* Novo PRIMARY no padrão Bootstrap 5 */
.btn-primary.btn-xs {
    background: #084298 !important; /* Azul escuro próximo ao padrão Bootstrap */
    color: #fff !important;
    border: none !important;
}
.btn-primary.btn-xs:hover {
    background: #052c65 !important; /* Ainda mais escuro no hover */
    transform: translateY(-1px);
}
.btn-primary.btn-xs:active,
.btn-primary.btn-xs:focus {
    background: #031633 !important; /* Active/Focus super escuro */
}


.btn-danger.btn-xs {
    background: #Ed3237 !important;
    color: #fff !important;
    border: none !important;
}
.btn-danger.btn-xs:hover {
    background: #962029 !important;
    transform: translateY(-1px);
}

.btn-warning.btn-xs {
    background: #e38e14 !important;
    color: #fff !important;
    border: none !important;
}
.btn-warning.btn-xs:hover {
    background: #b66a07 !important;
    transform: translateY(-1px);
}

/* Botões principais */
.btn-epamig-green {
    background: #025C3E !important;
    color: #fff !important;
    border: none;
}
.btn-epamig-green:hover {
    background: #013826 !important;
    transform: translateY(-1px);
}

.btn-epamig-blue {
    background: #1873b7 !important;
    color: #fff !important;
    border: none;
}
.btn-epamig-blue:hover {
    background: #104d7b !important;
    transform: translateY(-1px);
}

/* ================================
   Badges (status/perfis)
================================ */
.badge {
    border-radius: 8px !important;
    font-size: 1rem !important;
    font-weight: 600;
    padding: 6px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.badge-primary    { background: #007bff !important; color: #fff !important; }
.badge-info       { background: #17a2b8 !important; color: #fff !important; }
.badge-secondary  { background: #6c757d !important; color: #fff !important; }
.badge-success    { background: #04B378 !important; color: #fff !important; }
.badge-warning    { background: #e38e14 !important; color: #fff !important; }
.badge-danger     { background: #Ed3237 !important; color: #fff !important; }

/* ================================
   NOTA: estilos do `header` e da `navbar` movidos para
   `views/layouts/main.php` (centralizados lá para evitar conflitos).
   Removido deste arquivo.
================================ */

/* ================================
   Cabeçalho das tabelas
================================ */
.index-page .table thead th,
.index-page .grid-view thead th {
    background: #04B378 !important;
    color: #fff !important;
    font-weight: 700;
    font-size: 15px;
    border-color: #04B378;
    text-align: center;
    vertical-align: middle !important;
}

.index-page .table thead th a,
.index-page .grid-view thead th a {
    color: #fff !important;
    font-weight: 700 !important;
    text-decoration: none !important;
}

/* ================================
   Responsividade
================================ */
@media(max-width: 768px) {
    .header-content {
        flex-direction: column;
        padding: 10px 20px;
    }
    .header-links {
        margin-top: 10px;
        gap: 10px;
    }
}

h3, h5 {
    color: #025C3E !important;
    background: #fff;
    font-weight: 700;
}

/* Proposta 4 – Barra lateral */
.proposta4 {
    border-left: 5px solid #04B378;
    align-items: flex-start;
    text-align: left;
    padding-left: 25px;
}
.proposta4 i {
    margin-bottom: 8px;
}
.proposta4:hover {
    background: #f9fafb;
    transform: translateX(3px);
}

/* ================================
   Navbar
================================ */
.navbar.navbar-default {
    width: 100% !important;
    margin: 0;
    border-radius: 0;
    box-sizing: border-box;
}

.navbar.navbar-default .container-fluid {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

header, 
.navbar {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

.btn-epamig-save {
    background: #025C3E !important;
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    padding: 10px 20px;
    display: inline-flex;
    align-items: center;   /* 🔑 centraliza verticalmente */
    justify-content: center; /* 🔑 garante alinhamento central */
    gap: 4px;              /* 🔑 espaço mínimo entre ícone e texto */
    line-height: 1;        /* 🔑 remove altura extra do texto */
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.btn-epamig-save i {
    font-size: 15px;
    margin: 0;             /* 🔑 remove margens internas */
    padding: 0;
    line-height: 1;
}

.btn-epamig-save span {
    display: inline-block;
    line-height: 1;
}

.btn-epamig-save:hover {
    background: #013826 !important;
    transform: translateY(-1px);
}

/* ==============================
   Componentes compartilhados EPAMIG
   (card-view, table-modern, botões e modais)
   Coloque aqui estilos usados em várias views
   ============================== */
:root { --epamig-green: #025C3E; }
.card-view {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 14px #0001;
    padding: 26px 22px 20px 22px;
    margin-bottom: 30px;
    margin-top: 16px;
}
.table-modern {
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px #0001;
    overflow: hidden;
    margin-bottom: 24px;
}
.table-modern th {
    background: var(--epamig-green) !important;
    color: #fff !important;
    font-weight: 700;
    text-align: center;
    padding: 10px;
    font-size: 16px;
}
.table-modern td {
    text-align: center;
    padding: 9px;
    font-size: 15px;
    background: #fafcfb;
    border-bottom: 1px solid #e3e3e3;
    vertical-align: middle;
}
.table-modern tbody tr:not(:last-child) { border-bottom: 2px solid #e3e3e3 !important; }
.table-modern td.justify-cell { text-align: left; padding: 12px 18px; }
.table-modern .btn-ver-just { min-width: 70px; padding: 2px 15px; }
.view-section-title {
    color: var(--epamig-green);
    font-size: 22px;
    font-weight: 800;
    margin-top: 12px;
    margin-bottom: 18px;
    letter-spacing: 0.4px;
    text-align: center;
}
.btn-epamig {
    background: var(--epamig-green) !important;
    color: #fff !important;
    font-weight: 700;
    border-radius: 8px !important;
    font-size: 15px;
    min-width: 120px;
    padding: 8px 18px;
    margin-right: 10px;
    box-shadow: 0 2px 8px #025C3E22;
    border: none;
    transition: background 0.2s;
}
/* Botão de ação vermelha padronizada (Excluir) */
.btn-epamig-danger {
    background: #Ed3237 !important;
    color: #fff !important;
    font-weight: 700;
    border-radius: 8px !important;
    font-size: 15px;
    min-width: 120px;
    padding: 8px 18px;
    margin-right: 10px;
    box-shadow: 0 2px 8px #Ed323722;
    border: none;
    transition: background 0.16s, transform 0.16s;
}
.btn-epamig-danger:hover {
    background: #b82a2e !important;
    transform: translateY(-1px);
}

/* Contêiner que alinha botões lado a lado nas views */
.btn-actions p { margin: 0; display: flex; gap: 12px; align-items: center; }
.btn-actions { display: flex; align-items: center; }
.btn-warning, .btn-warning:active, .btn-warning:focus, .btn-warning:hover {
    background: #f5be46 !important;
    color: #fff !important;
    border: none !important;
}
.btn-sm.btn-success, .btn-sm.btn-warning {
    border-radius: 8px !important;
    font-weight: 600;
    min-width: 90px;
}
@media (max-width: 900px) {
    .card-view, .table-modern { padding: 10px 2px 8px 2px; font-size: 12px; }
    .view-section-title { font-size: 16px; }
}

#modalJustificativa .modal-header {
    background: #025C3E !important;
    color: #fff !important;
    border-radius: 12px 12px 0 0;
    justify-content: center;
    border-bottom: none;
}
#modalJustificativa .modal-title,
#modalJustificativa h5 {
    color: #fff !important;
    font-weight: 700;
    margin: 0;
    width: 100%;
    text-align: center;
    background: #025C3E !important;
    border: none;
    padding: 12px 0;
    border-radius: 12px 12px 0 0;
}
#modalJustificativa .btn-fechar-modal {
    position: absolute;
    bottom: 24px;
    right: 32px;
    min-width: 110px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 8px;
}
@media (max-width: 900px) {
    /* Adicione regras responsivas aqui, se necessário */
}

.navbar-separator {
    display: flex;
    align-items: center;
    margin-left: 32px;
    margin-right: 8px;
}
.navbar-separator li {
    border-left: 2px solid #fff;
    height: 32px;
    margin-top: 6px;
}

/* ================================
   Responsividade Global
================================ */

/* Tabelas responsivas com scroll horizontal */
@media (max-width: 992px) {
    .table-responsive,
    .grid-view,
    .grid-epamig {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        display: block;
        width: 100%;
    }
    
    table {
        min-width: 600px; /* Garante largura mínima */
    }
    
    .grid-epamig thead th input,
    .grid-epamig thead th select {
        min-width: 80px;
        font-size: 12px;
    }
}

/* Formulários e inputs */
@media (max-width: 768px) {
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-control {
        font-size: 14px;
        padding: 8px 12px;
    }
    
    label {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    select.form-control {
        font-size: 14px;
    }
    
    /* Ajusta largura de campos em formulários */
    .col-lg-6,
    .col-md-6 {
        width: 100%;
        margin-bottom: 15px;
    }
}

/* Botões responsivos */
@media (max-width: 768px) {
    .btn-xs,
    .btn-epamig-green,
    .btn-epamig-blue,
    .btn-epamig {
        font-size: 0.95rem !important;
        padding: 8px 16px !important;
        white-space: nowrap;
    }
    
    .btn-group {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .btn-group > .btn {
        flex: 1 1 auto;
        min-width: 100px;
    }
}

@media (max-width: 576px) {
    .btn-xs,
    .btn-epamig-green,
    .btn-epamig-blue,
    .btn-epamig {
        font-size: 0.85rem !important;
        padding: 6px 12px !important;
        width: 100%;
        margin-bottom: 8px;
    }
    
    .btn-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-actions .btn,
    .btn-actions button,
    .btn-actions a {
        width: 100%;
        margin: 4px 0 !important;
    }
}

/* Cards e painéis */
@media (max-width: 768px) {
    .card-view {
        padding: 16px 12px;
        margin-bottom: 20px;
    }
    
    .panel {
        margin-bottom: 15px;
    }
    
    .panel-body {
        padding: 10px;
    }
    
    .panel-heading {
        padding: 8px 12px;
        font-size: 14px;
    }
}

/* Títulos e textos */
@media (max-width: 768px) {
    .titulo-consulta {
        font-size: 1.4rem;
        margin: 10px 0 16px;
    }
    
    .view-section-title {
        font-size: 18px;
        margin-top: 10px;
        margin-bottom: 14px;
    }
    
    h3, h5 {
        font-size: 1.1rem !important;
    }
}

@media (max-width: 576px) {
    .titulo-consulta {
        font-size: 1.2rem;
        margin: 8px 0 12px;
    }
    
    .view-section-title {
        font-size: 16px;
    }
}

/* Grids e listas */
@media (max-width: 768px) {
    .acesso-card,
    .proposta4 {
        padding: 12px 14px;
        margin-bottom: 10px;
    }
    
    .acesso-card i {
        font-size: 20px;
    }
    
    .acesso-card h5 {
        font-size: 14px;
    }
}

/* Tabelas específicas */
@media (max-width: 992px) {
    .table-modern {
        font-size: 13px;
    }
    
    .table-modern th,
    .table-modern td {
        padding: 6px 8px;
        font-size: 13px;
    }
}

@media (max-width: 576px) {
    .table-modern {
        font-size: 11px;
    }
    
    .table-modern th,
    .table-modern td {
        padding: 4px 6px;
        font-size: 11px;
    }
    
    /* Em mobile, algumas colunas podem ser escondidas */
    .table-modern th:nth-child(n+6),
    .table-modern td:nth-child(n+6) {
        display: none; /* Esconde colunas extras em tabelas muito grandes */
    }
}

/* Badges */
@media (max-width: 576px) {
    .badge {
        font-size: 0.85rem !important;
        padding: 4px 10px;
    }
}

/* Footer - Tag HTML */
footer {
    background-color: #f5f5f5;
    border-top: 1px solid #ddd;
    padding: 20px 0;
    text-align: center;
    margin-top: 40px;
    width: 100%;
}

footer p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

@media (max-width: 768px) {
    footer {
        padding: 15px 10px;
        font-size: 13px;
        margin-top: 30px;
    }
    
    footer p {
        margin: 5px 0;
        font-size: 13px;
    }
}

/* Modal de Perfis */
.perfil-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px 0;
}

.perfil-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.perfil-card:hover {
    border-color: #025C3E;
    box-shadow: 0 4px 12px rgba(2, 92, 62, 0.15);
    transform: translateY(-2px);
    text-decoration: none;
}

.perfil-icon {
    width: 60px;
    height: 60px;
    background: #025C3E;
    border-radius: 50%;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.perfil-icon i {
    font-size: 28px;
    color: #fff;
}

.perfil-nome {
    font-size: 18px;
    font-weight: 600;
    color: #025C3E;
    margin-bottom: 10px;
}

.perfil-btn {
    font-size: 14px;
    color: #666;
}

@media (max-width: 768px) {
    .perfil-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 15px 0;
    }
    
    .perfil-card {
        padding: 16px;
    }
    
    .perfil-icon {
        width: 50px;
        height: 50px;
    }
    
    .perfil-icon i {
        font-size: 24px;
    }
    
    .perfil-nome {
        font-size: 16px;
    }
    
    #modalPerfis .modal-dialog {
        margin: 10px;
    }
}

@media (max-width: 576px) {
    .perfil-card {
        padding: 14px;
    }
    
    .perfil-icon {
        width: 45px;
        height: 45px;
    }
    
    .perfil-icon i {
        font-size: 22px;
    }
    
    .perfil-nome {
        font-size: 15px;
        margin-bottom: 8px;
    }
    
    .perfil-btn {
        font-size: 13px;
    }
}

/* ================================
   Melhorias Adicionais de Responsividade
================================ */

/* GridView do Yii2 */
@media (max-width: 992px) {
    .grid-view table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    
    .summary {
        font-size: 13px;
        padding: 10px 5px;
    }
    
    .pagination {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pagination > li > a,
    .pagination > li > span {
        padding: 6px 10px;
        font-size: 13px;
    }
}

/* Imagens responsivas */
img {
    max-width: 100%;
    height: auto;
}

/* Inputs e selects em mobile */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="tel"],
    textarea,
    select {
        font-size: 16px !important; /* Previne zoom no iOS */
    }
}

/* Tabs responsivas */
@media (max-width: 768px) {
    .nav-tabs {
        flex-wrap: wrap;
        border-bottom: 1px solid #ddd;
    }
    
    .nav-tabs > li {
        flex: 1 1 auto;
        min-width: 80px;
    }
    
    .nav-tabs > li > a {
        font-size: 13px;
        padding: 8px 12px;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .nav-tabs > li {
        flex: 1 1 100%;
        margin-bottom: 0;
    }
    
    .nav-tabs > li > a {
        border-radius: 0;
        border-bottom: 1px solid #ddd;
    }
}

/* Alertas e mensagens */
@media (max-width: 576px) {
    .alert {
        font-size: 13px;
        padding: 10px 12px;
        margin-bottom: 15px;
    }
    
    .alert-dismissible .close {
        padding: 8px 10px;
    }
}

/* Paginação */
@media (max-width: 576px) {
    .pagination {
        font-size: 12px;
    }
    
    .pagination > li > a,
    .pagination > li > span {
        padding: 5px 8px;
    }
    
    .pagination > li:not(.active):not(.disabled):not(:first-child):not(:last-child) {
        display: none; /* Esconde páginas intermediárias em mobile */
    }
}

/* Wrap para conteúdo - desabilitado para não conflitar com footer */
/* .wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.wrap > .container {
    flex: 1;
} */

/* Overflow de texto */
.text-truncate-mobile {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .text-truncate-mobile {
        max-width: 200px;
    }
}

@media (max-width: 576px) {
    .text-truncate-mobile {
        max-width: 150px;
    }
}


