/* الأنماط العامة */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', 'Cairo', sans-serif;
    background: #f5f7fa;
    color: #2c3e50;
    line-height: 1.6;
}

/* تنسيق الجداول */
.table-container {
    overflow-x: auto;
    border-radius: 12px;
    margin-top: 20px;
}

.table {
    margin-bottom: 0;
}

    .table th {
        background: #f8fafc;
        font-weight: 600;
        color: #1a3a5f;
        border-bottom: 2px solid #e2e8f0;
        padding: 15px;
        white-space: nowrap;
    }

    .table td {
        padding: 15px;
        vertical-align: middle;
        border-bottom: 1px solid #e2e8f0;
    }

.table-hover tbody tr:hover {
    background: #f8fafc;
}

/* البطاقات */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

    .card:hover {
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    }

.card-header {
    background: white;
    border-bottom: 1px solid #eef2f6;
    padding: 20px;
    border-radius: 16px 16px 0 0 !important;
}

    .card-header h3 {
        margin: 0;
        font-weight: 700;
        color: #1a3a5f;
        font-size: 1.25rem;
    }

.card-body {
    padding: 20px;
}

/* الأزرار */
.btn {
    border-radius: 10px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #1a3a5f 0%, #2c5a7a 100%);
    border: none;
}

    .btn-primary:hover {
        background: linear-gradient(135deg, #2c5a7a 0%, #1a3a5f 100%);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(26, 58, 95, 0.3);
    }

.btn-success {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, #e67e22 0%, #f39c12 100%);
    border: none;
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
    border: none;
}

/* الشارات */
.badge {
    padding: 6px 12px;
    border-radius: 30px;
    font-weight: 500;
    font-size: 12px;
}

/* النماذج */
.form-control, .form-select {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: 12px 15px;
    font-size: 14px;
    transition: all 0.2s;
}

    .form-control:focus, .form-select:focus {
        border-color: #e67e22;
        box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.1);
    }

.form-label {
    font-weight: 600;
    color: #1a3a5f;
    margin-bottom: 8px;
}

/* التنبيهات */
.alert {
    border: none;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
}

/* صفحة تسجيل الدخول والتسجيل */
.auth-box .form-control {
    background: #f8fafc;
}

.auth-box .btn {
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
}

/* الطباعة */
@media print {
    .app-header,
    .custom-sidebar,
    .toggle-menu,
    .app-footer,
    .breadcrumb-nav,
    .btn {
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }

    .page-content {
        box-shadow: none;
        padding: 0;
    }
}
/* ======= القائمة الجانبية */
:root {
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;
    --header-height: 70px;
    --primary-color: #1a3a5f;
    --accent-color: #e67e22;
    --bg-gradient: linear-gradient(135deg, #1a3a5f 0%, #2c5a7a 100%);
    --text-light: #ffffff;
    --text-dark: #2c3e50;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== الهيدر ========== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-gradient);
    box-shadow: var(--shadow-md);
    z-index: 1040;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-link {
    display: flex;
    align-items: center;
}

.logo-image {
    height: 45px;
    width: auto;
    filter: brightness(0) invert(1);
}

.system-version {
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    background: rgba(255,255,255,0.1);
    padding: 4px 10px;
    border-radius: 20px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    color: var(--text-light);
    font-size: 20px;
    border-radius: 12px;
    transition: var(--transition);
    text-decoration: none;
}

    .header-icon:hover {
        background: rgba(255,255,255,0.15);
        color: var(--text-light);
    }

.notification-badge,
.chat-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #e74c3c;
    color: white;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid var(--primary-color);
}

/* القائمة المنسدلة للإشعارات */
.notification-wrapper {
    position: relative;
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 360px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1050;
}

    .notification-dropdown.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

.notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

    .notification-header h6 {
        margin: 0;
        font-weight: 700;
        color: var(--text-dark);
    }

.notification-body {
    max-height: 350px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px 20px;
    border-bottom: 1px solid #f5f5f5;
    transition: var(--transition);
    cursor: pointer;
}

    .notification-item:hover {
        background: #f8f9fa;
    }

    .notification-item.unread {
        background: #e8f4fd;
    }

    .notification-item i {
        font-size: 20px;
        margin-top: 3px;
    }

.notification-content p {
    margin: 0 0 5px;
    font-size: 14px;
    color: var(--text-dark);
}

.notification-content small {
    color: #999;
    font-size: 12px;
}

.notification-footer {
    padding: 12px 20px;
    text-align: center;
    border-top: 1px solid #eee;
}

    .notification-footer a {
        color: var(--accent-color);
        text-decoration: none;
        font-size: 14px;
        font-weight: 500;
    }

/* القائمة المنسدلة للملف الشخصي */
.user-profile-wrapper {
    position: relative;
}

    .user-profile-wrapper .header-icon {
        width: auto;
        padding: 0 15px;
        gap: 8px;
    }

.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 280px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1050;
}

    .profile-dropdown.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

