@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@400;600;700&display=swap');

* {
    box-sizing: border-box;
}

body, html {
    background: #f3f4f6;
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    color: #1f2937;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Screen de Inicio de Sesion */
.login-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: radial-gradient(circle at center, #DA291C 0%, #a81c12 100%);
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    z-index: 9999;
}

.login-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    padding: 40px;
    width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

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

.login-logo-img {
    width: 200px;
    margin-bottom: 20px;
}

.login-title {
    margin-bottom: 25px;
    line-height: 1.3;
    text-align: center;
}

.login-main-title {
    color: #1f2937;
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 700;
}

.login-subtitle {
    color: #DA291C;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    margin-top: 4px;
}

.login-card label {
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    display: block;
    margin-bottom: 6px;
}

.login-card input {
    background: #f9fafb !important;
    border: 1px solid #d1d5db !important;
    color: #111827 !important;
    border-radius: 8px !important;
    padding: 12px 14px !important;
    margin-bottom: 18px !important;
    width: 100% !important;
    font-size: 14px !important;
    transition: all 0.2s ease;
}

.login-card input:focus {
    border-color: #DA291C !important;
    box-shadow: 0 0 0 3px rgba(218, 41, 28, 0.2) !important;
    outline: none !important;
    background: #ffffff !important;
}

.login-btn {
    background: #DA291C !important;
    border: none !important;
    color: #ffffff !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    width: 100% !important;
    cursor: pointer !important;
    box-shadow: 0 4px 6px -1px rgba(218, 41, 28, 0.3) !important;
    transition: all 0.2s ease !important;
    margin-top: 10px !important;
}

.login-btn:hover {
    background: #b91c1c !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 12px -1px rgba(218, 41, 28, 0.4) !important;
}

.login-footer {
    margin-top: 30px;
    color: #ffffff;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    max-width: 480px;
    line-height: 1.4;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.error-msg {
    color: #b91c1c;
    margin-top: 15px;
    font-size: 13px;
    font-weight: 600;
    background: #fee2e2;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #fca5a5;
}

/* Layout Principal */
.main-layout {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.map-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Panel Flotante de Filtros */
.floating-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 350px;
    max-height: calc(100vh - 40px);
    background: #ffffff;
    border: 2px solid #DA291C;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.floating-panel.collapsed {
    transform: translateX(-370px);
    opacity: 0;
    pointer-events: none;
}

.panel-header {
    padding: 15px 20px;
    border-bottom: 1.5px solid #DA291C;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fdf2f2;
}

.panel-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: #DA291C;
}

.panel-subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 11px;
    color: #6b7280;
    margin-top: 2px;
}

.close-btn {
    background: transparent;
    border: none;
    color: #DA291C;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 50%;
    transition: background 0.2s;
}

.close-btn:hover {
    background: rgba(218, 41, 28, 0.08);
}

.panel-content {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
    background: #ffffff;
}

/* Boton de Mostrar Filtros cuando esta colapsado */
.expand-btn-container {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 999;
}

.expand-btn {
    background: #ffffff;
    border: 2px solid #DA291C;
    color: #DA291C;
    border-radius: 8px;
    padding: 10px 18px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
}

.expand-btn:hover {
    background: #fdf2f2;
    transform: scale(1.02);
}

/* Selectores de Comuna */
.comuna-select-container {
    margin-bottom: 16px;
}

.comuna-select-container label {
    font-size: 12px;
    color: #DA291C;
    font-weight: 700;
    margin-bottom: 6px;
    display: block;
    letter-spacing: 0.5px;
}

.comuna-select-container select {
    background: #ffffff;
    border: 1px solid #d1d5db;
    color: #0f172a;
    border-radius: 6px;
    padding: 8px 12px;
    width: 100%;
    font-size: 14px;
}

.checkbox-container {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.checkbox-container input[type="checkbox"] {
    accent-color: #DA291C;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Botones auxiliares de seleccion masiva de Nodos */
.nodos-action-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.btn-action-mini {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #374151;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-action-mini:hover {
    background: #e5e7eb;
    color: #111827;
}

/* Lista compacta de Nodos */
.compact-node-list {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 12px;
    background: #f9fafb;
}

.compact-node-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 4px;
    font-size: 13px;
    font-weight: 500;
    color: #1f2937;
    cursor: pointer;
}

.compact-node-item input[type="checkbox"] {
    accent-color: #DA291C;
    width: 15px;
    height: 15px;
}

/* Boton de Aplicar Seleccion */
.btn-aplicar {
    background: #DA291C;
    border: none;
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 14px;
    padding: 10px 16px;
    border-radius: 8px;
    width: 100%;
    cursor: pointer;
    margin-top: 14px;
    box-shadow: 0 4px 6px -1px rgba(218, 41, 28, 0.25);
    transition: all 0.2s ease;
}

.btn-aplicar:hover {
    background: #b91c1c;
    box-shadow: 0 6px 10px -1px rgba(218, 41, 28, 0.35);
}

/* User Badge */
.user-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #ffffff;
    border: 1.5px solid #e5e7eb;
    border-radius: 30px;
    padding: 6px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.logout-btn {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #ef4444;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.logout-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

/* Leyenda del Mapa */
.map-legend-container {
    position: absolute;
    bottom: 24px;
    right: 24px;
    background: #ffffff;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 14px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.map-legend-title {
    font-family: 'Outfit', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    text-align: center;
}

.map-legend-grid {
    display: flex;
    gap: 2px;
}

.map-legend-cell {
    width: 24px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    border-radius: 3px;
}

/* Control y Botón de Modo Despliegue */
.despliegue-toggle-container {
    margin-bottom: 16px;
}

.btn-despliegue {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #f8fafc;
    color: #475569;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-despliegue:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
    transform: translateY(-1px);
}

.btn-despliegue.active {
    background: linear-gradient(135deg, #DA291C 0%, #b91c1c 100%);
    border-color: #DA291C;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(218, 41, 28, 0.35);
}

.despliegue-btn-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.despliegue-btn-left i {
    font-size: 15px;
}

.despliegue-titulo {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.despliegue-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    background: #e2e8f0;
    color: #64748b;
    transition: all 0.25s ease;
}

.btn-despliegue.active .despliegue-badge {
    background: #ffffff;
    color: #DA291C;
}

.filtros-estandar-wrapper {
    transition: all 0.3s ease;
}

