/* Reset básico para garantir que as porcentagens funcionem */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Container principal que segura Sidebar e Conteúdo */
.wrapper {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* --- SIDEBAR FIXA (18%) --- */
.sidebar {
    width: 18%;
    min-width: 160px; 
    background-color: #1a252f; 
    color: white;
    padding: 20px 10px;
    overflow-y: auto; 
    box-sizing: border-box;
    border-right: 1px solid #34495e;
}

/* CONTEÚDO PRINCIPAL (82%) */
.main-content {
    width: 82%;
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto; 
    background-color: #f4f7f6;
    box-sizing: border-box;
}

/* Títulos das Categorias (Consultas, Gestão, etc) */
.sidebar h4 {
    margin: 20px 0 10px 5px;
    font-size: 1.5rem;
    color: #95a5a6;
    letter-spacing: 1px;
    margin-left: 2rem;
    text-decoration: underline;
    text-decoration-thickness: 1.25px;
    text-underline-offset: 5px;
}

/* Listas e Itens */
.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    margin-left: 2rem;

}

.sidebar li {
    margin-bottom: 5px;
}

.sidebar a {
    color: #ecf0f1;
    text-decoration: none;
    display: block;
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 1.1rem;
    transition: background 0.3s;
}

.sidebar a:hover {
    background-color: #34495e;
    color: #3498db;
}

/* Submenus (Recuo Hierárquico) */
.sidebar .submenu {
    margin-left: 15px;
    border-left: 1px solid #34495e;
}

.sidebar .submenu li a {
    font-size: 1rem;
    color: #bdc3c7;
}

.sidebar .menu-label {
    padding: 8px 10px;
    font-size: 1.1rem;
    color: #ecf0f1;
}

/* --- ESTILO DAS TABELAS DE CONSULTA --- */
.container-tab-consulta {
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
    max-height: calc(115vh - 250px); 
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    overflow: auto;     
}

.titulo-pagina {
    margin-bottom: 20px;
    color: #2c3e50;
    border-left: 5px solid #2c3e50;
    padding-left: 10px;
    text-transform: none;
}

.table-consulta {
    width: 100%;
    min-width: 1200px;
    border-collapse: collapse;
    background-color: white;
    font-size: 0.9em;
}

.table-consulta thead {
    background-color: #2c3e50;
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table-consulta th {
    padding: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85em;
    text-align: center;
    background-color: #2c3e50;
}

.table-consulta tbody tr {
    text-align: center;
    border-bottom: 1px solid #ddd;
}

.table-consulta td {
    padding: 10px;
    color: #333;
}

/* --- COLUNAS FIXAS DO PANORAMA --- */
.table-consulta-panorama {
    width: 100%;
    min-width: 1200px;
    border-collapse: collapse;
    background-color: white;
    font-size: 0.9em;
}

.table-consulta-panorama thead {
    background-color: #2c3e50;
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table-consulta-panorama th {
    padding: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85em;
    text-align: center;
    background-color: #2c3e50;
}

.table-consulta-panorama tbody tr {
    text-align: center;
    border-bottom: 1px solid #ddd;
}

.table-consulta-panorama td {
    padding: 10px;
    color: #333;
}

.table-consulta-panorama tbody tr.linha-atraso td {
    background-color: #d9534f;
    color: white;
    font-weight: bold;
}

.table-consulta-panorama tbody tr:hover td {
    background-color: #f1f4f6 !important;
    transition: background-color 0.2s;
}

.table-consulta-panorama tbody tr.linha-atraso:hover td {
    background-color: #f1f4f6 !important;
    color:#d9534f !important; 
}

/* --- Fixando colunas do panorama --- */
.table-consulta-panorama th:nth-child(1),
.table-consulta-panorama td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 2;
}

.table-consulta-panorama th:nth-child(2),
.table-consulta-panorama td:nth-child(2) {
    position: sticky;
    left: 97px;
    z-index: 2;
}

.table-consulta-panorama th:nth-child(3),
.table-consulta-panorama td:nth-child(3) {
    position: sticky;
    left: 401px;
    z-index: 2;
}

.table-consulta-panorama thead th:nth-child(1),
.table-consulta-panorama thead th:nth-child(2),
.table-consulta-panorama thead th:nth-child(3) {
    z-index: 3;
    background-color: #2c3e50;
}

.table-consulta-panorama tbody tr:not(.linha-atraso) td:nth-child(1),
.table-consulta-panorama tbody tr:not(.linha-atraso) td:nth-child(2),
.table-consulta-panorama tbody tr:not(.linha-atraso) td:nth-child(3) {
    background-color: white;
}

.table-consulta-panorama tbody tr.linha-atraso td:nth-child(1),
.table-consulta-panorama tbody tr.linha-atraso td:nth-child(2),
.table-consulta-panorama tbody tr.linha-atraso td:nth-child(3) {
    background-color: #d9534f;
}

.table-consulta-panorama tbody tr:hover td:nth-child(1),
.table-consulta-panorama tbody tr:hover td:nth-child(2),
.table-consulta-panorama tbody tr:hover td:nth-child(3) {
    background-color: #f1f4f6 !important;
}

.table-consulta-panorama tbody tr.linha-atraso:hover td:nth-child(1),
.table-consulta-panorama tbody tr.linha-atraso:hover td:nth-child(2),
.table-consulta-panorama tbody tr.linha-atraso:hover td:nth-child(3) {
    background-color: #f1f4f6 !important;
    color: #d9534f !important;
}

    /* --- CONTAINER DO MAPA COM ZOOM --- */
.container-mapa {
    margin-top: 30px;
    text-align: left;
}

.map-wrapper {
    width: 100%;
    max-height: 800px; 
    overflow: auto; 
    border: 2px solid #ddd;
    border-radius: 8px;
    background-color: #f8f9fa;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
}

.map-wrapper img {
    display: block;
    margin: 0 auto;
    max-width: 100%; /* Inicia ajustado ao container */
    height: auto;
    transition: all 0.3s ease-in-out;
    cursor: zoom-in;
    transform-origin: top center; /* Melhor para navegação com scroll */
}

/* Classe aplicada via JS */
.map-wrapper img.img-zoom-active {
    max-width: none !important; 
    width: 300% !important; /* Define o nível de zoom */
    cursor: zoom-out;
}

.map-instrucao {
    font-size: 0.9rem;
    color: #666;
    margin-top: 10px;
}

/* DESTAQUE DE LINHA (HOVER) */
.table-consulta tbody tr:hover td {
    background-color: #f1f4f6 !important;
    transition: background-color 0.2s;
}

        /* Com atraso */
.table-consulta tbody tr.linha-atraso:hover td {
    background-color: #f1f4f6 !important;
    color:#d9534f !important; 
}

.legenda-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 0.9em;
}

