/* ============================================================
   Student Portal Dashboard Styles
   Modern School ERP Dashboard — Google Classroom / Canvas LMS style
   ============================================================ */

/* --- CSS Variables --- */
:root {
    --dash-bg: #f0f2f5;
    --dash-header-bg: #ffffff;
    --dash-header-height: 70px;
    --dash-header-border: #e5e7eb;
    --dash-card-bg: #ffffff;
    --dash-card-radius: 14px;
    --dash-card-shadow:
        0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --dash-card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.08);
    --dash-text-primary: #111827;
    --dash-text-secondary: #4b5563;
    --dash-text-muted: #9ca3af;
    --dash-accent: #4f46e5;
    --dash-accent-light: #eef2ff;
    --dash-blue: #3b82f6;
    --dash-green: #10b981;
    --dash-purple: #8b5cf6;
    --dash-orange: #f59e0b;
    --dash-red: #ef4444;
    --dash-font:
        "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* --- Reset dashboard area --- */
.dash-main {
    background: var(--dash-bg);
    min-height: calc(100vh - var(--dash-header-height));
    font-family: var(--dash-font);
    color: var(--dash-text-primary);
    padding-top: var(--dash-header-height);
}

/* ============================================================
   HEADER
   ============================================================ */
.dash-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    height: var(--dash-header-height);
    min-height: var(--dash-header-height);
    background: var(--dash-header-bg);
    border-bottom: 1px solid var(--dash-header-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Override page_wrapper overflow that clips fixed header */
.page_wrapper {
    overflow: visible !important;
}

.dash-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    min-height: var(--dash-header-height);
    padding: 0 24px;
    max-width: 1400px;
    margin: 0 auto;
    gap: 16px;
}

/* Left: Institute branding */
.dash-header__left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex-shrink: 0;
}

.dash-header__logo {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.dash-header__brand {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.dash-header__inst-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--dash-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.dash-header__acad-year {
    font-size: 11px;
    color: var(--dash-text-muted);
    white-space: nowrap;
}

/* Center: Navigation */
.dash-header__nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.dash-nav-link {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--dash-text-secondary);
    text-decoration: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    border: none;
    background: none;
}

.dash-nav-link:hover {
    background: var(--dash-accent-light);
    color: var(--dash-accent);
}

.dash-nav-link.active {
    background: var(--dash-accent-light);
    color: var(--dash-accent);
    font-weight: 600;
}

.dash-nav-link i {
    font-size: 10px;
    opacity: 0.6;
}

.dash-dropdown-menu {
    border: 1px solid var(--dash-header-border);
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 6px;
    min-width: 180px;
    margin-top: 6px !important;
}

.dash-dropdown-menu .dropdown-item {
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 13.5px;
    color: var(--dash-text-secondary);
    cursor: pointer;
    transition: all 0.12s ease;
}

.dash-dropdown-menu .dropdown-item:hover {
    background: transparent !important;
    color: var(--dash-accent);
}

.dash-dropdown-menu .dropdown-item.active,
.dash-dropdown-menu .dropdown-item.active:hover {
    background: transparent !important;
    color: var(--dash-accent);
    font-weight: 600;
}

.dash-dropdown-menu--profile {
    min-width: 240px;
}
/* keep a long email/username on one line */
.dash-dropdown-menu--profile .dropdown-header strong {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* align the Profile/Logout icons so the labels line up */
.dash-dropdown-menu--profile .dropdown-item i {
    width: 18px;
    text-align: center;
}

/* Right: Actions */
.dash-header__right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.dash-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--dash-text-secondary);
    font-size: 17px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dash-icon-btn:hover {
    background: var(--dash-accent-light);
    color: var(--dash-accent);
}

.dash-profile-btn {
    display: inline-flex;
    align-items: center;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.dash-profile__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--dash-header-border);
}

.dash-profile__avatar--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--dash-accent);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}

/* ============================================================
   MOBILE / TABLET HEADER (below lg)
   ============================================================ */
.dash-header__mobile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--dash-header-height);
    min-height: var(--dash-header-height);
    padding: 0 12px;
    gap: 8px;
}

.dash-mobile-hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--dash-text-secondary);
    font-size: 20px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.dash-mobile-hamburger:hover {
    background: var(--dash-accent-light);
    color: var(--dash-accent);
}

