/* static/style.css - Reworked Theme v3.3: Added welcome page styles */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700&display=swap');

:root {
    --bs-font-sans-serif: 'Tajawal', sans-serif;
    --bs-primary: #4f46e5;
    /* Indigo 600 */
    --bs-primary-rgb: 79, 70, 229;
    --bs-secondary: #6b7280;
    /* Gray 500 */
    --bs-success: #10b981;
    /* Emerald 500 */
    --bs-info: #06b6d4;
    /* Cyan 500 */
    --bs-warning: #f59e0b;
    /* Amber 500 */
    --bs-danger: #ef4444;
    /* Red 500 */
    --bs-light: #f9fafb;
    /* Gray 50 */
    --bs-dark: #111827;
    /* Gray 900 */
    --sidebar-bg: #1e1b4b;
    /* Indigo 950 */
    --sidebar-width: 280px;
    --header-height: 70px;
    --bs-body-bg: #f3f4f6;
    /* Gray 100 */
    --bs-body-color: #374151;
    /* Gray 700 */
    --bs-card-bg: #ffffff;
    --bs-card-border-color: rgba(0, 0, 0, 0.05);
    --bs-border-color: #e5e7eb;
    --bs-link-color: #4f46e5;
    --bs-link-hover-color: #4338ca;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: var(--bs-font-sans-serif);
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

/* --- Main Layout: Sidebar + Content --- */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: #fff;
    position: fixed;
    top: 0;
    right: 0;
    /* Positioned on the right for RTL */
    bottom: 0;
    z-index: 1030;
    transition: transform 0.3s ease-in-out;
}

.main-content {
    flex-grow: 1;
    padding-right: var(--sidebar-width);
    /* Offset for the sidebar */
    transition: padding-right 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

/* --- Sidebar Styles --- */
.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header .app-logo {
    color: #fff;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-nav {
    padding: 0.5rem 0;
    overflow-y: auto;
    max-height: calc(100vh - 72px - 90px);
    /* header height - footer height */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    color: #9ca3af;
    /* Gray 400 */
    padding: 0.55rem 1.1rem;
    margin: 0.15rem 0.75rem;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.sidebar-nav .nav-link .nav-icon {
    width: 24px;
    margin-left: 0.75rem;
    font-size: 1.1rem;
    opacity: 0.8;
}

.sidebar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
    transform: translateX(-2px);
    /* Slight nudge left for RTL */
}

.sidebar-nav .nav-link.active {
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.2) 0%, rgba(79, 70, 229, 0.1) 100%);
    color: #818cf8;
    /* Indigo 400 */
    font-weight: 600;
    border: 1px solid rgba(79, 70, 229, 0.3);
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.1);
}

.sidebar-nav .nav-link.active .nav-icon {
    opacity: 1;
    color: #818cf8;
}

.sidebar-nav .nav-link .nav-icon {
    width: 24px;
    margin-left: 1rem;
    /* Margin on the left for RTL */
    font-size: 1.1rem;
}

.sidebar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background-color: var(--bs-primary);
    color: #fff;
    font-weight: bold;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: #9ca3af;
    text-align: center;
}

/* --- Header Bar Styles --- */
.header {
    height: var(--header-height);
    background-color: var(--bs-card-bg);
    border-bottom: 1px solid var(--bs-card-border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 1050;
}

.header .user-menu {
    color: var(--bs-body-color);
}

.mobile-toggle {
    display: none;
    /* Hidden on desktop */
    font-size: 1.5rem;
    background: none;
    border: none;
    color: var(--bs-body-color);
}

/* --- Content Area --- */
.content-area {
    padding: 2rem;
    flex-grow: 1;
}

.content-area h1 {
    font-weight: 700;
    color: var(--bs-dark);
    font-size: 1.75rem;
}

/* --- Component Styles --- */
.card {
    border: none;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    background-color: var(--bs-card-bg);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 1.5rem;
    overflow: hidden;
    /* Ensure rounded corners clip content */
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    background-color: transparent;
    /* Cleaner look */
    border-bottom: 1px solid var(--bs-border-color);
    font-weight: 700;
    padding: 1.25rem 1.5rem;
    font-size: 1.1rem;
    color: var(--bs-dark);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none;
}

.table-responsive {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    background-color: var(--bs-card-bg);
}

.table {
    margin-bottom: 0;
}

.table th {
    background-color: var(--bs-light);
    font-weight: 700;
    white-space: nowrap;
}

.table td,
.table th {
    vertical-align: middle;
}

.table-hover>tbody>tr:hover>* {
    background-color: #f0f5ff;
}

/* Custom rule to place check/radio input before the label in RTL */
.form-check {
    padding-left: 0;
    padding-right: 1.5em;
}

.form-check .form-check-input {
    float: right;
    margin-left: 0;
    margin-right: -1.5em;
}

.form-check.form-check-inline {
    margin-right: 0;
    margin-left: 1rem;
}

/* Enhance visibility of checkboxes and radio buttons */
/* Enhance visibility of checkboxes and radio buttons */
.form-check-input {
    border-color: #d1d5db;
    border-width: 1.5px;
    width: 1.1em;
    height: 1.1em;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.form-check-input:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 0.25rem rgba(79, 70, 229, 0.25);
}

.form-control,
.form-select {
    border-color: #d1d5db;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    box-shadow: var(--shadow-sm);
}

/* RTL fix: move the dropdown caret to the left side */
.form-select {
    background-position: left 0.75rem center;
    padding-left: 2.25rem;
    padding-right: 0.75rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 0.25rem rgba(79, 70, 229, 0.25);
}

/* MODIFIED: Position modal close button to the top-left corner in RTL */
.modal-header {
    position: relative;
}

.modal-header .btn-close {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    right: auto;
    margin: 0;
}


/* --- Responsive Design for Sidebar --- */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(100%);
        /* Hides sidebar off-screen to the right for RTL */
        width: 280px;
        /* Slightly wider for easier touch targets */
        z-index: 1040;
        /* Ensure sidebar is above backdrop */
    }

    .sidebar.is-open {
        transform: translateX(0);
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.3);
    }

    .main-content {
        padding-right: 0;
        /* Full width content on mobile */
        width: 100%;
        /* Ensure full width */
    }

    .mobile-toggle {
        display: block;
    }

    .header {
        justify-content: space-between;
        padding: 0 1rem;
        /* Reduce header padding on mobile */
    }

    .backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1025;
        cursor: pointer;
        /* Indicate it's clickable */
    }

    /* MODIFICATION: Make content-area padding smaller on mobile */
    .content-area {
        padding: 1rem;
        overflow-x: hidden;
        /* Prevent horizontal scroll */
    }

    /* Prevent body scroll when sidebar is open */
    body.sidebar-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }

    /* Make tables scroll horizontally on mobile */
    .table-responsive {
        margin: 0 -1rem;
        /* Extend to edges */
        padding: 0 1rem;
    }

    /* Improve form layout on mobile */
    .row>[class*="col-"] {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* --- Welcome Page specific styles (New) --- */
.welcome-page {
    position: relative;
    display: flex;
    min-height: 100vh;
    background-color: #0B0F19;
    color: #F8FAFC;
    direction: rtl;
    overflow: hidden;
}

/* Base image layer with modern blending */
.welcome-bg-pattern {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    background-image: url('images/uni.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    filter: brightness(0.6) saturate(1.2);
    -webkit-mask-image: radial-gradient(circle at center, black 20%, transparent 90%);
    mask-image: radial-gradient(circle at center, black 20%, transparent 90%);
    opacity: 0.7;
    z-index: 0;
    pointer-events: none;
    animation: subtleSlowZoom 25s infinite alternate linear;
}

@keyframes subtleSlowZoom {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.05);
    }
}