.profile-header {
    padding: 25px 20px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

    .profile-header i {
        color: var(--primary-color);
        margin-bottom: 10px;
    }

    .profile-header h6 {
        margin: 10px 0 5px;
        font-weight: 700;
        color: var(--text-dark);
    }

    .profile-header small {
        color: #999;
    }

.profile-body {
    padding: 10px 0;
}

    .profile-body a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 20px;
        color: var(--text-dark);
        text-decoration: none;
        transition: var(--transition);
    }

        .profile-body a:hover {
            background: #f8f9fa;
            color: var(--accent-color);
            padding-right: 25px;
        }

.profile-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

    .logout-btn:hover {
        background: #dc2626;
        color: white;
    }

/* ========== زر تبديل القائمة ========== */
.toggle-menu {
    position: fixed;
    top: calc(var(--header-height) + 15px);
    right: calc(var(--sidebar-width) - 15px);
    width: 32px;
    height: 32px;
    background: white;
    border: none;
    border-radius: 50%;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    z-index: 1030;
}

    .toggle-menu:hover {
        transform: scale(1.1);
        background: var(--accent-color);
        color: white;
    }

    .toggle-menu i {
        font-size: 14px;
        transition: transform 0.3s ease;
    }

.sidebar-collapsed .toggle-menu {
    right: calc(var(--sidebar-collapsed-width) - 15px);
}

    .sidebar-collapsed .toggle-menu i {
        transform: rotate(180deg);
    }

/* ========== القائمة الجانبية ========== */
.custom-sidebar {
    position: fixed;
    top: var(--header-height);
    right: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
    z-index: 1020;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-collapsed .custom-sidebar {
    width: var(--sidebar-collapsed-width);
}

/* شريط التمرير المخصص */
.custom-sidebar::-webkit-scrollbar {
    width: 5px;
}

.custom-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-sidebar::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
}

    .custom-sidebar::-webkit-scrollbar-thumb:hover {
        background: rgba(0,0,0,0.3);
    }

/* قائمة العناصر */
.sidebar-menu {
    list-style: none;
    padding: 20px 0;
    margin: 0;
}

.menu-item {
    position: relative;
    margin: 5px 0;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: var(--text-dark);
    text-decoration: none;
    transition: var(--transition);
    border-right: 4px solid transparent;
    position: relative;
    white-space: nowrap;
}

    .menu-link i:first-child {
        width: 24px;
        font-size: 20px;
        text-align: center;
        margin-left: 15px;
        color: var(--accent-color);
        transition: var(--transition);
    }

.menu-text {
    flex: 1;
    font-weight: 500;
    font-size: 15px;
    transition: var(--transition);
}

.submenu-arrow {
    font-size: 12px;
    color: #999;
    transition: transform 0.3s ease;
    margin-right: 5px;
}

.menu-item.open .submenu-arrow {
    transform: rotate(-90deg);
}

