    /* Variables for consistency and easy theming */
    :root {
        --bg-primary: #0a1a14;
        --bg-secondary: #1a332a;
        --bg-card: #243b34;
        --accent: #c9a961;
        --accent-hover: #dbb976;
        --text-primary: #ffffff;
        --text-secondary: #e0e0e0;
        --text-muted: #a0a0a0;
        --border: rgba(201, 169, 97, 0.3);
        --shadow: rgba(0, 0, 0, 0.3);
        --radius: 8px;
        --spacing: 1rem;
    }

    /* Reset and base styles */
    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    body {
        background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
        color: var(--text-primary);
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
        line-height: 1.5;
        min-height: 100vh;
    }

    /* Navbar */
    .navbar-modern {
        background: rgba(26, 51, 42, 0.95);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--accent);
        box-shadow: 0 2px 20px var(--shadow);
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .navbar-brand {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--accent);
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        transition: color 0.2s ease;
    }

    .navbar-brand:hover {
        color: var(--accent-hover);
    }

    .nav-link {
        color: var(--text-secondary) !important;
        font-weight: 500;
        padding: 0.5rem 1rem !important;
        border-radius: var(--radius);
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .nav-link:hover {
        color: var(--text-primary) !important;
        background: rgba(255, 255, 255, 0.1);
    }

    .navbar-toggler {
        border: 1px solid var(--accent);
        background: var(--accent);
    }

    .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2810, 26, 20, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='m4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    }

    /* Button group */
    .btn-group-modern {
        display: flex;
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    .btn-modern {
        background: transparent;
        color: var(--text-primary);
        border: 1px solid var(--accent);
        border-radius: var(--radius);
        padding: 0.75rem 1.25rem;
        font-weight: 500;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        transition: all 0.2s ease;
        white-space: nowrap;
        cursor: pointer;
        font-size: 0.95rem;
    }

    .btn-modern:hover,
    .btn-modern:focus {
        background: var(--accent);
        color: var(--bg-primary);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(201, 169, 97, 0.3);
        text-decoration: none;
    }

    /* Content */
    .content-wrapper {
        padding: 2rem 1rem;
        max-width: 1200px;
        margin: 0 auto;
    }

    .main-card {
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        box-shadow: 0 4px 20px var(--shadow);
        padding: 2rem;
        position: relative;
    }

    .main-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, var(--accent), var(--accent-hover));
        border-radius: var(--radius) var(--radius) 0 0;
    }

    .section-title {
        font-size: 1.375rem;
        font-weight: 700;
        color: var(--accent);
        margin-bottom: 1.5rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    /* Forms */
    .form-group {
        margin-bottom: var(--spacing);
    }

    .form-control-modern,
    .form-select-modern {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 0.875rem 1rem;
        font-size: 1rem;
        transition: all 0.2s ease;
        width: 100%;
    }

    .form-control-modern::placeholder {
        color: var(--text-muted);
    }

    .form-control-modern:focus,
    .form-select-modern:focus {
        outline: none;
        border-color: var(--accent);
        box-shadow: 0 0 0 2px rgba(201, 169, 97, 0.2);
        background: var(--bg-card);
    }

    .input-group-modern {
        display: flex;
        border-radius: var(--radius);
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .input-group-modern .form-control-modern {
        border-radius: 0;
        border-right: none;
        flex: 1;
    }

    .btn-search {
        background: var(--accent);
        color: var(--bg-primary);
        border: none;
        padding: 0.875rem 1.5rem;
        font-weight: 600;
        transition: background 0.2s ease;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        cursor: pointer;
    }

    .btn-search:hover {
        background: var(--accent-hover);
    }

    /* Advanced search */
    .advanced-search {
        margin-top: 1.5rem;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        background: rgba(255, 255, 255, 0.02);
    }

    .advanced-search summary {
        padding: 1rem;
        color: var(--accent);
        font-weight: 600;
        cursor: pointer;
        list-style: none;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        transition: background 0.2s ease;
    }

    .advanced-search summary:hover {
        background: rgba(255, 255, 255, 0.05);
    }

    .advanced-search summary::-webkit-details-marker {
        display: none;
    }

    .advanced-search[open] summary {
        border-bottom: 1px solid var(--border);
    }

    .advanced-form {
        padding: 1.5rem;
    }

    .form-label-modern {
        color: var(--text-secondary);
        font-weight: 500;
        margin-bottom: 0.5rem;
        display: block;
        font-size: 0.9rem;
    }

    .form-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 1rem;
    }

    .form-row.two-cols {
        grid-template-columns: 1fr 1fr;
    }

    .button-group {
        display: flex;
        gap: 1rem;
        align-items: center;
        margin-top: 1.5rem;
    }

    .btn-reset {
        background: transparent;
        color: var(--text-muted);
        border: 1px solid var(--text-muted);
        border-radius: var(--radius);
        padding: 0.875rem 1.5rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .btn-reset:hover {
        color: var(--text-primary);
        border-color: var(--text-primary);
    }

    /* Loading state */
    .loading {
        opacity: 0.7;
        pointer-events: none;
    }

    .loading .btn-search::after {
        content: '';
        width: 12px;
        height: 12px;
        border: 2px solid transparent;
        border-top: 2px solid currentColor;
        border-radius: 50%;
        animation: spin 1s linear infinite;
        margin-right: 0.5rem;
    }

    @keyframes spin {
        to { transform: rotate(360deg); }
    }

    /* Responsive */
    @media (max-width: 768px) {
        .btn-group-modern {
            flex-direction: column;
        }

        .btn-modern {
            width: 100%;
            justify-content: center;
        }

        .content-wrapper {
            padding: 1rem 0.5rem;
        }

        .main-card {
            padding: 1.5rem;
        }

        .input-group-modern {
            flex-direction: column;
        }

        .input-group-modern .form-control-modern {
            border-radius: var(--radius);
            border: 1px solid var(--border);
            margin-bottom: 0.75rem;
        }

        .btn-search {
            border-radius: var(--radius);
            justify-content: center;
        }

        .form-row.two-cols {
            grid-template-columns: 1fr;
        }

        .button-group {
            flex-direction: column;
            align-items: stretch;
        }
    }

    @media (max-width: 576px) {
        .section-title {
            font-size: 1.25rem;
        }

        .navbar-brand {
            font-size: 1.25rem;
        }
    }

    /* Modal Styles */
    .modal-modern .modal-content {
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        box-shadow: 0 10px 40px var(--shadow);
    }

    .modal-header-modern {
        background: linear-gradient(135deg, var(--accent), var(--accent-hover));
        color: var(--bg-primary);
        border-bottom: 1px solid var(--border);
        padding: 1rem 1.5rem;
        border-radius: var(--radius) var(--radius) 0 0;
    }

    .modal-title-modern {
        font-weight: 700;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin: 0;
    }

    .btn-close-modern {
        position: absolute;   /* نحدد موقعه بشكل مطلق */
        left: 1rem;           /* مسافة من يسار المودال */
        top: 1rem;            /* مسافة من أعلى المودال */
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--bg-primary);
        opacity: 0.8;
        cursor: pointer;
        padding: 0;
        width: 1.5rem;
        height: 1.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .btn-close-modern:hover {
        opacity: 1;
    }

    .btn-close-modern::before {
        content: '×';
    }

    .modal-body-modern {
        padding: 1.5rem;
        color: var(--text-primary);
    }

    .modal-footer-modern {
        background: rgba(255, 255, 255, 0.02);
        border-top: 1px solid var(--border);
        padding: 1rem 1.5rem;
        border-radius: 0 0 var(--radius) var(--radius);
        display: flex;
        gap: 1rem;
        justify-content: flex-end;
    }

    .btn-secondary {
        background: transparent;
        color: var(--text-muted);
        border: 1px solid var(--text-muted);
    }

    .btn-secondary:hover {
        background: var(--text-muted);
        color: var(--bg-primary);
    }

    .btn-accent {
        background: var(--accent);
        color: var(--bg-primary);
        border: 1px solid var(--accent);
    }

    .btn-accent:hover {
        background: var(--accent-hover);
        color: var(--bg-primary);
    }

    /* Loading Spinner */
    .loading-center {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 3rem;
    }

    .spinner-modern {
        width: 2rem;
        height: 2rem;
        border: 3px solid rgba(201, 169, 97, 0.2);
        border-top: 3px solid var(--accent);
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }

    /* Statistics Dashboard */
    .statistics-dashboard {
        padding: 0;
    }

    .stats-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .stat-card-modern {
        background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 1.5rem;
        text-align: center;
        transition: all 0.2s ease;
        position: relative;
        overflow: hidden;
    }

    .stat-card-modern::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: var(--accent);
    }

    .stat-card-modern:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(201, 169, 97, 0.2);
    }

    .stat-primary::before { background: #007bff; }
    .stat-success::before { background: #28a745; }
    .stat-info::before { background: #17a2b8; }
    .stat-warning::before { background: #ffc107; }

    .stat-icon {
        font-size: 2rem;
        color: var(--accent);
        margin-bottom: 0.5rem;
        opacity: 0.8;
    }

    .stat-value {
        font-size: 1.75rem;
        font-weight: 700;
        color: var(--text-primary);
        margin-bottom: 0.25rem;
    }

    .stat-label {
        font-size: 0.875rem;
        color: var(--text-secondary);
        font-weight: 500;
    }

    /* Sections */
    .section-modern {
        margin-bottom: 2rem;
    }

    .section-title-small {
        font-size: 1rem;
        font-weight: 600;
        color: var(--accent);
        margin-bottom: 1rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    /* Collaborators List */
    .collaborators-list {
        background: var(--bg-secondary);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        overflow: hidden;
    }

    .collaborator-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
        border-bottom: 1px solid var(--border);
        transition: background 0.2s ease;
    }

    .collaborator-item:last-child {
        border-bottom: none;
    }

    .collaborator-item:hover {
        background: rgba(255, 255, 255, 0.05);
    }

    .collaborator-info {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .rank-badge {
        width: 1.5rem;
        height: 1.5rem;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.75rem;
        font-weight: 700;
    }

    .rank-gold {
        background: #FFD700;
        color: #333;
    }

    .rank-silver {
        background: #C0C0C0;
        color: #333;
    }

    .rank-bronze {
        background: #CD7F32;
        color: white;
    }

    .collaborator-name {
        color: var(--text-primary);
        font-weight: 500;
    }

    .session-count {
        background: var(--accent);
        color: var(--bg-primary);
        padding: 0.25rem 0.75rem;
        border-radius: 1rem;
        font-size: 0.875rem;
        font-weight: 600;
    }

    /* Sessions List */
    .sessions-list {
        background: var(--bg-secondary);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        overflow: hidden;
    }

    .session-item {
        padding: 1rem;
        border-bottom: 1px solid var(--border);
        transition: background 0.2s ease;
    }

    .session-item:last-child {
        border-bottom: none;
    }

    .session-item:hover {
        background: rgba(255, 255, 255, 0.05);
    }

    .session-title {
        color: var(--text-primary);
        font-size: 1rem;
        font-weight: 600;
        margin-bottom: 0.25rem;
    }

    .session-date {
        color: var(--text-muted);
        font-size: 0.875rem;
    }

    /* Alert Styles */
    .alert-modern {
        padding: 1rem;
        border-radius: var(--radius);
        border: 1px solid;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .alert-error {
        background: rgba(220, 53, 69, 0.1);
        border-color: rgba(220, 53, 69, 0.3);
        color: #f8d7da;
    }
/* Badge styles */
.badge {
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
}

.bg-secondary {
    background-color: var(--bg-secondary) !important;
}

.bg-info {
    background-color: #17a2b8 !important;
}

/* Dropdown styles */
.x-menu {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 20px var(--shadow);
}

.dropdown-item-x {
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-item-x:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.dropdown-item-x.text-danger {
    color: #dc3545 !important;
}

.dropdown-item-x.text-danger:hover {
    background: rgba(220, 53, 69, 0.1);
}

.dropdown-item-x i {
    width: 20px;
    text-align: center;
}

.dropdown-divider {
    border-color: var(--border);
}
/* Text colors */
.text-muted {
    color: var(--text-muted) !important;
}

.text-danger {
    color: #dc3545 !important;
}
    /* Responsive adjustments for modal */
    @media (max-width: 768px) {
        .stats-grid {
            grid-template-columns: 1fr 1fr;
            gap: 0.75rem;
        }

        .stat-card-modern {
            padding: 1rem;
        }

        .stat-icon {
            font-size: 1.5rem;
        }

        .stat-value {
            font-size: 1.5rem;
        }

        .modal-dialog {
            margin: 1rem;
        }

        .modal-header-modern,
        .modal-body-modern,
        .modal-footer-modern {
            padding: 1rem;
        }
    }

    @media (max-width: 480px) {
        .stats-grid {
            grid-template-columns: 1fr;
        }

        .collaborator-item,
        .session-item {
            padding: 0.75rem;
        }

        .modal-footer-modern {
            flex-direction: column;
        }

        .modal-footer-modern .btn-modern {
            width: 100%;
        }
    }
    .btn-modern:focus,
    .form-control-modern:focus,
    .btn-search:focus,
    .btn-reset:focus {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
    }

    /* Performance optimizations */
    .navbar-modern {
        will-change: transform;
    }

    /* Reduced motion for accessibility */
    @media (prefers-reduced-motion: reduce) {
        *,
        *::before,
        *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }