/* ============================================
   Author: Avangard
   ============================================ */

/* ====== CSS Variables ====== */
:root {
    --primary-color: #1976d2;
    --primary-dark: #1565c0;
    --primary-light: #42a5f5;
    --secondary-color: #26a69a;
    --accent-color: #ff4081;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --danger-color: #f44336;
    --info-color: #2196f3;
    --dark-color: #263238;
    --light-color: #f5f5f5;
    --text-primary: #212121;
    --text-secondary: #757575;
    --border-color: #e0e0e0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --shadow-card: 0 2px 8px rgba(0,0,0,0.08);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --sidebar-width: 280px;
    --sidebar-collapsed: 70px;
    --header-height: 64px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ====== Reset & Base ====== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    color: var(--text-primary);
    line-height: 1.6;
    direction: rtl;
    text-align: right;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* ====== Typography ====== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.75rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.1rem;
}

h6 {
    font-size: 1rem;
}

.text-primary {
    color: var(--primary-color) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-info {
    color: var(--info-color) !important;
}

.text-muted {
    color: #9e9e9e !important;
}

.fw-bold {
    font-weight: 700;
}

.fw-semibold {
    font-weight: 600;
}

.fw-medium {
    font-weight: 500;
}

/* ====== Layout ====== */
.app-container {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-right: var(--sidebar-width);
    transition: var(--transition);
    padding: 24px;
    padding-top: calc(var(--header-height) + 24px);
    min-height: 100vh;
}

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

/* ====== Sidebar ====== */

.logo-side {
    width: 75px;
}

a.sidebar-brand:hover {
    color: #fff;
}

.sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--dark-color) 0%, #1a237e 100%);
    color: #fff;
    z-index: 1000;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: var(--shadow-lg);
}

