/* ===================================================================
   StudBuddy Admin Panel — Theme Override
   Mirrors the frontend student dashboard design language:
     Primary  : #1492b8
     Dark     : #001b39
     Gradient : linear-gradient(93.74deg, #1492b8 0%, #001b39 81.62%)
     White    : #ffffff
     Text     : #323e4f
     BG       : #f4f6fb
=================================================================== */

:root {
    --sb-primary   : #1492b8;
    --sb-dark      : #001b39;
    --sb-gradient  : linear-gradient(93.74deg, #1492b8 0%, #001b39 81.62%);
    --sb-white     : #ffffff;
    --sb-text      : #323e4f;
    --sb-border    : #eef0f7;
    --sb-bg        : #f4f6fb;
    --sb-sidebar-w : 260px;
    --sb-header-h  : 70px;
}

/* ─── Body ─────────────────────────────────────────────── */
body {
    background-color: var(--sb-bg) !important;
    color: var(--sb-text) !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ─── SIDEBAR CONTAINER ─────────────────────────────────── */
.vertical-menu {
    background: var(--sb-white) !important;
    border-right : 1px solid var(--sb-border) !important;
    box-shadow   : 2px 0 10px rgba(0,0,0,0.06) !important;
    width        : var(--sb-sidebar-w) !important;
    position     : fixed !important;
    top          : 0 !important;
    left         : 0 !important;
    height       : 100vh !important;
    display      : flex !important;
    flex-direction: column !important;
    z-index      : 1001 !important;
    overflow     : hidden !important;
    transition   : width 0.3s ease !important;
}

/* Keep simplebar wrapper as flex column filler */
.vertical-menu .h-100 {
    display       : flex !important;
    flex-direction: column !important;
    height        : 100% !important;
    overflow      : hidden !important;
    flex          : 1 !important;
}

/* ─── SIDEBAR LOGO SECTION ──────────────────────────────── */
.ic-sidebar-logo-section {
    padding       : 0 20px;
    height        : var(--sb-header-h);
    display       : flex;
    align-items   : center;
    justify-content: space-between;
    border-bottom : 1px solid var(--sb-border);
    flex-shrink   : 0;
    background    : var(--sb-white);
}

.ic-sidebar-logo-section .ic-logo-full {
    height    : 38px;
    width     : auto;
    max-width : 160px;
    object-fit: contain;
    display   : block;
}

.ic-sidebar-logo-section .ic-logo-mini {
    height   : 32px;
    width    : auto;
    display  : none;
}

/* ─── SIDEBAR USER INFO ─────────────────────────────────── */
.ic-sidebar-user {
    padding      : 18px 20px;
    text-align   : center;
    border-bottom: 1px solid var(--sb-border);
    background   : linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
    flex-shrink  : 0;
}

.ic-sidebar-avatar {
    width        : 62px;
    height       : 62px;
    border-radius: 50%;
    object-fit   : cover;
    border       : 2.5px solid var(--sb-primary);
    margin-bottom: 10px;
    display      : block;
    margin-left  : auto;
    margin-right : auto;
}

.ic-sidebar-user-name {
    font-size    : 14px;
    font-weight  : 600;
    color        : var(--sb-text);
    margin       : 0 0 3px;
    white-space  : nowrap;
    overflow     : hidden;
    text-overflow: ellipsis;
}

.ic-sidebar-user-role {
    font-size    : 12px;
    color        : #8a8fa5;
    display      : block;
    margin-bottom: 8px;
}

.ic-status-badge {
    display    : inline-flex;
    align-items: center;
    gap        : 5px;
    background : #e8f9f1;
    color      : #2dca8c;
    font-size  : 11px;
    font-weight: 600;
    padding    : 3px 10px;
    border-radius: 20px;
}

.ic-status-dot {
    width        : 6px;
    height       : 6px;
    background   : #2dca8c;
    border-radius: 50%;
    display      : inline-block;
}

/* ─── SIDEBAR NAV WRAPPER (scrollable) ──────────────────── */
.ic-sidebar-nav-wrapper {
    flex          : 1;
    overflow-y    : auto;
    overflow-x    : hidden;
    padding-bottom: 20px;
    scrollbar-width: thin;
    scrollbar-color: #d0d5dd transparent;
}

.ic-sidebar-nav-wrapper::-webkit-scrollbar {
    width: 4px;
}

.ic-sidebar-nav-wrapper::-webkit-scrollbar-thumb {
    background    : #d0d5dd;
    border-radius : 10px;
}

/* ─── SIDEBAR MENU ITEMS ────────────────────────────────── */
#sidebar-menu {
    padding: 10px 0 20px;
}

#sidebar-menu ul li a {
    display      : flex;
    align-items  : center;
    gap          : 10px;
    padding      : 11px 16px;
    color        : var(--sb-text) !important;
    font-size    : 14px;
    font-weight  : 500;
    text-decoration: none;
    transition   : all 0.25s ease;
    border-radius: 0 10px 10px 0;
    margin-right : 16px;
    position     : relative;
    background   : transparent;
}

