:root {
    --primary-color: #ef4444; /* Rojo vibrante de la imagen */
    --primary-soft: rgba(239, 68, 68, 0.1);
    --secondary-color: #10b981; /* Verde médico scrubs */
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7); /* Glassmorphism */
    --border-color: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-color: #3b82f6; 
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.5);
    --radius-md: 16px;
    --sidebar-width: 260px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Inter', system-ui, sans-serif;
}

body {
    background: transparent;
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
}

/* Sidebar / Dashboard Layout */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(15px);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    transition: all 0.2s;
    margin-bottom: 0.5rem;
}

.nav-link:hover, .nav-link.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 2rem;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.interactive-map-container {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    padding: 2rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

#peru-svg-map {
    width: 100%;
    max-height: 70vh;
    cursor: crosshair;
}

#peru-svg-map path {
    fill: #1e293b;
    stroke: rgba(255,255,255,0.2);
    stroke-width: 0.8;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#peru-svg-map path:hover {
    fill: var(--accent-color);
}

#peru-svg-map path.selected {
    fill: var(--primary-color);
}

/* Modal / Form Styles */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #1e293b;
    padding: 2.5rem;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    color: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(15, 23, 42, 0.8);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.85rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #2563eb;
}

/* Table Enhancements */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    color: var(--text-main);
}

th {
    text-align: left;
    padding: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 1rem;
    background: rgba(30, 41, 59, 0.5);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

td:first-child {
    border-left: 1px solid var(--border-color);
    border-radius: 12px 0 0 12px;
}

td:last-child {
    border-right: 1px solid var(--border-color);
    border-radius: 0 12px 12px 0;
}

tr:hover td {
    background: rgba(30, 41, 59, 0.8);
    border-color: var(--primary-color);
}

.btn-action {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-info {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

.btn-review {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

.btn-info:hover { background: #3b82f6; color: white; }
.btn-review:hover { background: #10b981; color: white; }

@media (max-width: 768px) {
    .sidebar {
        width: 260px !important;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 1000;
        box-shadow: 5px 0 15px rgba(0,0,0,0.5);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .mobile-toggle {
        display: block !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 1.5rem 1rem !important;
        width: 100vw;
        overflow-x: hidden;
    }

    .header, header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem;
    }

    .user-profile {
        margin-top: 1rem;
        align-self: flex-start;
    }

    /* Tablas y grids para no romper layout */
    .plazas-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .review-grid, .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
