/* ── VARIABLES ─────────────────────────────────────────────── */
:root {
    --sidebar-w: 260px;
    --topbar-h: 56px;
    --transition: 0.28s cubic-bezier(.4,0,.2,1);
}

body {
    overflow-x: hidden;
    background: #f4f6fb;
}

/* ── OVERLAY ────────────────────────────────────────────────── */
#sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1040;
    backdrop-filter: blur(2px);
}

    #sidebar-overlay.show {
        display: block;
    }

/* ── SIDEBAR ────────────────────────────────────────────────── */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: linear-gradient(180deg, #1a1f36 0%, #2c3358 100%);
    color: #fff;
    z-index: 1050;
    transform: translateX(calc(-1 * var(--sidebar-w)));
    transition: transform var(--transition);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(0,0,0,0.18);
}

    #sidebar.open {
        transform: translateX(0);
    }

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: var(--topbar-h);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.sidebar-brand {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    text-decoration: none;
    letter-spacing: 0.3px;
}

    .sidebar-brand:hover {
        color: #90caf9;
    }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

    .sidebar-nav::-webkit-scrollbar {
        width: 4px;
    }

    .sidebar-nav::-webkit-scrollbar-track {
        background: transparent;
    }

    .sidebar-nav::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.15);
        border-radius: 2px;
    }

.sidebar-section {
    padding: 6px 16px 2px;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.4);
    font-weight: 600;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: rgba(255,255,255,0.82);
    text-decoration: none;
    font-size: 0.88rem;
    transition: background 0.15s, color 0.15s, padding-left 0.15s;
    border-left: 3px solid transparent;
}

    .sidebar-item:hover {
        background: rgba(255,255,255,0.08);
        color: #fff;
        padding-left: 24px;
        border-left-color: #90caf9;
    }

    .sidebar-item.active {
        background: rgba(144,202,249,0.15);
        color: #90caf9;
        border-left-color: #90caf9;
        font-weight: 600;
    }

    .sidebar-item i {
        font-size: 1.05rem;
        flex-shrink: 0;
    }

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

    .sidebar-footer .user-info {
        font-size: 0.82rem;
        color: rgba(255,255,255,0.7);
        margin-bottom: 8px;
    }

    .sidebar-footer .user-name {
        font-weight: 600;
        color: #fff;
        font-size: 0.9rem;
    }

    .sidebar-footer .user-role {
        display: inline-block;
        background: rgba(144,202,249,0.2);
        color: #90caf9;
        font-size: 0.7rem;
        padding: 1px 7px;
        border-radius: 20px;
        margin-top: 2px;
    }

/* ── TOPBAR ─────────────────────────────────────────────────── */
#topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid #e0e4ef;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.topbar-brand {
    font-weight: 700;
    color: #1a1f36;
    font-size: 1rem;
    text-decoration: none;
}

    .topbar-brand:hover {
        color: #1565c0;
    }

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-bd {
    font-size: 0.78rem;
    background: #e3f0ff;
    color: #1565c0;
    border-radius: 20px;
    padding: 3px 10px;
    font-weight: 600;
}

.btn-hamburger {
    border: none;
    background: none;
    padding: 6px 8px;
    cursor: pointer;
    color: #1a1f36;
    font-size: 1.3rem;
    border-radius: 6px;
    transition: background 0.15s;
}

    .btn-hamburger:hover {
        background: #f0f4ff;
    }

/* ── MAIN CONTENT ───────────────────────────────────────────── */
#main-content {
    min-height: calc(100vh - var(--topbar-h));
    padding: 28px 24px;
}

/* ── GREETING CARD ──────────────────────────────────────────── */
.greeting-card {
    background: linear-gradient(135deg, #1565c0 0%, #283593 100%);
    color: #fff;
    border-radius: 16px;
    padding: 28px 32px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

    .greeting-card::after {
        content: '\F4F1';
        font-family: 'bootstrap-icons';
        position: absolute;
        right: 24px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 5rem;
        opacity: 0.12;
    }

    .greeting-card h2 {
        font-weight: 700;
        font-size: 1.5rem;
        margin: 0 0 4px;
    }

    .greeting-card p {
        opacity: 0.85;
        margin: 0;
        font-size: 0.95rem;
    }

.greeting-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 0.78rem;
    margin-bottom: 8px;
}

/* ── MÓDULOS ────────────────────────────────────────────────── */
.modulos-heading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modulos-heading-toggle {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s, box-shadow 0.15s;
}

    .modulos-heading-toggle:hover,
    .modulos-heading-toggle:focus-visible,
    .modulos-heading-toggle.is-expanded {
        background: #e8f1ff;
        box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.12);
        outline: 0;
    }

.modulos-accordion {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modulo-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    overflow: hidden;
}

.modulo-section-toggle {
    width: 100%;
    border: 0;
    background: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    color: #111827;
}

    .modulo-section-toggle span:first-child {
        display: inline-flex;
        align-items: center;
        gap: 10px;
    }

    .modulo-section-toggle .bi {
        font-size: 1.05rem;
    }

.modulo-section-chevron {
    transition: transform 0.2s ease;
}

.modulo-section-toggle:not(.collapsed) .modulo-section-chevron {
    transform: rotate(180deg);
}

.modulo-section-body {
    padding: 0 16px 16px;
}

.modulo-card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 1px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

    .modulo-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 24px rgba(0,0,0,0.13);
        color: inherit;
        text-decoration: none;
    }

.modulo-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 12px;
}

.modulo-card .card-body {
    padding: 20px;
}

.modulo-card h6 {
    font-weight: 700;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.modulo-card p {
    font-size: 0.78rem;
    color: #6b7280;
    margin: 0;
}

#contenedorAccesosRapidos {
    border-radius: 12px;
    min-height: 40px;
}

.acceso-controles {
    z-index: 2;
    display: none;
}

#contenedorAccesosRapidos.modo-edicion .acceso-controles {
    display: flex;
}

/* ── NOTICIAS ───────────────────────────────────────────────── */
.noticia-card {
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 12px;
}

    .noticia-card .noticia-fecha {
        font-size: 0.75rem;
        color: #9ca3af;
    }

.noticia-pinned::before {
    content: '📌 ';
}

.noticia-adjuntos {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}

.noticia-adjunto-imagen img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(0,0,0,0.08);
    display: block;
    transition: transform .15s ease;
}

    .noticia-adjunto-imagen:hover img {
        transform: scale(1.04);
    }

.noticia-adjunto-archivo {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8f9fa;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.78rem;
    color: #495057;
    text-decoration: none;
    max-width: 180px;
}

    .noticia-adjunto-archivo:hover {
        background: #eef1f4;
        color: #212529;
    }

    .noticia-adjunto-archivo i {
        font-size: 1rem;
        flex-shrink: 0;
    }

    .noticia-adjunto-archivo span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