/* Floating ambient orbs (glassmorphism lighting) */
.welcome-page::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 60%;
    height: 70%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.4) 0%, rgba(99, 102, 241, 0.1) 40%, transparent 70%);
    filter: blur(80px);
    z-index: 0;
    animation: floatGlow1 15s infinite alternate ease-in-out;
}

.welcome-page::after {
    content: '';
    position: absolute;
    bottom: -10%;
    left: -10%;
    width: 50%;
    height: 60%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.3) 0%, rgba(5, 150, 105, 0.1) 40%, transparent 70%);
    filter: blur(80px);
    z-index: 0;
    animation: floatGlow2 12s infinite alternate ease-in-out;
}

@keyframes floatGlow1 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(-50px, 30px) scale(1.1);
    }
}

@keyframes floatGlow2 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(40px, -40px) scale(1.15);
    }
}

.welcome-main::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(179, 154, 106, 0.15) 0%, transparent 60%);
    filter: blur(60px);
    z-index: -1;
    pointer-events: none;
}

.welcome-header {
    position: absolute;
    top: 2.5rem;
    left: 2.5rem;
    z-index: 10;
}

.btn-login-top {
    display: inline-flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.05);
    color: #F8FAFC;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.75rem;
    padding: 0.7rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-login-top:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2), 0 0 15px rgba(255, 255, 255, 0.1);
}

.welcome-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2rem;
    z-index: 1;
    position: relative;
}

.welcome-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 700px;
    padding: 3rem;
    animation: fadeInSlideUp 0.8s ease-out forwards;
}

@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-logo {
    color: #FBBF24;
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.4));
    animation: floatIcon 4s ease-in-out infinite;
}

@keyframes floatIcon {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.welcome-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: #FFFFFF;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    background: linear-gradient(to right, #FFFFFF, #E2E8F0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-university {
    font-size: 1.8rem;
    font-weight: 700;
    color: #FBBF24;
    margin-bottom: 1.5rem;
    letter-spacing: 0.02em;
    text-shadow: 0 2px 10px rgba(251, 191, 36, 0.3);
}

.welcome-subtitle {
    font-size: 1.3rem;
    color: #94A3B8;
    line-height: 1.6;
    margin-bottom: 2.5rem;
    font-weight: 500;
}

.welcome-divider {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, transparent, #FBBF24, transparent);
    margin-bottom: 3rem;
    border-radius: 2px;
}

.welcome-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    width: 100%;
}

.request-card {
    display: flex;
    align-items: center;
    text-decoration: none;
    padding: 1.5rem;
    border-radius: 1.25rem;
    color: #fff;
    width: auto;
    min-width: 250px;
    max-width: 320px;
    flex: 1;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

.request-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, transparent 100%);
    z-index: 1;
}

.request-card:hover {
    transform: translateY(-8px) scale(1.02);
    color: #fff;
}

