body {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    background-color: #f4f6f9;
}

#contenedor {
    display: flex;
    position: relative;
}

#contenido {
    flex: 1;
    padding: 30px 40px;
    margin-left: 250px;
    min-height: 100vh;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.header-fecha {
    background: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 12px;
    color: #888;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Card Bienvenida */
.card-bienvenida {
    background: linear-gradient(135deg, #1a3a6b 0%, #2e6da4 100%);
    border-radius: 20px;
    padding: 35px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 20px rgba(26, 58, 107, 0.3);
    position: relative;
    overflow: hidden;
}

.bienvenida-texto h1 { font-size: 26px; margin-bottom: 10px; }
.bienvenida-icono { font-size: 70px; opacity: 0.2; }

.bienvenida-icono-img {
    width: 120px;
    height: auto;
    opacity: 0.85;
    filter: brightness(0) invert(1);
}

.datos-chips { display: flex; gap: 10px; margin-top: 15px; flex-wrap: wrap; }
.chip {
    background: rgba(255,255,255,0.2);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
}

/* Grid de Tarjetas */
.tarjetas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.tarjeta {
    padding: 25px;
    border-radius: 15px;
    color: white;
    position: relative;
    overflow: hidden;
}

.t-azul      { background: linear-gradient(135deg, #1a3a6b, #2e6da4); }
.t-azulclaro { background: linear-gradient(135deg, #4a90c4, #72b4e0); }
.t-verde     { background: linear-gradient(135deg, #4a7c3f, #6aab5a); }

.t-label { font-size: 11px; text-transform: uppercase; opacity: 0.8; margin: 10px 0 5px; }
.t-valor { font-size: 24px; font-weight: 700; }
.t-sub   { font-size: 11px; opacity: 0.7; }

/* Sidebar - ítem activo y hover */
.nav-item:hover, .nav-item.active {
    background: #eef3fb;
    color: #1a3a6b;
    border-left: 4px solid #1a3a6b;
}

.sidebar-logo i { color: #1a3a6b; }

/* Botón inscripción */
.btn-inscripcion {
    display: inline-block;
    margin-top: 15px;
    padding: 8px 15px;
    background: white;
    color: #4a7c3f;
    text-decoration: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

/* Título de sección */
.seccion-titulo {
    font-size: 16px;
    font-weight: 700;
    color: #3b4a6b;
    margin-bottom: 18px;
}

/* Círculos decorativos en tarjetas */
.tarjeta::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
}

.tarjeta::after {
    content: '';
    position: absolute;
    bottom: -40px;
    right: 40px;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

/* Sección Trámites */
.tramites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 300px));
    gap: 20px;
}

/* Círculos decorativos en card de bienvenida */
.card-bienvenida::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.card-bienvenida::after {
    content: '';
    position: absolute;
    bottom: -60px;
    right: 80px;
    width: 160px;
    height: 160px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

/* ==== LOADING / ERROR - DASHBOARD ==== */
#index_loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 80px 20px;
    color: #555;
    font-size: 14px;
    gap: 15px;
}

#index_error {
    display: none;
    text-align: center;
    padding: 40px 20px;
    color: #c0392b;
    font-size: 14px;
    font-weight: 600;
    background: #fdf0ef;
    border-radius: 12px;
    border: 1px solid #f5c6c2;
    margin-top: 20px;
}

/* Media query para dispositivos móviles */
@media screen and (max-width: 768px) {
    #contenido {
        padding: 20px 15px; /* Reducimos padding lateral en móvil */
        margin-left: 0;     /* Aseguramos que no haya margen del sidebar */
    }

    .datos-chips {
        display: flex;
        flex-wrap: wrap;   /* Se acomodan uno al lado del otro y bajan si no caben */
        gap: 8px;
    }

    .chip {
        flex-shrink: 0;    /* Evita que se compriman raro */
    }

    .tramites-grid {
        display: flex;
        flex-direction: column; /* Cambia de grid a lista vertical */
        gap: 15px;
    }

    /* Forzamos que cada tarjeta ocupe el 100% */
    .tramites-grid .tarjeta {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        box-sizing: border-box; /* Para que el padding no sume al ancho */
    }

    .card-bienvenida {
        padding: 25px; /* Ajuste ligero para que no se vea tan gigante en móvil */
    }
}