/* =========================================================
   Admin layout — sidebar colapsable + header + user dropdown
   Inspirado en AdminLTE, con estética EdukBlox
   ========================================================= */

:root {
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 0px;
    --header-height: 64px;
    --sidebar-bg: #5b3ed1;
    --sidebar-bg-2: #4a30b8;
    --sidebar-text: #ffffff;
    --sidebar-text-muted: rgba(255, 255, 255, 0.72);
    --sidebar-active: rgba(255, 255, 255, 0.16);
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --content-bg: #f4f6fb;
    --card-border: #eef0fa;
}

html, body {
    height: 100%;
}

body.admin-body {
    background: var(--content-bg);
    overflow-x: hidden;
}

/* ===== Sidebar ===== */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
    color: var(--sidebar-text);
    z-index: 1040;
    transition: width 0.25s ease, transform 0.25s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 18px rgba(10, 31, 68, 0.08);
}

body.sidebar-collapsed .admin-sidebar {
    width: var(--sidebar-collapsed-width);
    overflow: hidden;
}

.admin-sidebar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 1.15rem;
    letter-spacing: 0.5px;
    color: #fff;
    border-bottom: 1px solid var(--sidebar-border);
    min-height: var(--header-height);
    overflow: hidden;
    white-space: nowrap;
}

.admin-sidebar__brand .logo-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.admin-sidebar__brand-text {
    opacity: 1;
    transition: opacity 0.2s ease;
}

body.sidebar-collapsed .admin-sidebar .admin-sidebar__brand-text {
    opacity: 0;
    width: 0;
}

.admin-sidebar__nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 8px;
}

.admin-sidebar__nav::-webkit-scrollbar {
    width: 6px;
}
.admin-sidebar__nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.admin-sidebar .nav-link {
    color: var(--sidebar-text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin: 2px 0;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.93rem;
    white-space: nowrap;
    overflow: hidden;
    transition: background 0.15s ease, color 0.15s ease;
}

.admin-sidebar .nav-link i {
    font-size: 1.05rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.admin-sidebar .nav-link:hover {
    color: #fff;
    background: var(--sidebar-hover);
}

.admin-sidebar .nav-link.active {
    background: var(--sidebar-active);
    color: #fff;
    box-shadow: inset 3px 0 0 #fff;
}

body.sidebar-collapsed .admin-sidebar .nav-link {
    justify-content: center;
    padding: 10px 0;
}

body.sidebar-collapsed .admin-sidebar .nav-link .nav-label {
    opacity: 0;
    width: 0;
}

body.sidebar-collapsed .admin-sidebar .nav-link .nav-label,
body.sidebar-collapsed .admin-sidebar .admin-sidebar__brand-text {
    display: none;
}

/* ===== Header ===== */
.admin-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: #ffffff;
    border-bottom: 1px solid var(--card-border);
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    transition: left 0.25s ease;
    box-shadow: 0 2px 10px rgba(10, 31, 68, 0.04);
}

body.sidebar-collapsed .admin-header {
    left: var(--sidebar-collapsed-width);
}

.admin-header__left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-hamburger {
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--dojo-ink);
    transition: background 0.15s ease;
}

.btn-hamburger:hover,
.btn-hamburger:focus {
    background: var(--eb-bg-soft);
    color: var(--eb-primary);
}

.btn-hamburger i {
    font-size: 1.25rem;
}

.admin-header__title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-header__title img {
    height: 38px;
}

.admin-header__title-text {
    font-weight: 900;
    font-size: 1.15rem;
    color: var(--dojo-ink);
    line-height: 1.1;
}

.admin-header__title-text small {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: #8a91b3;
    letter-spacing: 0.3px;
    text-transform: none;
}

/* ===== User dropdown ===== */
.user-menu .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 999px;
    padding: 4px 14px 4px 4px;
    font-weight: 800;
    color: var(--dojo-ink);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.user-menu .dropdown-toggle::after {
    margin-left: 6px;
}