.legenda-label {
    font-weight: bold;
    color: #2c3e50;
}

.legenda-item {
    padding: 4px 10px;
    border-radius: 4px;
}

.legenda-atraso {
    background-color: #d9534f;
    color: white;
    font-weight: bold;
}

/* --- ESTILO DOS FILTROS --- */
.filtros-container {
    background-color: #fff;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.filtros-form {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
    width: 100%;
}

.filtro-grupo {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filtro-grupo label {
    font-size: 0.85em;
    font-weight: bold;
    color: #2c3e50;
}

.filtro-grupo select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    min-width: 150px;
}

.filtro-grupo-largo {
    flex: 0 0 100%; 
    width: 100%;
    clear: both;
    box-sizing: border-box;
}

.filtro-grupo-largo select {
    width: 100%;
    min-width: 100% !important; 
    box-sizing: border-box;
}

.campos-login input {
    max-width: 250px !important;
    width: 100% !important;
    height: 20px;
}

.btn-limpar {
    text-decoration: none;
    color: #000000;
    font-size: 0.9em;
    margin-left: 10px;
    height: 38px;
    display: flex;
    align-items: center;
}

.table-consulta tbody tr.linha-atraso td {
    background-color: #d9534f;
    color: white;
    font-weight: bold;
}

/* RESUMO RÁPIDO */
.header-resumo-info {
    padding: 10px 0;
    margin-bottom: 20px;
}

.resumo-main-title { 
    margin: 0; 
    color: #2c3e50; 
    font-size: 1.3rem; 
}

.resumo-metadados { 
    margin-top: 10px; 
    color: #000; 
}

.pipe { 
    color: #ccc; 
    margin: 0 5px; 
}

/* Cards de Manutenção */
.card-manutencao {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px !important;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.card-header-unidade {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    font-weight: bold;
    color: #000;
}

.card-body-content p {
    margin: 8px 0 0 0;
    color: #000;
    line-height: 1.5;
}

.box-entrave {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    padding: 12px;
    margin-top: 15px;
    border-radius: 4px;
}

/* Botões de Cópia de Conteúdo */
.header-resumo-info, .card-manutencao {
    position: relative;
    padding-bottom: 20px;
}

.btn-copiar-solo {
    position: absolute;
    right: 15px;
    top: 15px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    transition: transform 0.2s ease;
}

/* Controle do tamanho do ícone PNG */
.btn-copiar-solo img {
    width: 20px;
    height: 20px;
    display: block;
}

.btn-copiar-solo:hover {
    transform: scale(1.1);
}

/* CONVERSOR ORÇAPOLO */
.form-conversor {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 600px;
}

.input-file-custom {
    padding: 10px;
    border: 1px dashed #3498db;
    border-radius: 4px;
    background: #f9f9f9;
    cursor: pointer;
}

/* BOTÕES */
.btn-principal {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background 0.3s;
    align-self: flex-start;
    margin: 8px auto 15px auto !important;
    text-decoration: none;
}

.btn-principal:hover {
    background-color: #2980b9;
}

.btn-login-logout {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    text-decoration: none;
    transition: background 0.3s;
    display: block;
    width: fit-content;
    margin: 6px auto 30px auto !important; 
    text-align: center;
    align-self: center;
}

.btn-login-logout:hover {
    background-color: #2980b9;
}

/* ALERTAS */
.alerta-sucesso {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    background-color: #e8f4fd;
    color: #2c3e50;
    border-left: 5px solid #3498db;
}

.alerta-erro {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    background-color: #fce4e4;
    color: #c0392b;
    border-left: 5px solid #e74c3c;
}