.dash-mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.dash-mobile-logo {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.dash-mobile-brand__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.dash-mobile-inst-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--dash-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.dash-mobile-acad-year {
    font-size: 10px;
    color: var(--dash-text-muted);
    white-space: nowrap;
}

.dash-mobile-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.dash-mobile-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--dash-text-secondary);
    font-size: 16px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.dash-mobile-icon-btn:hover {
    background: var(--dash-accent-light);
    color: var(--dash-accent);
}

.dash-mobile-profile-btn {
    display: inline-flex;
    align-items: center;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.dash-mobile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--dash-header-border);
}

.dash-mobile-avatar--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--dash-accent);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

/* ============================================================
   OFFCANVAS NAVIGATION DRAWER
   ============================================================ */
.dash-offcanvas {
    width: 280px !important;
    background: #fff;
}

.dash-offcanvas__header {
    background: var(--dash-accent);
    color: #fff;
    padding: 16px 20px;
    border-bottom: none;
}

.dash-offcanvas__title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.dash-offcanvas__body {
    padding: 8px 0;
}

.dash-drawer-nav {
    display: flex;
    flex-direction: column;
    padding: 0 12px;
}

.dash-drawer-nav .dash-nav-link {
    padding: 12px 14px;
    font-size: 14px;
    border-radius: 8px;
    margin-bottom: 2px;
}

.dash-drawer-section {
    margin: 4px 0;
}

.dash-drawer-section__title {
    display: block;
    padding: 8px 14px 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--dash-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dash-drawer-section .dash-nav-link {
    padding-left: 24px;
    font-size: 13.5px;
}

.dash-drawer-divider {
    margin: 8px 14px;
    border-color: var(--dash-header-border);
}

/* ============================================================
   WELCOME CARD
   ============================================================ */
.dash-welcome-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: var(--dash-card-radius);
    padding: 28px 32px;
    color: #fff;
    gap: 24px;
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.25);
}

.dash-welcome-card__body {
    flex: 1;
    min-width: 0;
}

.dash-welcome-card__greeting {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.dash-welcome-card__icon {
    font-size: 36px;
    line-height: 1;
}

.dash-welcome-card__hello {
    font-size: 14px;
    font-weight: 400;
    opacity: 0.85;
    margin: 0;
}

.dash-welcome-card__name {
    font-size: 26px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.dash-welcome-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
}

.dash-welcome-card__meta-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    opacity: 0.9;
}

.dash-welcome-card__meta-item i {
    font-size: 13px;
    opacity: 0.7;
}

.dash-welcome-card__image {
    flex-shrink: 0;
}

.dash-welcome-card__image img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.dash-stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--dash-card-bg);
    border-radius: var(--dash-card-radius);
    padding: 18px 20px;
    box-shadow: var(--dash-card-shadow);
    transition: box-shadow 0.2s ease;
}

.dash-stat-card:hover {
    box-shadow: var(--dash-card-shadow-hover);
}

.dash-stat-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 18px;
    flex-shrink: 0;
}

.dash-stat-card__icon--blue {
    background: #eff6ff;
    color: var(--dash-blue);
}

.dash-stat-card__icon--green {
    background: #ecfdf5;
    color: var(--dash-green);
}

.dash-stat-card__icon--purple {
    background: #f5f3ff;
    color: var(--dash-purple);
}

.dash-stat-card__icon--orange {
    background: #fffbeb;
    color: var(--dash-orange);
}

.dash-stat-card__info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dash-stat-card__label {
    font-size: 12px;
    font-weight: 500;
    color: var(--dash-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dash-stat-card__value {
    font-size: 15px;
    font-weight: 600;
    color: var(--dash-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================
   GENERIC CARD
   ============================================================ */
.dash-card {
    background: var(--dash-card-bg);
    border-radius: var(--dash-card-radius);
    box-shadow: var(--dash-card-shadow);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
    height: 100%;
}

.dash-card:hover {
    box-shadow: var(--dash-card-shadow-hover);
}

.dash-card__header {
    padding: 18px 24px 0;
}

.dash-card__title {
    font-size: 17px;
    font-weight: 600;
    color: var(--dash-text-primary);
    margin: 0;
}

.dash-card__body {
    padding: 18px 24px 24px;
}

/* ============================================================
   SCHOOL INFO
   ============================================================ */
.dash-school-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dash-school-info__logo {
    margin-bottom: 4px;
}

.dash-school-info__logo img {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--dash-header-border);
}

.dash-school-info__name {
    font-size: 18px;
    font-weight: 700;
    color: var(--dash-text-primary);
    margin: 0;
}

.dash-school-info__row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--dash-text-secondary);
}

.dash-school-info__row i {
    width: 18px;
    text-align: center;
    color: var(--dash-text-muted);
    font-size: 13px;
    flex-shrink: 0;
}

.dash-school-info__desc {
    font-size: 13.5px;
    color: var(--dash-text-muted);
    line-height: 1.5;
    margin: 0;
}

/* ============================================================
   DETAIL GRID
   ============================================================ */
.dash-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 20px;
}

