/* ============================================================
   نظام التربية العملية — Design System
   Navy / gold RTL admin theme (ported & refined from the legacy
   EduPractical project, adapted to this app's areas & roles).
   ============================================================ */

:root {
    --brand-900: #081c34;
    --brand-800: #0d2748;
    --brand-700: #123360;
    --brand-600: #174078;
    --brand-500: #1c5096;
    --brand-400: #2563b8;
    --gold-500: #c8922a;
    --gold-400: #e0a830;
    --gold-300: #f0c060;
    --gold-200: #f8dfa0;
    --gold-100: #fdf5e0;
    --surface-bg: #eef2f7;
    --surface-card: #ffffff;
    --text-primary: #0f1f35;
    --text-secondary: #4a6080;
    --text-muted: #8aa0b8;
    --text-on-dark: #e8f0fa;
    --text-on-dark-muted: #7aa0c8;
    --border-light: #dce6f0;
    --border-mid: #b8ccdf;
    --shadow-sm: 0 1px 4px rgba(8, 28, 52, .07);
    --shadow-md: 0 4px 16px rgba(8, 28, 52, .10);
    --shadow-lg: 0 8px 32px rgba(8, 28, 52, .14);
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --topbar-height: 64px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --transition: .22s cubic-bezier(.4, 0, .2, 1);
}

/* ============================
   RESET & BASE
   ============================ */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    position: relative;
    min-height: 100%;
}

body {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
    background: var(--surface-bg);
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.65;
    min-height: 100vh;
    direction: rtl;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    margin: 0;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(28, 80, 150, .18);
}

/* ============================
   APP SHELL
   ============================ */
.app-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ============================
   SIDEBAR
   ============================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--brand-900);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    transition: width var(--transition);
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 18px;
    height: var(--topbar-height);
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    text-decoration: none;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 17px;
    color: var(--brand-900);
    box-shadow: 0 2px 8px rgba(200, 146, 42, .35);
}

.sidebar-brand-text {
    color: var(--text-on-dark);
    font-weight: 800;
    font-size: 14.5px;
    line-height: 1.3;
    white-space: nowrap;
    opacity: 1;
    transition: opacity var(--transition);
}

.sidebar.collapsed .sidebar-brand-text {
    opacity: 0;
    pointer-events: none;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .12) transparent;
}

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

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .12);
    border-radius: 4px;
}

.nav-section-label {
    padding: 14px 20px 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-on-dark-muted);
    white-space: nowrap;
    overflow: hidden;
    transition: opacity var(--transition);
}

.sidebar.collapsed .nav-section-label {
    opacity: 0;
}

.nav-item-wrapper {
    position: relative;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    color: var(--text-on-dark-muted);
    text-decoration: none;
    border-radius: 0;
    transition: color var(--transition), background var(--transition);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: right;
    position: relative;
}

.sidebar-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, .07);
}

.sidebar-link.active {
    color: var(--gold-400);
    background: rgba(200, 146, 42, .12);
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: var(--gold-400);
    border-radius: 2px 0 0 2px;
}

.sidebar-link-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 15px;
    flex-shrink: 0;
    transition: background var(--transition);
    background: rgba(255, 255, 255, .05);
}

.sidebar-link:hover .sidebar-link-icon {
    background: rgba(255, 255, 255, .10);
}

.sidebar-link.active .sidebar-link-icon {
    background: rgba(200, 146, 42, .18);
    color: var(--gold-400);
}

.sidebar-link-text {
    flex: 1;
    opacity: 1;
    transition: opacity var(--transition);
    font-size: 14px;
}

.sidebar.collapsed .sidebar-link-text,
.sidebar.collapsed .nav-chevron {
    opacity: 0;
    pointer-events: none;
}

.nav-chevron {
    font-size: 11px;
    transition: transform var(--transition), opacity var(--transition);
    color: var(--text-on-dark-muted);
}

.sidebar-link[aria-expanded="true"] .nav-chevron {
    transform: rotate(-90deg);
}

.sidebar-submenu {
    overflow: hidden;
    background: rgba(0, 0, 0, .18);
}

.sidebar-submenu .sidebar-link {
    padding-right: 60px;
    font-size: 13.5px;
    font-weight: 400;
    color: rgba(160, 190, 220, .75);
}

