﻿/* =========================================================
   ADMIN SHELL
========================================================= */

.admin-shell {
    display: flex;
    min-height: 100vh;
    background: #f4f6f9;
    position: relative;
}

/* =========================================================
   SIDEBAR
========================================================= */

.admin-sidebar {
    width: 240px;
    position: relative;
    background: #0d6efd;
    color: #fff;
    flex-shrink: 0;
    transition: width .25s ease, transform .25s ease;
    z-index: 500;
}

/* =========================================================
   MAIN
========================================================= */

.admin-main {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 2rem 1.5rem;
    position: relative;
    z-index: auto ;
}

.admin-container {
    width: 100%;
    max-width: 1200px;
}

/* =========================================================
   PANEL BASE
========================================================= */

.admin-panel {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.8rem;
    box-shadow: 0 10px 30px rgba(0,0,0,.06);
}

/* =========================================================
   HEADER
========================================================= */

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 600;
}

/* =========================================================
   DASHBOARD
========================================================= */

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.metric-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 1.25rem 1.4rem;
    box-shadow: 0 8px 20px rgba(0,0,0,.06);
    position: relative;
    overflow: hidden;
}

    .metric-card::after {
        content: "";
        position: absolute;
        right: -30px;
        top: -30px;
        width: 120px;
        height: 120px;
        border-radius: 50%;
        opacity: .08;
    }

.metric-primary::after {
    background: #0d6efd;
}

.metric-success::after {
    background: #198754;
}

.metric-warning::after {
    background: #ffc107;
}

.metric-danger::after {
    background: #dc3545;
}

.metric-title {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
}

.metric-value {
    font-size: 2rem;
    font-weight: 800;
    margin-top: .4rem;
}

.metric-sub {
    font-size: .75rem;
    color: #adb5bd;
}

.dashboard-block {
    background: #fff;
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: 0 6px 16px rgba(0,0,0,.05);
}

/* =========================================================
   SIDEBAR MENU
========================================================= */

.admin-menu {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
}

.admin-menu-header {
    margin-bottom: 2rem;
}

.admin-title {
    font-size: 1.2rem;
    font-weight: 700;
}

.admin-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

    .admin-menu-list li {
        margin-bottom: .4rem;
    }

    .admin-menu-list a {
        display: flex;
        align-items: center;
        gap: .7rem;
        padding: .65rem .75rem;
        border-radius: 10px;
        color: rgba(255,255,255,.85);
        text-decoration: none;
        transition: background .2s ease;
    }

        .admin-menu-list a i {
            font-size: 1.1rem;
        }

    /* Hover */
    .admin-menu-list li:hover a {
        background: rgba(255,255,255,.15);
    }

    /* ACTIVO REAL */
    .admin-menu-list li.active a {
        background: rgba(255,255,255,.35);
        color: #fff;
        font-weight: 700;
        box-shadow: inset 4px 0 0 #fff;
    }

/* =========================================================
   FOOTER
========================================================= */

.admin-menu-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,.2);
}

.back-link {
    color: rgba(255,255,255,.85);
    text-decoration: none;
    display: flex;
    gap: .6rem;
}

/* =========================================================
   SIDEBAR STATES (DESKTOP)
========================================================= */

.admin-shell.sidebar-open .admin-sidebar {
    width: 240px;
}

.admin-shell.sidebar-closed .admin-sidebar {
    width: 70px;
}

.admin-shell.sidebar-closed .admin-menu span {
    display: none;
}

.admin-shell.sidebar-closed .admin-menu a {
    justify-content: center;
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 768px) {

    .admin-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        transform: translateX(-100%);
    }

    .admin-shell.sidebar-open .admin-sidebar {
        transform: translateX(0);
    }

    .admin-main {
        padding-left: 0;
    }
}

/* =========================================================
   OVERLAY (SOLO MÓVIL)
========================================================= */

@media (max-width: 768px) {
    .admin-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.35);
        z-index: 1040;
    }
}

/* =========================================================
   DESKTOP FIX (NO OVERLAY)
========================================================= */

@media (min-width: 769px) {
    .admin-overlay {
        display: none;
        pointer-events: none;
    }
}
.admin-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .65rem .75rem;
    border-radius: 10px;
    color: rgba(255,255,255,.85);
    text-decoration: none;
    transition: background .2s ease;
}

    .admin-link:hover {
        background: rgba(255,255,255,.15);
        color: #fff;
    }

    /* 🔥 ACTIVO REAL (NavLink) */
    .admin-link.active {
        background: rgba(255,255,255,.30);
        color: #fff;
        font-weight: 700;
        box-shadow: inset 4px 0 0 #ffffff;
    }