#sidebar-menu ul li a:hover {
    color     : var(--sb-primary) !important;
    background: rgba(20, 146, 184, 0.07);
}

/* Active state — gradient matching student frontend */
#sidebar-menu ul li a.active,
#sidebar-menu ul li.mm-active > a,
#sidebar-menu ul li.active > a {
    background   : var(--sb-gradient) !important;
    color        : #ffffff !important;
    border-radius: 0 10px 10px 0;
}

/* Icons */
#sidebar-menu ul li a i {
    font-size : 16px;
    min-width : 20px;
    color     : var(--sb-primary);
    transition: color 0.25s;
}

#sidebar-menu ul li a.active i,
#sidebar-menu ul li.mm-active > a i {
    color: #ffffff !important;
}

/* Menu section titles */
#sidebar-menu ul li.menu-title,
#sidebar-menu li.menu-title {
    padding      : 14px 20px 4px;
    font-size    : 10.5px;
    font-weight  : 700;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    color        : #9ca3af !important;
    background   : transparent !important;
    cursor       : default;
}

/* Sub-menu */
#sidebar-menu ul li ul.sub-menu {
    background: transparent !important;
    padding   : 0 !important;
}

#sidebar-menu ul li ul.sub-menu li a {
    padding-left: 48px !important;
    font-size   : 13.5px !important;
    color       : #5a6478 !important;
    font-weight : 400 !important;
    border-radius: 0 10px 10px 0;
    margin-right: 16px;
}

#sidebar-menu ul li ul.sub-menu li a:hover {
    color     : var(--sb-primary) !important;
    background: rgba(20, 146, 184, 0.07) !important;
}

#sidebar-menu ul li ul.sub-menu li.active > a,
#sidebar-menu ul li ul.sub-menu li a.active {
    background: rgba(20, 146, 184, 0.12) !important;
    color     : var(--sb-primary) !important;
    font-weight: 600 !important;
}

/* MetisMenu arrow */
.has-arrow::after {
    border-color: #9ca3af !important;
}

/* ─── COLLAPSED SIDEBAR ─────────────────────────────────── */
body.vertical-collpsed .vertical-menu {
    width: 70px !important;
}

body.vertical-collpsed .vertical-menu:hover {
    width: var(--sb-sidebar-w) !important;
}

body.vertical-collpsed .ic-sidebar-user,
body.vertical-collpsed .ic-sidebar-logo-section .ic-logo-full {
    display: none;
}

body.vertical-collpsed .ic-sidebar-logo-section .ic-logo-mini {
    display: block;
}

body.vertical-collpsed #sidebar-menu ul li a span,
body.vertical-collpsed #sidebar-menu li.menu-title {
    display: none;
}

body.vertical-collpsed #sidebar-menu ul li a {
    justify-content: center;
    padding        : 11px 0;
    margin-right   : 0;
    border-radius  : 0;
}

body.vertical-collpsed .main-content {
    margin-left: 70px !important;
}

body.vertical-collpsed .footer {
    margin-left: 70px !important;
}

body.vertical-collpsed #page-topbar {
    left: 70px !important;
}

/* ─── TOP HEADER ────────────────────────────────────────── */
#page-topbar {
    background  : var(--sb-white) !important;
    border-bottom: 1px solid var(--sb-border) !important;
    box-shadow  : 0 1px 8px rgba(0,0,0,0.05) !important;
    left        : var(--sb-sidebar-w) !important;
    height      : var(--sb-header-h) !important;
    transition  : left 0.3s ease !important;
}