.profile-nav {
    background: linear-gradient(-180deg, var(--dark-color) 0%, #1a237e 100%);
    color: #fff;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

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

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    white-space: nowrap;
}

    .sidebar-brand i {
        font-size: 1.5rem;
        color: var(--primary-light);
    }

.sidebar-toggle {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

    .sidebar-toggle:hover {
        background: rgba(255,255,255,0.1);
    }

.sidebar-nav {
    padding: 16px 0;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-section-title {
    padding: 8px 20px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
}

.sidebar.collapsed .nav-section-title {
    display: none;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    transition: var(--transition);
    gap: 12px;
    white-space: nowrap;
}

    .nav-link:hover,
    .nav-link.active {
        background: rgba(255,255,255,0.1);
        color: #fff;
        border-right: 3px solid var(--primary-light);
    }
.nav-tabs .nav-link:hover,
.nav-tabs .nav-link.active {
    border-right: 1px solid #dee2e6 #dee2e6 #fff;
}

        .nav-link i {
            font-size: 1.25rem;
            min-width: 24px;
            text-align: center;
        }

    .nav-link .nav-text {
        transition: opacity 0.2s;
    }

.sidebar.collapsed .nav-link .nav-text {
    display: none;
}

.nav-badge {
    margin-right: auto;
    margin-left: 0;
    background: var(--accent-color);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.sidebar.collapsed .nav-badge {
    display: none;
}

/* ====== Header ====== */
.top-header {
    position: fixed;
    top: 0;
    right: var(--sidebar-width);
    left: 0;
    height: var(--header-height);
    background: #fff;
    box-shadow: var(--shadow-sm);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    transition: var(--transition);
}

    .top-header.expanded {
        right: var(--sidebar-collapsed);
    }

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    padding-top: 20px;
    margin-bottom: 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

    .breadcrumb a:hover {
        color: var(--primary-color);
    }

.header-right {
    display: flex;
    align-items: center;
   
}

.header-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .header-btn:hover {
        background: var(--light-color);
        color: var(--primary-color);
    }

    .header-btn .badge {
        position: absolute;
        top: 2px;
        left: 2px;
        background: var(--danger-color);
        color: #fff;
        font-size: 0.65rem;
        padding: 2px 5px;
        border-radius: 50%;
        font-weight: 700;
    }

.user-dropdown {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

    .user-dropdown:hover {
        background: var(--light-color);
    }

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ====== Cards ====== */
.card {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    border: none;
    transition: var(--transition);
    overflow: hidden;
}

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

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
}

    .card-header h5 {
        margin: 0;
        font-weight: 700;
    }

.filter-bar {
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: #fafafa;
}

/* ====== Stats Cards ====== */
.stat-card {
    padding: 24px;
    border-radius: var(--radius-md);
    color: #fff;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

    .stat-card::before {
        content: '';
        position: absolute;
        top: -50%;
        right: -50%;
        width: 200%;
        height: 200%;
        background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
        opacity: 0;
        transition: var(--transition);
    }

    .stat-card:hover::before {
        opacity: 1;
    }

    .stat-card:hover {
        transform: translateY(-4px);
    }

    .stat-card.primary {
        background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    }

    .stat-card.success {
        background: linear-gradient(135deg, var(--success-color), #388e3c);
    }

    .stat-card.warning {
        background: linear-gradient(135deg, var(--warning-color), #f57c00);
    }

    .stat-card.danger {
        background: linear-gradient(135deg, var(--danger-color), #d32f2f);
    }

    .stat-card.info {
        background: linear-gradient(135deg, var(--info-color), #1976d2);
    }

    .stat-card.secondary {
        background: linear-gradient(135deg, var(--secondary-color), #00796b);
    }

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.3;
    position: absolute;
    left: 20px;
    top: 20px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.stat-change {
    font-size: 0.8rem;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ====== Buttons ====== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
}

    .btn:hover {
        transform: translateY(-1px);
        box-shadow: var(--shadow-md);
    }

    .btn:active {
        transform: translateY(0);
    }

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

    .btn-primary:hover {
        background: var(--primary-dark);
    }

.btn-success {
    background: var(--success-color);
    color: #fff;
}

.btn-danger {
    background: var(--danger-color);
    color: #fff;
}

.btn-warning {
    background: var(--warning-color);
    color: #fff;
}

.btn-info {
    background: var(--info-color);
    color: #fff;
}

    .btn-info:hover, .btn-info:focus {
        background: #006fcc;
        color: #fff;
    }

.btn-dark {
    background: var(--dark-color);
    color: #fff;
}

.btn-outline-primary {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

    .btn-outline-primary:hover {
        background: var(--primary-color);
        color: #fff;
    }
.btn-outline-secondary {
    background: transparent;
    border: 2px solid #6c757d;
    color: #6c757d;
}

    .btn-outline-secondary:hover {
        background: #6c757d;
        color: #fff;
    }
.btn-outline-warning {
    border: 2px solid #ffc107;
}

.btn-outline-danger {
    background: transparent;
    border: 2px solid var(--danger-color);
    color: var(--danger-color);
}

    .btn-outline-danger:hover {
        background: var(--danger-color);
        color: #fff;
    }

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    padding: 0;
}

.btn-group {
    display: inline-flex;
}

/* ====== Forms ====== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

    .form-label.required::after {
        content: ' *';
        color: var(--danger-color);
    }

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
    background: #fff;
    color: var(--text-primary);
    height: 40px;
}

    .form-control:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
    }

    .form-control.is-invalid {
        border-color: var(--danger-color);
    }

    .form-control.is-valid {
        border-color: var(--success-color);
    }

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23757575' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 16px center;
    padding-left: 40px;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.form-check-input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.form-check-label {
    font-size: 0.9rem;
    cursor: pointer;
}

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 6px 16px;
    background: var(--light-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    color: var(--text-secondary);
}

.input-group > :not(:first-child) {
    border-right: 1px solid var(--border-color);
}

.input-group > :not(:last-child) {
    border-left: 1px solid var(--border-color);
}
/* ====== Tables ====== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

    .table thead th {
        background: #fafafa;
        padding: 14px 16px;
        font-weight: 700;
        color: var(--text-primary);
        border-bottom: 2px solid var(--border-color);
        white-space: nowrap;
        text-align: right;
    }

    .table tbody td {
        padding: 14px 16px;
        border-bottom: 1px solid var(--border-color);
        vertical-align: middle;
    }

    .table tbody tr:hover {
        background: #f8f9fa;
    }

    .table tbody tr:last-child td {
        border-bottom: none;
    }

/* ====== Badges ====== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    gap: 4px;
}

.badge-primary {
    background: rgba(25, 118, 210, 0.1);
    color: var(--primary-color);
}

.badge-success {
    background: rgba(76, 175, 80, 0.1);
    color: var(--success-color);
}

.badge-warning {
    background: rgba(255, 152, 0, 0.1);
    color: var(--warning-color);
}

.badge-danger {
    background: rgba(244, 67, 54, 0.1);
    color: var(--danger-color);
}

.badge-info {
    background: rgba(33, 150, 243, 0.1);
    color: var(--info-color);
}

.badge-secondary {
    background: rgba(158, 158, 158, 0.1);
    color: var(--text-secondary);
}

/* ====== Alerts ====== */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    border-right: 4px solid transparent;
}

.alert-primary {
    background: rgba(25, 118, 210, 0.08);
    border-color: var(--primary-color);
    color: var(--primary-dark);
}

.alert-success {
    background: rgba(76, 175, 80, 0.08);
    border-color: var(--success-color);
    color: #2e7d32;
}

.alert-warning {
    background: rgba(255, 152, 0, 0.08);
    border-color: var(--warning-color);
    color: #ef6c00;
}

.alert-danger {
    background: rgba(244, 67, 54, 0.08);
    border-color: var(--danger-color);
    color: #c62828;
}

.alert-info {
    background: rgba(33, 150, 243, 0.08);
    border-color: var(--info-color);
    color: #1565c0;
}

/* ====== Tabs ====== */
.nav-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 24px;
   
}

    .nav-tabs .nav-link {
        padding: 12px 20px;
        color: var(--text-secondary);
        font-weight: 600;
        border-bottom: 2px solid transparent;
        margin-bottom: -2px;
        background: none;
      
    }

        .nav-tabs .nav-link:hover,
        .nav-tabs .nav-link.active {
            color: var(--primary-color);
            border-bottom-color: var(--primary-color);
            background: none;
        }

.tab-content {
    padding: 20px 0;
}

/* ====== Modal ====== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

    /* Use ::before for the dimmed/blurred backdrop so it doesn't create
   a stacking context that traps .modal-dialog behind the overlay */
    .modal-overlay::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        backdrop-filter: blur(4px);
        z-index: -1;
    }

    .modal-overlay.active {
        display: flex;
    }

.modal-dialog {
    position: relative;
    z-index: 2001;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
    pointer-events: auto;
}

    .modal-dialog.modal-lg {
        max-width: 900px;
    }

    .modal-dialog.modal-xl {
        max-width: 1200px;
    }

    .modal-dialog.modal-sm {
        max-width: 400px;
    }

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

    .modal-close:hover {
        background: var(--light-color);
        color: var(--danger-color);
    }

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ====== Empty Layout ====== */
.empty-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--primary-dark) 50%, var(--primary-color) 100%);
    padding: 20px;
}

.container-empty {
    max-width: 1000px;
}

.logo {
    width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.empty-samll {
    max-width: 450px;
}
/* ====== Error Pages ====== */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
}

.error-card {
    text-align: center;
    max-width: 500px;
}

.error-code {
    font-size: 8rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.error-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.error-message {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* ====== Dashboard Widgets ====== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.widget-card {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-card);
}

.widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.widget-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.widget-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

    .widget-icon.primary {
        background: rgba(25, 118, 210, 0.1);
        color: var(--primary-color);
    }

    .widget-icon.success {
        background: rgba(76, 175, 80, 0.1);
        color: var(--success-color);
    }

    .widget-icon.warning {
        background: rgba(255, 152, 0, 0.1);
        color: var(--warning-color);
    }

    .widget-icon.danger {
        background: rgba(244, 67, 54, 0.1);
        color: var(--danger-color);
    }

.widget-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.widget-change {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

    .widget-change.up {
        color: var(--success-color);
    }

    .widget-change.down {
        color: var(--danger-color);
    }

/* ====== Timeline ====== */
.timeline {
    position: relative;
    padding-right: 30px;
}

    .timeline::before {
        content: '';
        position: absolute;
        right: 8px;
        top: 0;
        bottom: 0;
        width: 2px;
        background: var(--border-color);
    }

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

    .timeline-item:last-child {
        padding-bottom: 0;
    }

.timeline-dot {
    position: absolute;
    right: -30px;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: var(--shadow-sm);
}

    .timeline-dot.primary {
        background: var(--primary-color);
    }

    .timeline-dot.success {
        background: var(--success-color);
    }

    .timeline-dot.warning {
        background: var(--warning-color);
    }

    .timeline-dot.danger {
        background: var(--danger-color);
    }

.timeline-content {
    background: #fafafa;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.timeline-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ====== Avatar ====== */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: var(--shadow-sm);
}

.avatar-sm {
    width: 32px;
    height: 32px;
}

.avatar-lg {
    width: 56px;
    height: 56px;
}

.avatar-xl {
    width: 80px;
    height: 80px;
}

.avatar-group {
    display: flex;
    align-items: center;
}

    .avatar-group .avatar {
        margin-left: -10px;
        border: 2px solid #fff;
    }

        .avatar-group .avatar:first-child {
            margin-left: 0;
        }

/* ====== Progress ====== */
.progress {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

    .progress-bar.primary {
        background: var(--primary-color);
    }

    .progress-bar.success {
        background: var(--success-color);
    }

    .progress-bar.warning {
        background: var(--warning-color);
    }

    .progress-bar.danger {
        background: var(--danger-color);
    }

/* ====== Pagination ====== */
.pagination {
    display: flex;
    gap: 4px;
    align-items: center;
}

.page-link {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: var(--light-color);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

    .page-link:hover,
    .page-link.active {
        background: var(--primary-color);
        color: #fff;
    }

    .page-link.disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

/* ====== Dropdown ====== */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    padding: 8px 0;
    z-index: 1000;
    display: none;
    margin-top: 8px;
    border: 1px solid var(--border-color);
}

    .dropdown-menu.show {
        display: block;
        animation: dropdownSlide 0.2s ease;
    }

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition);
    cursor: pointer;
}

    .dropdown-item:hover {
        background: var(--light-color);
        color: var(--primary-color);
    }

    .dropdown-item i {
        font-size: 1rem;
        width: 20px;
        text-align: center;
    }

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

/* ====== Toast Container ====== */
.toast-container {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ====== Loading Spinner ====== */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ====== Empty State ====== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--border-color);
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.empty-state-text {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* ====== File Upload ====== */
.file-upload-design {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

    .file-upload-design:hover {
        border-color: var(--primary-color);
        background: rgba(25, 118, 210, 0.02);
    }

.file-upload-design-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.file-upload-design-text {
    font-weight: 600;
    margin-bottom: 4px;
}

.file-upload-design-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ====== Print Styles ====== */
@media print {
    .sidebar,
    .top-header,
    .no-print {
        display: none !important;
    }

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

/* ====== Responsive ====== */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(100%);
    }

        .sidebar.show {
            transform: translateX(0);
        }

    .main-content,
    .main-content.expanded {
        margin-right: 0;
    }

    .top-header,
    .top-header.expanded {
        right: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }

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

@media (max-width: 768px) {
    .main-content {
        padding: 16px;
        padding-top: calc(var(--header-height) + 16px);
    }

    .header-left,
    .header-left > div {
        min-width: 0;
        overflow: hidden;
    }

    .page-title {
        font-size: 1.1rem;
        padding-top: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .breadcrumb {
        display: none;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .card-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .btn-group {
        flex-wrap: wrap;
    }

    .card-body form .d-flex.justify-content-end {
        flex-wrap: wrap;
    }

        .card-body form .d-flex.justify-content-end .btn {
            padding: 6px 14px;
            font-size: 0.8rem;
        }

    .login-header,
    .login-body {
        padding: 20px;
    }
}

/* ====== Utilities ====== */

.d-flex {
    display: flex !important;
}

.d-inline-flex {
    display: inline-flex !important;
}

.d-grid {
    display: grid !important;
}

.justify-content-start {
    justify-content: flex-start !important;
}

.justify-content-end {
    justify-content: flex-end !important;
}

.justify-content-center {
    justify-content: center !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.align-items-start {
    align-items: flex-start !important;
}

.align-items-center {
    align-items: center !important;
}

.align-items-end {
    align-items: flex-end !important;
}

.flex-column {
    flex-direction: column !important;
}

.flex-wrap {
    flex-wrap: wrap !important;
}

.flex-1 {
    flex: 1 !important;
}

.gap-1 {
    gap: 4px !important;
}

.gap-2 {
    gap: 8px !important;
}

.gap-3 {
    gap: 16px !important;
}

.gap-4 {
    gap: 24px !important;
}

.m-0 {
    margin: 0 !important;
}

.mb-1 {
    margin-bottom: 4px !important;
}

.mb-2 {
    margin-bottom: 8px !important;
}

.mb-3 {
    margin-bottom: 16px !important;
}

.mb-4 {
    margin-bottom: 24px !important;
}

.mt-1 {
    margin-top: 4px !important;
}

.mt-2 {
    margin-top: 8px !important;
}

.mt-3 {
    margin-top: 16px !important;
}

.mt-4 {
    margin-top: 24px !important;
}

.ms-1 {
    margin-right: 4px !important;
}

.ms-2 {
    margin-right: 8px !important;
}

.ms-3 {
    margin-right: 16px !important;
}

.me-1 {
    margin-left: 4px !important;
}

.me-2 {
    margin-left: 8px !important;
}

.me-3 {
    margin-left: 16px !important;
}

.p-0 {
    padding: 0 !important;
}

.p-1 {
    padding: 4px !important;
}

.p-2 {
    padding: 8px !important;
}

.p-3 {
    padding: 16px !important;
}

.p-4 {
    padding: 24px !important;
}

.w-100 {
    width: 100% !important;
}

.h-100 {
    height: 100% !important;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rounded {
    border-radius: var(--radius-sm) !important;
}

.rounded-md {
    border-radius: var(--radius-md) !important;
}

.rounded-lg {
    border-radius: var(--radius-lg) !important;
}

.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow-md {
    box-shadow: var(--shadow-md) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

.bg-white {
    background: #fff !important;
}

.bg-light {
    background: var(--light-color) !important;
}

.bg-primary {
    background: var(--primary-color) !important;
}

.bg-success {
    background: var(--success-color) !important;
}

.bg-danger {
    background: var(--danger-color) !important;
}

.border {
    border: 1px solid var(--border-color) !important;
}

.border-0 {
    border: none !important;
}

/* ====== Custom Scrollbar ====== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #a1a1a1;
    }

/* ====== Date Picker Customization ====== */
.datepicker {
    font-family: 'Cairo', sans-serif !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-lg) !important;
    border: none !important;
}

    .datepicker table tr td.today {
        background: rgba(25, 118, 210, 0.1) !important;
        color: var(--primary-color) !important;
    }

    .datepicker table tr td.active,
    .datepicker table tr td.active:hover {
        background: var(--primary-color) !important;
        color: #fff !important;
    }

    .datepicker table tr td.day:hover {
        background: rgba(25, 118, 210, 0.05) !important;
    }

/* ====== SweetAlert2 Customization ====== */
.swal2-popup {
    font-family: 'Cairo', sans-serif !important;
    border-radius: var(--radius-lg) !important;
}

.swal2-title {
    font-weight: 700 !important;
}

.swal2-confirm {
    background: var(--primary-color) !important;
    border-radius: var(--radius-sm) !important;
    font-weight: 600 !important;
}

.swal2-cancel {
    border-radius: var(--radius-sm) !important;
    font-weight: 600 !important;
}

/* ====== DataTables ====== */
div.dt-container div.dt-info, div.dt-container div.dt-paging {
    margin-top: 1rem;
}

div.dt-container div.dt-search, div.dt-container div.dt-paging {
    float: left !important;
    text-align: left !important;
    padding-left: 1rem;
    margin-bottom: 1rem;
}

div.dt-container div.dt-info, div.dt-container div.dt-length {
    float: right !important;
    padding-right: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 576px) {
    div.dt-container div.dt-layout-start,
    div.dt-container div.dt-layout-end {
        margin-inline-start: 0 !important;
        margin-inline-end: 0 !important;
        width: 100%;  
    }

    div.dt-container div.dt-search,
    div.dt-container div.dt-length {
        float: none !important;
        text-align: right !important;
        width: 98%;
        margin-right: 1rem;
        padding-right: 0;
    }
}

table.dataTable {
    clear: both;
}

.table > :not(:first-child) {
    border-top: none;
}

table.dataTable thead > tr > th.dt-orderable-asc:hover,
table.dataTable thead > tr > th.dt-orderable-desc:hover {
    outline: none;
    outline-offset: 0;
}

table.dataTable thead th, table.dataTable thead td, table.dataTable tbody th, table.dataTable tbody td {
    text-align: right !important;
}

table.dataTable th.dt-type-numeric div.dt-column-header,
table.dataTable th.dt-type-numeric div.dt-column-footer,
table.dataTable th.dt-type-date div.dt-column-header,
table.dataTable th.dt-type-date div.dt-column-footer,
table.dataTable td.dt-type-numeric div.dt-column-header,
table.dataTable td.dt-type-numeric div.dt-column-footer,
table.dataTable td.dt-type-date div.dt-column-header,
table.dataTable td.dt-type-date div.dt-column-footer {
    flex-direction: row;
}

.table-bordered > :not(caption) > * {
    border-top-color: var(--border-color);
}

table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control {
    padding-left: 48px !important;
    position: relative;
}

    table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before {
        content: "\f067";
        font-family: "Font Awesome 7 Free";
        font-weight: 900;
        width: 24px;
        height: 24px;
        display: inline-block;
        vertical-align: middle;
        text-align: center;
        line-height: 24px;
        border-radius: 50%;
        background: #0d6efd;
        color: #fff;
        font-size: 11px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
        transition: all 0.25s ease;
        cursor: pointer;
        border: none;
        margin-left: 0.5rem;
    }

table.dataTable.dtr-inline.collapsed > tbody > tr.dtr-expanded > td.dtr-control:before {
    content: "\f068";
    font-family: "Font Awesome 7 Free";
    font-weight: 900;
    background: #dc3545;
    color: #fff;
    border: none;
}
/* ====== Section Divider ====== */
.section-divider {
    display: flex;
    align-items: center;
    margin: 32px 0 24px;
    gap: 16px;
}

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

.section-divider-text {
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.9rem;
    white-space: nowrap;
}
/* ====== Stepper ====== */
.stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    transition: var(--transition);
}

.step.active .step-number,
.step.completed .step-number {
    background: var(--primary-color);
    color: #fff;
}

.step-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.step.active .step-label,
.step.completed .step-label {
    color: var(--primary-color);
}

.step-line {
    width: 40px;
    height: 2px;
    background: var(--border-color);
    transition: var(--transition);
}

.step.completed + .step-line {
    background: var(--primary-color);
}
/* ====== Floating Action Button ====== */
.fab {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-color);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: var(--transition);
    z-index: 100;
}

    .fab:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(255, 64, 129, 0.4);
    }
/* ====== Tooltip ====== */
/* Base tooltip container */
[data-tooltip] {
    position: relative;
    z-index: 1;
}
    /* Tooltip content */
    [data-tooltip]::after {
        content: attr(data-tooltip);
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        padding: 8px 12px;
        background: var(--dark-color);
        color: #fff;
        font-size: 0.75rem;
        font-weight: 600;
        line-height: 1.45;
        border-radius: var(--radius-sm);
        white-space: normal;
        max-width: 340px; /* Slightly wider for RTL */
        width: max-content;
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
        margin-bottom: 10px;
        z-index: 9999;
        pointer-events: none;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
        text-align: start; /* RTL friendly */
        direction: rtl; /* Force RTL if needed */
    }
    /* Show on hover */
    [data-tooltip]:hover::after {
        opacity: 1;
        visibility: visible;
    }
    /* Bottom tooltip */
    [data-tooltip].tooltip-bottom::after {
        bottom: auto;
        top: 100%;
        margin-bottom: 0;
        margin-top: 10px;
        max-width: 360px;
    }
    /* Arrow */
    [data-tooltip]::before {
        content: '';
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
        z-index: 9999;
        pointer-events: none;
    }

    [data-tooltip]:hover::before {
        opacity: 1;
        visibility: visible;
    }
    /* Default (top) arrow */
    [data-tooltip]::before {
        bottom: 100%;
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-top: 6px solid var(--dark-color);
        margin-bottom: 4px;
    }
    /* Bottom arrow */
    [data-tooltip].tooltip-bottom::before {
        top: 100%;
        bottom: auto;
        border-top: none;
        border-bottom: 6px solid var(--dark-color);
        margin-top: 4px;
    }
/* ====== Ripple Effect ====== */
.ripple {
    position: relative;
    overflow: hidden;
}

    .ripple::after {
        content: '';
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        pointer-events: none;
        background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
        background-repeat: no-repeat;
        background-position: 50%;
        transform: scale(10, 10);
        opacity: 0;
        transition: transform 0.5s, opacity 1s;
    }

    .ripple:active::after {
        transform: scale(0, 0);
        opacity: 0.3;
        transition: 0s;
    }
/* ====== Skeleton Loading ====== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 16px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
/* ====== Print Button ====== */
.print-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: var(--transition);
    z-index: 100;
}

    .print-btn:hover {
        background: var(--primary-dark);
        transform: scale(1.1);
    }

@media print {
    .print-btn,
    .fab {
        display: none !important;
    }
}
/* ====== Select 2 ====== */
.select2-container--open {
    z-index: 9999;
}

.select2-hidden-accessible {
    border: 0 !important;
    clip: rect(0 0 0 0) !important;
    height: 1px !important;
    margin: -1px !important;
    overflow: hidden !important;
    padding: 0 !important;
    position: absolute !important;
    width: 1px !important
}

.select2-container--default .select2-selection--single,
.select2-selection .select2-selection--single {
    border: 2px solid var(--border-color);
    border-radius: 0;
    padding: 6px 12px;
    height: 34px
}

.select2-container--default .select2-selection--single {
    background-color: #fff;
    border: 2px solid var(--border-color);
    border-radius: 4px
}

.select2-container .select2-selection--single {
    box-sizing: border-box;
    cursor: pointer;
    display: block;
    height: 28px;
    user-select: none;
    -webkit-user-select: none
}

    .select2-container .select2-selection--single .select2-selection__rendered {
        padding-right: 10px
    }

    .select2-container .select2-selection--single .select2-selection__rendered {
        padding-left: 0;
        padding-right: 0;
        height: auto;
        margin-top: -3px
    }

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #444;
    line-height: 28px
}

.select2-container--default .select2-selection--single,
.select2-selection .select2-selection--single {
    border: 2px solid var(--border-color);
    border-radius: 0 !important;
    padding: 6px 12px;
    height: 40px !important
}

    .select2-container--default .select2-selection--single .select2-selection__arrow {
        height: 26px;
        position: absolute;
        top: 6px !important;
        right: 1px;
        width: 20px
    }

    .select2-container--default .select2-selection--single .select2-selection__clear {
        margin-right: 8px;
        margin-left: 20px;
        position: relative;
        top: -3px;
    }

.select2 .select2-selection__clear {
    display: none !important;
}

.flatpickr-months .flatpickr-month {
    height: 43px;
}

.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default .select2-selection--multiple {
    width: 100%;
    border: 2px solid var(--border-color);
}

.select2-container .select2-search--inline .select2-search__field {
    height: 40px;
    line-height: 1.6;
    margin: 0;
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 12px 16px;
}

.select2-container--default .select2-selection--multiple {
    padding: 0;
}

.select2-container .select2-search--inline .select2-search__field {
    height: 36px; /* Slightly less than the 40px container for a clean look */
    line-height: 36px; /* Centers text vertically */
    margin: 0;
    padding: 0 16px; /* Removed top/bottom padding (0), kept side padding (16px) */
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: inline-block;
    vertical-align: middle;
}

.select2-container--default .select2-selection--multiple {
    display: flex;
    align-items: center;
    min-height: 40px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
}

    .select2-container--default .select2-selection--multiple .select2-selection__rendered {
        margin: 0;
    }

    .select2-container--default .select2-selection--multiple .select2-selection__choice {
        margin-top: 0;
    }
/* ====== Fix Sidebar ====== */
.nav-text {
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.sidebar.collapsed .nav-text {
    opacity: 0;
    pointer-events: none;
    width: 0;
    display: inline-block;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-brand {
    gap: 0px;
}
/* ====== Notification Dropdown ====== */
.notification-wrapper {
    position: relative;
}

.notification-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 360px;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    z-index: 1100;
    overflow: hidden;
    border: 1px solid var(--border-color);
    animation: notifSlideIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

    .notification-dropdown.show {
        display: block;
    }

@keyframes notifSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    background: #fafafa;
}

.notification-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.mark-all-read {
    background: none;
    border: none;
    font-size: 0.78rem;
    color: var(--primary-color);
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.3s;
}

    .mark-all-read:hover {
        background: rgba(25, 118, 210, 0.08);
    }

.notification-list {
    max-height: 360px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}

    .notification-item:last-child {
        border-bottom: none;
    }

    .notification-item:hover {
        background: #f5f9ff;
    }

    .notification-item.unread {
        background: #eef5ff;
    }

        .notification-item.unread:hover {
            background: #ddeeff;
        }

        .notification-item.unread::before {
            content: '';
            position: absolute;
            right: 0;
            top: 0;
            bottom: 0;
            width: 3px;
            background: var(--primary-color);
            border-radius: 0 3px 3px 0;
        }

.notif-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

    .notif-icon.success {
        background: rgba(76,175,80,0.12);
        color: #4caf50;
    }

    .notif-icon.warning {
        background: rgba(255,152,0,0.12);
        color: #ff9800;
    }

    .notif-icon.danger {
        background: rgba(244,67,54,0.12);
        color: #f44336;
    }

    .notif-icon.info {
        background: rgba(33,150,243,0.12);
        color: #2196f3;
    }

    .notif-icon.primary {
        background: rgba(25,118,210,0.12);
        color: #1976d2;
    }

.notif-body {
    flex: 1;
    min-width: 0;
}

.notif-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 3px;
}

.notification-item.unread .notif-text {
    font-weight: 700;
}

.notif-sub {
    font-size: 0.78rem;
    color: #757575;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-time {
    font-size: 0.72rem;
    color: #aaa;
    font-weight: 500;
}

.notif-dot {
    width: 8px;
    height: 8px;
    background: #1976d2;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}

.notification-item.read .notif-dot {
    visibility: hidden;
}

.notification-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    background: #fafafa;
}

.show-all-link {
    font-size: 0.875rem;
    font-weight: 700;
    color: #1976d2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
}

    .show-all-link:hover {
        color: #1565c0;
    }

@keyframes bellShake {
    0%,100% {
        transform: rotate(0deg);
    }

    15% {
        transform: rotate(15deg);
    }

    30% {
        transform: rotate(-13deg);
    }

    45% {
        transform: rotate(10deg);
    }

    60% {
        transform: rotate(-8deg);
    }

    75% {
        transform: rotate(5deg);
    }
}

@keyframes ringing {
    0% {
        transform: rotate(-15deg);
    }

    2% {
        transform: rotate(15deg);
    }

    4% {
        transform: rotate(-18deg);
    }

    6% {
        transform: rotate(18deg);
    }

    8% {
        transform: rotate(-22deg);
    }

    10% {
        transform: rotate(22deg);
    }

    12% {
        transform: rotate(-18deg);
    }

    14% {
        transform: rotate(18deg);
    }

    16% {
        transform: rotate(-12deg);
    }

    18% {
        transform: rotate(12deg);
    }

    20% {
        transform: rotate(0deg);
    }
}

#notificationBtn.has-unread .fa-bell {
    display: inline-block;
    transform-origin: 50% 0%;
    /* animation: bellShake 2s ease infinite;*/
    animation: ringing 2.0s 5 ease 1.0s;
    color: #ff9800;
}

body.modal-open {
    overflow: hidden;
    padding-right: 8px;
}
/* ====== File Preview ====== */
.file {
    text-align: center;
}

.file-preview {
    max-width: 180px;
    max-height: 180px;
    border-radius: 12px;
    border: 2px solid #dee2e6;
    object-fit: cover;
    padding: 4px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
/* ====== Select 2 ====== */
.select2-selection__rendered {
    text-align: right;
}

.dt-length .select2 {
    width: 60% !important;
}
/* ====== About ====== */
.promo-side {
    background: linear-gradient(135deg, rgba(25, 118, 210, 0.9), rgba(38, 166, 154, 0.8)) !important;
    color: white !important;
}

.hero-section {
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 50px 20px;
    text-align: center;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    margin-bottom: 50px;
}

.feature-icon-box {
    background: rgba(255, 255, 255, .75);
    padding: 20px;
    border-radius: var(--radius-md);
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

    .feature-icon-box:hover {
        background: rgba(255, 255, 255, 1);
        transform: translateY(-5px);
    }

    .feature-icon-box i {
        font-size: 2.5rem;
        margin-bottom: 15px;
        display: block;
    }

    .feature-icon-box p {
        color: var(--primary-color);
    }

.breadcrumb-separator {
    font-size: 0.7rem;
}

.notif-clock-icon {
    font-size: 0.65rem;
    margin-left: 3px;
}
/* ====== Pre-loader ====== */

.loading-container {
    z-index: 9999;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--primary-dark) 50%, var(--primary-color) 100%);
    transition: opacity 0.3s ease;
}

    .loading-container.loading-inactive {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .loading-container .loader {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        margin: 50vh auto;
        position: relative;
        right: -12px;
        background-color: rgba(255, 255, 255, 0.9);
        animation: typing 1s linear infinite alternate;
    }

@keyframes typing {
    0% {
        background-color: rgba(255, 255, 255, 1);
        box-shadow: 20px 0px 0px 0px rgba(255, 255, 255, 0.2), 40px 0px 0px 0px rgba(255, 255, 255, 0.2);
    }

    50% {
        background-color: rgba(255, 255, 255, 0.4);
        box-shadow: 20px 0px 0px 0px rgba(255, 255, 255, 1), 40px 0px 0px 0px rgba(255, 255, 255, 0.2);
    }

    100% {
        background-color: rgba(255, 255, 255, 0.4);
        box-shadow: 20px 0px 0px 0px rgba(255, 255, 255, 0.2), 40px 0px 0px 0px rgba(255, 255, 255, 1);
    }
}

alert-dismissible .btn-close {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    padding: 1.25rem 1rem;
}
/* ====== Validation ====== */
.field-validation-valid {
    display: none;
}

.was-validated .form-control:valid,
.form-control.valid,
.was-validated .custom-select:valid,
.custom-select.valid {
    border-color: #28a745;
}

    .was-validated .form-control:valid:focus,
    .form-control.valid:focus,
    .was-validated .custom-select:valid:focus,
    .custom-select.valid:focus {
        border-color: #28a745;
        box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
    }

    .was-validated .form-control:valid ~ .valid-feedback,
    .was-validated .form-control:valid ~ .valid-tooltip,
    .form-control.valid ~ .valid-feedback,
    .form-control.valid ~ .valid-tooltip,
    .was-validated .custom-select:valid ~ .valid-feedback,
    .was-validated .custom-select:valid ~ .valid-tooltip,
    .custom-select.valid ~ .valid-feedback,
    .custom-select.valid ~ .valid-tooltip {
        display: block;
    }

.was-validated .form-check-input:valid ~ .form-check-label,
.form-check-input.valid ~ .form-check-label {
    color: #28a745;
}

.was-validated .form-check-input:valid ~ .valid-feedback,
.was-validated .form-check-input:valid ~ .valid-tooltip,
.form-check-input.valid ~ .valid-feedback,
.form-check-input.valid ~ .valid-tooltip {
    display: block;
}

.was-validated .custom-control-input:valid ~ .custom-control-label,
.custom-control-input.valid ~ .custom-control-label {
    color: #28a745;
}

    .was-validated .custom-control-input:valid ~ .custom-control-label::before,
    .custom-control-input.valid ~ .custom-control-label::before {
        background-color: #71dd8a;
    }

.was-validated .custom-control-input:valid ~ .valid-feedback,
.was-validated .custom-control-input:valid ~ .valid-tooltip,
.custom-control-input.valid ~ .valid-feedback,
.custom-control-input.valid ~ .valid-tooltip {
    display: block;
}

.was-validated .custom-control-input:valid:checked ~ .custom-control-label::before,
.custom-control-input.valid:checked ~ .custom-control-label::before {
    background-color: #34ce57;
}

.was-validated .custom-control-input:valid:focus ~ .custom-control-label::before,
.custom-control-input.valid:focus ~ .custom-control-label::before {
    box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.was-validated .custom-file-input:valid ~ .custom-file-label,
.custom-file-input.valid ~ .custom-file-label {
    border-color: #28a745;
}

    .was-validated .custom-file-input:valid ~ .custom-file-label::before,
    .custom-file-input.valid ~ .custom-file-label::before {
        border-color: inherit;
    }

.was-validated .custom-file-input:valid ~ .valid-feedback,
.was-validated .custom-file-input:valid ~ .valid-tooltip,
.custom-file-input.valid ~ .valid-feedback,
.custom-file-input.valid ~ .valid-tooltip {
    display: block;
}

.was-validated .custom-file-input:valid:focus ~ .custom-file-label,
.custom-file-input.valid:focus ~ .custom-file-label {
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

span.required {
    color: #dc3545;
}

.field-validation-error {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 80%;
    color: #dc3545;
}

span.field-validation-error:before {
    content: "\f057";
    padding-left: 3px;
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
}

.invalid-tooltip {
    position: absolute;
    top: 100%;
    z-index: 5;
    display: none;
    max-width: 100%;
    padding: .5rem;
    margin-top: .1rem;
    font-size: .875rem;
    line-height: 1;
    color: #fff;
    background-color: rgba(220, 53, 69, 0.8);
    border-radius: .2rem;
}

.was-validated .form-control:invalid,
.form-control.input-validation-error,
.was-validated .custom-select:invalid,
.custom-select.input-validation-error {
    border-color: #dc3545;
}

    .was-validated .form-control:invalid:focus,
    .form-control.input-validation-error:focus,
    .was-validated .custom-select:invalid:focus,
    .custom-select.input-validation-error:focus {
        border-color: #dc3545;
        box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
    }

    .was-validated .form-control:invalid ~ .field-validation-error,
    .was-validated .form-control:invalid ~ .invalid-tooltip,
    .form-control.input-validation-error ~ .field-validation-error,
    .form-control.input-validation-error ~ .invalid-tooltip,
    .was-validated .custom-select:invalid ~ .field-validation-error,
    .was-validated .custom-select:invalid ~ .invalid-tooltip,
    .custom-select.input-validation-error ~ .field-validation-error,
    .custom-select.input-validation-error ~ .invalid-tooltip,
    .field-validation-error {
        display: block;
    }

.was-validated .form-check-input:invalid ~ .form-check-label,
.form-check-input.input-validation-error ~ .form-check-label {
    color: #dc3545;
}

.was-validated .form-check-input:invalid ~ .field-validation-error,
.was-validated .form-check-input:invalid ~ .invalid-tooltip,
.form-check-input.input-validation-error ~ .field-validation-error,
.form-check-input.input-validation-error ~ .invalid-tooltip {
    display: block;
}

.was-validated .custom-control-input:invalid ~ .custom-control-label,
.custom-control-input.input-validation-error ~ .custom-control-label {
    color: #dc3545;
}

    .was-validated .custom-control-input:invalid ~ .custom-control-label::before,
    .custom-control-input.input-validation-error ~ .custom-control-label::before {
        background-color: #efa2a9;
    }

.was-validated .custom-control-input:invalid ~ .field-validation-error,
.was-validated .custom-control-input:invalid ~ .invalid-tooltip,
.custom-control-input.input-validation-error ~ .field-validation-error,
.custom-control-input.input-validation-error ~ .invalid-tooltip {
    display: block;
}

.was-validated .custom-control-input:invalid:checked ~ .custom-control-label::before,
.custom-control-input.input-validation-error:checked ~ .custom-control-label::before {
    background-color: #e4606d;
}

.was-validated .custom-control-input:invalid:focus ~ .custom-control-label::before,
.custom-control-input.input-validation-error:focus ~ .custom-control-label::before {
    box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.was-validated .custom-file-input:invalid ~ .custom-file-label,
.custom-file-input.input-validation-error ~ .custom-file-label {
    border-color: #dc3545;
}

    .was-validated .custom-file-input:invalid ~ .custom-file-label::before,
    .custom-file-input.input-validation-error ~ .custom-file-label::before {
        border-color: inherit;
    }

.was-validated .custom-file-input:invalid ~ .field-validation-error,
.was-validated .custom-file-input:invalid ~ .invalid-tooltip,
.custom-file-input.input-validation-error ~ .field-validation-error,
.custom-file-input.input-validation-error ~ .invalid-tooltip {
    display: block;
}

.was-validated .custom-file-input:invalid:focus ~ .custom-file-label,
.custom-file-input.input-validation-error:focus ~ .custom-file-label {
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control:disabled,
.form-control[readonly] {
    cursor: not-allowed;
}

.input-validation-error + .select2-container .select2-selection {
    border-color: #dc3545 !important;
}

.valid + .select2-container .select2-selection {
    border-color: #28a745 !important;
}

.flatpickr-input[readonly] {
    cursor: pointer;
}
/* ====== Terms ====== */
.terms-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--primary-dark) 50%, var(--primary-color) 100%);
    padding: 40px 20px;
}

.terms-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden;
    animation: loginSlideUp 0.5s ease;
}

.terms-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    padding: 40px;
    text-align: center;
}

    .terms-header i {
        font-size: 3rem;
        margin-bottom: 16px;
        display: block;
    }

    .terms-header h1 {
        color: #fff;
        font-size: 2rem;
        margin-bottom: 8px;
    }

    .terms-header p {
        opacity: 0.9;
        margin: 0;
    }

.terms-body {
    padding: 40px;
}

.terms-section {
    margin-bottom: 32px;
}

    .terms-section:last-child {
        margin-bottom: 0;
    }

    .terms-section h3 {
        color: var(--primary-color);
        font-size: 1.25rem;
        margin-bottom: 16px;
        display: flex;
        align-items: center;
        gap: 10px;
    }

        .terms-section h3 i {
            font-size: 1.1rem;
            width: 32px;
            height: 32px;
            background: rgba(25, 118, 210, 0.1);
            border-radius: 50%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

    .terms-section p, .terms-section li {
        color: var(--text-secondary);
        line-height: 1.8;
        font-size: 0.95rem;
    }

    .terms-section ul {
        padding-right: 24px;
        list-style: none;
    }

        .terms-section ul li {
            position: relative;
            padding-right: 20px;
            margin-bottom: 8px;
        }

            .terms-section ul li::before {
                content: '\f00c';
                font-family: 'Font Awesome 7 Free';
                font-weight: 900;
                position: absolute;
                right: 0;
                color: var(--success-color);
                font-size: 0.8rem;
            }

.terms-footer {
    padding: 24px 40px;
    background: #fafafa;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.last-updated {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .terms-body {
        padding: 24px;
    }

    .terms-header {
        padding: 24px;
    }

    .terms-footer {
        flex-direction: column;
        text-align: center;
    }
}
/* ====== Privacy ====== */

.privacy-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--primary-dark) 50%, var(--primary-color) 100%);
    padding: 40px 20px;
}

.privacy-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden;
    animation: loginSlideUp 0.5s ease;
}

.privacy-header {
    background: linear-gradient(135deg, var(--secondary-color), #00796b);
    color: #fff;
    padding: 40px;
    text-align: center;
}

    .privacy-header i {
        font-size: 3rem;
        margin-bottom: 16px;
        display: block;
    }

    .privacy-header h1 {
        color: #fff;
        font-size: 2rem;
        margin-bottom: 8px;
    }

    .privacy-header p {
        opacity: 0.9;
        margin: 0;
    }

.privacy-body {
    padding: 40px;
}

.privacy-section {
    margin-bottom: 32px;
}

    .privacy-section:last-child {
        margin-bottom: 0;
    }

    .privacy-section h3 {
        color: var(--secondary-color);
        font-size: 1.25rem;
        margin-bottom: 16px;
        display: flex;
        align-items: center;
        gap: 10px;
    }

        .privacy-section h3 i {
            font-size: 1.1rem;
            width: 32px;
            height: 32px;
            background: rgba(38, 166, 154, 0.1);
            border-radius: 50%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: var(--secondary-color);
        }

    .privacy-section p, .privacy-section li {
        color: var(--text-secondary);
        line-height: 1.8;
        font-size: 0.95rem;
    }

    .privacy-section ul {
        padding-right: 24px;
        list-style: none;
    }

        .privacy-section ul li {
            position: relative;
            padding-right: 20px;
            margin-bottom: 8px;
        }

            .privacy-section ul li::before {
                content: '\f00c';
                font-family: 'Font Awesome 7 Free';
                font-weight: 900;
                position: absolute;
                right: 0;
                color: var(--secondary-color);
                font-size: 0.8rem;
            }

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 0.9rem;
}

    .data-table th, .data-table td {
        padding: 12px 16px;
        text-align: right;
        border-bottom: 1px solid var(--border-color);
    }

    .data-table th {
        background: #fafafa;
        font-weight: 700;
        color: var(--text-primary);
    }

    .data-table tr:hover {
        background: #f8f9fa;
    }

.privacy-footer {
    padding: 24px 40px;
    background: #fafafa;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.last-updated {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(76, 175, 80, 0.1);
    color: var(--success-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 16px;
}

@media (max-width: 768px) {
    .privacy-body {
        padding: 24px;
    }

    .privacy-header {
        padding: 24px;
    }

    .privacy-footer {
        flex-direction: column;
        text-align: center;
    }

    .data-table {
        font-size: 0.8rem;
    }

        .data-table th, .data-table td {
            padding: 8px;
        }
}

.validation-summary-errors ul {
    margin-bottom: 0;
}
/* ====== Month Picker ====== */
.fp-monthSelect-grid {
    display: flex;
    flex-wrap: wrap;
    padding: 0.5rem;
    box-sizing: border-box;
}

.fp-monthSelect-item {
    flex: 0 0 33.33%;
    text-align: center;
    padding: 0.45rem 0.25rem;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.85rem;
    box-sizing: border-box;
    transition: background 0.15s;
}

    .fp-monthSelect-item:hover {
        background: rgba(25, 118, 210, 0.12);
    }

    .fp-monthSelect-item.selected {
        background: var(--primary-color);
        color: #fff;
    }

[type="password"], .ltr {
    direction: ltr;
}
.flatpickr-current-month {
    direction: rtl !important;
}

.flatpickr-months .flatpickr-prev-month.flatpickr-next-month, .flatpickr-months .flatpickr-next-month.flatpickr-next-month {
    left: 0 !important;
    right:auto;
}

.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month, .flatpickr-months .flatpickr-next-month.flatpickr-prev-month {
    right: 0 !important;
    left: auto;
}

.flatpickr-current-month input.cur-year {
    padding: 0 .5ch 0 !important;
    direction:rtl;
}
.numInputWrapper span {
    padding: 0 2px 0 4px !important;
    left: 0 !important;
    right:auto;
}
.flatpickr-innerContainer {
    direction: rtl;
}
.fp-monthSelect-grid
{
    direction:rtl;
}