.menu-link:hover {
    background: rgba(230, 126, 34, 0.08);
    border-right-color: var(--accent-color);
    padding-right: 25px;
}

    .menu-link:hover i:first-child {
        color: var(--accent-color);
        transform: scale(1.1);
    }

.menu-link.active {
    background: linear-gradient(90deg, rgba(230,126,34,0.12) 0%, rgba(230,126,34,0.04) 100%);
    border-right-color: var(--accent-color);
    color: var(--accent-color);
}

    .menu-link.active i:first-child {
        color: var(--accent-color);
    }

/* القوائم الفرعية */
.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background: rgba(0,0,0,0.02);
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.menu-item.open .submenu {
}

.submenu li {
    margin: 0;
}

.submenu a {
    display: flex;
    align-items: center;
    padding: 12px 20px 12px 65px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
    border-right: 3px solid transparent;
}

    .submenu a i {
        width: 20px;
        margin-left: 12px;
        font-size: 14px;
        color: #999;
    }

    .submenu a:hover {
        background: rgba(230, 126, 34, 0.06);
        color: var(--accent-color);
        border-right-color: var(--accent-color);
        padding-right: 70px;
    }

        .submenu a:hover i {
            color: var(--accent-color);
        }

/* حالة القائمة المغلقة */
.sidebar-collapsed .menu-text,
.sidebar-collapsed .submenu-arrow {
    opacity: 0;
    visibility: hidden;
    width: 0;
}

.sidebar-collapsed .menu-link {
    justify-content: center;
    padding: 14px 0;
}

    .sidebar-collapsed .menu-link i:first-child {
        margin-left: 0;
        font-size: 22px;
    }

.sidebar-collapsed .has-submenu .submenu {
    position: absolute;
    right: 100%;
    top: 0;
    width: 220px;
    background: white;
    box-shadow: var(--shadow-lg);
    border-radius: 0 12px 12px 0;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.sidebar-collapsed .has-submenu:hover .submenu {
    opacity: 1;
    visibility: visible;
}

.sidebar-collapsed .submenu a {
    padding: 12px 20px;
}

/* ========== المحتوى الرئيسي ========== */
.main-content {
    margin-top: var(--header-height);
    margin-right: var(--sidebar-width);
    min-height: calc(100vh - var(--header-height));
    background: #f5f7fa;
    transition: var(--transition);
    padding: 20px;
}

.sidebar-collapsed ~ .main-content {
    margin-right: var(--sidebar-collapsed-width);
}

.content-wrapper {
    max-width: 1400px;
    margin: 0 auto;
}

/* Breadcrumb */
.breadcrumb-nav {
    margin-bottom: 20px;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item {
    font-size: 14px;
}

    .breadcrumb-item a {
        color: var(--accent-color);
        text-decoration: none;
    }

    .breadcrumb-item.active {
        color: #666;
    }

/* Page Content */
.page-content {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: var(--shadow-sm);
}

/* ========== الفوتر ========== */
.app-footer {
    margin-top: 30px;
    padding: 20px 0;
    color: #666;
    font-size: 14px;
}

/* ========== صفحة المصادقة ========== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a3a5f 0%, #2c5a7a 50%, #1a3a5f 100%);
    padding: 20px;
}

.auth-box {
    width: 100%;
    max-width: 480px;
    background: white;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

    .auth-logo img {
        height: 70px;
        margin-bottom: 15px;
    }

    .auth-logo h3 {
        color: var(--primary-color);
        font-weight: 700;
    }

/* ========== Loading Spinner ========== */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.spinner-content {
    background: white;
    padding: 30px 50px;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

    .spinner-content p {
        margin: 15px 0 0;
        color: var(--text-dark);
        font-weight: 500;
    }

/* ========== Responsive ========== */
@media (max-width: 992px) {
    .custom-sidebar {
        transform: translateX(100%);
        box-shadow: var(--shadow-lg);
    }

    .sidebar-collapsed .custom-sidebar {
        transform: translateX(0);
        width: var(--sidebar-width);
    }

    .main-content {
        margin-right: 0 !important;
    }

    .toggle-menu {
        right: 15px;
    }

    .sidebar-collapsed .toggle-menu {
        right: calc(var(--sidebar-width) - 15px);
    }

    .sidebar-collapsed .menu-text,
    .sidebar-collapsed .submenu-arrow {
        opacity: 1;
        visibility: visible;
        width: auto;
    }

    .sidebar-collapsed .menu-link {
        justify-content: flex-start;
        padding: 14px 20px;
    }

        .sidebar-collapsed .menu-link i:first-child {
            margin-left: 15px;
        }
}

@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }

    .app-header {
        padding: 0 10px;
    }

    .logo-image {
        height: 35px;
    }

    .system-version {
        display: none;
    }

    .user-profile-wrapper .header-icon span {
        display: none;
    }

    .header-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .page-content {
        padding: 15px;
    }

    .notification-dropdown {
        width: 300px;
        left: -100px;
    }
}

@media (max-width: 480px) {
    .auth-box {
        padding: 25px 20px;
    }

    .notification-dropdown {
        width: 280px;
        left: -150px;
    }
}

/* ========== Animations ========== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.menu-item {
    animation: slideIn 0.3s ease forwards;
}

    .menu-item:nth-child(1) {
        animation-delay: 0.05s;
    }

    .menu-item:nth-child(2) {
        animation-delay: 0.1s;
    }

    .menu-item:nth-child(3) {
        animation-delay: 0.15s;
    }

    .menu-item:nth-child(4) {
        animation-delay: 0.2s;
    }

    .menu-item:nth-child(5) {
        animation-delay: 0.25s;
    }

    .menu-item:nth-child(6) {
        animation-delay: 0.3s;
    }

    .menu-item:nth-child(7) {
        animation-delay: 0.35s;
    }

    .menu-item:nth-child(8) {
        animation-delay: 0.4s;
    }


/* تحسينات التصميم */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    width: 100%;
    max-width: 460px;
    padding: 0 15px;
}