.navbar-header {
    height    : var(--sb-header-h) !important;
    padding   : 0 24px !important;
    display   : flex;
    align-items: center;
    justify-content: space-between;
}

/* Hide old brand box since logo is in sidebar */
.navbar-brand-box {
    display: none !important;
}

/* ─── HEADER TOGGLE BUTTON ──────────────────────────────── */
#vertical-menu-btn {
    color     : var(--sb-text) !important;
    font-size : 22px !important;
    padding   : 8px 10px !important;
    border-radius: 8px !important;
    background: transparent !important;
    border    : none !important;
    box-shadow: none !important;
    outline   : none !important;
    transition: all 0.2s !important;
}

#vertical-menu-btn:hover {
    background: rgba(20, 146, 184, 0.08) !important;
    color     : var(--sb-primary) !important;
}

/* ─── HEADER WELCOME TEXT ───────────────────────────────── */
.ic-header-welcome {
    font-size  : 17px;
    font-weight: 600;
    color      : var(--sb-text);
    margin     : 0;
}

.ic-header-welcome span {
    color: var(--sb-primary);
}

/* ─── HEADER ACTION BUTTONS ─────────────────────────────── */
.header-item {
    color     : var(--sb-text) !important;
    background: transparent !important;
    border    : none !important;
    box-shadow: none !important;
    transition: all 0.2s;
}

.header-item:hover,
.header-item:focus {
    color     : var(--sb-primary) !important;
    background: rgba(20,146,184,0.07) !important;
    box-shadow: none !important;
    outline   : none !important;
}

.header-item:focus-visible {
    outline: none !important;
}

/* ─── ADMIN USER DROPDOWN (Header) ─────────────────────── */
.header-profile-user {
    width        : 36px;
    height       : 36px;
    border-radius: 50%;
    object-fit   : cover;
    border       : 2px solid var(--sb-primary);
    flex-shrink  : 0;
}

.ic-admin-name {
    font-size  : 13.5px;
    font-weight: 600;
    color      : var(--sb-text);
    line-height : 1.3;
}

.ic-admin-badge {
    font-size    : 10.5px;
    font-weight  : 600;
    color        : var(--sb-primary);
    background   : rgba(20,146,184,0.10);
    padding      : 1px 7px;
    border-radius: 10px;
    display      : inline-block;
    line-height  : 1.6;
}

/* ─── BOOTSTRAP DROPDOWN ────────────────────────────────── */
/* Reset SKOTE interference on header dropdowns */
.navbar-header .dropdown-menu,
#page-topbar .dropdown-menu {
    position    : absolute !important;
    min-height  : auto !important;
    height      : auto !important;
    padding     : 8px !important;
    margin-top  : 6px !important;
    inset       : unset !important;
    top         : auto !important;
}

.dropdown-menu {
    border       : 1px solid var(--sb-border) !important;
    border-radius: 12px !important;
    box-shadow   : 0 10px 28px rgba(0,0,0,0.10) !important;
    min-width    : 200px !important;
    z-index      : 9999 !important;
    background   : #ffffff !important;
    overflow     : visible !important;
}

.dropdown-item {
    border-radius: 7px;
    padding      : 9px 13px;
    font-size    : 13.5px;
    color        : var(--sb-text);
    transition   : all 0.2s;
    display      : flex;
    align-items  : center;
    gap          : 9px;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: rgba(20,146,184,0.08);
    color     : var(--sb-primary);
}

.dropdown-item i {
    font-size: 16px;
    color    : var(--sb-primary);
    min-width: 18px;
}

.dropdown-item.text-danger,
.dropdown-item.text-danger i {
    color: #e74c3c !important;
}

.dropdown-item.text-danger:hover {
    background: rgba(231,76,60,0.07) !important;
    color     : #e74c3c !important;
}

.dropdown-divider {
    margin      : 4px 0 !important;
    border-color: var(--sb-border) !important;
}

/* ─── MAIN CONTENT ──────────────────────────────────────── */
.main-content {
    margin-left: var(--sb-sidebar-w) !important;
    min-height : calc(100vh - var(--sb-header-h)) !important;
    background : var(--sb-bg) !important;
    transition : margin-left 0.3s ease !important;
}

.page-content {
    padding: calc(var(--sb-header-h) + 20px) 22px 20px !important;
}