.user-menu .dropdown-toggle:hover,
.user-menu .dropdown-toggle[aria-expanded="true"] {
    border-color: var(--eb-primary);
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.12);
}

.user-menu .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6c5ce7, #ff7ab6);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.9rem;
}

.user-menu .user-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu .dropdown-menu {
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(10, 31, 68, 0.15);
    padding: 12px;
    min-width: 240px;
    margin-top: 8px;
}

.user-menu .dropdown-menu .user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--eb-bg-soft);
    margin-bottom: 8px;
}

.user-menu .dropdown-menu .user-card .user-avatar {
    width: 44px;
    height: 44px;
    font-size: 1.05rem;
}

.user-menu .dropdown-menu .user-card .name {
    font-weight: 900;
    color: var(--dojo-ink);
    line-height: 1.1;
}

.user-menu .dropdown-menu .user-card .email {
    font-size: 0.78rem;
    color: #6c7393;
    font-weight: 600;
}

.user-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 10px;
    padding: 10px 12px;
    font-weight: 700;
    color: var(--dojo-ink);
}

.user-menu .dropdown-item i {
    width: 18px;
    color: var(--eb-primary);
}

.user-menu .dropdown-item:hover,
.user-menu .dropdown-item:focus {
    background: var(--eb-bg-soft);
    color: var(--eb-primary);
}

.user-menu .dropdown-item.text-danger {
    color: #d63062;
}
.user-menu .dropdown-item.text-danger i {
    color: #d63062;
}
.user-menu .dropdown-item.text-danger:hover {
    background: #ffe2ec;
    color: #b21f4d;
}

.user-menu .dropdown-divider {
    margin: 8px 4px;
    border-color: var(--card-border);
}

/* ===== Main wrapper ===== */
.admin-main {
    margin-left: var(--sidebar-width);
    padding-top: calc(var(--header-height) + 24px);
    padding-bottom: 32px;
    min-height: 100vh;
    transition: margin-left 0.25s ease;
}

body.sidebar-collapsed .admin-main {
    margin-left: var(--sidebar-collapsed-width);
}

.admin-main__inner {
    padding: 0 24px;
}

@media (max-width: 991.98px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    body.sidebar-open .admin-sidebar {
        transform: translateX(0);
    }
    .admin-header,
    body.sidebar-collapsed .admin-header {
        left: 0;
    }
    .admin-main,
    body.sidebar-collapsed .admin-main {
        margin-left: 0;
    }
    .admin-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(10, 31, 68, 0.45);
        z-index: 1035;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }
    body.sidebar-open .admin-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
    .admin-header__title-text small {
        display: none;
    }
    .user-menu .dropdown-toggle .user-name,
    .user-menu .dropdown-toggle::after,
    .user-menu .dropdown-toggle .bi-chevron-down {
        display: none;
    }
    .user-menu .dropdown-toggle {
        padding: 4px;
        border: none;
        background: transparent;
    }
}

/* ===== Page header ===== */
.page-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    color: var(--dojo-ink);
    font-size: 1.55rem;
    margin: 0;
}

.page-date {
    color: #6c7393;
    font-weight: 600;
    font-size: 0.9rem;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    gap: 12px;
    flex-wrap: wrap;
}