.faculty-card {
    background: linear-gradient(135deg, #186A5E 0%, #0F4941 100%);
}

.faculty-card:hover {
    box-shadow: 0 15px 35px -5px rgba(24, 106, 94, 0.5);
}

.student-card {
    background: linear-gradient(135deg, #20315C 0%, #152243 100%);
}

.student-card:hover {
    box-shadow: 0 15px 35px -5px rgba(32, 49, 92, 0.5);
}

.card-icon {
    font-size: 2.2rem;
    margin-left: 1.25rem;
    z-index: 2;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 1rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.request-card .card-text {
    flex: 1;
    text-align: right;
    z-index: 2;
}

.card-text h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 0.4rem 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.card-text p {
    font-size: 0.95rem;
    margin: 0;
    opacity: 0.8;
}

.card-arrow {
    margin-right: 1rem;
    font-size: 1.2rem;
    opacity: 0.8;
    z-index: 2;
    transition: transform 0.3s ease;
}

.request-card:hover .card-arrow {
    transform: translateX(-5px);
    opacity: 1;
}

@media (max-width: 991.98px) {
    .welcome-main {
        padding: 2rem 1rem;
    }

    .welcome-content-wrapper {
        padding: 2rem 1.5rem;
    }

    .welcome-actions {
        flex-direction: column;
        align-items: center;
    }

    .request-card {
        width: 100%;
        max-width: 100%;
    }

    .welcome-title {
        font-size: 2.5rem;
    }

    .welcome-university {
        font-size: 1.4rem;
    }

    .welcome-subtitle {
        font-size: 1.1rem;
    }
}

/* --- Login Page specific styles --- */
.login-page {
    background-color: var(--bs-light);
    /* Lighter bg for login page */
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-page .card {
    width: 100%;
    max-width: 450px;
    border: none;
}

/* --- Print Styles (Base) --- */
/* MODIFICATION: Reduced all font sizes by 1pt for the faculty/teacher form */
/* MODIFICATION: These .print-page styles are for SCREEN PREVIEW */
.print-page {
    background: white;
    font-size: 9.5pt;
    line-height: 1.35;
    color: black;

    /* MODIFICATION: Responsive print preview for screens */
    width: 100%;
    /* Use 100% width */
    max-width: 210mm;
    /* Max-width is the A4 size */
    min-height: auto;
    /* Remove fixed min-height for screen */
    padding: 1rem;
    /* Use rem for screen padding */

    margin: 1rem auto;
    box-shadow: 0 0 0.5cm rgba(0, 0, 0, 0.3);
    position: relative;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    /* MODIFICATION: Add box-sizing */
}

/* Ensure standard print output ignores screen styles */
@media print {
    body {
        background: white;
    }

    .btn,
    .sidebar,
    .header,
    .filter-form-card,
    .sortable-header {
        display: none !important;
    }

    .print-page {
        box-shadow: none !important;
        margin: 0;
        width: 100%;
        max-width: none;
        border: none;
    }
}

.print-page .header-text {
    text-align: center;
    margin-bottom: 0.5em;
}

.print-page h4,
.print-page h5,
.print-page h6 {
    font-family: 'Arial', 'Tahoma', sans-serif;
    font-weight: bold;
    margin-bottom: 0.2em;
}

.print-page h4 {
    font-size: 13pt;
}

.print-page h5 {
    font-size: 12pt;
}

.print-page h6 {
    font-size: 11pt;
}

.print-page .main-form-title {
    margin-top: 0.4em;
    border-top: 1.5px solid black;
    border-bottom: 1.5px solid black;
    padding: 0.2em 0;
    display: block;
    width: 95%;
    margin-left: auto;
    margin-right: auto;
    font-size: 12pt;
    margin-bottom: 0.6em;
    text-align: center;
}

.print-page .header-logos {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4em;
    height: 55px;
}

.print-page .header-logos img {
    max-height: 100%;
    max-width: 120px;
    object-fit: contain;
}

.print-page .section {
    margin-bottom: 0.5em;
    border: 1px solid #a0a0a0;
    padding: 0.3em;
}

.print-page .section.compact-section {
    margin-bottom: 0.4em;
    padding: 0.2em;
}

.print-page .section-title {
    font-weight: bold;
    margin-bottom: 0.3em;
    background-color: #eaeaea;
    padding: 0.2em;
    text-align: center;
    font-size: 10pt;
}

.print-page .info-table {
    width: 100%;
    border-collapse: collapse;
}

.print-page .info-table td {
    padding: 0.2em 0.35em;
    vertical-align: top;
    border: 1px solid #c0c0c0;
    font-size: 8.5pt;
    word-break: break-word;
}

.print-page .info-table td:first-child {
    font-weight: bold;
    width: 38%;
}

.print-page .info-table td:last-child {
    width: 62%;
}

.print-page .signatures-section {
    display: flex;
    justify-content: space-around;
    text-align: center;
    margin-top: 0.8em;
    padding-top: 0.4em;
    border-top: 1px solid #a0a0a0;
    min-height: 70px;
}

.print-page .signatures-section .sig-block {
    width: 30%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}

.print-page .signatures-section img {
    max-height: 35px;
    max-width: 90px;
    object-fit: contain;
    display: block;
    margin: 0 auto 0.2em auto;
}

.print-page .signatures-section span {
    font-size: 7.5pt;
}

.print-page .signatures-section small {
    font-size: 6.5pt;
    color: #333;
}

.print-page .head-signature-block {
    text-align: center;
    margin-top: 0.8em;
    padding-top: 0.4em;
    border-top: 1px solid #a0a0a0;
    min-height: 75px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}

.print-page .head-signature-block img {
    max-height: 45px;
    max-width: 120px;
    object-fit: contain;
    display: block;
    margin: 0 auto 0.2em auto;
}

.print-page .head-signature-block span {
    font-size: 8.5pt;
}

.print-page .head-signature-block small {
    font-size: 7.5pt;
    color: #333;
}

.print-page .footer-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    font-size: 7pt;
    border-top: 1px solid black;
    padding-top: 0.4em;
    margin-top: auto;
    width: 100%;
}

.print-page .qr-code img {
    max-height: 50px;
    max-width: 50px;
}

.print-page .form-id-date {
    text-align: right;
}

.print-page .arabic-text {
    font-family: 'Arial', 'Tahoma', sans-serif;
}

.print-page .english-text {
    font-family: 'Times New Roman', serif;
}

/* MODIFIED/NEW: Styles for faculty review and print forms */
.review-faculty-table .form-check-label i {
    font-size: 1.2rem;
}

.print-page .conditions-table td.condition-check {
    width: 10%;
    text-align: center;
    font-size: 0.9rem;
    /* Reduced icon size */
    vertical-align: middle;
}

/* Styles for the redesigned faculty info table */
.print-page .info-table.faculty-info-layout {
    table-layout: fixed;
}

.print-page .info-table.faculty-info-layout td {
    vertical-align: middle;
    font-weight: normal !important;
}

.print-page .info-table.faculty-info-layout .label {
    font-weight: bold !important;
}

/* Styles for the redesigned opinion table in faculty print form */
.print-page .opinion-table td.answer {
    text-align: center;
    vertical-align: middle;
    font-size: 9pt;
}

.print-page .opinion-table td:nth-child(1),
.print-page .opinion-table td:nth-child(3) {
    font-weight: bold !important;
}


/* NEW: Enhanced Maintenance Mode Switch */
.maintenance-switch .form-check-input {
    width: 5em;
    height: 2.5em;
    cursor: pointer;
    background-color: #dc3545;
    /* Red when off (Maintenance is ON) */
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba(255,255,255,1.0)'/%3e%3c/svg%3e");
}

.maintenance-switch .form-check-input:checked {
    background-color: #198754;
    /* Green when on (Maintenance is OFF) */
    border-color: #198754;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba(255,255,255,1.0)'/%3e%3c/svg%3e");
}

.maintenance-switch .form-check-label {
    padding-right: 1.5em;
    font-size: 1.1rem;
    font-weight: 500;
}


@media print {

    body,
    html {
        margin: 0 !important;
        padding: 0 !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    /* 1. Hide Navigation, Buttons, and Forms */
    .sidebar,
    .header,
    .alert,
    .btn,
    .page-header,
    .modal,
    .pagination,
    script,
    form,
    .mobile-toggle {
        display: none !important;
        visibility: hidden !important;
    }

    /* 2. Show Main Content Wrapper */
    .dashboard-wrapper,
    .main-content,
    .content-area,
    .container {
        display: block !important;
        visibility: visible !important;
        position: static !important;
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        background-color: white !important;
    }

    /* 3. Show Cards, Titles, and Tables */
    .card,
    h1,
    h2,
    h3,
    h4,
    h5 {
        display: block !important;
        visibility: visible !important;
        color: black !important;
    }

    /* 4. Optimize Cards for Print */
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        margin-bottom: 15px !important;
        break-inside: avoid;
        /* Prevents a card from being cut in half by a page break */
    }

    /* 5. Optimize Tables */
    .table-responsive {
        overflow: visible !important;
        display: block !important;
    }

    /* 6. Layout Fix for Statistics Grid */
    .row {
        display: flex !important;
        flex-wrap: wrap !important;
    }

    /* Force 3 columns on print for the top stats cards */
    .col-md-4 {
        width: 33% !important;
        flex: 0 0 33% !important;
    }

    /* Force 2 columns on print for the charts/tables below */
    .col-lg-6 {
        width: 50% !important;
        flex: 0 0 50% !important;
    }


    /* MODIFICATION: Reset .print-page styles for actual printing */
    .print-page {
        width: 100%;
        /* Use 100% of the A4 page */
        height: 100%;
        position: relative;
        margin: 0 !important;
        padding: 1cm !important;
        /* Use cm for printing */
        border: none !important;
        box-shadow: none !important;
        page-break-after: always;
        box-sizing: border-box;
        min-height: 297mm;
        /* Set A4 min-height for printing only */
    }

    .print-page .section,
    .print-page .signatures-section,
    .print-page .head-signature-block {
        page-break-inside: avoid;
    }

    .print-page .footer-info {
        position: absolute;
        bottom: 1cm;
        left: 1cm;
        right: 1cm;
        width: calc(100% - 2cm);
        margin-top: 0;
    }

    @page {
        size: A4 portrait;
        margin: 0;
    }
}

/* ---
--- NEW STYLES FOR CITATION TABLES (v7.0)
--- */

/*
  MODIFICATION (Request 2) & FIX (v7.2):
  Add styles for .is-invalid on file/select inputs.
  Bootstrap (in RTL) adds padding-left and a background-image (error icon).
  We remove the icon but must also reset the padding-left to its default value
  to prevent a large empty white space.
*/
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--bs-danger);
    background-image: none;
    /* Remove Bootstrap's default error icon */
    /* FIX: Reset padding-left (for RTL) to default. Bootstrap adds this for the icon. */
    padding-right: var(--bs-form-control-padding-x, 0.75rem);
}


/* Style for the file validation error message */
.file-error-message {
    color: var(--bs-danger);
    font-size: 0.875em;
    margin-top: 0.25rem;
}

/* Fieldset for grouping citation tables */
.citation-fieldset {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    padding: 1rem 1.5rem;
    margin-top: 1rem;
    /* MODIFICATION (Request 3): Add margin-top for spacing */
}

.citation-fieldset .fieldset-legend {
    /* MODIFICATION (Request 3): Ensure legend is styled like a label */
    font-size: 1rem;
    /* Match form-label font size */
    font-weight: 500;
    /* Match form-label font weight */
    padding: 0 0.5rem;
    width: auto;
    margin-bottom: 0.5rem;
    /* Match form-label margin */
    font-family: var(--bs-font-sans-serif);
    /* Ensure consistent font */
    float: none;
    /* MODIFICATION (Request 3): Disable floating */
}

/* Container for the dynamic rows */
.citation-table-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Styling for each data row */
.citation-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.citation-row .form-control {
    flex: 1 1 50%;
    /* Each input takes up 50% */
}

.citation-row .remove-row-btn {
    /* MODIFICATION (Request 4): Fix button click area */
    flex: 0 0 auto;
    /* Button doesn't grow or shrink */
    width: 38px;
    /* Set explicit width */
    height: 38px;
    /* Set explicit height to match input */
    padding: 0;
    /* Remove padding */
    line-height: 1;
    /* Ensure icon centers vertically */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Ensure icon inside is centered */
.citation-row .remove-row-btn .fas {
    margin: 0;
    /* Remove any default margins */
}


/* Styling for the header row */
.citation-row.citation-header {
    font-weight: 500;
    color: var(--bs-dark);
    margin-bottom: 0.25rem;
    padding: 0 0.5rem;
    /* Align with inputs */
    /* MODIFICATION (Request 4): Adjust padding to align with new button size */
    padding-left: 46px;
    /* Align with remove button (38px + 8px gap) */
}

/* ---
--- NEW STYLES FOR PRINTING CITATION TABLES (v7.0)
--- */
.print-page .citation-print-table {
    font-size: 8pt;
    /* Slightly smaller font for table data */
}

.print-page .citation-print-table th {
    background-color: #f0f0f0;
    text-align: center;
    font-size: 8.5pt;
    padding: 0.2em;
    border: 1px solid #a0a0a0;
}

.print-page .citation-print-table td {
    font-size: 8pt;
    padding: 0.2em 0.35em;
    border: 1px solid #c0c0c0;
    vertical-align: middle;
}

.print-page .citation-print-table td:last-child {
    /* For DOI link */
    width: 35%;
    text-align: left;
    direction: ltr;
}

/* ---
--- NEW STYLES FOR CITATION ROW INDEX (v8.1)
--- */
.citation-index {
    flex: 0 0 25px;
    /* Don't grow, don't shrink, base width 25px */
    font-weight: bold;
    color: var(--bs-secondary);
    text-align: center;
}

.citation-row.citation-header .citation-index {
    padding-right: 0.5rem;
    /* Align header # with row numbers */
}

/* ---
--- MODIFICATION (v9.0): Styles for new citation table in modal
--- */
.list-group-item .citation-index {
    flex: 0 0 30px;
    font-weight: bold;
    color: var(--bs-secondary);
    text-align: right;
    padding-left: 0.5rem;
}

/* Style for the new table-based modal */
.modal-body .table th {
    background-color: var(--bs-light);
}

.modal-body .table td {
    word-break: break-word;
    /* allow long links/titles to wrap */
}


/* ---
--- MODIFICATION: Mobile Responsive Fixes
--- */
@media (max-width: 767.98px) {

    /* 1. Stack citation form rows on mobile */
    .citation-row {
        flex-direction: column;
        align-items: stretch;
        /* Make inputs full width */
        gap: 0.5rem;
    }

    .citation-row .form-control {
        flex-basis: auto;
        /* Reset flex-basis */
        width: 100%;
    }

    .citation-row .remove-row-btn {
        width: 100%;
        /* Make remove button full width */
    }

    .citation-index {
        display: none;
        /* Hide the '#' number on mobile */
    }

    .citation-row.citation-header {
        display: none;
        /* Hide the header row on mobile */
    }

    /* 2. Make welcome buttons full width on small screens */
    .welcome-btn {
        width: 100%;
        max-width: 250px;
        /* Keep max-width */
        height: auto;
        /* Allow height to adjust */
        padding: 1.5rem;
        /* Add some padding */
    }

    .welcome-actions {
        gap: 1rem;
    }
}

/* ---
--- Dashboard Home Page Cards
--- */
.dashboard-home-header h1 {
    font-weight: 700;
    color: var(--bs-dark);
}

.dashboard-home-header p {
    margin-bottom: 0;
}

.dashboard-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.dashboard-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background-color: var(--bs-card-bg);
    border: 1px solid var(--bs-card-border-color);
    border-radius: 0.75rem;
    text-decoration: none;
    color: var(--bs-body-color);
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--bs-primary);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: rgba(var(--bs-primary-rgb), 0.3);
    color: var(--bs-body-color);
    text-decoration: none;
}