.sidebar-submenu .sidebar-link:hover {
    color: #fff;
}

.sidebar-submenu .sidebar-link.active {
    color: var(--gold-300);
}

.sidebar-footer {
    padding: 14px;
    border-top: 1px solid rgba(255, 255, 255, .07);
    flex-shrink: 0;
}

.sidebar-toggle-btn {
    width: 100%;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: var(--radius-sm);
    color: var(--text-on-dark-muted);
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Tajawal', sans-serif;
    font-size: 13px;
    transition: background var(--transition), color var(--transition);
}

.sidebar-toggle-btn:hover {
    background: rgba(255, 255, 255, .10);
    color: #fff;
}

.sidebar-toggle-btn span {
    transition: opacity var(--transition);
    white-space: nowrap;
}

.sidebar.collapsed .sidebar-toggle-btn span {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-toggle-btn i {
    transform: rotate(180deg);
}

.sidebar-toggle-btn i {
    transition: transform var(--transition);
}

.sidebar.collapsed .sidebar-link:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    right: calc(var(--sidebar-collapsed) + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--brand-800);
    color: #fff;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 9999;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, .08);
}

/* ============================
   MAIN AREA
   ============================ */
.main-area {
    margin-right: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-right var(--transition);
    width: 100%;
    /* Without this, a wide table grows the flex item past the viewport (flex items
       default to min-width:auto) instead of scrolling inside .table-responsive. */
    min-width: 0;
}

.main-area.sidebar-collapsed {
    margin-right: var(--sidebar-collapsed);
}

/* ============================
   TOP BAR
   ============================ */
.topbar {
    height: var(--topbar-height);
    background: var(--surface-card);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: var(--shadow-sm);
}

.topbar-breadcrumb {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.topbar-page-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.topbar-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background var(--transition), color var(--transition);
    text-decoration: none;
}

.topbar-icon-btn:hover {
    background: var(--surface-bg);
    color: var(--brand-600);
}

.topbar-divider {
    width: 1px;
    height: 28px;
    background: var(--border-light);
    margin: 0 4px;
}

/* User chip */
.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px 5px 5px;
    border-radius: 50px;
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: background var(--transition), box-shadow var(--transition);
    background: var(--surface-card);
}

.user-chip:hover {
    background: var(--surface-bg);
    box-shadow: var(--shadow-sm);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--brand-600), var(--brand-800));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.user-chip-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-chip-role {
    font-size: 11px;
    color: var(--text-muted);
}

.user-chip-info {
    line-height: 1.2;
}

/* Role badges */
.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .02em;
}