.dash-detail-grid--compact {
    gap: 10px 16px;
}

.dash-detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dash-detail-item__label {
    font-size: 12px;
    font-weight: 500;
    color: var(--dash-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.dash-detail-item__value {
    font-size: 14.5px;
    font-weight: 500;
    color: var(--dash-text-primary);
    word-break: break-word;
}

/* ============================================================
   PARENT CARD
   ============================================================ */
.dash-parent-card {
    background: #f9fafb;
    border-radius: 10px;
    padding: 16px 18px;
    border: 1px solid #f3f4f6;
}

.dash-parent-card__name {
    font-size: 15px;
    font-weight: 600;
    color: var(--dash-text-primary);
    margin: 0 0 2px;
}

.dash-parent-card__relation {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    color: var(--dash-accent);
    background: var(--dash-accent-light);
    padding: 2px 10px;
    border-radius: 20px;
    margin-bottom: 4px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991.98px) {
    .dash-welcome-card {
        flex-direction: column-reverse;
        text-align: center;
        padding: 24px 20px;
    }

    .dash-welcome-card__greeting {
        justify-content: center;
    }

    .dash-welcome-card__meta {
        justify-content: center;
    }

    .dash-welcome-card__name {
        font-size: 22px;
    }

    .dash-welcome-card__image img {
        width: 72px;
        height: 72px;
    }

    .dash-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .dash-stat-card {
        padding: 14px 16px;
    }

    .dash-stat-card__icon {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }

    .dash-card__header {
        padding: 14px 16px 0;
    }

    .dash-card__body {
        padding: 14px 16px 18px;
    }

    .dash-card__title {
        font-size: 15px;
    }

    .dash-welcome-card {
        padding: 20px 16px;
    }

    .dash-welcome-card__name {
        font-size: 20px;
    }
}

.dash-header + main:not(.dash-main) {
    padding-top: var(--dash-header-height);
}

.dash-header .container > .row {
    margin-top: 1rem !important;
}

@media (max-width: 991.98px) {
    .dash-header {
        height: auto;
        min-height: var(--dash-header-height);
    }
}

/* Inline academic-year selector inside the admin dash-header brand */
.dash-header__acad-year-select {
    width: auto;
    height: 38px;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 30px 6px 12px;
    color: var(--dash-text-primary);
    border-color: var(--dash-header-border);
    border-radius: 8px;
    background-position: right 10px center;
}

.dash-header__acad-year-select:focus {
    border-color: var(--dash-accent);
    box-shadow: 0 0 0 2px var(--dash-accent-light);
    outline: none;
}

/* Search field inside the admin dash-header */
.dash-header__search {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 180px;
}

.dash-header__search .header_search {
    margin: 0;
    width: 100%;
}

.dash-header__search input[type="search"] {
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--dash-header-border);
    padding: 0 10px;
    font-size: 13px;
}

.dash-header__search .dropdown_search {
    top: 38px;
}

.dash-header__logo--brand {
    height: 52px;
    width: auto;
    border-radius: 10px;
    object-fit: contain;
}

.dash-header .main_menu_list .dropdown > .dropdown-menu {
    display: none !important;
}
.dash-header .main_menu_list .dropdown.show > .dropdown-menu {
    display: block !important;
}

/* Institute switcher avatar in the admin header right cluster */
.dash-header__switcher img {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid var(--dash-header-border);
    transition: box-shadow 0.15s ease;
}

.dash-header__switcher:hover img {
    box-shadow: 0 0 0 2px var(--dash-accent-light);
}

/* reset theme padding so the profile avatar / settings icon keep their size */
.dash-header .header_btns_group .dash-icon-btn,
.dash-header .header_btns_group .dash-profile-btn {
    padding: 0 !important;
}