.login-logo a {
    color: #fff;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.2);
    font-size: 2rem;
    font-weight: 700;
    text-decoration: none;
}

.login-logo h4 {
    color: rgba(255,255,255,0.9);
    margin-top: 10px;
    font-weight: 400;
    font-size: 1.2rem;
}

.card {
    border: none;
    border-radius: 20px;
    overflow: hidden;
}

.login-card-body {
    padding: 2rem;
}

.login-box-msg {
    font-size: 1.1rem;
    margin-bottom: 1.8rem;
    color: #555;
    font-weight: 500;
    text-align: center;
}

/* تحسين الحقول */
.input-group-text {
    background-color: #f8f9fc;
    border: 1px solid #ced4da;
    border-left: none;
    transition: all 0.2s;
}

.form-control {
    border-right: none;
    border-left: 1px solid #ced4da;
    padding: 0.75rem 1rem;
    font-size: 1rem;
}

    .form-control:focus {
        border-color: #667eea;
        box-shadow: none;
    }

        .form-control:focus + .input-group-append .input-group-text {
            border-color: #667eea;
            color: #667eea;
        }

/* زر الدخول */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: transform 0.2s, box-shadow 0.2s;
}

    .btn-primary:hover {
        background: linear-gradient(135deg, #5a6fd8 0%, #6a4290 100%);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(102,126,234,0.4);
    }

    .btn-primary:active {
        transform: translateY(0);
    }

/* checkbox */
.icheck-primary input[type="checkbox"]:checked + label::before {
    background-color: #667eea;
    border-color: #667eea;
}

/* روابط */
a {
    color: #667eea;
    transition: color 0.2s;
}

    a:hover {
        color: #5a6fd8;
        text-decoration: none;
    }

/* تحسين الأزرار الاجتماعية */
.social-auth-links button {
    transition: all 0.2s;
}

    .social-auth-links button:hover {
        transform: scale(1.05);
    }

/* أنيميشن */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate__fadeInUp {
    animation: fadeInUp 0.6s ease-out;
}

/* رسائل الخطأ */
.alert-danger {
    background-color: #f8d7da;
    border-right: 4px solid #dc3545;
    border-radius: 10px;
    font-size: 0.9rem;
}


/* ========== قائمة المحادثات ========== */
.conversation-wrapper {
    position: relative;
}

.conversation-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 360px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1050;
}

    .conversation-dropdown.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

