:root {
    --azul-gris-bg: #57727a;
    --ocre-arena: #bda76c;
    --ocre-borde: #b18b68;
    --blanco: #ffffff;
    --gris-fondo: #f0f2f5;
    --degradado-corp: linear-gradient(135deg, rgb(72, 102, 139) 30%, #bda76c 100%);
}


body { margin: 0; padding: 0; font-family: 'Roboto', sans-serif; height: 100vh; display: flex; flex-direction: column; background: var(--gris-fondo); overflow: hidden; }

#login-screen {
    position: fixed; inset: 0; background: var(--degradado-corp);
    display: flex; justify-content: center; align-items: center; z-index: 5000;
}
.login-card {
    background: white; padding: 40px; border-radius: 15px; width: 350px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5); text-align: center;
    border-top: 5px solid var(--ocre-borde);
}
.login-card h2 { color: var(--azul-gris-bg); margin-top: 0; margin-bottom: 25px; font-weight: bold; }
.login-card input { width: 100%; padding: 12px; margin-bottom: 15px; border: 1px solid #ddd; border-radius: 8px; box-sizing: border-box; }
.btn-login { width: 100%; padding: 12px; background: var(--ocre-borde); color: white; border: none; border-radius: 8px; cursor: pointer; font-weight: bold; font-size: 16px; }

.header-corp {
    background: var(--degradado-corp) !important;
    color: var(--blanco); padding: 12px 25px; font-size: 18px; font-weight: bold;
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3); border-bottom: 3px solid var(--ocre-borde); z-index: 2000;
}
.header-left { display: flex; justify-content: flex-start; }
.header-center { display: flex; justify-content: center; }
.header-right { display: flex; justify-content: flex-end; align-items: center; gap: 20px; }

.main-nav { display: flex; gap: 10px; }
.btn-nav {
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.3);
    color: white; padding: 6px 15px; border-radius: 4px; cursor: pointer;
    font-size: 12px; font-weight: bold; transition: 0.3s;
}
.btn-nav.active { background: var(--ocre-borde); border-color: var(--ocre-borde); }

#visor-content { display: none; flex-direction: column; height: 100vh; width: 100vw; }
.main-container { flex-grow: 1; position: relative; overflow: hidden; display: flex; }
.sub-view { display: none; width: 100%; height: 100%; }
.sub-view.active-view { display: flex; }

#map { width: 100%; height: 100%; background: #1a1a1a; }
.sidebar { position: absolute; top: 15px; left: 55px; z-index: 1000; width: 310px; display: flex; flex-direction: column; gap: 15px; max-height: calc(100% - 30px); pointer-events: none; }
.sidebar .card { pointer-events: auto; background: white; border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,0.3); padding: 18px; }

#listaCapas { list-style: none; padding: 0; margin: 0; max-height: 200px; overflow-y: auto; }
.capa-item { background: #f8fafc; padding: 8px; border-radius: 6px; margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; border-left: 4px solid var(--ocre-borde); border: 1px solid #e2e8f0; }
.capa-item.oculta { opacity: 0.5; border-left-color: #cbd5e0; }
.capa-nombre { font-weight: bold; color: #2d3748; font-size: 11px; display: block; }
.capa-meta { color: #718096; font-size: 9px; }
.capa-controles { display: flex; gap: 5px; }
.btn-accion { border: none; padding: 4px 6px; border-radius: 4px; cursor: pointer; font-size: 12px; }

.btn-descargar { background: #e0f2fe; color: #0369a1; }
.btn-descargar:hover { background: #bae6fd; }
.btn-ver.activo { background: #c6f6d5; color: #27ae60; }
.btn-borrar { background: #fee2e2; color: #dc2626; }

.info.legend { padding: 12px; background: rgba(255, 255, 255, 0.95); border-radius: 8px; box-shadow: 0 0 15px rgba(0,0,0,0.2); width: 160px; max-height: 40vh; overflow-y: auto; font-size: 11px; }
.info.legend strong { display: block; margin-bottom: 5px; color: var(--azul-gris-bg); border-bottom: 1px solid #ddd; }

.sidebar-stats { width: 310px; padding: 15px; background: #f8fafc; border-right: 1px solid #ddd; }
.stats-display { flex-grow: 1; padding: 30px; display: flex; justify-content: center; overflow-y: auto; }
.chart-container { width: 100%; max-width: 900px; height: 500px; display: flex; flex-direction: column; align-items: center; justify-content: center; }

h3 { margin: 0 0 15px 0; color: #2c3e50; font-size: 15px; border-bottom: 2px solid var(--ocre-borde); padding-bottom: 8px; }
.loader { font-size: 10px; color: var(--ocre-borde); display: none; margin-bottom: 8px; font-weight: bold; text-align: center; }
.btn-cargar { width: 100%; padding: 10px; background: var(--ocre-borde); color: white; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; }
.user-info { font-size: 12px; font-weight: normal; background: rgba(255,255,255,0.15); padding: 5px 12px; border-radius: 20px; }
.btn-logout { background: #e74c3c; color: white; border: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 11px; font-weight: bold; }

.footer-corp { background: var(--degradado-corp) !important; border-top: 3px solid var(--ocre-borde) !important; color: #ffffff !important; display: flex; justify-content: space-between; align-items: flex-start; padding: 12px 30px; font-size: 11px; z-index: 2000; }
.footer-column { display: flex; flex-direction: column; gap: 2px; }
.footer-column.right { text-align: right; }
.footer-column a { color: var(--blanco) !important; text-decoration: underline; font-weight: bold; }


.info.legend {
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    font-family: Arial, sans-serif;
    max-height: 400px;
    overflow-y: auto;
    line-height: 18px;
    color: #333;
}

.legend-item {
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.legend-scale {
    display: flex;
    align-items: center;
    margin-top: 5px;
}

.legend-color-bar {
    height: 15px;
    width: 100px;
    border: 1px solid #999;
    margin-right: 8px;
}

.legend-labels {
    font-size: 11px;
    display: flex;
    justify-content: space-between;
    width: 100px;
}
/* En styles.css */
.btn-download {
    width: 100%;
    padding: 10px;
    background: #27ae60; /* Color verde para diferenciar descargas */
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
    transition: 0.3s;
}

.btn-download:hover {
    background: #219150;
}