.dashboard-card:hover::before {
    opacity: 1;
}

.dashboard-card-icon {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background-color: rgba(var(--bs-primary-rgb), 0.08);
    border-radius: 0.75rem;
}

.dashboard-card-body {
    flex: 1 1 auto;
    min-width: 0;
}

.dashboard-card-body h5 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--bs-dark);
}

.dashboard-card-body p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--bs-secondary);
    line-height: 1.3;
}

.dashboard-card-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.3em 0.65em;
    border-radius: 50rem;
    color: #fff;
    min-width: 24px;
    text-align: center;
    animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

@media (max-width: 575.98px) {
    .dashboard-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* ---
--- Sortable Table Headers
--- */
.sortable-header {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: background-color 0.15s ease;
}

.sortable-header:hover {
    background-color: #e9ecef;
}

.sortable-header .sort-icon {
    display: inline-block;
    margin-right: 0.25rem;
    font-size: 0.75rem;
    opacity: 0.4;
    transition: opacity 0.15s ease;
}

.sortable-header:hover .sort-icon {
    opacity: 0.7;
}

.sortable-header.sort-asc .sort-icon,
.sortable-header.sort-desc .sort-icon {
    opacity: 1;
    color: var(--bs-primary);
}

/* ---
--- Filter Form Styles
--- */
.filter-form-card {
    border: 1px solid var(--bs-card-border-color);
    border-radius: 0.5rem;
    background-color: #f9fafb;
}

.filter-form-card .card-body {
    padding: 1rem;
}

/* ---
--- Notification Bell Styles
--- */
.notif-wrapper {
    position: relative;
}

.notif-bell-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--bs-body-color);
    cursor: pointer;
    position: relative;
    padding: 6px 10px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.notif-bell-btn:hover {
    background-color: rgba(79, 70, 229, 0.1);
    color: #818cf8;
}

.notif-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 50%;
    animation: notif-pulse 2s infinite;
}

@keyframes notif-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