.conversation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

    .conversation-header h6 {
        margin: 0;
        font-weight: 700;
        color: var(--text-dark);
    }

.conversation-body {
    max-height: 400px;
    overflow-y: auto;
}

.conversation-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px 20px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: var(--transition);
}

    .conversation-item:hover {
        background: #f8f9fa;
    }

    .conversation-item.unread {
        background: #e8f4fd;
    }

.conversation-avatar {
    position: relative;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.unread-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    font-size: 11px;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid white;
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

    .conversation-title span {
        font-weight: 600;
        color: var(--text-dark);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .conversation-title small {
        color: #999;
        font-size: 11px;
    }

.conversation-last-message {
    color: #666;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-footer {
    padding: 12px 20px;
    text-align: center;
    border-top: 1px solid #eee;
}

    .conversation-footer a {
        color: var(--accent-color);
        text-decoration: none;
        font-size: 14px;
        font-weight: 500;
    }

.conversation-loading,
.conversation-empty,
.notification-loading,
.notification-empty {
    padding: 30px;
    text-align: center;
    color: #999;
}

/* ========== الإشعارات ========== */
.notification-actions {
    display: flex;
    gap: 10px;
}

    .notification-actions .btn-link {
        color: var(--accent-color);
        text-decoration: none;
        font-size: 13px;
        padding: 0;
    }

.unread-dot {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
}

/* ========== رسائل المحادثة ========== */
.message {
    display: flex;
    margin-bottom: 15px;
}

.message-in {
    justify-content: flex-start;
}

.message-out {
    justify-content: flex-end;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 16px;
    position: relative;
}

.message-in .message-content {
    background: #f0f2f5;
    border-top-right-radius: 4px;
}

.message-out .message-content {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border-top-left-radius: 4px;
}

.message-sender {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--primary-color);
}

.message-text {
    word-wrap: break-word;
}

    .message-text a {
        color: inherit;
        text-decoration: underline;
    }

.message-time {
    font-size: 11px;
    margin-top: 4px;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 5px;
}

.message-out .message-time {
    justify-content: flex-end;
}

.message-system {
    text-align: center;
    margin: 15px 0;
}

    .message-system span {
        background: #e9ecef;
        padding: 5px 15px;
        border-radius: 20px;
        font-size: 12px;
        color: #666;
    }

/* ========== مؤشر الكتابة ========== */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: #f0f2f5;
    border-radius: 20px;
    font-size: 13px;
    color: #666;
}

.typing-dots span {
    animation: typing 1.4s infinite;
    opacity: 0;
}

    .typing-dots span:nth-child(1) {
        animation-delay: 0s;
    }

    .typing-dots span:nth-child(2) {
        animation-delay: 0.2s;
    }

    .typing-dots span:nth-child(3) {
        animation-delay: 0.4s;
    }

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0;
    }

    30% {
        opacity: 1;
    }
}

/* ========== حالة الاتصال ========== */
.online-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.online-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
}

    .online-status-dot.online {
        background: #27ae60;
    }

    .online-status-dot.offline {
        background: #95a5a6;
    }

.profile-avatar {
    position: relative;
    display: inline-block;
}

.user-role-badge {
    margin-top: 8px;
}

    .user-role-badge .badge {
        font-size: 11px;
        padding: 4px 8px;
    }

.chart-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    height: 100%;
    display: flex;
    flex-direction: column;
}

    .chart-card h6 {
        color: #1a3a5f;
        font-weight: 700;
        margin-bottom: 15px;
        flex-shrink: 0;
    }

