/**
 * Ostadyar Platform - Main Custom Stylesheet (app.css)
 * ---------------------------------------------------
 * Includes:
 * - Persian B Yekan Typography
 * - Design Tokens & Theme Colors (Light / Dark)
 * - Dark Mode High-Contrast Overrides
 * - SweetAlert2 Dark & RTL Theming
 * - DataTables RTL, Sorting & Refresh Button Styling
 * - Global Fullscreen Wave Loader Animations
 * - Fluid Responsive Container Architecture
 */

@font-face {
    font-family: 'BYekan';
    src: url('/fonts/BYekan.eot');
    src: url('/fonts/BYekan.eot?#iefix') format('embedded-opentype'),
    url('/fonts/BYekan.ttf') format('truetype'),
    url('/fonts/BYekan.ttf') format('truetype'),
    local('B Yekan'), local('BYekan'), local('Yekan');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'BYekan';
    src: url('/fonts/BYekan.ttf') format('truetype'),
    url('/fonts/BYekan.ttf') format('truetype'),
    local('B Yekan Bold'), local('BYekan Bold'), local('Yekan Bold');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --ostad-wave-ink: #131316;
    --font-family-base: 'BYekan', 'B Yekan', 'Yekan', Tahoma, sans-serif;
    --ostad-primary: #4f46e5;
    --ostad-primary-dark: #3730a3;
    --ostad-primary-light: #6366f1;
    --ostad-secondary: #06b6d4;
    --ostad-accent: #f59e0b;
    --ostad-success: #10b981;
    --ostad-danger: #ef4444;
    --ostad-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #06b6d4 100%);
    --ostad-gradient-accent: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    --ostad-card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.04), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
    --ostad-hover-shadow: 0 20px 30px -10px rgba(79, 70, 229, 0.15), 0 10px 15px -5px rgba(79, 70, 229, 0.08);
    --ostad-border: rgba(226, 232, 240, 0.8);
    /* Fix duplicate breadcrumb divider in RTL */
    --bs-breadcrumb-divider: '/';
    /* Improved muted-text contrast for WCAG 2.1 AA (ratio ≥4.5:1 on #f8fafc) */
    --bs-secondary-color: #4b5563;
}