.notif-dropdown {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 8px;
    width: 340px;
    max-height: 420px;
    background: var(--bs-card-bg, #fff);
    border: 1px solid var(--bs-card-border-color, #dee2e6);
    border-radius: 0.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    overflow: hidden;
}

.notif-dropdown.show {
    display: block;
}

.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--bs-card-border-color, #dee2e6);
    font-size: 0.9rem;
}

.notif-header .btn-link {
    font-size: 0.78rem;
    padding: 0;
    color: #6366f1;
}

.notif-list {
    max-height: 340px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s;
}

.notif-item:hover {
    background-color: rgba(79, 70, 229, 0.05);
}

.notif-item.unread {
    background-color: rgba(99, 102, 241, 0.08);
}

.notif-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.notif-item-body {
    flex: 1;
    min-width: 0;
}

.notif-item-msg {
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 2px;
}

.notif-item-time {
    font-size: 0.72rem;
    color: #9ca3af;
}

.notif-empty {
    padding: 2rem;
    text-align: center;
    color: #9ca3af;
    font-size: 0.9rem;
}

/* ---
--- Request Timeline Styles
--- */
.timeline {
    position: relative;
    padding: 0;
}

.timeline::before {
    content: '';
    position: absolute;
    right: 10px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #e5e7eb, #d1d5db);
    border-radius: 3px;
}

.timeline-item {
    position: relative;
    padding: 0 35px 1.5rem 0;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    right: 4px;
    top: 4px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.timeline-content {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    transition: box-shadow 0.2s;
}

.timeline-item:hover .timeline-content {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.timeline-text {
    font-size: 0.88rem;
    line-height: 1.5;
    margin-bottom: 0.35rem;
    color: var(--bs-body-color);
}

.timeline-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: #9ca3af;
    flex-wrap: wrap;
}

.timeline-meta span {
    white-space: nowrap;
}

/* ============ TOAST NOTIFICATIONS ============ */
.toast-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
    max-width: 500px;
    width: 90%;
}

.toast-item {
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    color: #fff;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    animation: toastSlideIn 0.4s ease-out;
    pointer-events: auto;
    cursor: pointer;
}

.toast-item.toast-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.toast-item.toast-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.toast-item.toast-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #1f2937;
}

.toast-item.toast-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.toast-item.toast-hide {
    animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* ============ REQUEST PROGRESS BAR ============ */
.request-progress {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0.5rem 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
}

.progress-step .step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: #9ca3af;
    z-index: 1;
    transition: all 0.3s;
    border: 2px solid #e5e7eb;
}

.progress-step.completed .step-dot {
    background: #22c55e;
    border-color: #22c55e;
    color: #fff;
}

.progress-step.active .step-dot {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
    animation: stepPulse 2s ease-in-out infinite;
}

.progress-step.rejected .step-dot {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

@keyframes stepPulse {

    0%,
    100% {
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.1);
    }
}

.progress-step .step-label {
    font-size: 0.6rem;
    margin-top: 4px;
    color: #9ca3af;
    text-align: center;
    white-space: nowrap;
}

.progress-step.completed .step-label,
.progress-step.active .step-label {
    color: var(--bs-body-color);
    font-weight: 600;
}

.progress-step::after {
    content: '';
    position: absolute;
    top: 14px;
    right: -50%;
    width: 100%;
    height: 3px;
    background: #e5e7eb;
    z-index: 0;
}

.progress-step:last-child::after {
    display: none;
}

.progress-step.completed::after {
    background: #22c55e;
}

/* ============ DARK MODE ============ */
.dark-mode-toggle {
    background: none;
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    padding: 0.35rem 0.6rem;
    cursor: pointer;
    color: var(--bs-body-color);
    font-size: 1.1rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.dark-mode-toggle:hover {
    background: var(--bs-tertiary-bg);
}

[data-bs-theme="dark"] {
    --bs-body-bg: #0f172a;
    --bs-body-color: #e2e8f0;
    --bs-card-bg: #1e293b;
    --bs-card-border-color: #334155;
    --bs-tertiary-bg: #1e293b;
    --bs-border-color: #334155;
}

[data-bs-theme="dark"] .sidebar {
    background: #0c1425 !important;
    border-color: #1e293b !important;
}

[data-bs-theme="dark"] .header {
    background: #1e293b !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .table {
    color: #e2e8f0;
}

[data-bs-theme="dark"] .table-hover tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .card {
    background: #1e293b;
    border-color: #334155;
}

[data-bs-theme="dark"] .card-header {
    background: #162032;
    border-color: #334155;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

[data-bs-theme="dark"] .modal-content {
    background: #1e293b;
    border-color: #334155;
}

[data-bs-theme="dark"] .btn-outline-secondary {
    color: #94a3b8;
    border-color: #475569;
}

[data-bs-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .bg-white {
    background: #1e293b !important;
}

[data-bs-theme="dark"] .dashboard-card {
    background: #1e293b;
    border-color: #334155;
}

[data-bs-theme="dark"] .dashboard-card:hover {
    background: #253347;
    border-color: #4F46E5;
}

[data-bs-theme="dark"] .nav-link {
    color: #94a3b8;
}

[data-bs-theme="dark"] .nav-link:hover,
[data-bs-theme="dark"] .nav-link.active {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .alert {
    border-color: #334155;
}

/* ============ MOBILE RESPONSIVE ============ */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--bs-body-color);
    padding: 0.25rem;
}

@media (max-width: 768px) {
    .sidebar-toggle {
        display: block;
    }

    .sidebar {
        position: fixed !important;
        left: -280px;
        top: 0;
        height: 100vh;
        transition: left 0.3s ease;
        z-index: 2000;
        box-shadow: none;
    }

    .sidebar.sidebar-open {
        left: 0;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1999;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .content-area {
        margin-right: 0 !important;
        padding: 1rem !important;
    }

    .header {
        padding: 0 1rem !important;
    }

    /* Card-based table on mobile */
    .table-responsive table thead {
        display: none;
    }

    .table-responsive table tbody tr {
        display: block;
        margin-bottom: 0.75rem;
        border: 1px solid var(--bs-border-color);
        border-radius: 8px;
        padding: 0.75rem;
    }

    .table-responsive table tbody td {
        display: flex;
        justify-content: space-between;
        padding: 0.35rem 0;
        border: none;
    }

    .table-responsive table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--bs-body-color);
    }
}

/* ============ SESSION TIMEOUT MODAL ============ */
.session-timeout-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.session-timeout-overlay.active {
    display: flex;
}

.session-timeout-box {
    background: var(--bs-card-bg, #fff);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.session-timeout-box .timer {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ef4444;
    margin: 1rem 0;
}

/* =========================================================
   TIMELINE — Audit Trail (Item 15)
   ========================================================= */
.timeline {
    position: relative;
    padding-right: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    right: 10px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--bs-primary) 0%, var(--bs-secondary) 100%);
    border-radius: 3px;
}

.timeline-item {
    position: relative;
    display: flex;
    gap: 1rem;
    padding-bottom: 1.5rem;
}

.timeline-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bs-body-bg, #fff);
    border: 2px solid var(--bs-border-color, #dee2e6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    z-index: 1;
    position: relative;
    right: -20px;
}