/* ─── PAGE TITLE & BREADCRUMB ───────────────────────────── */
.page-title-box {
    background: transparent !important;
    padding   : 0 0 18px !important;
}

.page-title-box h5.page-title {
    font-size  : 19px;
    font-weight: 700;
    color      : var(--sb-text);
    margin-bottom: 6px;
}

.breadcrumb {
    background    : transparent !important;
    padding       : 0 !important;
    margin-bottom : 0 !important;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: #b0b8c9;
}

.breadcrumb-item a {
    color          : var(--sb-primary);
    text-decoration: none;
    font-size      : 13px;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color    : #8a8fa5;
    font-size: 13px;
}

/* ─── CARDS ─────────────────────────────────────────────── */
.card {
    border       : 1px solid var(--sb-border) !important;
    border-radius: 12px !important;
    box-shadow   : 0 2px 10px rgba(0,0,0,0.04) !important;
    background   : var(--sb-white) !important;
}

.card-body {
    padding: 20px !important;
}

.card-header {
    background   : transparent !important;
    border-bottom: 1px solid var(--sb-border) !important;
    padding      : 16px 20px !important;
    font-weight  : 600;
    color        : var(--sb-text);
}

/* ─── DASHBOARD STAT CARDS ──────────────────────────────── */
.ic-bg-dashboard-card {
    background: var(--sb-gradient) !important;
}

.bg-blue-grey {
    background: linear-gradient(93.74deg, #2980b9 0%, #2c3e50 81.62%) !important;
}

.mini-stat {
    border-radius: 12px !important;
    overflow: hidden;
}

/* ─── BUTTONS ───────────────────────────────────────────── */
.btn-primary {
    background   : var(--sb-gradient) !important;
    border       : none !important;
    border-radius: 8px !important;
    font-weight  : 500 !important;
    box-shadow   : 0 4px 12px rgba(20,146,184,0.28) !important;
    transition   : all 0.3s ease !important;
}

.btn-primary:hover,
.btn-primary:focus {
    opacity   : 0.92;
    box-shadow: 0 6px 16px rgba(20,146,184,0.40) !important;
}

/* ─── FORM CONTROLS ─────────────────────────────────────── */
.form-control:focus {
    border-color: var(--sb-primary) !important;
    box-shadow  : 0 0 0 3px rgba(20,146,184,0.14) !important;
}

.form-label {
    font-weight: 500;
    color      : var(--sb-text);
    font-size  : 14px;
}

/* ─── TABLE ─────────────────────────────────────────────── */
.table thead th {
    background  : #f8f9fc;
    color       : var(--sb-text);
    font-size   : 13px;
    font-weight : 600;
    border-bottom: 2px solid var(--sb-border) !important;
}

/* ─── PAGINATION ─────────────────────────────────────────── */
.page-link {
    color       : var(--sb-primary);
    border-color: var(--sb-border);
}

.page-item.active .page-link {
    background   : var(--sb-primary);
    border-color : var(--sb-primary);
}

/* ─── FOOTER ────────────────────────────────────────────── */
.footer {
    background  : var(--sb-white) !important;
    border-top  : 1px solid var(--sb-border) !important;
    padding     : 16px 24px !important;
    color       : #8a8fa5 !important;
    font-size   : 13px !important;
    margin-left : var(--sb-sidebar-w) !important;
    transition  : margin-left 0.3s ease !important;
}

/* ─── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .vertical-menu {
        transform : translateX(-100%);
        transition: transform 0.3s ease, width 0.3s ease !important;
        width     : var(--sb-sidebar-w) !important;
    }

    body.sidebar-enable .vertical-menu {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
    }

    .footer {
        margin-left: 0 !important;
    }

    #page-topbar {
        left: 0 !important;
    }

    body.vertical-collpsed .vertical-menu {
        width: var(--sb-sidebar-w) !important;
    }

    body.vertical-collpsed .main-content,
    body.vertical-collpsed .footer {
        margin-left: 0 !important;
    }

    body.vertical-collpsed #page-topbar {
        left: 0 !important;
    }
}

@media (max-width: 767.98px) {
    .navbar-header {
        padding: 0 14px !important;
    }

    .ic-header-welcome {
        display: none !important;
    }

    .page-content {
        padding: calc(var(--sb-header-h) + 14px) 14px 14px !important;
    }
}