/* ===== Welcome banner (morado) ===== */
.welcome-banner {
    background: linear-gradient(135deg, #6c4ad6 0%, #5b3ed1 60%, #4a30b8 100%);
    color: #fff;
    border-radius: 22px;
    padding: 28px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: 0 14px 30px rgba(91, 62, 209, 0.25);
    position: relative;
    overflow: hidden;
}

.welcome-banner h2 {
    font-weight: 900;
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.welcome-banner p {
    color: rgba(255, 255, 255, 0.88);
    font-weight: 600;
    max-width: 720px;
    margin-bottom: 18px;
}

.welcome-banner__actions .btn {
    margin-right: 8px;
}

.welcome-banner__actions .btn-light {
    background: #fff;
    color: var(--dojo-ink);
    border: none;
    font-weight: 800;
}

.welcome-banner__actions .btn-outline-light {
    border: 2px solid rgba(255, 255, 255, 0.7);
    color: #fff;
    font-weight: 800;
    box-shadow: none;
}

.welcome-banner__actions .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.welcome-banner__icon {
    font-size: 4.5rem;
    opacity: 0.35;
    flex-shrink: 0;
}

/* ===== Widgets informativos ===== */
.info-widgets {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-widget {
    background: #fff;
    border-radius: 18px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid var(--card-border);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    cursor: default;
}

.info-widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(10, 31, 68, 0.07);
}

.info-widget__label {
    font-weight: 800;
    font-size: 0.78rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.info-widget__value {
    font-weight: 900;
    font-size: 1.7rem;
    color: var(--dojo-ink);
    line-height: 1;
}

.info-widget__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    flex-shrink: 0;
}

.info-widget--blue   { border-left: 4px solid #00b9ff; }
.info-widget--blue   .info-widget__label  { color: #00b9ff; }
.info-widget--blue   .info-widget__icon   { background: linear-gradient(135deg, #00b9ff, #5cd4ff); }

.info-widget--green  { border-left: 4px solid #1cc88a; }
.info-widget--green  .info-widget__label  { color: #1cc88a; }
.info-widget--green  .info-widget__icon   { background: linear-gradient(135deg, #1cc88a, #36e8a6); }

.info-widget--cyan   { border-left: 4px solid #36b9cc; }
.info-widget--cyan   .info-widget__label  { color: #36b9cc; }
.info-widget--cyan   .info-widget__icon   { background: linear-gradient(135deg, #36b9cc, #5ed3e5); }

.info-widget--orange { border-left: 4px solid #ffb547; }
.info-widget--orange .info-widget__label  { color: #ff9f1c; }
.info-widget--orange .info-widget__icon   { background: linear-gradient(135deg, #ffb547, #ffce80); color: #6b4400; }

/* ===== Footer ===== */
.admin-footer {
    margin-left: var(--sidebar-width);
    padding: 18px 24px;
    background: #fff;
    border-top: 1px solid var(--card-border);
    color: #6c7393;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: margin-left 0.25s ease;
}

body.sidebar-collapsed .admin-footer {
    margin-left: var(--sidebar-collapsed-width);
}

@media (max-width: 991.98px) {
    .admin-footer,
    body.sidebar-collapsed .admin-footer {
        margin-left: 0;
    }
}

/* ===== Pequeños ajustes al contenido existente ===== */
.section-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    color: var(--dojo-ink);
    font-size: 1.15rem;
    margin: 28px 0 16px;
}

.class-card {
    border-radius: 16px;
    color: #fff;
    padding: 20px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    box-shadow: 0 10px 22px rgba(10, 31, 68, 0.08);
}

.class-card--blue  { background: linear-gradient(135deg, #2196f3, #4aa3ff); }
.class-card--teal  { background: linear-gradient(135deg, #1abc9c, #4cd2b3); }

.class-card__title {
    font-weight: 900;
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.class-card__meta {
    font-weight: 600;
    opacity: 0.92;
    display: flex;
    align-items: center;
    gap: 6px;
}

.class-card__action {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 999px;
    padding: 8px 18px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.new-class-card {
    background: #fff;
    border: 2px dashed #1cc88a;
    border-radius: 16px;
    padding: 28px 22px;
    text-align: center;
    color: var(--dojo-ink);
}

.new-class-card .badge-new {
    display: inline-block;
    background: #1cc88a;
    color: #fff;
    font-weight: 800;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 6px;
}

.new-class-card .btn-create {
    background: #1cc88a;
    color: #043b27;
    border: none;
    border-radius: 999px;
    font-weight: 800;
    padding: 10px 22px;
    margin-top: 10px;
}

.welcome-image {
    margin-top: 28px;
    border-radius: 18px;
    overflow: hidden;
    background: #f7d774;
    aspect-ratio: 21 / 9;
    background-image: linear-gradient(135deg, #f7d774 0%, #ffb547 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b4400;
    font-weight: 900;
    font-size: 1.2rem;
}