.timeline-content {
    flex: 1;
    background: var(--bs-tertiary-bg, #f8f9fa);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--bs-border-color, #dee2e6);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* =========================================================
   KEYBOARD SHORTCUTS MODAL (Item 14)
   ========================================================= */
.shortcuts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.shortcuts-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
}

.shortcuts-list li:last-child {
    border-bottom: none;
}

.shortcuts-list kbd {
    background: var(--bs-tertiary-bg, #e9ecef);
    border: 1px solid var(--bs-border-color, #ced4da);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.85rem;
    font-family: monospace;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* =========================================================
   DARK MODE TOGGLE BUTTON
   ========================================================= */
.dark-mode-toggle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--bs-border-color, #dee2e6);
    background: var(--bs-body-bg, #fff);
    color: var(--bs-body-color, #212529);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.dark-mode-toggle:hover {
    background: var(--bs-primary);
    color: #fff;
    border-color: var(--bs-primary);
    transform: rotate(20deg);
}

/* =========================================================
   TOAST NOTIFICATIONS
   ========================================================= */
.toast-container {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
}

.toast-item {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
    text-align: center;
    min-width: 280px;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: toastSlideIn 0.4s ease;
    cursor: pointer;
    transition: opacity 0.3s, transform 0.3s;
}

.toast-item.toast-hide {
    opacity: 0;
    transform: translateY(-20px);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toast-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.toast-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.toast-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.toast-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* ================================================================
   DARK MODE — Comprehensive Overrides
   Activated by: data-bs-theme="dark" on <html>
   ================================================================ */

[data-bs-theme="dark"] {
    --dark-bg: #1a1d23;
    --dark-surface: #22252b;
    --dark-surface-2: #2a2d35;
    --dark-border: #343840;
    --dark-text: #e2e8f0;
    --dark-text-muted: #94a3b8;
    --dark-hover: #30333b;
}

/* --- Page Background --- */
[data-bs-theme="dark"] body {
    background-color: var(--dark-bg) !important;
    color: var(--dark-text) !important;
}

/* --- Sidebar --- */
[data-bs-theme="dark"] .sidebar {
    background: var(--dark-surface) !important;
    border-color: var(--dark-border) !important;
}

[data-bs-theme="dark"] .sidebar .nav-link {
    color: var(--dark-text-muted) !important;
}

[data-bs-theme="dark"] .sidebar .nav-link:hover,
[data-bs-theme="dark"] .sidebar .nav-link.active {
    background: var(--dark-hover) !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .sidebar .sidebar-header,
[data-bs-theme="dark"] .sidebar .sidebar-brand {
    color: #fff !important;
    border-color: var(--dark-border) !important;
}

/* --- Top Header / Navbar --- */
[data-bs-theme="dark"] .top-header,
[data-bs-theme="dark"] .header-bar,
[data-bs-theme="dark"] header,
[data-bs-theme="dark"] .navbar {
    background: var(--dark-surface) !important;
    border-color: var(--dark-border) !important;
    color: var(--dark-text) !important;
}

/* --- Main Content Area --- */
[data-bs-theme="dark"] .main-content,
[data-bs-theme="dark"] .content-area {
    background: var(--dark-bg) !important;
}

/* --- Cards --- */
[data-bs-theme="dark"] .card {
    background: var(--dark-surface) !important;
    border-color: var(--dark-border) !important;
    color: var(--dark-text) !important;
}

[data-bs-theme="dark"] .card-header {
    background: var(--dark-surface-2) !important;
    border-color: var(--dark-border) !important;
    color: var(--dark-text) !important;
}

[data-bs-theme="dark"] .card-footer {
    background: var(--dark-surface-2) !important;
    border-color: var(--dark-border) !important;
}

[data-bs-theme="dark"] .card-body {
    color: var(--dark-text) !important;
}

/* --- Dashboard Cards (admin home) --- */
[data-bs-theme="dark"] .dashboard-card {
    background: var(--dark-surface) !important;
    border-color: var(--dark-border) !important;
    color: var(--dark-text) !important;
}

[data-bs-theme="dark"] .dashboard-card:hover {
    background: var(--dark-hover) !important;
    border-color: #4f46e5 !important;
}

[data-bs-theme="dark"] .dashboard-card-body h5,
[data-bs-theme="dark"] .dashboard-card-body p {
    color: var(--dark-text) !important;
}

/* --- Tables --- */
[data-bs-theme="dark"] .table {
    --bs-table-bg: var(--dark-surface);
    --bs-table-striped-bg: var(--dark-surface-2);
    --bs-table-hover-bg: var(--dark-hover);
    --bs-table-border-color: var(--dark-border);
    color: var(--dark-text) !important;
}

[data-bs-theme="dark"] .table thead th {
    background: var(--dark-surface-2) !important;
    color: var(--dark-text) !important;
    border-color: var(--dark-border) !important;
}

[data-bs-theme="dark"] .table td {
    border-color: var(--dark-border) !important;
    color: var(--dark-text) !important;
}

[data-bs-theme="dark"] .table-striped>tbody>tr:nth-of-type(odd)>td {
    background: var(--dark-surface-2) !important;
}

/* --- Forms & Inputs --- */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] textarea.form-control {
    background-color: var(--dark-surface-2) !important;
    border-color: var(--dark-border) !important;
    color: var(--dark-text) !important;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25) !important;
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: var(--dark-text-muted) !important;
}

[data-bs-theme="dark"] .form-label,
[data-bs-theme="dark"] label {
    color: var(--dark-text) !important;
}

[data-bs-theme="dark"] .input-group-text {
    background: var(--dark-surface-2) !important;
    border-color: var(--dark-border) !important;
    color: var(--dark-text-muted) !important;
}

/* --- Modals --- */
[data-bs-theme="dark"] .modal-content {
    background: var(--dark-surface) !important;
    border-color: var(--dark-border) !important;
    color: var(--dark-text) !important;
}

[data-bs-theme="dark"] .modal-header {
    border-color: var(--dark-border) !important;
}

[data-bs-theme="dark"] .modal-footer {
    border-color: var(--dark-border) !important;
}

[data-bs-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* --- Dropdown Menus --- */
[data-bs-theme="dark"] .dropdown-menu {
    background: var(--dark-surface) !important;
    border-color: var(--dark-border) !important;
}

[data-bs-theme="dark"] .dropdown-item {
    color: var(--dark-text) !important;
}

[data-bs-theme="dark"] .dropdown-item:hover {
    background: var(--dark-hover) !important;
}

/* --- Tabs / Nav pills --- */
[data-bs-theme="dark"] .nav-tabs {
    border-color: var(--dark-border) !important;
}

[data-bs-theme="dark"] .nav-tabs .nav-link {
    color: var(--dark-text-muted) !important;
}

[data-bs-theme="dark"] .nav-tabs .nav-link.active {
    background: var(--dark-surface) !important;
    border-color: var(--dark-border) var(--dark-border) var(--dark-surface) !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .nav-pills .nav-link.active {
    background: #4f46e5 !important;
}

/* --- Pagination --- */
[data-bs-theme="dark"] .page-link {
    background: var(--dark-surface) !important;
    border-color: var(--dark-border) !important;
    color: var(--dark-text) !important;
}

[data-bs-theme="dark"] .page-item.active .page-link {
    background: #4f46e5 !important;
    border-color: #4f46e5 !important;
}

/* --- Breadcrumbs --- */
[data-bs-theme="dark"] .breadcrumb {
    background: var(--dark-surface-2) !important;
}

[data-bs-theme="dark"] .breadcrumb-item a {
    color: #818cf8 !important;
}

/* --- Alerts / Callouts --- */
[data-bs-theme="dark"] .alert {
    border-color: var(--dark-border) !important;
}

/* --- Text Utilities --- */
[data-bs-theme="dark"] .text-dark {
    color: var(--dark-text) !important;
}

[data-bs-theme="dark"] .text-muted {
    color: var(--dark-text-muted) !important;
}

[data-bs-theme="dark"] h1,
[data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5,
[data-bs-theme="dark"] h6 {
    color: var(--dark-text) !important;
}

/* --- Background Utility Overrides --- */
[data-bs-theme="dark"] .bg-light {
    background-color: var(--dark-surface-2) !important;
}

[data-bs-theme="dark"] .bg-white {
    background-color: var(--dark-surface) !important;
}

[data-bs-theme="dark"] .bg-body {
    background-color: var(--dark-bg) !important;
}

/* --- Stat Cards (admin dashboard) --- */
[data-bs-theme="dark"] .card.border-0.shadow-sm {
    background: var(--dark-surface) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important;
}

/* --- List Groups --- */
[data-bs-theme="dark"] .list-group-item {
    background: var(--dark-surface) !important;
    border-color: var(--dark-border) !important;
    color: var(--dark-text) !important;
}

/* --- Badges (keep readable) --- */
[data-bs-theme="dark"] .badge.bg-light {
    background: var(--dark-surface-2) !important;
    color: var(--dark-text) !important;
}

/* --- Print View (keep light for printing) --- */
[data-bs-theme="dark"] .print-page {
    background: white !important;
    color: black !important;
}

/* --- Toast Notifications (dark variants) --- */
[data-bs-theme="dark"] .toast-success {
    background: #064e3b !important;
    color: #6ee7b7 !important;
    border-color: #065f46 !important;
}

[data-bs-theme="dark"] .toast-danger {
    background: #7f1d1d !important;
    color: #fca5a5 !important;
    border-color: #991b1b !important;
}

[data-bs-theme="dark"] .toast-warning {
    background: #78350f !important;
    color: #fde68a !important;
    border-color: #92400e !important;
}

[data-bs-theme="dark"] .toast-info {
    background: #1e3a5f !important;
    color: #93c5fd !important;
    border-color: #1e40af !important;
}

/* --- Dark Mode Toggle Button --- */
[data-bs-theme="dark"] .dark-mode-toggle {
    background: var(--dark-surface-2) !important;
    color: #fbbf24 !important;
    border-color: var(--dark-border) !important;
}

/* --- Hardcoded white background fixes --- */
[data-bs-theme="dark"] .login-page .card,
[data-bs-theme="dark"] .welcome-container {
    background: var(--dark-surface) !important;
    color: var(--dark-text) !important;
}

/* --- Scrollbar Dark --- */
[data-bs-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--dark-border);
    border-radius: 4px;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* --- Border Utility Fix --- */
[data-bs-theme="dark"] .border,
[data-bs-theme="dark"] .border-top,
[data-bs-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-start,
[data-bs-theme="dark"] .border-end {
    border-color: var(--dark-border) !important;
}

/* --- Accordion --- */
[data-bs-theme="dark"] .accordion-item {
    background: var(--dark-surface) !important;
    border-color: var(--dark-border) !important;
}

[data-bs-theme="dark"] .accordion-button {
    background: var(--dark-surface) !important;
    color: var(--dark-text) !important;
}

[data-bs-theme="dark"] .accordion-button:not(.collapsed) {
    background: var(--dark-surface-2) !important;
    color: #818cf8 !important;
}

/* --- HR / Dividers --- */
[data-bs-theme="dark"] hr {
    border-color: var(--dark-border) !important;
    opacity: 0.3;
}

/* --- Welcome / Login Page Text --- */
[data-bs-theme="dark"] .text-dark,
[data-bs-theme="dark"] .text-body {
    color: var(--dark-text) !important;
}

[data-bs-theme="dark"] .login-page,
[data-bs-theme="dark"] .login-page .card,
[data-bs-theme="dark"] .login-page h1,
[data-bs-theme="dark"] .login-page h2,
[data-bs-theme="dark"] .login-page h3,
[data-bs-theme="dark"] .login-page h5,
[data-bs-theme="dark"] .login-page p,
[data-bs-theme="dark"] .login-page label {
    color: var(--dark-text) !important;
}

[data-bs-theme="dark"] .login-page {
    background: var(--dark-bg) !important;
}

/* --- Sidebar Footer --- */
[data-bs-theme="dark"] .sidebar-footer {
    background: var(--dark-surface-2) !important;
    border-color: var(--dark-border) !important;
    color: var(--dark-text-muted) !important;
}

[data-bs-theme="dark"] .sidebar-footer p {
    color: var(--dark-text-muted) !important;
}

/* --- Dashboard Home Card Descriptions --- */
[data-bs-theme="dark"] .dashboard-card p,
[data-bs-theme="dark"] .dashboard-card small {
    color: var(--dark-text-muted) !important;
}

[data-bs-theme="dark"] .dashboard-card h5 {
    color: var(--dark-text) !important;
}

/* --- Dashboard Home Header --- */
[data-bs-theme="dark"] .dashboard-home-header h1 {
    color: var(--dark-text) !important;
}

[data-bs-theme="dark"] .dashboard-home-header p {
    color: var(--dark-text-muted) !important;
}

/* --- Select Options (browser dark) --- */
[data-bs-theme="dark"] select option {
    background: var(--dark-surface) !important;
    color: var(--dark-text) !important;
}

/* --- Table Hover Text --- */
[data-bs-theme="dark"] .table-hover tbody tr:hover td {
    color: var(--dark-text) !important;
}

/* --- Strong / Bold text --- */
[data-bs-theme="dark"] strong,
[data-bs-theme="dark"] b,
[data-bs-theme="dark"] .fw-bold {
    color: #f1f5f9 !important;
}

/* --- Card Titles --- */
[data-bs-theme="dark"] .card-title {
    color: var(--dark-text) !important;
}

/* --- Session Timeout Overlay --- */
[data-bs-theme="dark"] .session-timeout-box {
    background: var(--dark-surface) !important;
    color: var(--dark-text) !important;
}

/* --- App Logo in Sidebar --- */
[data-bs-theme="dark"] .app-logo {
    color: #fff !important;
}

[data-bs-theme="dark"] .app-logo span {
    color: #fff !important;
}

/* --- Badge text-dark override --- */
[data-bs-theme="dark"] .badge.text-dark {
    color: #1a1d23 !important;
}

/* --- Print area stays light --- */
@media print {
    [data-bs-theme="dark"] body {
        background: white !important;
        color: black !important;
    }
}

/* =========================================================
   REAL-TIME UPDATES — Socket.IO UI Components
   ========================================================= */

/* --- Connection Status Indicator --- */
.socket-status {
    display: flex;
    align-items: center;
    padding: 0.25rem;
}

.socket-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    transition: background 0.3s ease;
}

.socket-connected {
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
    animation: socketPulse 2s infinite;
}

.socket-disconnected {
    background: #ef4444;
    box-shadow: 0 0 4px rgba(239, 68, 68, 0.4);
}

.socket-reconnecting {
    background: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
    animation: socketPulse 1s infinite;
}

@keyframes socketPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.3);
    }
}

/* --- Notification Bell --- */
.notification-bell-wrapper {
    position: relative;
}

.notification-bell-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--bs-body-color, #333);
    cursor: pointer;
    position: relative;
    padding: 0.4rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.notification-bell-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
    transform: scale(1.1);
}

.notif-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

.notif-badge-pulse {
    animation: badgePulse 0.6s ease 3;
}

@keyframes badgePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.4);
    }
}

/* --- Notification Dropdown --- */
.notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 340px;
    max-height: 420px;
    background: var(--bs-body-bg, #fff);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    z-index: 3000;
    overflow: hidden;
}

.notif-dropdown-open {
    display: block;
    animation: dropdownSlide 0.2s ease;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notif-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
    font-weight: 600;
    font-size: 0.9rem;
}

.notif-mark-read-btn {
    background: none;
    border: none;
    color: #6366f1;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.notif-mark-read-btn:hover {
    background: rgba(99, 102, 241, 0.1);
}

.notif-dropdown-body {
    overflow-y: auto;
    max-height: 350px;
}

.notif-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.9rem;
}