/* Fix duplicate breadcrumb slash in RTL — Bootstrap RTL uses ::after instead of ::before */
.breadcrumb-item + .breadcrumb-item::before,
.breadcrumb-item + .breadcrumb-item::after {
    display: none;
}
.breadcrumb-item + .breadcrumb-item::before {
    display: inline-block;
    content: '/';
    padding-inline: 0.5rem;
    color: var(--bs-breadcrumb-divider-color, #6c757d);
}

/* Form check pointer cursor */
.form-check,
.form-check-input,
.form-check-label,
.form-switch,
.form-switch .form-check-input,
.form-switch .form-check-label {
    cursor: pointer;
    user-select: none;
}

.form-check-input:disabled,
.form-check-input:disabled ~ .form-check-label {
    cursor: not-allowed;
}

[data-bs-theme="dark"] {
    --ostad-wave-ink: #f5f5f7;
    --ostad-border: rgba(51, 65, 85, 0.7);
    --ostad-card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    --ostad-hover-shadow: 0 20px 30px -10px rgba(99, 102, 241, 0.25);
    --bs-body-bg: #0b0f19;
    --bs-body-bg-rgb: 11, 15, 25;
    --bs-body-color: #f1f5f9;
    --bs-body-color-rgb: 241, 245, 249;
    --bs-tertiary-bg: #1e293b;
    --bs-tertiary-bg-rgb: 30, 41, 59;
    --bs-secondary-bg: #1e293b;
    --bs-secondary-bg-rgb: 30, 41, 59;
    --bs-border-color: rgba(51, 65, 85, 0.7);
    --bs-card-bg: #0f172a;
    --bs-light-rgb: 30, 41, 59;
}

/* Dark Mode High-Contrast & Readability Protection */
[data-bs-theme="dark"] .bg-light,
[data-bs-theme="dark"] .bg-light-subtle {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .badge.bg-light,
[data-bs-theme="dark"] .badge.bg-light-subtle {
    background-color: rgba(51, 65, 85, 0.7) !important;
    color: #cbd5e1 !important;
    border-color: rgba(71, 85, 105, 0.6) !important;
}

[data-bs-theme="dark"] .card {
    background-color: #0f172a;
    border-color: rgba(51, 65, 85, 0.7);
    color: #f1f5f9;
}

[data-bs-theme="dark"] .text-dark {
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .bg-warning.text-dark,
[data-bs-theme="dark"] .bg-warning .text-dark,
[data-bs-theme="dark"] .btn-warning.text-dark,
[data-bs-theme="dark"] .btn-warning .text-dark,
[data-bs-theme="dark"] .bg-white.text-dark,
[data-bs-theme="dark"] .bg-white .text-dark {
    color: #0f172a !important;
}

[data-bs-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .border-light,
[data-bs-theme="dark"] .border-light-subtle {
    border-color: rgba(51, 65, 85, 0.7) !important;
}

[data-bs-theme="dark"] .btn-light {
    background-color: #1e293b;
    border-color: rgba(71, 85, 105, 0.6);
    color: #f1f5f9;
}

[data-bs-theme="dark"] .btn-light:hover {
    background-color: #334155;
    border-color: rgba(100, 116, 139, 0.7);
    color: #ffffff;
}

[data-bs-theme="dark"] .dropdown-menu {
    background-color: #0f172a;
    border: 1px solid rgba(51, 65, 85, 0.8);
    color: #f1f5f9;
}

[data-bs-theme="dark"] .dropdown-item {
    color: #cbd5e1;
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
    background-color: #1e293b;
    color: #ffffff;
}

[data-bs-theme="dark"] .table {
    --bs-table-color: #f1f5f9;
    --bs-table-bg: #0f172a;
    --bs-table-border-color: rgba(51, 65, 85, 0.7);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #0b0f19;
    border-color: rgba(51, 65, 85, 0.7);
    color: #f1f5f9;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #0b0f19;
    border-color: #6366f1;
    color: #ffffff;
}

[data-bs-theme="dark"] .form-control:disabled,
[data-bs-theme="dark"] .form-control[readonly] {
    background-color: #1e293b !important;
    border-color: rgba(51, 65, 85, 0.5) !important;
    color: #94a3b8 !important;
}

/* SweetAlert2 Styles & Dark Mode */
.swal2-popup {
    border-radius: 1rem !important;
    direction: rtl !important;
}

.swal2-actions {
    gap: 0.5rem;
}

[data-bs-theme="dark"] .swal2-popup {
    background-color: #0f172a !important;
    color: #f1f5f9 !important;
    border: 1px solid rgba(51, 65, 85, 0.8) !important;
}

[data-bs-theme="dark"] .swal2-title,
[data-bs-theme="dark"] .swal2-html-container {
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .swal2-toast {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    border: 1px solid rgba(51, 65, 85, 0.8) !important;
}

* {
    font-family: var(--font-family-base) !important;
}

body {
    font-family: var(--font-family-base) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    line-height: 1.8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f8fafc;
    color: #1e293b;
}

[data-bs-theme="dark"] body {
    background-color: #0b0f19;
    color: #f1f5f9;
}

/* Heading typography — proper line-height for Persian diacritics */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.35;
}

/* Widescreen Fluid Responsive Container Architecture */
.container,
.container-fluid,
.container-ostad {
    width: 100%;
    padding-right: 1rem;
    padding-left: 1rem;
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 576px) {
    .container, .container-sm, .container-ostad {
        max-width: 100%;
        padding-right: 1.25rem;
        padding-left: 1.25rem;
    }
}

@media (min-width: 768px) {
    .container, .container-sm, .container-md, .container-ostad {
        max-width: 100%;
        padding-right: 1.5rem;
        padding-left: 1.5rem;
    }
}

@media (min-width: 992px) {
    .container, .container-sm, .container-md, .container-lg, .container-ostad {
        max-width: 96%;
        padding-right: 2rem;
        padding-left: 2rem;
    }
}

@media (min-width: 1200px) {
    .container, .container-sm, .container-md, .container-lg, .container-xl, .container-ostad {
        max-width: 96%;
        padding-right: 2.25rem;
        padding-left: 2.25rem;
    }
}

@media (min-width: 1400px) {
    .container, .container-sm, .container-md, .container-lg, .container-xl, .container-xxl, .container-ostad {
        max-width: 96%;
        padding-right: 2.5rem;
        padding-left: 2.5rem;
    }
}

@media (min-width: 1600px) {
    .container, .container-sm, .container-md, .container-lg, .container-xl, .container-xxl, .container-ostad {
        max-width: 1780px;
        padding-right: 3rem;
        padding-left: 3rem;
    }
}

@media (min-width: 1920px) {
    .container, .container-sm, .container-md, .container-lg, .container-xl, .container-xxl, .container-ostad {
        max-width: 1880px;
        padding-right: 3.5rem;
        padding-left: 3.5rem;
    }
}

/* Glassmorphism Navbar & Header Stacking Order */
header.sticky-top {
    z-index: 1040 !important;
}

.main-content .sticky-top {
    z-index: 10 !important;
}

.navbar-ostad {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid var(--ostad-border);
    transition: all 0.3s ease;
}

[data-bs-theme="dark"] .navbar-ostad {
    background: rgba(15, 23, 42, 0.85);
}

.brand-logo-icon {
    width: 42px;
    height: 42px;
    background: var(--ostad-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 6px 15px rgba(79, 70, 229, 0.35);
}

.brand-title {
    font-weight: 700;
    font-size: 1.45rem;
    letter-spacing: -0.5px;
    background: var(--ostad-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Dynamic Brand Logo (Adaptive Light & Dark Modes) */
.brand-logo-link {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-logo-link:hover {
    transform: translateY(-1px) scale(1.02);
}

.navbar-brand-logo {
    height: 42px;
    width: auto;
    max-height: 44px;
    object-fit: contain;
    transition: filter 0.3s ease, opacity 0.3s ease;
    vertical-align: middle;
}

.footer-brand-logo {
    height: 48px;
    width: auto;
    max-height: 52px;
    object-fit: contain;
    transition: filter 0.3s ease;
}

/* -------------------------------------------------------------
   Navbar Action Controls & Uniform Sizing Architecture
   Ensures 100% height (38px), 16px icon scale, and vertical rhythm
------------------------------------------------------------- */
.nav-action-btn {
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.875rem !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
    vertical-align: middle !important;
    text-decoration: none !important;
    transition: all 0.2s ease-in-out !important;
}

/* Circular Icon Buttons (Theme toggle, Notification bell) */
.nav-action-btn.nav-icon-btn {
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    padding: 0 !important;
    border-radius: 50% !important;
}

/* Unified 16px Icon Scale across all Navbar Action Controls */
.nav-action-btn i,
.nav-action-btn .bi {
    font-size: 1rem !important;
    line-height: 1 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Shopping Cart Button */
.nav-cart-btn {
    padding: 0 0.85rem !important;
    gap: 0.45rem !important;
}

/* Language Selector Button */
.nav-lang-btn {
    padding: 0 0.75rem !important;
    gap: 0.4rem !important;
}

.nav-lang-btn span {
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px;
    line-height: 1 !important;
}

/* User Account Profile Button */
.nav-user-btn {
    padding: 0 0.85rem 0 0.35rem !important;
    gap: 0.5rem !important;
    background-color: var(--bs-body-bg, #ffffff) !important;
    border: 1px solid var(--ostad-border) !important;
}

html[dir="rtl"] .nav-user-btn {
    padding: 0 0.35rem 0 0.85rem !important;
}

.nav-user-btn .nav-user-avatar {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    border-radius: 50% !important;
    font-size: 13px !important;
}

.nav-user-btn span {
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    line-height: 1 !important;
}

/* Notification Bell Accent Styling */
.nav-bell-btn {
    color: #f59e0b !important;
    border: 1px solid rgba(245, 158, 11, 0.4) !important;
    background-color: rgba(245, 158, 11, 0.06) !important;
}

.nav-bell-btn:hover {
    color: #ffffff !important;
    background-color: #f59e0b !important;
    border-color: #f59e0b !important;
}

[data-bs-theme="dark"] .nav-bell-btn {
    color: #fbbf24 !important;
    border-color: rgba(251, 191, 36, 0.35) !important;
    background-color: rgba(251, 191, 36, 0.08) !important;
}

[data-bs-theme="dark"] .nav-bell-btn:hover {
    color: #0f172a !important;
    background-color: #fbbf24 !important;
    border-color: #fbbf24 !important;
}

/* Dark Mode User Button */
[data-bs-theme="dark"] .nav-user-btn {
    background-color: #1e293b !important;
    border-color: rgba(71, 85, 105, 0.6) !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .nav-user-btn:hover {
    background-color: #334155 !important;
    border-color: rgba(100, 116, 139, 0.7) !important;
    color: #ffffff !important;
}

/* Caret Alignment inside Flexbox Dropdown Toggles */
html[dir="ltr"] .dropdown-toggle::after {
    margin-left: 0.35rem !important;
    margin-right: 0 !important;
}

html[dir="rtl"] .dropdown-toggle::after {
    margin-right: 0.35rem !important;
    margin-left: 0 !important;
}

/* Light Mode Rules */
[data-bs-theme="light"] .logo-dark-mode {
    display: none !important;
}

[data-bs-theme="light"] .logo-light-mode {
    display: inline-block !important;
    filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.08));
}

/* Dark Mode Rules: Enhanced Neon Glow */
[data-bs-theme="dark"] .logo-light-mode {
    display: none !important;
}

[data-bs-theme="dark"] .logo-dark-mode {
    display: inline-block !important;
    filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.45)) drop-shadow(0 0 20px rgba(168, 85, 247, 0.35));
}

[data-bs-theme="dark"] .brand-logo-link:hover .navbar-brand-logo.logo-dark-mode {
    filter: drop-shadow(0 0 14px rgba(6, 182, 212, 0.75)) drop-shadow(0 0 28px rgba(168, 85, 247, 0.6));
}

.nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    color: #475569;
    padding: 0.6rem 1rem !important;
    border-radius: 10px;
    transition: all 0.2s ease;
}

[data-bs-theme="dark"] .nav-link {
    color: #94a3b8;
}

.nav-link:hover, .nav-link.active {
    color: var(--ostad-primary) !important;
    background: rgba(79, 70, 229, 0.08);
}

[data-bs-theme="dark"] .nav-link:hover, [data-bs-theme="dark"] .nav-link.active {
    color: #a5b4fc !important;
    background: rgba(99, 102, 241, 0.15);
}

/* Nav Pills Specificity Architecture: Ensures active pills have solid background and high-contrast white text */
.nav-pills .nav-link {
    color: var(--bs-secondary-color, #64748b) !important;
    background-color: var(--bs-tertiary-bg, #f8fafc) !important;
    border: 1px solid var(--bs-border-color, #e2e8f0) !important;
    font-weight: 600;
}

.nav-pills .nav-link:hover:not(.active) {
    color: var(--ostad-primary, #4f46e5) !important;
    background-color: rgba(79, 70, 229, 0.08) !important;
    border-color: rgba(79, 70, 229, 0.2) !important;
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    color: #ffffff !important;
    background-color: var(--ostad-primary, #4f46e5) !important;
    border-color: var(--ostad-primary, #4f46e5) !important;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35) !important;
}

[data-bs-theme="dark"] .nav-pills .nav-link {
    color: #94a3b8 !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-bs-theme="dark"] .nav-pills .nav-link:hover:not(.active) {
    color: #a5b4fc !important;
    background-color: rgba(99, 102, 241, 0.15) !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
}

[data-bs-theme="dark"] .nav-pills .nav-link.active,
[data-bs-theme="dark"] .nav-pills .show > .nav-link {
    color: #ffffff !important;
    background-color: var(--ostad-primary, #4f46e5) !important;
    border-color: var(--ostad-primary, #4f46e5) !important;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.5) !important;
}

/* -------------------------------------------------------------
   Dashboard Sidebar Navigation Architecture
   Eliminates active link overflow, width spilling, and horizontal jump
------------------------------------------------------------- */
.dashboard-sidebar-card {
    top: 85px !important;
    z-index: 10;
}

@media (max-width: 991.98px) {
    .dashboard-sidebar-card {
        position: static !important;
        top: 0 !important;
    }
}

.sidebar-nav-group {
    padding: 0.5rem !important;
    gap: 0.25rem !important;
    box-sizing: border-box !important;
}

.sidebar-nav-group .list-group-item {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-radius: 0.75rem !important;
    padding: 0.25rem 1rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease-in-out !important;
    background-color: transparent !important;
    color: var(--bs-secondary-color, #64748b) !important;
}

.sidebar-nav-group .list-group-item.active {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35) !important;
}

.sidebar-nav-group .list-group-item.active i,
.sidebar-nav-group .list-group-item.active span {
    color: #ffffff !important;
}

.sidebar-nav-group .list-group-item:not(.active):hover {
    background-color: rgba(79, 70, 229, 0.08) !important;
    color: var(--ostad-primary, #4f46e5) !important;
}

.sidebar-nav-group .list-group-item.text-danger:not(.active) {
    color: var(--bs-danger, #ef4444) !important;
}

.sidebar-nav-group .list-group-item.text-danger:not(.active):hover {
    background-color: rgba(239, 68, 68, 0.08) !important;
    color: #ef4444 !important;
}

[data-bs-theme="dark"] .sidebar-nav-group .list-group-item:not(.active) {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .sidebar-nav-group .list-group-item:not(.active):hover {
    background-color: rgba(99, 102, 241, 0.15) !important;
    color: #f1f5f9 !important;
}

/* Modern Cards */
.card {
    border: 1px solid var(--ostad-border);
    border-radius: 1.25rem;
    box-shadow: var(--ostad-card-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-elevate {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-elevate:hover {
    transform: translateY(-5px);
    box-shadow: var(--ostad-hover-shadow) !important;
}

/* Modern Buttons */
.btn-gradient-primary {
    background: var(--ostad-gradient);
    border: none;
    color: #fff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
    font-weight: 600;
    transition: all 0.25s ease;
}

.btn-gradient-primary:hover {
    opacity: 0.94;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
}

.btn-gradient-accent {
    background: var(--ostad-gradient-accent);
    border: none;
    color: #fff;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
    font-weight: 600;
}

.btn-gradient-accent:hover {
    color: #fff;
    opacity: 0.94;
    transform: translateY(-2px);
}

/* Pulsing Badges */
.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--ostad-danger);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    animation: pulse 1.8s infinite;
    display: inline-block;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Accessibility: Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
    .hover-elevate {
        transition: none !important;
    }
    .hover-elevate:hover {
        transform: none !important;
    }
    .pulse-dot {
        animation: none !important;
    }
    .btn-gradient-primary,
    .btn-gradient-accent {
        transition: none !important;
    }
    .btn-gradient-primary:hover,
    .btn-gradient-accent:hover {
        transform: none !important;
    }
    .brand-logo-link {
        transition: none !important;
    }
    .brand-logo-link:hover {
        transform: none !important;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.main-content {
    flex: 1;
}

/* -------------------------------------------------------------
   Wave Loader - Theme Adaptive (Light & Dark)
   Ink comes from --ostad-wave-ink (#131316 light / #f5f5f7 dark).
   Per instance knobs: color (the ink) and --rate (speed multiplier).
------------------------------------------------------------- */
.wav {
    color: var(--ostad-wave-ink);
    --dur: 1.8s;
    --rate: 1;
    display: block;
    transition: color 0.3s ease;
}

/* the bars shimmer on the beads' phase, so the wave carries through the
   whole disc rather than only in the dots */
.wav .wav-bar {
    stroke: currentColor;
    stroke-width: .8;
    opacity: .24;
    animation: wav-shimmer calc(var(--dur) * var(--rate, 1)) ease-in-out infinite;
    animation-delay: calc(var(--i) * var(--dur) * var(--rate, 1) / -9);
}

.wav .wav-bead {
    fill: currentColor;
    animation: wav-bob calc(var(--dur) * var(--rate, 1)) ease-in-out infinite;
    animation-delay: calc(var(--i) * var(--dur) * var(--rate, 1) / -7);
}

@keyframes wav-bob {
    0%, 100% {
        transform: translateY(-16px);
    }
    50% {
        transform: translateY(16px);
    }
}

@keyframes wav-shimmer {
    0%, 100% {
        opacity: .2;
    }
    50% {
        opacity: .62;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wav .wav-bar {
        animation: none;
        opacity: .3;
    }

    .wav .wav-bead {
        animation: none;
        transform: translateY(calc((var(--i) - 2) * 7px));
    }
}

/* Inline variant - sits beside text in buttons, table toolbars, empty states.
   Follows the surrounding text color so it keeps contrast on colored buttons. */
.wav-inline {
    color: inherit;
    display: inline-block;
    width: 1.35em;
    height: 1.35em;
    vertical-align: -0.35em;
}

/* The one loading visual of the platform: the wave icon with its caption
   underneath. Built by OstadLoader.markup() in assets/js/wave-loader.js and used
   by every loading state - fullscreen, scoped overlays and inline placeholders. */
:root {
    --ostad-loading-text-color: #2050ff;
    --ostad-loading-halo-color: rgba(32, 80, 255, 0.38);
}

.ostad-loading-block {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: auto !important;
    min-height: auto !important;
    padding: 0 !important;
    margin: 0 auto;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    text-align: center;
    position: relative;
}

/* Transparent clean wrapper for loading SVG */
.ostad-loading-halo-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
}

/* SVG loaded from public/assets/js/ostadyar_loading.svg - pure, crisp, transparent */
.ostad-loading-block .ostad-loading-svg,
.ostad-loading-block .ostad-loading-svg-wrapper,
.ostad-loading-block .ostad-loading-svg-wrapper svg,
.ostad-loading-block .wav {
    position: relative;
    z-index: 1;
    width: 200px;
    height: 200px;
    flex-shrink: 0;
    object-fit: contain;
    filter: none !important;
}

/* Small inline loader inside buttons or compact badges */
.ostad-loading-inline,
.wav-inline {
    display: inline-block;
    vertical-align: middle;
    width: 1.25em !important;
    height: 1.25em !important;
    filter: none !important;
}

/* Caption text completely hidden as requested */
.ostad-loading-caption {
    display: none !important;
}

/* Overlay wrapper - ALWAYS fullscreen and perfectly centered */
.ostad-loader-overlay,
.ostad-loader-overlay-anchored {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(248, 250, 252, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2147483000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    opacity: 1;
    transition: opacity 0.35s ease, visibility 0.35s ease, background 0.3s ease;
}

.ostad-loader-overlay.fade-out,
.ostad-loader-overlay-anchored.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Dark Mode Theme Adaptive Rules */
[data-bs-theme="dark"] .ostad-loader-overlay,
[data-bs-theme="dark"] .ostad-loader-overlay-anchored {
    background: rgba(11, 15, 25, 0.82);
}

[data-bs-theme="dark"] .ostad-loading-block .ostad-loading-svg,
[data-bs-theme="dark"] .ostad-loading-block .ostad-loading-svg-wrapper svg,
[data-bs-theme="dark"] .ostad-loading-block .wav {
    filter: none !important;
}

/* -------------------------------------------------------------
   DataTables Persian RTL & Theme Optimizations
------------------------------------------------------------- */
.dataTables_wrapper {
    font-size: 0.875rem;
    padding: 0.25rem 0;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 0.75rem;
}

/* DataTables Toolbar Positioning (RTL / LTR) */
.dataTables_wrapper .dt-toolbar-row {
    margin-bottom: 0.85rem;
}

/* RTL Layout: Search on RIGHT, Length & Refresh on LEFT */
[dir="rtl"] .dataTables_wrapper .dt-toolbar-search,
html[dir="rtl"] .dataTables_wrapper .dt-toolbar-search {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: right;
}

[dir="rtl"] .dataTables_wrapper .dt-toolbar-tools,
html[dir="rtl"] .dataTables_wrapper .dt-toolbar-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.65rem;
}

[dir="rtl"] .dataTables_wrapper .dataTables_filter,
html[dir="rtl"] .dataTables_wrapper .dataTables_filter {
    text-align: right !important;
}

[dir="rtl"] .dataTables_wrapper .dataTables_filter label,
html[dir="rtl"] .dataTables_wrapper .dataTables_filter label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--bs-secondary-color, #64748b);
    font-weight: 500;
    font-size: 0.8125rem;
    margin-bottom: 0;
}

/* LTR Layout: Length & Refresh on LEFT, Search on RIGHT */
[dir="ltr"] .dataTables_wrapper .dt-toolbar-row .dt-toolbar-tools,
html[dir="ltr"] .dataTables_wrapper .dt-toolbar-row .dt-toolbar-tools {
    order: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.65rem;
}

[dir="ltr"] .dataTables_wrapper .dt-toolbar-row .dt-toolbar-search,
html[dir="ltr"] .dataTables_wrapper .dt-toolbar-row .dt-toolbar-search {
    order: 2;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    text-align: right;
}

[dir="ltr"] .dataTables_wrapper .dataTables_filter,
html[dir="ltr"] .dataTables_wrapper .dataTables_filter {
    text-align: right !important;
}

[dir="ltr"] .dataTables_wrapper .dataTables_filter label,
html[dir="ltr"] .dataTables_wrapper .dataTables_filter label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--bs-secondary-color, #64748b);
    font-weight: 500;
    font-size: 0.8125rem;
    margin-bottom: 0;
}

@media (max-width: 767.98px) {
    .dataTables_wrapper .dt-toolbar-search,
    .dataTables_wrapper .dt-toolbar-tools {
        justify-content: center !important;
        width: 100% !important;
    }
    .dataTables_wrapper .dataTables_filter {
        text-align: center !important;
    }
    .dataTables_wrapper .dataTables_filter label {
        justify-content: center;
    }
}

/* DataTables Search Input */
.dataTables_wrapper .dataTables_filter input {
    height: 34px;
    border-radius: 0.5rem !important;
    padding: 0.25rem 0.85rem;
    border: 1px solid var(--ostad-border, #e2e8f0) !important;
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color);
    font-size: 0.8125rem;
    font-weight: 500;
    outline: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--ostad-primary, #4f46e5) !important;
    box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.15) !important;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter input {
    background-color: rgba(30, 41, 59, 0.6) !important;
    border-color: rgba(51, 65, 85, 0.7) !important;
    color: #cbd5e1;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--ostad-primary-light, #818cf8) !important;
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25) !important;
}

/* Length Wrapper & Harmonized Select Box */
.dataTables_wrapper .dataTables_length {
    display: inline-flex;
    align-items: center;
    margin-bottom: 0;
}

.dataTables_wrapper .dataTables_length label {
    display: inline-flex;
    align-items: center;
    margin-bottom: 0;
    gap: 0.4rem;
    color: var(--bs-secondary-color, #64748b);
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1;
}

.dataTables_wrapper .dataTables_length select {
    display: inline-flex;
    align-items: center;
    height: 34px;
    line-height: 1.5;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 0.5rem !important;
    border: 1px solid var(--ostad-border, #e2e8f0) !important;
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-secondary-color, #64748b) !important;
    min-width: 4.75rem;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease-in-out;
    vertical-align: middle;
}

[dir="rtl"] .dataTables_wrapper .dataTables_length select,
html[dir="rtl"] .dataTables_wrapper .dataTables_length select {
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
    padding-right: 0.75rem !important;
    padding-left: 2rem !important;
    background-position: left 0.65rem center !important;
    text-align: right;
}

[dir="ltr"] .dataTables_wrapper .dataTables_length select,
html[dir="ltr"] .dataTables_wrapper .dataTables_length select {
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
    padding-left: 0.75rem !important;
    padding-right: 2rem !important;
    background-position: right 0.65rem center !important;
    text-align: left;
}

.dataTables_wrapper .dataTables_length select:hover {
    background-color: rgba(79, 70, 229, 0.08) !important;
    border-color: var(--ostad-primary, #4f46e5) !important;
    color: var(--ostad-primary, #4f46e5) !important;
}

.dataTables_wrapper .dataTables_length select:focus {
    border-color: var(--ostad-primary, #4f46e5) !important;
    box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.15) !important;
    outline: 0;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length select {
    background-color: rgba(30, 41, 59, 0.6) !important;
    border-color: rgba(51, 65, 85, 0.7) !important;
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length select:hover {
    background-color: rgba(99, 102, 241, 0.18) !important;
    border-color: var(--ostad-primary-light, #818cf8) !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length select:focus {
    border-color: var(--ostad-primary-light, #818cf8) !important;
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25) !important;
}

.dataTables_wrapper .dataTables_info {
    padding-top: 0.75rem;
    color: var(--bs-secondary-color);
    font-size: 0.85rem;
}

.dataTables_wrapper .dataTables_paginate {
    padding-top: 0.5rem;
}

[dir="rtl"] .dataTables_wrapper .dataTables_paginate ul.pagination {
    justify-content: flex-end;
    gap: 3px;
}

.dataTables_wrapper .page-item .page-link {
    border-radius: 0.5rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    border-color: var(--ostad-border);
    color: var(--bs-body-color);
    background-color: var(--bs-body-bg);
}

.dataTables_wrapper .page-item.active .page-link {
    background-color: var(--ostad-primary);
    border-color: var(--ostad-primary);
    color: #fff;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

[dir="rtl"] table.dataTable thead > tr > th.sorting,
[dir="rtl"] table.dataTable thead > tr > th.sorting_asc,
[dir="rtl"] table.dataTable thead > tr > th.sorting_desc {
    padding-right: 0.75rem;
    padding-left: 26px;
}

[dir="rtl"] table.dataTable thead > tr > th.sorting:before,
[dir="rtl"] table.dataTable thead > tr > th.sorting_asc:before,
[dir="rtl"] table.dataTable thead > tr > th.sorting_desc:before,
[dir="rtl"] table.dataTable thead > tr > th.sorting:after,
[dir="rtl"] table.dataTable thead > tr > th.sorting_asc:after,
[dir="rtl"] table.dataTable thead > tr > th.sorting_desc:after {
    right: auto;
    left: 10px;
}

/* Dark mode overrides for DataTables */
[data-bs-theme="dark"] .dataTables_wrapper .page-item:not(.active) .page-link {
    background-color: rgba(30, 41, 59, 0.6);
    border-color: rgba(51, 65, 85, 0.6);
    color: #94a3b8;
}

[data-bs-theme="dark"] .dataTables_wrapper .page-item.disabled .page-link {
    background-color: rgba(15, 23, 42, 0.5);
    border-color: rgba(51, 65, 85, 0.3);
    color: #475569;
}

/* Universal Ostadyar Custom Pagination */
.ostad-pagination {
    gap: 4px;
}

.ostad-pagination .page-item .page-link {
    border-radius: 0.5rem !important;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    border-color: var(--ostad-border);
    color: var(--bs-body-color);
    background-color: var(--bs-body-bg);
    box-shadow: none;
    transition: all 0.2s ease-in-out;
}

.ostad-pagination .page-item .page-link:hover {
    background-color: rgba(79, 70, 229, 0.08);
    border-color: var(--ostad-primary);
    color: var(--ostad-primary);
}

.ostad-pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%) !important;
    border-color: var(--ostad-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.35) !important;
}

.ostad-pagination .page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    background-color: var(--bs-body-bg);
    border-color: var(--ostad-border);
    color: var(--bs-secondary-color);
}

[data-bs-theme="dark"] .ostad-pagination .page-item:not(.active) .page-link {
    background-color: rgba(30, 41, 59, 0.6);
    border-color: rgba(51, 65, 85, 0.6);
    color: #94a3b8;
}

[data-bs-theme="dark"] .ostad-pagination .page-item:not(.active) .page-link:hover {
    background-color: rgba(99, 102, 241, 0.15);
    color: #f1f5f9;
    border-color: var(--ostad-primary-light);
}

[data-bs-theme="dark"] .ostad-pagination .page-item.disabled .page-link {
    background-color: rgba(15, 23, 42, 0.5);
    border-color: rgba(51, 65, 85, 0.3);
    color: #475569;
}

/* Refresh button injected by DataTableService */
.dataTables_wrapper .dt-refresh-btn {
    white-space: nowrap;
    height: 34px;
    font-size: 0.8125rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.25rem 0.85rem !important;
    border-radius: 0.5rem !important;
    border: 1px solid var(--ostad-border, #e2e8f0) !important;
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-secondary-color, #64748b) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.dataTables_wrapper .dt-refresh-btn:hover {
    background-color: rgba(79, 70, 229, 0.08) !important;
    border-color: var(--ostad-primary, #4f46e5) !important;
    color: var(--ostad-primary, #4f46e5) !important;
}

.dataTables_wrapper .dt-refresh-btn:active {
    background-color: rgba(79, 70, 229, 0.15) !important;
    border-color: var(--ostad-primary, #4f46e5) !important;
    transform: scale(0.98);
}

.dataTables_wrapper .dt-refresh-btn:focus-visible {
    border-color: var(--ostad-primary, #4f46e5) !important;
    box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.15) !important;
    outline: 0;
}

.dataTables_wrapper .dt-refresh-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

[data-bs-theme="dark"] .dataTables_wrapper .dt-refresh-btn {
    background-color: rgba(30, 41, 59, 0.6) !important;
    border-color: rgba(51, 65, 85, 0.7) !important;
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .dataTables_wrapper .dt-refresh-btn:hover {
    background-color: rgba(99, 102, 241, 0.18) !important;
    border-color: var(--ostad-primary-light, #818cf8) !important;
    color: #f1f5f9 !important;
}

/* -------------------------------------------------------------
   LTR Direction & Alignment Utilities for Persian RTL Layouts
------------------------------------------------------------- */

.ltr-dir {
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: isolate;
}

.ltr-center {
    direction: ltr !important;
    text-align: center !important;
    unicode-bidi: isolate;
}

/* Form Controls with LTR Direction */

input.ltr-dir,
textarea.ltr-dir,
select.ltr-dir {
    direction: ltr !important;
    text-align: left !important;
}

input.ltr-center,
textarea.ltr-center,
select.ltr-center {
    direction: ltr !important;
    text-align: center !important;
}

/* Form Placeholders alignment in LTR fields */

[dir="rtl"] input.ltr-dir::placeholder,
[dir="rtl"] textarea.ltr-dir::placeholder {
    direction: ltr;
    text-align: left;
}

[dir="rtl"] input.ltr-center::placeholder,
[dir="rtl"] textarea.ltr-center::placeholder {
    direction: ltr;
    text-align: center;
}

/* -------------------------------------------------------------
   Password Visibility Toggle Button
------------------------------------------------------------- */
.btn-toggle-password {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bs-tertiary-bg, #f8fafc);
    border: 1px solid var(--ostad-border, var(--bs-border-color));
    color: var(--bs-secondary-color, #64748b);
    padding: 0.375rem 0.85rem;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    z-index: 4;
}

.btn-toggle-password:hover,
.btn-toggle-password:focus {
    background-color: var(--bs-secondary-bg, #f1f5f9);
    color: var(--ostad-primary);
    border-color: var(--ostad-primary);
    box-shadow: none;
    outline: none;
}

.btn-toggle-password:active i {
    transform: scale(0.9);
}

[data-bs-theme="dark"] .btn-toggle-password {
    background-color: #1e293b;
    border-color: rgba(51, 65, 85, 0.8);
    color: #94a3b8;
}

[data-bs-theme="dark"] .btn-toggle-password:hover,
[data-bs-theme="dark"] .btn-toggle-password:focus {
    background-color: #334155;
    color: #f1f5f9;
    border-color: var(--ostad-primary-light);
}

/* -------------------------------------------------------------
   Calibri Font Utility (English Digits & Alphanumeric Values)
------------------------------------------------------------- */
.calibri,
.calibri *,
input.calibri,
textarea.calibri,
select.calibri,
code.calibri,
span.calibri,
td.calibri,
th.calibri {
    font-family: 'Calibri', 'Segoe UI', Candara, Optima, Arial, sans-serif !important;
}

input.calibri::placeholder,
textarea.calibri::placeholder {
    font-family: 'Calibri', 'Segoe UI', Candara, Optima, Arial, sans-serif !important;
}

/* -------------------------------------------------------------
   Language Selector Endonym Styling (Native Autonyms)
------------------------------------------------------------- */
.lang-item-fa {
    font-family: 'BYekan', 'B Yekan', Tahoma, sans-serif !important;
}
.lang-item-ar {
    font-family: 'BYekan', 'B Yekan', Tahoma, 'Segoe UI', sans-serif !important;
}
.lang-item-en {
    font-family: 'Calibri', 'Segoe UI', Candara, Arial, sans-serif !important;
}

/* -------------------------------------------------------------
   LTR Mode Overrides (when html[dir="ltr"] is active for English)
   Corrects Bootstrap RTL inversions and viewport boundary spill
------------------------------------------------------------- */
html[dir="ltr"] {
    --font-family-base: 'Calibri', 'Segoe UI', Candara, Optima, Arial, sans-serif;
    --bs-body-font-family: 'Calibri', 'Segoe UI', Candara, Optima, Arial, sans-serif;
    font-family: 'Calibri', 'Segoe UI', Candara, Optima, Arial, sans-serif !important;
    overflow-x: clip;
    max-width: 100vw;
}

html[dir="ltr"] body {
    font-family: 'Calibri', 'Segoe UI', Candara, Optima, Arial, sans-serif !important;
    overflow-x: clip;
    max-width: 100vw;
}

/* Set default font to Calibri across all elements in English mode (preserving icons & native language endonyms) */
html[dir="ltr"] *:not(i):not([class*="bi-"]):not([class^="bi-"]):not([class*="fa-"]):not(.lang-item-fa):not(.lang-item-ar) {
    font-family: 'Calibri', 'Segoe UI', Candara, Optima, Arial, sans-serif !important;
}

html[dir="ltr"] input::placeholder,
html[dir="ltr"] textarea::placeholder {
    font-family: 'Calibri', 'Segoe UI', Candara, Optima, Arial, sans-serif !important;
}

@supports not (overflow-x: clip) {
    html[dir="ltr"],
    html[dir="ltr"] body {
        overflow-x: hidden;
    }
}

/* Main Navbar Left Alignment & Brand Attachment in LTR */
html[dir="ltr"] .navbar-brand {
    margin-right: 1.5rem !important;
    margin-left: 0 !important;
}

html[dir="ltr"] #mainNavbar .navbar-nav.me-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
}

html[dir="ltr"] #mainNavbar .navbar-nav {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

html[dir="ltr"] #mainNavbar .navbar-nav .nav-link {
    text-align: left;
}

/* Dropdown Menus Alignment & Overflow Boundary Fix in LTR */
html[dir="ltr"] .dropdown-menu {
    text-align: left !important;
    max-width: calc(100vw - 1.5rem);
}

html[dir="ltr"] .dropdown-menu-end,
html[dir="ltr"] .dropdown-menu-end[data-bs-popper],
html[dir="ltr"] .dropdown-menu-sm-end[data-bs-popper],
html[dir="ltr"] .dropdown-menu-md-end[data-bs-popper],
html[dir="ltr"] .dropdown-menu-lg-end[data-bs-popper],
html[dir="ltr"] .dropdown-menu-xl-end[data-bs-popper],
html[dir="ltr"] .dropdown-menu-xxl-end[data-bs-popper] {
    right: 0 !important;
    left: auto !important;
}

html[dir="ltr"] .dropdown-menu-start,
html[dir="ltr"] .dropdown-menu-start[data-bs-popper],
html[dir="ltr"] .dropdown-menu-sm-start[data-bs-popper],
html[dir="ltr"] .dropdown-menu-md-start[data-bs-popper],
html[dir="ltr"] .dropdown-menu-lg-start[data-bs-popper],
html[dir="ltr"] .dropdown-menu-xl-start[data-bs-popper],
html[dir="ltr"] .dropdown-menu-xxl-start[data-bs-popper] {
    left: 0 !important;
    right: auto !important;
}

/* LTR Utility Overrides (Counteracting bootstrap.rtl.min.css) */
html[dir="ltr"] .me-0 { margin-right: 0 !important; margin-left: 0 !important; }
html[dir="ltr"] .me-1 { margin-right: 0.25rem !important; margin-left: 0 !important; }
html[dir="ltr"] .me-2 { margin-right: 0.5rem !important; margin-left: 0 !important; }
html[dir="ltr"] .me-3 { margin-right: 1rem !important; margin-left: 0 !important; }
html[dir="ltr"] .me-4 { margin-right: 1.5rem !important; margin-left: 0 !important; }
html[dir="ltr"] .me-5 { margin-right: 3rem !important; margin-left: 0 !important; }
html[dir="ltr"] .me-auto { margin-right: auto !important; margin-left: 0 !important; }

html[dir="ltr"] .ms-0 { margin-left: 0 !important; margin-right: 0 !important; }
html[dir="ltr"] .ms-1 { margin-left: 0.25rem !important; margin-right: 0 !important; }
html[dir="ltr"] .ms-2 { margin-left: 0.5rem !important; margin-right: 0 !important; }
html[dir="ltr"] .ms-3 { margin-left: 1rem !important; margin-right: 0 !important; }
html[dir="ltr"] .ms-4 { margin-left: 1.5rem !important; margin-right: 0 !important; }
html[dir="ltr"] .ms-5 { margin-left: 3rem !important; margin-right: 0 !important; }
html[dir="ltr"] .ms-auto { margin-left: auto !important; margin-right: 0 !important; }

html[dir="ltr"] .pe-0 { padding-right: 0 !important; padding-left: 0 !important; }
html[dir="ltr"] .pe-1 { padding-right: 0.25rem !important; padding-left: 0 !important; }
html[dir="ltr"] .pe-2 { padding-right: 0.5rem !important; padding-left: 0 !important; }
html[dir="ltr"] .pe-3 { padding-right: 1rem !important; padding-left: 0 !important; }
html[dir="ltr"] .pe-4 { padding-right: 1.5rem !important; padding-left: 0 !important; }
html[dir="ltr"] .pe-5 { padding-right: 3rem !important; padding-left: 0 !important; }

html[dir="ltr"] .ps-0 { padding-left: 0 !important; padding-right: 0 !important; }
html[dir="ltr"] .ps-1 { padding-left: 0.25rem !important; padding-right: 0 !important; }
html[dir="ltr"] .ps-2 { padding-left: 0.5rem !important; padding-right: 0 !important; }
html[dir="ltr"] .ps-3 { padding-left: 1rem !important; padding-right: 0 !important; }
html[dir="ltr"] .ps-4 { padding-left: 1.5rem !important; padding-right: 0 !important; }
html[dir="ltr"] .ps-5 { padding-left: 3rem !important; padding-right: 0 !important; }

html[dir="ltr"] .text-start { text-align: left !important; }
html[dir="ltr"] .text-end { text-align: right !important; }

/* -------------------------------------------------------------
   LTR Input Group & Button Group Overrides (Counteracting bootstrap.rtl.min.css)
------------------------------------------------------------- */
/* Margin direction fix for LTR */
html[dir="ltr"] .input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
    margin-left: calc(var(--bs-border-width) * -1) !important;
    margin-right: 0 !important;
}

/* Base LTR Input Group Radii */
html[dir="ltr"] .input-group > :first-child:not(:last-child) {
    border-top-left-radius: var(--bs-border-radius) !important;
    border-bottom-left-radius: var(--bs-border-radius) !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

html[dir="ltr"] .input-group > :last-child:not(:first-child) {
    border-top-right-radius: var(--bs-border-radius) !important;
    border-bottom-right-radius: var(--bs-border-radius) !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

html[dir="ltr"] .input-group > :not(:first-child):not(:last-child) {
    border-radius: 0 !important;
}

/* Small input-group */
html[dir="ltr"] .input-group-sm > :first-child:not(:last-child) {
    border-top-left-radius: var(--bs-border-radius-sm) !important;
    border-bottom-left-radius: var(--bs-border-radius-sm) !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}
html[dir="ltr"] .input-group-sm > :last-child:not(:first-child) {
    border-top-right-radius: var(--bs-border-radius-sm) !important;
    border-bottom-right-radius: var(--bs-border-radius-sm) !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

/* Large input-group */
html[dir="ltr"] .input-group-lg > :first-child:not(:last-child) {
    border-top-left-radius: var(--bs-border-radius-lg) !important;
    border-bottom-left-radius: var(--bs-border-radius-lg) !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}
html[dir="ltr"] .input-group-lg > :last-child:not(:first-child) {
    border-top-right-radius: var(--bs-border-radius-lg) !important;
    border-bottom-right-radius: var(--bs-border-radius-lg) !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

/* Rounded-3 / Rounded-pill Input Group Utilities for both LTR and RTL */
html[dir="ltr"] .input-group.rounded-3 > :first-child:not(:last-child) {
    border-top-left-radius: var(--bs-border-radius-lg) !important;
    border-bottom-left-radius: var(--bs-border-radius-lg) !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}
html[dir="ltr"] .input-group.rounded-3 > :last-child:not(:first-child) {
    border-top-right-radius: var(--bs-border-radius-lg) !important;
    border-bottom-right-radius: var(--bs-border-radius-lg) !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}
html[dir="ltr"] .input-group.rounded-3 > :not(:first-child):not(:last-child) {
    border-radius: 0 !important;
}

html[dir="rtl"] .input-group.rounded-3 > :first-child:not(:last-child) {
    border-top-right-radius: var(--bs-border-radius-lg) !important;
    border-bottom-right-radius: var(--bs-border-radius-lg) !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}
html[dir="rtl"] .input-group.rounded-3 > :last-child:not(:first-child) {
    border-top-left-radius: var(--bs-border-radius-lg) !important;
    border-bottom-left-radius: var(--bs-border-radius-lg) !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}
html[dir="rtl"] .input-group.rounded-3 > :not(:first-child):not(:last-child) {
    border-radius: 0 !important;
}

/* Button Group LTR Overrides */
html[dir="ltr"] .btn-group > :not(:first-child),
html[dir="ltr"] .btn-group > .btn-group:not(:first-child) {
    margin-left: calc(var(--bs-border-width) * -1) !important;
    margin-right: 0 !important;
}

html[dir="ltr"] .btn-group > :first-child:not(:last-child),
html[dir="ltr"] .btn-group > .btn-group:first-child:not(:last-child) > .btn {
    border-top-left-radius: var(--bs-border-radius) !important;
    border-bottom-left-radius: var(--bs-border-radius) !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

html[dir="ltr"] .btn-group > :last-child:not(:first-child),
html[dir="ltr"] .btn-group > .btn-group:last-child:not(:first-child) > .btn {
    border-top-right-radius: var(--bs-border-radius) !important;
    border-bottom-right-radius: var(--bs-border-radius) !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

html[dir="ltr"] .btn-group > :not(:first-child):not(:last-child) {
    border-radius: 0 !important;
}

/* Rounded start/end LTR Overrides */
html[dir="ltr"] .rounded-start {
    border-bottom-right-radius: 0 !important;
    border-top-right-radius: 0 !important;
    border-top-left-radius: var(--bs-border-radius) !important;
    border-bottom-left-radius: var(--bs-border-radius) !important;
}
html[dir="ltr"] .rounded-end {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-top-right-radius: var(--bs-border-radius) !important;
    border-bottom-right-radius: var(--bs-border-radius) !important;
}
html[dir="ltr"] .rounded-start-circle {
    border-bottom-right-radius: 0 !important;
    border-top-right-radius: 0 !important;
    border-top-left-radius: 50% !important;
    border-bottom-left-radius: 50% !important;
}
html[dir="ltr"] .rounded-end-circle {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-top-right-radius: 50% !important;
    border-bottom-right-radius: 50% !important;
}
html[dir="ltr"] .rounded-start-pill {
    border-bottom-right-radius: 0 !important;
    border-top-right-radius: 0 !important;
    border-top-left-radius: var(--bs-border-radius-pill) !important;
    border-bottom-left-radius: var(--bs-border-radius-pill) !important;
}
html[dir="ltr"] .rounded-end-pill {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-top-right-radius: var(--bs-border-radius-pill) !important;
    border-bottom-right-radius: var(--bs-border-radius-pill) !important;
}
html[dir="ltr"] .rounded-start-0 { border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }
html[dir="ltr"] .rounded-start-1 { border-top-left-radius: var(--bs-border-radius-sm) !important; border-bottom-left-radius: var(--bs-border-radius-sm) !important; border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
html[dir="ltr"] .rounded-start-2 { border-top-left-radius: var(--bs-border-radius) !important; border-bottom-left-radius: var(--bs-border-radius) !important; border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
html[dir="ltr"] .rounded-start-3 { border-top-left-radius: var(--bs-border-radius-lg) !important; border-bottom-left-radius: var(--bs-border-radius-lg) !important; border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
html[dir="ltr"] .rounded-start-4 { border-top-left-radius: var(--bs-border-radius-xl) !important; border-bottom-left-radius: var(--bs-border-radius-xl) !important; border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
html[dir="ltr"] .rounded-start-5 { border-top-left-radius: var(--bs-border-radius-xxl) !important; border-bottom-left-radius: var(--bs-border-radius-xxl) !important; border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }

html[dir="ltr"] .rounded-end-0 { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
html[dir="ltr"] .rounded-end-1 { border-top-right-radius: var(--bs-border-radius-sm) !important; border-bottom-right-radius: var(--bs-border-radius-sm) !important; border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }
html[dir="ltr"] .rounded-end-2 { border-top-right-radius: var(--bs-border-radius) !important; border-bottom-right-radius: var(--bs-border-radius) !important; border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }
html[dir="ltr"] .rounded-end-3 { border-top-right-radius: var(--bs-border-radius-lg) !important; border-bottom-right-radius: var(--bs-border-radius-lg) !important; border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }
html[dir="ltr"] .rounded-end-4 { border-top-right-radius: var(--bs-border-radius-xl) !important; border-bottom-right-radius: var(--bs-border-radius-xl) !important; border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }
html[dir="ltr"] .rounded-end-5 { border-top-right-radius: var(--bs-border-radius-xxl) !important; border-bottom-right-radius: var(--bs-border-radius-xxl) !important; border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }

/* -------------------------------------------------------------
   Notification & General Ostad Pagination
------------------------------------------------------------- */
.ostad-pagination {
    gap: 0.25rem;
}

.ostad-pagination .page-item .page-link {
    border-radius: 999px !important;
    min-width: 32px;
    height: 32px;
    padding: 0 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--bs-secondary-color);
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    transition: all 0.15s ease-in-out;
}

.ostad-pagination .page-item .page-link:hover {
    color: var(--ostad-primary);
    border-color: var(--ostad-primary);
    background-color: var(--bs-tertiary-bg);
}

.ostad-pagination .page-item.active .page-link {
    color: #ffffff !important;
    background-color: var(--ostad-primary) !important;
    border-color: var(--ostad-primary) !important;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.35);
}

.ostad-pagination .page-item.disabled .page-link {
    color: var(--bs-secondary-color);
    opacity: 0.5;
    background-color: transparent;
    border-color: transparent;
    cursor: not-allowed;
}

[data-bs-theme="dark"] .ostad-pagination .page-item .page-link {
    background-color: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

[data-bs-theme="dark"] .ostad-pagination .page-item .page-link:hover {
    background-color: #334155;
    color: #f1f5f9;
    border-color: var(--ostad-primary-light);
}

[data-bs-theme="dark"] .ostad-pagination .page-item.active .page-link {
    background-color: var(--ostad-primary) !important;
    border-color: var(--ostad-primary) !important;
    color: #ffffff !important;
}

/* Dashboard Sidebar Card Sticky Offset */
.dashboard-sidebar-card {
    top: 85px !important;
}

@media (max-width: 991.98px) {
    .dashboard-sidebar-card {
        position: static !important;
        top: auto !important;
    }
}

/* ==========================================================================
   Utility Classes: Dimensions, Icons, Typography, Cursors & Direction
   ========================================================================== */

/*#region width & height*/
.h-auto { height: auto !important; }
.w-auto { width: auto !important; }
.min-w-auto { min-width: auto !important; }
.min-h-auto { min-height: auto !important; }

.w-10px { width: 10px !important; }
.h-10px { height: 10px !important; }
.min-w-10px { min-width: 10px !important; }
.min-h-10px { min-height: 10px !important; }
.max-h-10px { max-height: 10px !important; }
.max-w-10px { max-width: 10px !important; }
.w-15px { width: 15px !important; }
.h-15px { height: 15px !important; }
.min-w-15px { min-width: 15px !important; }
.min-h-15px { min-height: 15px !important; }
.max-h-15px { max-height: 15px !important; }
.max-w-15px { max-width: 15px !important; }
.w-20px { width: 20px !important; }
.h-20px { height: 20px !important; }
.min-w-20px { min-width: 20px !important; }
.min-h-20px { min-height: 20px !important; }
.max-h-20px { max-height: 20px !important; }
.max-w-20px { max-width: 20px !important; }
.w-25px { width: 25px !important; }
.h-25px { height: 25px !important; }
.min-w-25px { min-width: 25px !important; }
.min-h-25px { min-height: 25px !important; }
.max-h-25px { max-height: 25px !important; }
.max-w-25px { max-width: 25px !important; }
.w-30px { width: 30px !important; }
.h-30px { height: 30px !important; }
.min-w-30px { min-width: 30px !important; }
.min-h-30px { min-height: 30px !important; }
.max-h-30px { max-height: 30px !important; }
.max-w-30px { max-width: 30px !important; }
.w-35px { width: 35px !important; }
.h-35px { height: 35px !important; }
.min-w-35px { min-width: 35px !important; }
.min-h-35px { min-height: 35px !important; }
.max-h-35px { max-height: 35px !important; }
.max-w-35px { max-width: 35px !important; }
.w-40px { width: 40px !important; }
.h-40px { height: 40px !important; }
.min-w-40px { min-width: 40px !important; }
.min-h-40px { min-height: 40px !important; }
.max-h-40px { max-height: 40px !important; }
.max-w-40px { max-width: 40px !important; }
.w-45px { width: 45px !important; }
.h-45px { height: 45px !important; }
.min-w-45px { min-width: 45px !important; }
.min-h-45px { min-height: 45px !important; }
.max-h-45px { max-height: 45px !important; }
.max-w-45px { max-width: 45px !important; }
.w-50px { width: 50px !important; }
.h-50px { height: 50px !important; }
.min-w-50px { min-width: 50px !important; }
.min-h-50px { min-height: 50px !important; }
.max-h-50px { max-height: 50px !important; }
.max-w-50px { max-width: 50px !important; }
.w-55px { width: 55px !important; }
.h-55px { height: 55px !important; }
.min-w-55px { min-width: 55px !important; }
.min-h-55px { min-height: 55px !important; }
.max-h-55px { max-height: 55px !important; }
.max-w-55px { max-width: 55px !important; }
.w-60px { width: 60px !important; }
.h-60px { height: 60px !important; }
.min-w-60px { min-width: 60px !important; }
.min-h-60px { min-height: 60px !important; }
.max-h-60px { max-height: 60px !important; }
.max-w-60px { max-width: 60px !important; }
.w-65px { width: 65px !important; }
.h-65px { height: 65px !important; }
.min-w-65px { min-width: 65px !important; }
.min-h-65px { min-height: 65px !important; }
.max-h-65px { max-height: 65px !important; }
.max-w-65px { max-width: 65px !important; }
.w-70px { width: 70px !important; }
.h-70px { height: 70px !important; }
.min-w-70px { min-width: 70px !important; }
.min-h-70px { min-height: 70px !important; }
.max-h-70px { max-height: 70px !important; }
.max-w-70px { max-width: 70px !important; }
.w-75px { width: 75px !important; }
.h-75px { height: 75px !important; }
.min-w-75px { min-width: 75px !important; }
.min-h-75px { min-height: 75px !important; }
.max-h-75px { max-height: 75px !important; }
.max-w-75px { max-width: 75px !important; }
.w-80px { width: 80px !important; }
.h-80px { height: 80px !important; }
.min-w-80px { min-width: 80px !important; }
.min-h-80px { min-height: 80px !important; }
.max-h-80px { max-height: 80px !important; }
.max-w-80px { max-width: 80px !important; }
.w-85px { width: 85px !important; }
.h-85px { height: 85px !important; }
.min-w-85px { min-width: 85px !important; }
.min-h-85px { min-height: 85px !important; }
.max-h-85px { max-height: 85px !important; }
.max-w-85px { max-width: 85px !important; }
.w-90px { width: 90px !important; }
.h-90px { height: 90px !important; }
.min-w-90px { min-width: 90px !important; }
.min-h-90px { min-height: 90px !important; }
.max-h-90px { max-height: 90px !important; }
.max-w-90px { max-width: 90px !important; }
.w-95px { width: 95px !important; }
.h-95px { height: 95px !important; }
.min-w-95px { min-width: 95px !important; }
.min-h-95px { min-height: 95px !important; }
.max-h-95px { max-height: 95px !important; }
.max-w-95px { max-width: 95px !important; }
.w-100px { width: 100px !important; }
.h-100px { height: 100px !important; }
.min-w-100px { min-width: 100px !important; }
.min-h-100px { min-height: 100px !important; }
.max-h-100px { max-height: 100px !important; }
.max-w-100px { max-width: 100px !important; }
.w-105px { width: 105px !important; }
.h-105px { height: 105px !important; }
.min-w-105px { min-width: 105px !important; }
.min-h-105px { min-height: 105px !important; }
.max-h-105px { max-height: 105px !important; }
.max-w-105px { max-width: 105px !important; }
.w-110px { width: 110px !important; }
.h-110px { height: 110px !important; }
.min-w-110px { min-width: 110px !important; }
.min-h-110px { min-height: 110px !important; }
.max-h-110px { max-height: 110px !important; }
.max-w-110px { max-width: 110px !important; }
.w-115px { width: 115px !important; }
.h-115px { height: 115px !important; }
.min-w-115px { min-width: 115px !important; }
.min-h-115px { min-height: 115px !important; }
.max-h-115px { max-height: 115px !important; }
.max-w-115px { max-width: 115px !important; }
.w-120px { width: 120px !important; }
.h-120px { height: 120px !important; }
.min-w-120px { min-width: 120px !important; }
.min-h-120px { min-height: 120px !important; }
.max-h-120px { max-height: 120px !important; }
.max-w-120px { max-width: 120px !important; }
.w-125px { width: 125px !important; }
.h-125px { height: 125px !important; }
.min-w-125px { min-width: 125px !important; }
.min-h-125px { min-height: 125px !important; }
.max-h-125px { max-height: 125px !important; }
.max-w-125px { max-width: 125px !important; }
.w-130px { width: 130px !important; }
.h-130px { height: 130px !important; }
.min-w-130px { min-width: 130px !important; }
.min-h-130px { min-height: 130px !important; }
.max-h-130px { max-height: 130px !important; }
.max-w-130px { max-width: 130px !important; }
.w-135px { width: 135px !important; }
.h-135px { height: 135px !important; }
.min-w-135px { min-width: 135px !important; }
.min-h-135px { min-height: 135px !important; }
.max-h-135px { max-height: 135px !important; }
.max-w-135px { max-width: 135px !important; }
.w-140px { width: 140px !important; }
.h-140px { height: 140px !important; }
.min-w-140px { min-width: 140px !important; }
.min-h-140px { min-height: 140px !important; }
.max-h-140px { max-height: 140px !important; }
.max-w-140px { max-width: 140px !important; }
.w-145px { width: 145px !important; }
.h-145px { height: 145px !important; }
.min-w-145px { min-width: 145px !important; }
.min-h-145px { min-height: 145px !important; }
.max-h-145px { max-height: 145px !important; }
.max-w-145px { max-width: 145px !important; }
.w-150px { width: 150px !important; }
.h-150px { height: 150px !important; }
.min-w-150px { min-width: 150px !important; }
.min-h-150px { min-height: 150px !important; }
.max-h-150px { max-height: 150px !important; }
.max-w-150px { max-width: 150px !important; }
.w-175px { width: 175px !important; }
.h-175px { height: 175px !important; }
.min-w-175px { min-width: 175px !important; }
.min-h-175px { min-height: 175px !important; }
.max-h-175px { max-height: 175px !important; }
.max-w-175px { max-width: 175px !important; }
.w-180px { width: 180px !important; }
.h-180px { height: 180px !important; }
.min-w-180px { min-width: 180px !important; }
.min-h-180px { min-height: 180px !important; }
.max-h-180px { max-height: 180px !important; }
.max-w-180px { max-width: 180px !important; }
.w-200px { width: 200px !important; }
.h-200px { height: 200px !important; }
.min-w-200px { min-width: 200px !important; }
.min-h-200px { min-height: 200px !important; }
.max-h-200px { max-height: 200px !important; }
.max-w-200px { max-width: 200px !important; }
.w-225px { width: 225px !important; }
.h-225px { height: 225px !important; }
.min-w-225px { min-width: 225px !important; }
.min-h-225px { min-height: 225px !important; }
.max-h-225px { max-height: 225px !important; }
.max-w-225px { max-width: 225px !important; }
.w-250px { width: 250px !important; }
.h-250px { height: 250px !important; }
.min-w-250px { min-width: 250px !important; }
.min-h-250px { min-height: 250px !important; }
.max-h-250px { max-height: 250px !important; }
.max-w-250px { max-width: 250px !important; }
.w-255px { width: 255px !important; }
.h-255px { height: 255px !important; }
.min-w-255px { min-width: 255px !important; }
.min-h-255px { min-height: 255px !important; }
.max-h-255px { max-height: 255px !important; }
.max-w-255px { max-width: 255px !important; }
.w-260px { width: 260px !important; }
.h-260px { height: 260px !important; }
.min-w-260px { min-width: 260px !important; }
.min-h-260px { min-height: 260px !important; }
.max-h-260px { max-height: 260px !important; }
.max-w-260px { max-width: 260px !important; }
.w-265px { width: 265px !important; }
.h-265px { height: 265px !important; }
.min-w-265px { min-width: 265px !important; }
.min-h-265px { min-height: 265px !important; }
.max-h-265px { max-height: 265px !important; }
.max-w-265px { max-width: 265px !important; }
.w-275px { width: 275px !important; }
.h-275px { height: 275px !important; }
.min-w-275px { min-width: 275px !important; }
.min-h-275px { min-height: 275px !important; }
.max-h-275px { max-height: 275px !important; }
.max-w-275px { max-width: 275px !important; }
.w-295px { width: 295px !important; }
.h-295px { height: 295px !important; }
.min-w-295px { min-width: 295px !important; }
.min-h-295px { min-height: 295px !important; }
.max-h-295px { max-height: 295px !important; }
.max-w-295px { max-width: 295px !important; }
.w-300px { width: 300px !important; }
.h-300px { height: 300px !important; }
.min-w-300px { min-width: 300px !important; }
.min-h-300px { min-height: 300px !important; }
.max-h-300px { max-height: 300px !important; }
.max-w-300px { max-width: 300px !important; }
.w-325px { width: 325px !important; }
.h-325px { height: 325px !important; }
.min-w-325px { min-width: 325px !important; }
.min-h-325px { min-height: 325px !important; }
.max-h-325px { max-height: 325px !important; }
.max-w-325px { max-width: 325px !important; }
.w-350px { width: 350px !important; }
.h-350px { height: 350px !important; }
.min-w-350px { min-width: 350px !important; }
.min-h-350px { min-height: 350px !important; }
.max-h-350px { max-height: 350px !important; }
.max-w-350px { max-width: 350px !important; }
.w-375px { width: 375px !important; }
.h-375px { height: 375px !important; }
.min-w-375px { min-width: 375px !important; }
.min-h-375px { min-height: 375px !important; }
.max-h-375px { max-height: 375px !important; }
.max-w-375px { max-width: 375px !important; }
.w-400px { width: 400px !important; }
.h-400px { height: 400px !important; }
.min-w-400px { min-width: 400px !important; }
.min-h-400px { min-height: 400px !important; }
.max-h-400px { max-height: 400px !important; }
.max-w-400px { max-width: 400px !important; }
.w-425px { width: 425px !important; }
.h-425px { height: 425px !important; }
.min-w-425px { min-width: 425px !important; }
.min-h-425px { min-height: 425px !important; }
.max-h-425px { max-height: 425px !important; }
.max-w-425px { max-width: 425px !important; }
.w-450px { width: 450px !important; }
.h-450px { height: 450px !important; }
.min-w-450px { min-width: 450px !important; }
.min-h-450px { min-height: 450px !important; }
.max-h-450px { max-height: 450px !important; }
.max-w-450px { max-width: 450px !important; }
.w-475px { width: 475px !important; }
.h-475px { height: 475px !important; }
.min-w-475px { min-width: 475px !important; }
.min-h-475px { min-height: 475px !important; }
.max-h-475px { max-height: 475px !important; }
.max-w-475px { max-width: 475px !important; }
.w-500px { width: 500px !important; }
.h-500px { height: 500px !important; }
.min-w-500px { min-width: 500px !important; }
.min-h-500px { min-height: 500px !important; }
.max-h-500px { max-height: 500px !important; }
.max-w-500px { max-width: 500px !important; }
.w-550px { width: 550px !important; }
.h-550px { height: 550px !important; }
.min-w-550px { min-width: 550px !important; }
.min-h-550px { min-height: 550px !important; }
.max-h-550px { max-height: 550px !important; }
.max-w-550px { max-width: 550px !important; }
.w-600px { width: 600px !important; }
.h-600px { height: 600px !important; }
.min-w-600px { min-width: 600px !important; }
.min-h-600px { min-height: 600px !important; }
.max-h-600px { max-height: 600px !important; }
.max-w-600px { max-width: 600px !important; }
.w-650px { width: 650px !important; }
.h-650px { height: 650px !important; }
.min-w-650px { min-width: 650px !important; }
.min-h-650px { min-height: 650px !important; }
.max-h-650px { max-height: 650px !important; }
.max-w-650px { max-width: 650px !important; }
.w-700px { width: 700px !important; }
.h-700px { height: 700px !important; }
.min-w-700px { min-width: 700px !important; }
.min-h-700px { min-height: 700px !important; }
.max-h-700px { max-height: 700px !important; }
.max-w-700px { max-width: 700px !important; }
.w-750px { width: 750px !important; }
.h-750px { height: 750px !important; }
.min-w-750px { min-width: 750px !important; }
.min-h-750px { min-height: 750px !important; }
.max-h-750px { max-height: 750px !important; }
.max-w-750px { max-width: 750px !important; }
.w-800px { width: 800px !important; }
.h-800px { height: 800px !important; }
.min-w-800px { min-width: 800px !important; }
.min-h-800px { min-height: 800px !important; }
.max-h-800px { max-height: 800px !important; }
.max-w-800px { max-width: 800px !important; }
.w-850px { width: 850px !important; }
.h-850px { height: 850px !important; }
.min-w-850px { min-width: 850px !important; }
.min-h-850px { min-height: 850px !important; }
.max-h-850px { max-height: 850px !important; }
.max-w-850px { max-width: 850px !important; }
.w-900px { width: 900px !important; }
.h-900px { height: 900px !important; }
.min-w-900px { min-width: 900px !important; }
.min-h-900px { min-height: 900px !important; }
.max-h-900px { max-height: 900px !important; }
.max-w-900px { max-width: 900px !important; }
.w-950px { width: 950px !important; }
.h-950px { height: 950px !important; }
.min-w-950px { min-width: 950px !important; }
.min-h-950px { min-height: 950px !important; }
.max-h-950px { max-height: 950px !important; }
.max-w-950px { max-width: 950px !important; }
.w-1000px { width: 1000px !important; }
.h-1000px { height: 1000px !important; }
.min-w-1000px { min-width: 1000px !important; }
.min-h-1000px { min-height: 1000px !important; }
.max-h-1000px { max-height: 1000px !important; }
.max-w-1000px { max-width: 1000px !important; }
.left-0 { right: 0 !important; }
.right-0 { left: 0 !important; }
.top-0 { top: 0 !important; }
.bottom-0 { bottom: 0 !important; }

/* LTR directional overrides for left/right */
html[dir="ltr"] .left-0, html[direction="ltr"] .left-0 { left: 0 !important; right: auto !important; }
html[dir="ltr"] .right-0, html[direction="ltr"] .right-0 { right: 0 !important; left: auto !important; }
/*#endregion width & height*/

/*#region icon size*/
.icon-2x { font-size: 2rem !important; }
.icon-3x { font-size: 3rem !important; }
.icon-4x { font-size: 4rem !important; }
.icon-xs { font-size: 0.65rem !important; }
.icon-sm { font-size: 0.875rem !important; }
.icon-md { font-size: 1.25rem !important; }
.icon-lg { font-size: 1.5rem !important; }
.icon-xl { font-size: 1.75rem !important; }
/*#endregion icon size*/

/*#region FontSize */
.font-10, .font-size-10 { font-size: 10px !important; }
.font-11, .font-size-11 { font-size: 11px !important; }
.font-12, .font-size-12 { font-size: 12px !important; }
.font-13, .font-size-13 { font-size: 13px !important; }
.font-14, .font-size-14 { font-size: 14px !important; }
.font-15, .font-size-15 { font-size: 15px !important; }
.font-16, .font-size-16 { font-size: 16px !important; }
.font-17, .font-size-17 { font-size: 17px !important; }
.font-18, .font-size-18 { font-size: 18px !important; }
.font-19, .font-size-19 { font-size: 19px !important; }
.font-20, .font-size-20 { font-size: 20px !important; }
.font-21, .font-size-21 { font-size: 21px !important; }
.font-22, .font-size-22 { font-size: 22px !important; }
.font-23, .font-size-23 { font-size: 23px !important; }
.font-24, .font-size-24 { font-size: 24px !important; }
.font-25, .font-size-25 { font-size: 25px !important; }
.font-26, .font-size-26 { font-size: 26px !important; }
.font-27, .font-size-27 { font-size: 27px !important; }
.font-28, .font-size-28 { font-size: 28px !important; }
.font-29, .font-size-29 { font-size: 29px !important; }
.font-30, .font-size-30 { font-size: 30px !important; }
.font-31, .font-size-31 { font-size: 31px !important; }
.font-32, .font-size-32 { font-size: 32px !important; }
.font-33, .font-size-33 { font-size: 33px !important; }
.font-34, .font-size-34 { font-size: 34px !important; }
.font-35, .font-size-35 { font-size: 35px !important; }
.font-40, .font-size-40 { font-size: 40px !important; }
.font-45, .font-size-45 { font-size: 45px !important; }

.fa-2x { font-size: 2em !important; }
.fa-3x { font-size: 3em !important; }

.font-weight-bold { font-weight: 500 !important; }
.font-weight-bolder { font-weight: 600 !important; }
.font-weight-boldest { font-weight: 700 !important; }
/*#endregion FontSize */

/*#region Cursor */
.auto, .cursor-auto { cursor: auto !important; }
.default, .cursor-default { cursor: default !important; }
.none, .cursor-none { cursor: none !important; }
.context-menu, .cursor-context-menu, .n.context-menu { cursor: context-menu !important; }
.help, .cursor-help { cursor: help !important; }
.pointer, .cursor-pointer { cursor: pointer !important; }
.progress, .cursor-progress { cursor: progress !important; }
.wait, .cursor-wait { cursor: wait !important; }
.cell, .cursor-cell { cursor: cell !important; }
.crosshair, .cursor-crosshair { cursor: crosshair !important; }
.text, .cursor-text { cursor: text !important; }
.vertical-text, .cursor-vertical-text { cursor: vertical-text !important; }
.alias, .cursor-alias { cursor: alias !important; }
.copy, .cursor-copy { cursor: copy !important; }
.move, .cursor-move { cursor: move !important; }
.no-drop, .cursor-no-drop { cursor: no-drop !important; }
.not-allowed, .cursor-not-allowed { cursor: not-allowed !important; }
.all-scroll, .cursor-all-scroll { cursor: all-scroll !important; }
.col-resize, .cursor-col-resize { cursor: col-resize !important; }
.row-resize, .cursor-row-resize { cursor: row-resize !important; }
.n-resize, .cursor-n-resize { cursor: n-resize !important; }
.e-resize, .cursor-e-resize { cursor: e-resize !important; }
.s-resize, .cursor-s-resize { cursor: s-resize !important; }
.w-resize, .cursor-w-resize { cursor: w-resize !important; }
.ns-resize, .cursor-ns-resize { cursor: ns-resize !important; }
.ew-resize, .cursor-ew-resize { cursor: ew-resize !important; }
.ne-resize, .cursor-ne-resize { cursor: ne-resize !important; }
.nw-resize, .cursor-nw-resize { cursor: nw-resize !important; }
.se-resize, .cursor-se-resize { cursor: se-resize !important; }
.sw-resize, .cursor-sw-resize { cursor: sw-resize !important; }
.nesw-resize, .cursor-nesw-resize { cursor: nesw-resize !important; }
.nwse-resize, .cursor-nwse-resize { cursor: nwse-resize !important; }

/* Pull floats with RTL & LTR support */
.pull-right { float: left !important; }
.pull-left { float: right !important; }
html[dir="ltr"] .pull-right, html[direction="ltr"] .pull-right { float: right !important; }
html[dir="ltr"] .pull-left, html[direction="ltr"] .pull-left { float: left !important; }
/*#endregion Cursor */

/*#region Direction */
.ltr-input, .ltr-dir {
    text-align: left !important;
    direction: ltr !important;
}
.ltr-center {
    text-align: center !important;
    direction: ltr !important;
}
.rtl_center, .rtl-center {
    text-align: center !important;
    direction: rtl !important;
}
.rtl_dir, .rtl-dir {
    text-align: right !important;
    direction: rtl !important;
}
.rtl_justify, .rtl-justify {
    text-align: justify !important;
    direction: rtl !important;
}
.ltr_justify, .ltr-justify {
    text-align: justify !important;
    direction: ltr !important;
}

html[direction="ltr"] .rtl_center, html[dir="ltr"] .rtl_center,
html[direction="ltr"] .rtl-center, html[dir="ltr"] .rtl-center {
    text-align: center !important;
    direction: ltr !important;
}
html[direction="ltr"] .rtl_dir, html[dir="ltr"] .rtl_dir,
html[direction="ltr"] .rtl-dir, html[dir="ltr"] .rtl-dir {
    text-align: right !important;
    direction: ltr !important;
}
html[direction="ltr"] .rtl_justify, html[dir="ltr"] .rtl_justify,
html[direction="ltr"] .rtl-justify, html[dir="ltr"] .rtl-justify {
    text-align: justify !important;
    direction: ltr !important;
}

.rtl-label, .rtl_label { text-align: right !important; unicode-bidi: plaintext; }
.ltr-label, .ltr_label { text-align: left !important; unicode-bidi: plaintext; }
/*#endregion Direction */

/* =============================================================
   UI/UX Pro-Max Compliance Additions
   - WCAG contrast fixes
   - Dark mode table-light override
   - Footer hover state
   - Focus-visible accessibility fix
   - Catalog card hover-elevate
============================================================= */

/* Badge contrast improvements — WCAG 2.1 AA (≥3:1 for UI components) */
.badge.bg-primary-subtle.text-primary {
    color: #3730a3 !important;
}
.badge.bg-success-subtle.text-success {
    color: #065f46 !important;
}
.badge.bg-warning-subtle.text-warning {
    color: #92400e !important;
}
.badge.bg-info-subtle.text-info {
    color: #0e7490 !important;
}

/* Dark mode — fix table-light thead */
[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] thead.table-light > tr > th,
[data-bs-theme="dark"] thead.table-light > tr > td,
[data-bs-theme="dark"] .table-light > * > tr > th,
[data-bs-theme="dark"] .table-light > * > tr > td {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: rgba(51, 65, 85, 0.7) !important;
}

/* Footer link hover state */
.footer-ostad a.text-reset:hover,
.footer-ostad ul a:hover {
    color: var(--ostad-primary) !important;
    text-decoration: none !important;
}

/* Focus-visible accessibility — keyboard navigation indicator */
.nav-action-btn:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--ostad-primary) !important;
    outline-offset: 2px !important;
    box-shadow: none !important;
}

.btn-toggle-password:focus {
    outline: none;
    box-shadow: none;
}

.btn-toggle-password:focus-visible {
    outline: 2px solid var(--ostad-primary);
    outline-offset: 2px;
    box-shadow: none;
}

[data-bs-theme="dark"] .btn-toggle-password:focus-visible {
    outline-color: var(--ostad-primary-light);
}

/*#region Admin Portal Theme & Collapsible Sidebar */
:root {
    --admin-sidebar-width: 270px;
    --admin-sidebar-mini-width: 76px;
    --admin-topbar-height: 68px;
    --admin-transition: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-layout-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bs-body-bg);
    position: relative;
}

/* Fixed Docked Admin Sidebar */
.admin-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    height: 100vh;
    width: var(--admin-sidebar-width);
    z-index: 1050;
    background-color: var(--bs-body-bg);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    transition: width var(--admin-transition), transform var(--admin-transition), box-shadow var(--admin-transition);
    overflow: visible;
    user-select: none;
}

/* RTL / LTR Positioning */
html[dir="rtl"] .admin-sidebar,
html:not([dir="ltr"]) .admin-sidebar {
    right: 0;
    left: auto;
    border-left: 1px solid var(--ostad-border);
}

html[dir="ltr"] .admin-sidebar {
    left: 0;
    right: auto;
    border-right: 1px solid var(--ostad-border);
}

/* Sidebar Header */
.admin-sidebar-header {
    height: var(--admin-topbar-height);
    min-height: var(--admin-topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--ostad-border);
    background-color: inherit;
    position: relative;
    z-index: 2;
    overflow: visible;
}

.admin-sidebar-header .brand-full {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    overflow: hidden;
    transition: opacity var(--admin-transition);
}

.admin-sidebar-header .brand-mini {
    display: none;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    width: 100%;
}

.admin-sidebar-header .brand-logo-img {
    height: 38px;
    width: auto;
    object-fit: contain;
}

.admin-sidebar-header .brand-icon-badge {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--ostad-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

/* Floating Edge Toggle Button (Matches user screenshot) */
.admin-sidebar-edge-toggle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid var(--ostad-border);
    color: #2563eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    z-index: 1060;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html[dir="rtl"] .admin-sidebar-edge-toggle,
html:not([dir="ltr"]) .admin-sidebar-edge-toggle {
    left: -16px;
}

html[dir="ltr"] .admin-sidebar-edge-toggle {
    right: -16px;
}

.admin-sidebar-edge-toggle:hover {
    background: #f8fafc;
    color: #1d4ed8;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.2);
    transform: translateY(-50%) scale(1.08);
}

.admin-sidebar-edge-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

.admin-sidebar-edge-toggle i {
    font-size: 1.15rem;
    line-height: 1;
}

[data-bs-theme="dark"] .admin-sidebar-edge-toggle {
    background: #1e293b;
    border-color: rgba(51, 65, 85, 0.85);
    color: #60a5fa;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

[data-bs-theme="dark"] .admin-sidebar-edge-toggle:hover {
    background: #334155;
    color: #93c5fd;
    box-shadow: 0 4px 14px rgba(96, 165, 250, 0.25);
}

.admin-sidebar-mobile-close {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--ostad-border);
    background: var(--bs-body-bg);
    color: var(--bs-secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
}

/* Sidebar Body & Custom Scrollbar */
.admin-sidebar-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 0.85rem;
    display: flex;
    flex-direction: column;
}

.admin-sidebar-body::-webkit-scrollbar {
    width: 5px;
}

.admin-sidebar-body::-webkit-scrollbar-track {
    background: transparent;
}

.admin-sidebar-body::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 10px;
}

.admin-sidebar-body::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}

/* User Card in Sidebar */
.sidebar-user-card {
    background-color: var(--bs-secondary-bg);
    border: 1px solid var(--ostad-border);
    border-radius: 1.15rem;
    padding: 0.9rem;
    margin-bottom: 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all var(--admin-transition);
}

.sidebar-user-avatar {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 50%;
    background: var(--ostad-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.2);
    overflow: hidden;
}

.sidebar-user-details {
    overflow: hidden;
    flex: 1;
    transition: opacity var(--admin-transition);
}

.sidebar-user-details .user-name {
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-details .user-mobile {
    font-size: 0.78rem;
    color: var(--bs-secondary-color);
    margin-bottom: 0.35rem;
}

/* Navigation List & Links */
.admin-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.admin-nav-item {
    width: 100%;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0.95rem;
    border-radius: 0.85rem;
    color: var(--bs-body-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-nav-link:hover {
    background-color: var(--bs-secondary-bg);
    color: var(--ostad-primary);
}

html[dir="rtl"] .admin-nav-link:hover,
html:not([dir="ltr"]) .admin-nav-link:hover {
    transform: translateX(-3px);
}

html[dir="ltr"] .admin-nav-link:hover {
    transform: translateX(3px);
}

.admin-nav-link.active {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.12) 0%, rgba(124, 58, 237, 0.08) 100%);
    color: var(--ostad-primary);
    font-weight: 700;
}

html[dir="rtl"] .admin-nav-link.active,
html:not([dir="ltr"]) .admin-nav-link.active {
    border-right: 3.5px solid var(--ostad-primary);
}

html[dir="ltr"] .admin-nav-link.active {
    border-left: 3.5px solid var(--ostad-primary);
}

.admin-nav-link .nav-icon {
    font-size: 1.25rem;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.admin-nav-link:hover .nav-icon {
    transform: scale(1.12);
}

.admin-nav-link .nav-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity var(--admin-transition);
}

.admin-nav-link .nav-badge {
    font-size: 0.72rem;
    padding: 0.25em 0.6em;
    border-radius: 20px;
    transition: opacity var(--admin-transition);
}

/* Section Titles & Dividers */
.sidebar-section-title {
    font-size: 0.73rem;
    font-weight: 700;
    color: var(--bs-secondary-color);
    letter-spacing: 0.4px;
    padding: 0.85rem 0.85rem 0.35rem;
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-section-divider {
    display: none;
    border: none;
    border-top: 1px solid var(--ostad-border);
    margin: 0.65rem 0.5rem;
}

/* Sidebar Footer */
.admin-sidebar-footer {
    padding: 0.75rem 0.85rem;
    border-top: 1px solid var(--ostad-border);
    background-color: inherit;
}

/* Main Content Wrapper (Adapts with Sidebar State) */
.admin-main-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-right var(--admin-transition), margin-left var(--admin-transition);
}

html[dir="rtl"] .admin-main-wrapper,
html:not([dir="ltr"]) .admin-main-wrapper {
    margin-right: var(--admin-sidebar-width);
    margin-left: 0;
}

html[dir="ltr"] .admin-main-wrapper {
    margin-left: var(--admin-sidebar-width);
    margin-right: 0;
}

/* Admin Topbar Header */
.admin-topbar {
    height: var(--admin-topbar-height);
    min-height: var(--admin-topbar-height);
    background-color: rgba(var(--bs-body-bg-rgb), 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--ostad-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1040;
    transition: background-color 0.25s ease;
}

.admin-topbar-start {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.admin-topbar-end {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.admin-content-body {
    flex: 1;
    padding: 1.5rem 1.75rem;
}

/* Minimal Admin Footer */
.admin-footer {
    background-color: var(--bs-body-bg);
    border-top: 1px solid var(--ostad-border);
    padding: 1rem 1.75rem;
    font-size: 0.84rem;
    color: var(--bs-secondary-color);
}

/* Mobile Sidebar Backdrop */
.admin-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1045;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

/* ==========================================================================
   Collapsed / Mini Sidebar Mode (Desktop >= 992px)
   ========================================================================== */
@media (min-width: 992px) {
    /* When collapsed via wrapper class or early html class */
    .admin-layout-wrapper.sidebar-collapsed .admin-sidebar,
    html.sidebar-collapsed-pref .admin-layout-wrapper:not(.sidebar-expanded-manual) .admin-sidebar {
        width: var(--admin-sidebar-mini-width);
    }

    html[dir="rtl"] .admin-layout-wrapper.sidebar-collapsed .admin-main-wrapper,
    html:not([dir="ltr"]) .admin-layout-wrapper.sidebar-collapsed .admin-main-wrapper,
    html.sidebar-collapsed-pref[dir="rtl"] .admin-layout-wrapper:not(.sidebar-expanded-manual) .admin-main-wrapper,
    html.sidebar-collapsed-pref:not([dir="ltr"]) .admin-layout-wrapper:not(.sidebar-expanded-manual) .admin-main-wrapper {
        margin-right: var(--admin-sidebar-mini-width);
        margin-left: 0;
    }

    html[dir="ltr"] .admin-layout-wrapper.sidebar-collapsed .admin-main-wrapper,
    html.sidebar-collapsed-pref[dir="ltr"] .admin-layout-wrapper:not(.sidebar-expanded-manual) .admin-main-wrapper {
        margin-left: var(--admin-sidebar-mini-width);
        margin-right: 0;
    }

    /* Header toggle in collapsed */
    .admin-layout-wrapper.sidebar-collapsed .admin-sidebar-header .brand-full,
    html.sidebar-collapsed-pref .admin-layout-wrapper:not(.sidebar-expanded-manual) .admin-sidebar-header .brand-full {
        display: none !important;
    }

    .admin-layout-wrapper.sidebar-collapsed .admin-sidebar-header .brand-mini,
    html.sidebar-collapsed-pref .admin-layout-wrapper:not(.sidebar-expanded-manual) .admin-sidebar-header .brand-mini {
        display: flex !important;
    }

    .admin-layout-wrapper.sidebar-collapsed .admin-sidebar-header,
    html.sidebar-collapsed-pref .admin-layout-wrapper:not(.sidebar-expanded-manual) .admin-sidebar-header {
        padding: 0 0.5rem;
        justify-content: center;
    }

    /* User details in collapsed */
    .admin-layout-wrapper.sidebar-collapsed .sidebar-user-card,
    html.sidebar-collapsed-pref .admin-layout-wrapper:not(.sidebar-expanded-manual) .sidebar-user-card {
        padding: 0.5rem 0.25rem;
        justify-content: center;
        background: transparent;
        border-color: transparent;
        margin-bottom: 0.75rem;
    }

    .admin-layout-wrapper.sidebar-collapsed .sidebar-user-avatar,
    html.sidebar-collapsed-pref .admin-layout-wrapper:not(.sidebar-expanded-manual) .sidebar-user-avatar {
        width: 42px;
        height: 42px;
        min-width: 42px;
        margin: 0 auto;
    }

    .admin-layout-wrapper.sidebar-collapsed .sidebar-user-details,
    html.sidebar-collapsed-pref .admin-layout-wrapper:not(.sidebar-expanded-manual) .sidebar-user-details {
        display: none !important;
    }

    /* Section titles in collapsed */
    .admin-layout-wrapper.sidebar-collapsed .sidebar-section-title,
    html.sidebar-collapsed-pref .admin-layout-wrapper:not(.sidebar-expanded-manual) .sidebar-section-title {
        display: none !important;
    }

    .admin-layout-wrapper.sidebar-collapsed .sidebar-section-divider,
    html.sidebar-collapsed-pref .admin-layout-wrapper:not(.sidebar-expanded-manual) .sidebar-section-divider {
        display: block !important;
    }

    /* Navigation links in collapsed */
    .admin-layout-wrapper.sidebar-collapsed .admin-nav-link,
    html.sidebar-collapsed-pref .admin-layout-wrapper:not(.sidebar-expanded-manual) .admin-nav-link {
        justify-content: center;
        padding: 0.72rem 0;
        gap: 0;
        border-right: none !important;
        border-left: none !important;
        border-radius: 0.75rem;
    }

    .admin-layout-wrapper.sidebar-collapsed .admin-nav-link .nav-icon,
    html.sidebar-collapsed-pref .admin-layout-wrapper:not(.sidebar-expanded-manual) .admin-nav-link .nav-icon {
        margin: 0;
        font-size: 1.35rem;
    }

    .admin-layout-wrapper.sidebar-collapsed .admin-nav-link .nav-text,
    html.sidebar-collapsed-pref .admin-layout-wrapper:not(.sidebar-expanded-manual) .admin-nav-link .nav-text,
    .admin-layout-wrapper.sidebar-collapsed .admin-nav-link .nav-badge,
    html.sidebar-collapsed-pref .admin-layout-wrapper:not(.sidebar-expanded-manual) .admin-nav-link .nav-badge {
        display: none !important;
    }

    .admin-layout-wrapper.sidebar-collapsed .admin-nav-link.active,
    html.sidebar-collapsed-pref .admin-layout-wrapper:not(.sidebar-expanded-manual) .admin-nav-link.active {
        background: var(--bs-primary-bg-subtle);
        color: var(--ostad-primary);
        box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
    }
}

/* ==========================================================================
   Mobile & Tablet Responsive Drawer (< 992px)
   ========================================================================== */
@media (max-width: 991.98px) {
    .admin-sidebar {
        width: 280px !important;
        max-width: 85vw;
    }

    html[dir="rtl"] .admin-sidebar,
    html:not([dir="ltr"]) .admin-sidebar {
        transform: translateX(100%);
    }

    html[dir="ltr"] .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-main-wrapper {
        margin-right: 0 !important;
        margin-left: 0 !important;
        width: 100% !important;
    }

    .admin-content-body {
        padding: 1rem;
    }

    .admin-topbar {
        padding: 0 1rem;
    }

    /* When mobile drawer opened */
    .admin-layout-wrapper.sidebar-mobile-open .admin-sidebar {
        transform: translateX(0) !important;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.35);
    }

    .admin-layout-wrapper.sidebar-mobile-open .admin-sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
}

/* Dark Mode Overrides for Admin Portal */
[data-bs-theme="dark"] .admin-sidebar {
    background-color: #0f172a;
    border-color: rgba(51, 65, 85, 0.6);
}

[data-bs-theme="dark"] .admin-sidebar-header,
[data-bs-theme="dark"] .admin-sidebar-footer,
[data-bs-theme="dark"] .admin-topbar,
[data-bs-theme="dark"] .admin-footer {
    border-color: rgba(51, 65, 85, 0.6);
}

[data-bs-theme="dark"] .admin-topbar {
    background-color: rgba(15, 23, 42, 0.92);
}

[data-bs-theme="dark"] .sidebar-user-card {
    background-color: rgba(30, 41, 59, 0.65);
    border-color: rgba(51, 65, 85, 0.7);
}

[data-bs-theme="dark"] .admin-nav-link:hover {
    background-color: rgba(30, 41, 59, 0.8);
    color: var(--ostad-primary-light);
}

[data-bs-theme="dark"] .admin-nav-link.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.22) 0%, rgba(124, 58, 237, 0.15) 100%);
    color: #818cf8;
}

[data-bs-theme="dark"] .admin-sidebar-toggle-btn {
    background-color: #1e293b;
    border-color: rgba(51, 65, 85, 0.8);
    color: #94a3b8;
}

[data-bs-theme="dark"] .admin-sidebar-toggle-btn:hover {
    background-color: #334155;
    color: #f1f5f9;
}

/* Custom Sidebar Tooltip Styling */
.admin-sidebar-tooltip {
    pointer-events: none;
    z-index: 1070;
}

.admin-sidebar-tooltip .tooltip-arrow {
    display: none !important;
}

.admin-sidebar-tooltip .tooltip-inner {
    font-family: var(--font-family-base);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.45rem 0.85rem;
    border-radius: 0.55rem;
    background-color: #0f172a;
    color: #f8fafc;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    letter-spacing: 0;
    white-space: nowrap;
    max-width: 260px;
}

[data-bs-theme="dark"] .admin-sidebar-tooltip .tooltip-inner {
    background-color: #1e293b;
    color: #f1f5f9;
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
/*#endregion Admin Portal Theme & Collapsible Sidebar */

/*#region Floating Scroll-To-Top Button */
.ostad-scroll-to-top {
    position: fixed;
    bottom: 30px;
    z-index: 1030;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--ostad-primary, #2050ff);
    color: #ffffff;
    border: none;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(32, 80, 255, 0.38);
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.9);
    pointer-events: none;
    transition: opacity 0.25s ease,
                transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.2s ease,
                background-color 0.2s ease,
                color 0.2s ease;
}

html[dir="rtl"] .ostad-scroll-to-top,
html:not([dir="ltr"]) .ostad-scroll-to-top {
    left: 30px;
    right: auto;
}

html[dir="ltr"] .ostad-scroll-to-top {
    right: 30px;
    left: auto;
}

.ostad-scroll-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.ostad-scroll-to-top:hover {
    background: var(--ostad-primary, #2050ff);
    color: #ffffff;
    transform: translateY(-4px) scale(1.06);
    box-shadow: 0 8px 24px rgba(32, 80, 255, 0.5);
}

.ostad-scroll-to-top:active {
    transform: translateY(0) scale(0.95);
    box-shadow: 0 2px 8px rgba(32, 80, 255, 0.35);
}

.ostad-scroll-to-top i {
    line-height: 1;
    transition: transform 0.15s ease;
}

.ostad-scroll-to-top:hover i {
    transform: translateY(-2px);
}

[data-bs-theme="dark"] .ostad-scroll-to-top {
    background: #3b82f6;
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55), 0 0 12px rgba(59, 130, 246, 0.35);
}

[data-bs-theme="dark"] .ostad-scroll-to-top:hover {
    background: #2563eb;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.65), 0 0 16px rgba(59, 130, 246, 0.5);
}

@media (max-width: 576px) {
    .ostad-scroll-to-top {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        bottom: 20px;
    }
    html[dir="rtl"] .ostad-scroll-to-top,
    html:not([dir="ltr"]) .ostad-scroll-to-top {
        left: 20px;
    }
    html[dir="ltr"] .ostad-scroll-to-top {
        right: 20px;
    }
}
/*#endregion Floating Scroll-To-Top Button */

/*#region Print Styles */
@media print {
    header,
    footer,
    nav.navbar,
    .navbar-ostad,
    .footer-ostad,
    .d-print-none,
    #ostadAppLoader {
        display: none !important;
    }

    body {
        background-color: #fff !important;
        color: #000 !important;
    }
}
/*#endregion Print Styles */
.datepicker-persian .table-days tr td:nth-child(7), .datepicker-persian .table-days tr th:nth-child(7) { color: red !important; }
html[lang="fa"] .datepicker-plot-area .table-days tr td:nth-child(7), html[lang="fa"] .datepicker-plot-area .table-days tr th:nth-child(7) { color: red !important; }

/* Collapsible sidebar groups + menu search */
.sidebar-group-toggle {
    width: 100%;
    background: none;
    border: 0;
    text-align: start;
    cursor: pointer;
    color: var(--bs-secondary-color);
}

.sidebar-group-toggle:hover,
.sidebar-group-toggle:focus-visible {
    color: var(--bs-body-color);
}

.sidebar-group-chevron {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.sidebar-group-toggle.collapsed .sidebar-group-chevron {
    transform: rotate(90deg);
}

.sidebar-search {
    padding: 0.6rem 0.85rem 0;
}

.sidebar-no-results {
    padding: 0.75rem 0.85rem;
    font-size: 0.8rem;
    color: var(--bs-secondary-color);
}

@media (min-width: 992px) {
    /* icon-only (collapsed) sidebar: every group must stay visible and the search box is hidden */
    .admin-layout-wrapper.sidebar-collapsed .sidebar-group-body.collapse:not(.show),
    html.sidebar-collapsed-pref .admin-layout-wrapper:not(.sidebar-expanded-manual) .sidebar-group-body.collapse:not(.show) {
        display: block !important;
    }

    .admin-layout-wrapper.sidebar-collapsed .sidebar-search,
    html.sidebar-collapsed-pref .admin-layout-wrapper:not(.sidebar-expanded-manual) .sidebar-search {
        display: none !important;
    }
}

/* Admin-edited page content (page/cms.html.twig) */
.cms-content img { max-width: 100%; height: auto; border-radius: 0.5rem; }
.cms-content table { width: 100%; margin-bottom: 1rem; border-collapse: collapse; }
.cms-content th, .cms-content td { border: 1px solid var(--bs-border-color); padding: 0.5rem 0.75rem; }
.cms-content h2, .cms-content h3, .cms-content h4 { margin-top: 1.5rem; font-weight: 700; }
.cms-content blockquote { border-inline-start: 4px solid var(--bs-primary); padding-inline-start: 1rem; color: var(--bs-secondary-color); }

/* Star ratings: the half star fills from the reading start, so mirror it in RTL pages */
[dir="rtl"] .bi-star-half { display: inline-block; transform: scaleX(-1); }