.badge-college { background: #dbeafe; color: #1d4ed8; }
.badge-directorate { background: #fef3c7; color: #b45309; }
.badge-supervisor { background: #d1fae5; color: #065f46; }
.badge-teacher { background: #ede9fe; color: #5b21b6; }
.badge-principal { background: #ffe4e6; color: #9f1239; }
.badge-student { background: #fee2e2; color: #991b1b; }

/* Dropdown menu */
.dropdown-menu {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    font-family: 'Tajawal', sans-serif;
    font-size: 14px;
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 9px;
    transition: background var(--transition), color var(--transition);
}

.dropdown-item:hover {
    background: var(--surface-bg);
    color: var(--text-primary);
}

.dropdown-item i {
    width: 16px;
    text-align: center;
    color: var(--text-muted);
}

.dropdown-item:hover i {
    color: var(--brand-600);
}

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

/* ============================
   PAGE CONTENT
   ============================ */
.page-content {
    flex: 1;
    padding: 28px 32px;
    animation: fadeUp .35s ease both;
    min-width: 0;
    max-width: 100%;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h1, .page-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
}

.page-header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 2px;
}

/* h1/h2 used directly in pages without .page-header wrapper */
.page-content > h1:first-child,
.page-content > h2:first-child {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 20px;
}

/* Secondary tab nav (per-area quick links) */
.nav-tabs {
    border-bottom: 1px solid var(--border-light);
    gap: 4px;
    margin-bottom: 24px !important;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13.5px;
    padding: 10px 16px;
    transition: background var(--transition), color var(--transition);
}

.nav-tabs .nav-link:hover {
    background: var(--surface-bg);
    color: var(--brand-600);
    border-color: transparent;
}

.nav-tabs .nav-link.active {
    background: var(--surface-bg);
    color: var(--brand-700);
    border-color: transparent;
    box-shadow: inset 0 -2px 0 var(--gold-500);
}

/* Cards */
.card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    background: var(--surface-card);
    transition: box-shadow var(--transition);
}

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

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-light);
    padding: 16px 20px;
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
}

.card-body {
    padding: 20px;
}

.card-title {
    color: var(--text-primary);
    font-weight: 700;
}

/* Stats cards */
.stat-card {
    background: var(--surface-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: box-shadow var(--transition), transform var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-icon.blue { background: #dbeafe; color: #1d4ed8; }
.stat-icon.green { background: #d1fae5; color: #065f46; }
.stat-icon.amber { background: #fef3c7; color: #b45309; }
.stat-icon.purple { background: #ede9fe; color: #5b21b6; }
.stat-icon.gold { background: var(--gold-100); color: var(--gold-500); }

.stat-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 3px;
}

/* Quick stat cards used on dashboards (.card.text-center > .card-body > .display-6) */
.card.text-center .display-6 {
    font-weight: 800;
    color: var(--brand-700);
}

/* Buttons */
.btn {
    font-family: 'Tajawal', sans-serif;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    padding: 9px 18px;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 13px;
}

.btn-primary {
    background: var(--brand-600);
    border-color: var(--brand-600);
    color: #fff;
}

.btn-primary:hover, .btn-primary:focus {
    background: var(--brand-700);
    border-color: var(--brand-700);
    color: #fff;
    box-shadow: 0 4px 12px rgba(28, 80, 150, .30);
}

.btn-outline-primary {
    color: var(--brand-600);
    border: 1.5px solid var(--brand-500);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--brand-600);
    border-color: var(--brand-600);
    color: #fff;
    transform: translateY(-1px);
}

.btn-outline-secondary {
    color: var(--text-secondary);
    border: 1.5px solid var(--border-mid);
}

.btn-outline-secondary:hover {
    background: var(--surface-bg);
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.btn-outline-danger:hover {
    transform: translateY(-1px);
}

.btn-success {
    background: #0f9d68;
    border-color: #0f9d68;
}

.btn-success:hover {
    background: #0c7f54;
    border-color: #0c7f54;
}

.btn-gold {
    background: var(--gold-500);
    border-color: var(--gold-500);
    color: #fff;
}

.btn-gold:hover {
    background: var(--gold-400);
    border-color: var(--gold-400);
    color: #fff;
}

.btn-link {
    font-weight: 600;
}

/* Tables */
.table {
    font-size: 14px;
    color: var(--text-primary);
}

.table thead th {
    background: var(--surface-bg);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 12.5px;
    letter-spacing: .03em;
    text-transform: uppercase;
    border-bottom: 2px solid var(--border-light);
    padding: 12px 14px;
}

.table tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition);
}

.table tbody tr:hover {
    background: rgba(28, 80, 150, .03);
}

.table td {
    padding: 12px 14px;
    vertical-align: middle;
}

/* Alerts */
.alert {
    border-radius: var(--radius-md);
    border-width: 0;
    padding: 12px 16px;
    font-size: 14px;
}

.alert-success { background: #d1fae5; color: #065f46; }
.alert-danger { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #b45309; }
.alert-info { background: #dbeafe; color: #1d4ed8; }

/* Forms */
.form-control, .form-select {
    font-family: 'Tajawal', sans-serif;
    border-radius: var(--radius-sm);
    border-color: var(--border-mid);
    font-size: 14px;
    padding: 9px 12px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(28, 80, 150, .12);
}

.form-control:disabled, .form-control[readonly] {
    background-color: var(--surface-bg);
    color: var(--text-muted);
}

.form-label {
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.form-text {
    color: var(--text-muted);
    font-size: 12.5px;
}

.form-check-input:checked {
    background-color: var(--brand-600);
    border-color: var(--brand-600);
}

/* List groups (used for attachment lists) */
.list-group-item {
    border-color: var(--border-light);
    padding: 12px 16px;
    font-size: 14px;
}

.list-group-item:first-child {
    border-top-right-radius: var(--radius-md);
    border-top-left-radius: var(--radius-md);
}

.list-group-item:last-child {
    border-bottom-right-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
}

/* ============================
   AUTH PAGES (login / register)
   ============================ */
.auth-wrapper {
    min-height: calc(100vh - 40px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    background:
        radial-gradient(circle at 15% 15%, rgba(200, 146, 42, .12), transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(28, 80, 150, .10), transparent 40%),
        var(--surface-bg);
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--surface-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    padding: 36px 32px;
}

.auth-card-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--brand-900);
    box-shadow: 0 4px 14px rgba(200, 146, 42, .35);
}

.auth-title {
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.auth-subtitle {
    text-align: center;
    font-size: 13.5px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 12.5px;
    margin: 22px 0;
}

.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-light);
}

.register-role-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.register-role-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-light);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    transition: all var(--transition);
}

.register-role-link:hover {
    border-color: var(--brand-500);
    background: var(--surface-bg);
    color: var(--brand-700);
    transform: translateY(-1px);
}

.register-role-link i {
    color: var(--brand-500);
    font-size: 16px;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .register-role-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================
   LANDING / HOME PAGE
   ============================ */
.hero-section {
    background: linear-gradient(135deg, var(--brand-900), var(--brand-700));
    border-radius: var(--radius-lg);
    padding: 56px 40px;
    color: var(--text-on-dark);
    position: relative;
    overflow: hidden;
    margin-bottom: 32px;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 90% 10%, rgba(200, 146, 42, .25), transparent 45%),
        radial-gradient(circle at 5% 95%, rgba(37, 99, 184, .35), transparent 40%);
}

.hero-section-content {
    position: relative;
    max-width: 640px;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(200, 146, 42, .18);
    color: var(--gold-300);
    border: 1px solid rgba(200, 146, 42, .35);
    padding: 5px 14px;
    border-radius: 50px;
    font-size: 12.5px;
    font-weight: 700;
    margin-bottom: 18px;
}

.hero-title {
    font-size: 34px;
    font-weight: 800;
    margin-bottom: 12px;
    line-height: 1.3;
}

.hero-subtitle {
    font-size: 15.5px;
    color: var(--text-on-dark-muted);
    margin-bottom: 26px;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-actions .btn-primary {
    background: var(--gold-500);
    border-color: var(--gold-500);
}

.hero-actions .btn-primary:hover {
    background: var(--gold-400);
    border-color: var(--gold-400);
}

.hero-actions .btn-outline-light {
    color: var(--text-on-dark);
    border: 1.5px solid rgba(232, 240, 250, .35);
}

.hero-actions .btn-outline-light:hover {
    background: rgba(232, 240, 250, .12);
    border-color: rgba(232, 240, 250, .6);
    color: #fff;
}

.role-tile {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 22px 20px;
    background: var(--surface-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-primary);
    height: 100%;
    transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}

.role-tile:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
    border-color: var(--brand-400);
    color: var(--text-primary);
}

.role-tile-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    background: var(--surface-bg);
    color: var(--brand-600);
}

.role-tile-title {
    font-weight: 700;
    font-size: 15px;
}

.role-tile-desc {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================
   FOOTER
   ============================ */
.main-footer {
    background: var(--surface-card);
    border-top: 1px solid var(--border-light);
    padding: 14px 32px;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-copy {
    font-size: 12.5px;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-link {
    font-size: 12.5px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition);
}

.footer-link:hover {
    color: var(--brand-600);
}

/* ============================
   MOBILE OVERLAY
   ============================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(8, 28, 52, .5);
    backdrop-filter: blur(2px);
    z-index: 999;
}

/* ============================
   LOADING SPINNER
   ============================ */
.loading-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(100%);
        width: var(--sidebar-width) !important;
        transition: transform var(--transition);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-area {
        margin-right: 0 !important;
    }

    .page-content {
        padding: 20px 16px;
    }

    .hero-section {
        padding: 36px 24px;
    }

    .hero-title {
        font-size: 26px;
    }
}

@media (max-width: 767.98px) {
    .user-chip-info {
        display: none;
    }

    .user-chip {
        padding: 5px;
    }
}

/* ============================
   SCROLLBAR
   ============================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-mid);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================
   STUDENT DASHBOARD
   ============================ */
.student-hero {
    background: linear-gradient(135deg, var(--brand-800), var(--brand-500));
    border-radius: var(--radius-md);
    padding: 28px 32px;
    color: #fff;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.student-hero::after {
    content: "";
    position: absolute;
    inset-inline-start: -40px;
    top: -40px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(224,168,48,.25), transparent 70%);
    border-radius: 50%;
}

.student-hero-content {
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
}

.student-hero-avatar {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
    color: var(--brand-900);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    flex-shrink: 0;
}

.student-hero-greeting { font-size: 14px; opacity: .85; }
.student-hero-name { font-size: 24px; font-weight: 800; margin: 2px 0 8px; }
.student-hero-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; opacity: .9; }
.student-hero-meta i { color: var(--gold-300); margin-inline-end: 4px; }

.student-hero-status {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: var(--radius-sm);
    padding: 12px 18px;
    text-align: center;
    min-width: 150px;
}
.student-hero-status-label { font-size: 12px; opacity: .8; margin-bottom: 4px; }
.student-hero-status-value { font-size: 15px; font-weight: 700; }

/* Progress timeline */
.student-timeline {
    display: flex;
    justify-content: space-between;
    position: relative;
    gap: 8px;
}
.student-timeline::before {
    content: "";
    position: absolute;
    top: 22px;
    inset-inline: 32px;
    height: 3px;
    background: var(--surface-bg);
    z-index: 0;
}
.student-timeline-step {
    position: relative;
    z-index: 1;
    text-align: center;
    flex: 1;
}
.student-timeline-dot {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-bg);
    color: var(--text-muted);
    border: 3px solid var(--surface-card);
    transition: var(--transition);
}
.student-timeline-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.student-timeline-step.done .student-timeline-dot { background: var(--brand-500); color: #fff; }
.student-timeline-step.done .student-timeline-label { color: var(--brand-600); }
.student-timeline-step.current .student-timeline-dot {
    background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
    color: var(--brand-900);
    box-shadow: 0 0 0 5px rgba(224,168,48,.25);
    transform: scale(1.08);
}
.student-timeline-step.current .student-timeline-label { color: var(--gold-500); font-weight: 800; }

/* Placement highlight */
.placement-card {
    background: linear-gradient(135deg, #0f5132 0%, #146c43 100%);
    border-radius: var(--radius-md);
    padding: 26px 28px 22px;
    color: #fff;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}
.placement-card-ribbon {
    display: inline-block;
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 999px;
    padding: 4px 14px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 16px;
}
.placement-card-ribbon i { color: var(--gold-300); }
.placement-school { display: flex; align-items: center; gap: 14px; }
.placement-school > i { font-size: 34px; color: var(--gold-300); }
.placement-school-label { font-size: 12px; opacity: .8; }
.placement-school-name { font-size: 19px; font-weight: 800; line-height: 1.3; }
.placement-person {
    background: rgba(255,255,255,.1);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    height: 100%;
}
.placement-person-label { font-size: 12px; opacity: .85; margin-bottom: 5px; }
.placement-person-label i { color: var(--gold-300); margin-inline-end: 3px; }
.placement-person-name { font-size: 15px; font-weight: 700; }

/* Wish list */
.wish-list { list-style: none; margin: 0; padding: 0; }
.wish-list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--surface-bg);
}
.wish-list-item:last-child { border-bottom: 0; }
.wish-list-item.is-placed { background: rgba(25,135,84,.06); }
.wish-order {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface-bg);
    color: var(--brand-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
}
.wish-list-item.is-placed .wish-order { background: var(--brand-500); color: #fff; }
.wish-school { font-weight: 600; margin-bottom: 4px; }
.profile-mini .list-group-item { padding-inline: 0; }

/* ============================
   ACADEMIC YEAR SWITCHER (topbar)
   ============================ */
.year-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-bg);
    border: 1px solid var(--border-light);
    border-radius: 999px;
    padding: 6px 14px;
    font-family: 'Tajawal', sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--brand-600);
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
}
.year-chip:hover { background: #e3ebf5; border-color: var(--border-mid); }
.year-chip > i:first-child { color: var(--gold-500); }
.year-chip-text { white-space: nowrap; }
.year-chip-history {
    background: #fff7e6;
    border-color: var(--gold-300);
    color: var(--gold-600, #a6761f);
}