.notif-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--bs-body-color, #333);
    border-bottom: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.05));
    transition: background 0.15s ease;
}

.notif-item:hover {
    background: rgba(99, 102, 241, 0.05);
    text-decoration: none;
    color: var(--bs-body-color, #333);
}

.notif-unread {
    background: rgba(99, 102, 241, 0.08);
    border-right: 3px solid #6366f1;
}

.notif-item-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 50%;
    color: #6366f1;
    font-size: 0.8rem;
}

.notif-item-body {
    flex: 1;
    min-width: 0;
}

.notif-item-msg {
    font-size: 0.85rem;
    line-height: 1.4;
    word-break: break-word;
}

.notif-item-time {
    font-size: 0.7rem;
    color: var(--bs-secondary-color, #6c757d);
    margin-top: 2px;
}

/* --- Socket Toast Notifications --- */
.socket-toast-container {
    position: fixed;
    top: 1rem;
    left: 1.5rem;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
    max-width: 400px;
}

.socket-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.socket-toast-show {
    opacity: 1;
    transform: translateX(0);
}

.socket-toast-hide {
    opacity: 0;
    transform: translateX(-30px) scale(0.95);
}

.socket-toast-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.socket-toast-status .socket-toast-icon {
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
}

.socket-toast-notification .socket-toast-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.socket-toast-refresh .socket-toast-icon {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.socket-toast-body {
    flex: 1;
    min-width: 0;
}

.socket-toast-msg {
    font-size: 0.88rem;
    font-weight: 500;
    color: #1e293b;
    line-height: 1.4;
    word-break: break-word;
}

.socket-toast-status-text {
    font-size: 0.75rem;
    color: #6366f1;
    margin-top: 2px;
    font-weight: 600;
}

.socket-toast-close {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.2rem;
    border-radius: 4px;
    transition: all 0.15s;
}

.socket-toast-close:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Auto-dismiss progress bar */
.socket-toast-progress {
    position: absolute;
    bottom: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #a78bfa);
    border-radius: 0 0 14px 14px;
    animation: toastProgress 8s linear forwards;
}

@keyframes toastProgress {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* --- Dark Mode for Real-Time UI --- */
[data-bs-theme="dark"] .notification-bell-btn {
    color: var(--dark-text, #e2e8f0);
}

[data-bs-theme="dark"] .notif-dropdown {
    background: var(--dark-surface, #22252b);
    border-color: var(--dark-border, #343840);
}

[data-bs-theme="dark"] .notif-dropdown-header {
    border-color: var(--dark-border, #343840);
    color: var(--dark-text, #e2e8f0);
}

[data-bs-theme="dark"] .notif-item {
    color: var(--dark-text, #e2e8f0);
    border-color: var(--dark-border, #343840);
}

[data-bs-theme="dark"] .notif-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--dark-text, #e2e8f0);
}

[data-bs-theme="dark"] .notif-unread {
    background: rgba(99, 102, 241, 0.15);
}

[data-bs-theme="dark"] .socket-toast {
    background: rgba(30, 41, 59, 0.92);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .socket-toast-msg {
    color: var(--dark-text, #e2e8f0);
}

[data-bs-theme="dark"] .socket-toast-close {
    color: #64748b;
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
    .socket-toast-container {
        left: 0.5rem;
        right: 0.5rem;
        max-width: none;
    }

    .notif-dropdown {
        width: 300px;
        left: -100px;
    }
}

/* --- Premium Form Redesign --- */
.premium-form-container {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 1.5rem;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 2.5rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

[data-bs-theme="dark"] .premium-form-container {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.3);
}

.premium-input {
    border-radius: 0.75rem !important;
    padding: 0.8rem 1.2rem !important;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.premium-input:focus {
    background-color: #ffffff;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15) !important;
    transform: translateY(-1px);
}

[data-bs-theme="dark"] .premium-input {
    background-color: rgba(15, 23, 42, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

[data-bs-theme="dark"] .premium-input:focus {
    background-color: rgba(15, 23, 42, 0.9);
    border-color: #818cf8;
    box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.2) !important;
}

.premium-label {
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
}

[data-bs-theme="dark"] .premium-label {
    color: #cbd5e1;
}

.premium-heading {
    color: #1e293b;
    font-weight: 800;
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
    letter-spacing: -0.02em;
}

[data-bs-theme="dark"] .premium-heading {
    color: #f8fafc;
}

.premium-subheading {
    color: #64748b;
    margin-bottom: 2.5rem;
    font-size: 1.05rem;
}

[data-bs-theme="dark"] .premium-subheading {
    color: #94a3b8;
}

.premium-submit-btn {
    border-radius: 1rem;
    padding: 1rem 2rem;
    font-size: 1.15rem;
    font-weight: 700;
    background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    width: 100%;
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.premium-submit-btn:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
    background: linear-gradient(135deg, #4338ca 0%, #2563eb 100%);
    color: white;
}

.premium-divider {
    border-top: 1px solid #e2e8f0;
    margin: 2.5rem 0;
    opacity: 1;
}

[data-bs-theme="dark"] .premium-divider {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.fieldset-premium {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px dashed #cbd5e1;
    margin-bottom: 2rem;
}

[data-bs-theme="dark"] .fieldset-premium {
    background: rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.15);
}

.fieldset-legend-premium {
    background: linear-gradient(135deg, #4f46e5, #3b82f6);
    color: white;
    padding: 0.4rem 1.2rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    float: none;
    width: auto;
    margin-bottom: 0;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

/* Specific styling for radio button groups to look like segmented controls */
.premium-radio-group {
    display: flex;
    gap: 1rem;
    background: #f1f5f9;
    padding: 0.5rem;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
}

[data-bs-theme="dark"] .premium-radio-group {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
}

.premium-radio-group .form-check {
    margin: 0;
    padding: 0;
    flex: 1;
}

.premium-radio-group .form-check-input {
    display: none;
}

.premium-radio-group .form-check-label {
    display: block;
    text-align: center;
    padding: 0.6rem 1rem;
    border-radius: 0.75rem;
    cursor: pointer;
    font-weight: 600;
    color: #64748b;
    transition: all 0.2s ease;
}

[data-bs-theme="dark"] .premium-radio-group .form-check-label {
    color: #94a3b8;
}

.premium-radio-group .form-check-input:checked+.form-check-label {
    background: white;
    color: #4f46e5;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

[data-bs-theme="dark"] .premium-radio-group .form-check-input:checked+.form-check-label {
    background: #1e293b;
    color: #818cf8;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.premium-file-upload {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.premium-file-upload input[type=file] {
    padding: 0.6rem 1rem !important;
}