/* ---------- Estilos generales ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: "Segoe UI", Roboto, system-ui, sans-serif;
    background: #0d1117;
    color: #e6edf3;
    padding: 20px;
}
.container {
    max-width: 1300px;
    margin: 0 auto;
}
h1,
h2,
h3 {
    font-weight: 400;
}

/* ---------- Header mejorado ---------- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
    border-bottom: 1px solid #30363d;
    padding-bottom: 15px;
}
.header h1 {
    font-size: 1.8rem;
    background: linear-gradient(135deg, #58a6ff, #f0883e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.header .sub {
    font-size: 0.9rem;
    color: #8b949e;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.nav-links a {
    color: var(--blue-accent);
    text-decoration: none;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.nav-links a:hover {
    color: var(--brand-gold);
}
.badge {
    color: #8b949e;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ---------- FAQ (con Material Icons) ---------- */
.faq {
    background: #161b22;
    border-radius: 12px;
    padding: 15px 20px;
    margin-top: 25px;
    border: 1px solid #30363d;
}
.faq-item {
    border-bottom: 1px solid #30363d;
}
.faq-item:last-child {
    border-bottom: none;
}
.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    cursor: pointer;
    font-weight: 500;
    color: #f0f6fc;
    user-select: none;
}
.faq-question:hover {
    color: #58a6ff;
}
.faq-question .material-icons {
    font-size: 1.4rem;
    transition: transform 0.2s;
}
.faq-question.active .material-icons {
    transform: rotate(180deg);
}
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition:
        max-height 0.3s ease,
        padding 0.3s ease;
    padding: 0 5px;
    color: #c9d1d9;
    line-height: 1.6;
}
.faq-answer.open {
    max-height: 300px;
    padding-bottom: 18px;
}

/* ---------- Dashboard, mapa, panel, métricas, etc. (igual) ---------- */
.dashboard {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}
@media (max-width: 850px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
}
.map-container {
    background: #161b22;
    border-radius: 12px;
    border: 1px solid #30363d;
    overflow: hidden;
    height: 500px;
    position: relative;
}
#map {
    width: 100%;
    height: 100%;
}
.panel {
    background: #161b22;
    border-radius: 12px;
    border: 1px solid #30363d;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.panel h3 {
    font-size: 1.1rem;
    color: #f0f6fc;
    border-bottom: 1px solid #30363d;
    padding-bottom: 10px;
}
.metric-card {
    background: #0d1117;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid #58a6ff;
}
.metric-card .value {
    font-size: 2rem;
    font-weight: 300;
    color: #f0f6fc;
}
.metric-card .label {
    font-size: 0.85rem;
    color: #8b949e;
    margin-top: 4px;
}
.toggle-group {
    display: flex;
    gap: 10px;
    background: #0d1117;
    padding: 6px;
    border-radius: 30px;
    border: 1px solid #30363d;
}
.toggle-btn {
    flex: 1;
    padding: 10px 0;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    background: transparent;
    color: #8b949e;
    transition: all 0.2s;
}
.toggle-btn.active {
    background: #238636;
    color: #fff;
}
.toggle-btn:first-child.active {
    background: #da3633;
    color: #fff;
}
.export-btn {
    background: #238636;
    border: none;
    color: #fff;
    padding: 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 10px;
}
.export-btn:hover {
    background: #2ea043;
}

/* ---------- Modal ---------- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
.modal-overlay.open {
    display: flex;
}
.modal {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 16px;
    padding: 30px 35px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}
.modal h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #f0f6fc;
}
.modal p {
    color: #8b949e;
    margin-bottom: 20px;
    font-size: 0.95rem;
}
.modal .close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.8rem;
    cursor: pointer;
    color: #8b949e;
    background: none;
    border: none;
}
.modal .close:hover {
    color: #f0f6fc;
}
.modal label {
    display: block;
    margin-top: 15px;
    font-weight: 500;
    color: #c9d1d9;
}
.modal input,
.modal select {
    width: 100%;
    padding: 10px 12px;
    margin-top: 5px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    color: #e6edf3;
    font-size: 0.95rem;
}
.modal input:focus,
.modal select:focus {
    outline: none;
    border-color: #58a6ff;
}
.modal .submit-btn {
    width: 100%;
    margin-top: 25px;
    padding: 14px;
    background: #238636;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
}
.modal .submit-btn:hover {
    background: #2ea043;
}

.footer {
    text-align: center;
    color: #8b949e;
    font-size: 0.85rem;
    margin-top: 30px;
    border-top: 1px solid #30363d;
    padding-top: 20px;
}
.footer a {
    color: #58a6ff;
    text-decoration: none;
}
.leaflet-control-attribution {
    background: #0d1117 !important;
    color: #8b949e !important;
}
