:root {
    /* Paleta de colores más moderna y premium */
    --primary-color: #4f46e5;    /* Indigo */
    --primary-hover: #4338ca;
    
    --success-color: #10b981;    /* Emerald */
    --danger-color: #ef4444;     /* Red */
    --warning-color: #f59e0b;    /* Amber */
    --info-color: #0ea5e9;       /* Sky */

    --sidebar-bg: #0f172a;       /* Slate 900 */
    --sidebar-color: #cbd5e1;    /* Slate 300 */
    --sidebar-hover-bg: #1e293b; /* Slate 800 */
    --sidebar-width: 260px;
    
    --body-bg: #f1f5f9;          /* Slate 100 */
    --card-bg: #ffffff;
    
    --text-main: #1e293b;        /* Slate 800 */
    --text-muted: #64748b;       /* Slate 500 */
}

body {
    background-color: var(--body-bg);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Tipografía general */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.025em;
    color: #0f172a;
}

/* Sidebar Wrapper */
#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

#sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 15px rgba(0,0,0,0.05);
    z-index: 1000;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

#sidebar .sidebar-header {
    padding: 25px 20px;
    background: #0b1120; /* Ligeramente más oscuro que el sidebar */
    color: #fff;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

#sidebar .sidebar-header h5 {
    color: #fff;
    margin-bottom: 0;
}

#sidebar .sidebar-header i {
    font-size: 2.2rem;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #818cf8, #4f46e5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#sidebar ul.components {
    padding: 20px 0;
}

#sidebar ul li a {
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    color: var(--sidebar-color);
    text-decoration: none;
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
}

#sidebar ul li a:hover {
    color: #fff;
    background: var(--sidebar-hover-bg);
}

#sidebar ul li.active a {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.15) 0%, transparent 100%);
    border-left: 4px solid var(--primary-color);
}

#sidebar ul li a i {
    width: 25px;
    font-size: 1.1rem;
    text-align: center;
    margin-right: 12px;
    color: #64748b;
    transition: 0.2s;
}

#sidebar ul li a:hover i, #sidebar ul li.active a i {
    color: #818cf8; /* Indigo claro */
}

/* Page Content */
#content {
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    padding: 24px;
    min-height: 100vh;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Navbar */
.navbar {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    margin-bottom: 24px;
    padding: 12px 24px;
}

/* Cards (Tarjetas) */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    margin-bottom: 24px;
    background: var(--card-bg);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Efecto hover suave solo para tarjetas interactivas (opcional) */
.card.interactive:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid #f1f5f9;
    padding: 18px 24px;
}

.card-title {
    font-weight: 600;
}

/* Tablas */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 2px solid #e2e8f0;
    padding: 14px 20px;
}

.table td {
    padding: 16px 20px;
    vertical-align: middle;
    border-bottomColor: #f1f5f9;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* Botones (Sobrescribiendo Bootstrap) */
.btn {
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-sm {
    padding: 6px 12px;
    border-radius: 6px;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.4);
}

.btn-success { background-color: var(--success-color); border-color: var(--success-color); }
.btn-danger { background-color: var(--danger-color); border-color: var(--danger-color); }
.btn-warning { background-color: var(--warning-color); border-color: var(--warning-color); color: #fff;}
.btn-info { background-color: var(--info-color); border-color: var(--info-color); color: #fff;}

/* Formularios */
.form-control, .form-select {
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    transition: all 0.2s ease;
    background-color: #f8fafc;
}

.form-control:focus, .form-select:focus {
    background-color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-label {
    font-weight: 500;
    color: #475569;
    margin-bottom: 6px;
}

/* Alertas y Badges */
.badge {
    padding: 6px 10px;
    font-weight: 500;
    border-radius: 6px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    #sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
        box-shadow: none;
    }
    #sidebar.active {
        margin-left: 0;
        box-shadow: 4px 0 25px rgba(0,0,0,0.3);
    }
    #content {
        width: 100%;
        margin-left: 0;
        padding: 16px;
    }
    .navbar {
        border-radius: 8px;
        padding: 10px 16px;
    }
}

/* Dashboard summary cards override for modern look */
.bg-primary { background: linear-gradient(135deg, #4f46e5, #3b82f6) !important; }
.bg-success { background: linear-gradient(135deg, #10b981, #059669) !important; filter: none; }
.bg-warning { background: linear-gradient(135deg, #f59e0b, #d97706) !important; }
.bg-danger  { background: linear-gradient(135deg, #ef4444, #dc2626) !important; }

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Map container fixes */
#map {
    height: 400px;
    width: 100%;
    border-radius: 12px;
    z-index: 1;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}