.chart-container {
    position: relative;
    flex: 1;
    min-height: 200px;
    max-height: 200px;
    width: 100%;
}

    .chart-container canvas {
        width: 100% !important;
        height: 100% !important;
        max-height: 300px;
    }
.brand-icon {
    width:40px;
    height:40px;
    background: linear-gradient(135deg, #1a3a5c, #0b1c2f);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #ddd;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

    .brand-icon i {
        font-size: 20px;
        color: #fff;
    }

@media (max-height: 600px) and (orientation: landscape) {
    body {
        align-items: flex-start;
        padding: 15px;
    }

    .login-card {
        padding: 20px;
    }

    .brand-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 15px;
    }

        .brand-icon i {
            font-size: 25px;
        }

    .brand-title {
        font-size: 20px;
        margin-bottom: 0;
    }

    .form-group {
        margin-bottom: 15px;
    }

    .form-control {
        height: 45px;
    }

    .divider {
        margin: 20px 0;
    }
}


.profile-avatar-container {
    display: flex;
    justify-content: center;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #f0f0f0;
}

.profile-avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a3a5f, #e67e22);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: bold;
}

/* ========== قائمة الإشعارات المنسدلة ========== */
.notification-wrapper {
    position: relative;
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 380px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1060;
}

    .notification-dropdown.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

.notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
}

    .notification-header h6 {
        margin: 0;
        font-weight: 700;
        color: #1a3a5f;
    }

    .notification-header .btn-link {
        color: #e67e22;
        text-decoration: none;
        font-size: 13px;
        padding: 0;
    }

.notification-body {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px 20px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

    .notification-item:hover {
        background: #f8f9fa;
    }

    .notification-item.unread {
        background: #e8f4fd;
    }

    .notification-item i {
        font-size: 20px;
        margin-top: 2px;
        width: 24px;
        text-align: center;
    }

.notification-content {
    flex: 1;
    min-width: 0;
}

    .notification-content p {
        margin: 0 0 5px;
        font-size: 14px;
        color: #333;
        line-height: 1.4;
    }

    .notification-content small {
        color: #999;
        font-size: 12px;
    }

.unread-dot {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #e67e22;
    border-radius: 50%;
}

.notification-footer {
    padding: 12px 20px;
    text-align: center;
    border-top: 1px solid #f0f0f0;
}

    .notification-footer a {
        color: #e67e22;
        text-decoration: none;
        font-size: 14px;
        font-weight: 500;
    }

        .notification-footer a:hover {
            text-decoration: underline;
        }

/* ========== شارة الإشعارات ========== */
.notification-badge,
.chat-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #e74c3c;
    color: white;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid white;
}


/* تحسينات القائمة الجانبية */
.custom-sidebar {
    transition: width 0.3s ease;
}

    .custom-sidebar.collapsed {
        width: 70px;
    }

/* القوائم الفرعية */
.submenu {
    display: none;
    overflow: hidden;
}

.has-submenu.open > .submenu {
    display: block;
}

/* القائمة النشطة */
.menu-link.active {
    background: rgba(26, 58, 95, 0.1) !important;
    color: #1a3a5f !important;
    font-weight: 600;
}

.submenu a.active {
    background: rgba(26, 58, 95, 0.05);
    color: #1a3a5f;
    font-weight: 600;
    border-right: 3px solid #1a3a5f;
}

/* أيقونة السهم */
.submenu-arrow {
    transition: transform 0.3s ease;
    margin-right: auto;
}

.has-submenu.open .submenu-arrow {
    transform: rotate(-90deg);
}

/* Tooltip للقائمة المصغرة */
.sidebar-collapsed .menu-link {
    justify-content: center;
    padding: 12px;
}

.sidebar-collapsed .menu-text,
.sidebar-collapsed .submenu-arrow,
.sidebar-collapsed .badge {
    display: none;
}

.sidebar-collapsed .has-submenu:hover .submenu {
    display: block;
    position: absolute;
    right: 70px;
    top: 0;
    background: white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border-radius: 8px;
    min-width: 200px;
    z-index: 1000;
}