/* =================================================================================
 * VUEXY BASE CUSTOM STYLES - UNIFIED FILE
 * جميع التصميمات المخصصة في ملف واحد
 * ================================================================================= */

/* =================================================================================
 * GLOBAL BUTTON REFLECTION EFFECT - تأثير الانعكاس على جميع الأزرار
 * ================================================================================= */
/* Base setup for all buttons */
.btn:not(.btn-link),
.wallet-btn {
    position: relative !important;
    overflow: hidden !important;
}

/* Hover interactions - Global lift and brightness */
.btn:not(.btn-link):hover,
.wallet-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    filter: brightness(1.1) !important;
}

/* Reflection glare layer for all buttons */
.btn:not(.btn-link)::after,
.wallet-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg,
            transparent,
            rgba(255, 255, 255, 0.1),
            transparent);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 1;
}

/* Trigger glare on hover */
.btn:not(.btn-link):hover::after,
.wallet-btn:hover::after {
    left: 100%;
}

/* Active State */
.btn:not(.btn-link):active,
.wallet-btn:active {
    transform: translateY(0) !important;
    filter: brightness(0.9) !important;
}

/* =================================================================================
 * GLOBAL CARD REFLECTION EFFECT - تأثير الانعكاس على الكروت
 * ================================================================================= */
.stats-card,
.card.filter-card,
.card.user-type-filter-card {
    position: relative !important;
    overflow: hidden !important;
}

.stats-card::after,
.card.filter-card::after,
.card.user-type-filter-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 150%;
    height: 100%;
    background: linear-gradient(120deg,
            transparent,
            rgba(255, 255, 255, 0.15),
            transparent);
    transition: all 0.7s ease-in-out;
    pointer-events: none;
    z-index: 99;
}

.stats-card:hover::after,
.card.filter-card:hover::after,
.card.user-type-filter-card:hover::after {
    left: 150%;
}

/* =================================================================================
 * GLOBAL OUTLINE TO FILLED TRANSFORMATION
 * تحويل جميع الأزرار ذات الإطار إلى أزرار ممتلئة تلقائياً
 * ================================================================================= */
.btn-outline-primary {
    background-color: #7367f0 !important;
    color: #fff !important;
    border-color: #7367f0 !important;
}

.btn-outline-secondary {
    background-color: #a8aaae !important;
    color: #fff !important;
    border-color: #a8aaae !important;
}

.btn-outline-success {
    background-color: #28c76f !important;
    color: #fff !important;
    border-color: #28c76f !important;
}

.btn-outline-danger {
    background-color: #ea5455 !important;
    color: #fff !important;
    border-color: #ea5455 !important;
}

.btn-outline-warning {
    background-color: #ff9f43 !important;
    color: #fff !important;
    border-color: #ff9f43 !important;
}

.btn-outline-info {
    background-color: #00cfe8 !important;
    color: #fff !important;
    border-color: #00cfe8 !important;
}

.btn-outline-dark {
    background-color: #4b4b4b !important;
    color: #fff !important;
    border-color: #4b4b4b !important;
}

/* Global hover background persistence - Prevents white hover */
.btn-primary:hover,
.btn-outline-primary:hover {
    background-color: #7367f0 !important;
}

.btn-secondary:hover,
.btn-outline-secondary:hover {
    background-color: #a8aaae !important;
}

.btn-success:hover,
.btn-outline-success:hover {
    background-color: #28c76f !important;
}

.btn-danger:hover,
.btn-outline-danger:hover {
    background-color: #ea5455 !important;
}

.btn-warning:hover,
.btn-outline-warning:hover {
    background-color: #ff9f43 !important;
}

.btn-info:hover,
.btn-outline-info:hover {
    background-color: #00cfe8 !important;
}

.btn-dark:hover,
.btn-outline-dark:hover {
    background-color: #4b4b4b !important;
}

/* Fix for btn-label-* hover states to prevent them turning solid/white */
.btn-label-primary:hover {
    background-color: #eae8fd !important;
    /* Keep light background */
    color: #7367f0 !important;
    /* Keep primary text */
}

.btn-label-secondary:hover {
    background-color: #f2f2f3 !important;
    color: #a8aaae !important;
}

.btn-label-success:hover {
    background-color: #eafbf1 !important;
    color: #28c76f !important;
}

.btn-label-danger:hover {
    background-color: #fceceb !important;
    color: #ea5455 !important;
}

.btn-label-warning:hover {
    background-color: #fff5e8 !important;
    color: #ff9f43 !important;
}

.btn-label-info:hover {
    background-color: #e5f9fb !important;
    color: #00cfe8 !important;
}

.btn-label-dark:hover {
    background-color: #edeeef !important;
    color: #4b4b4b !important;
}

/* Ensure text and icons in all buttons remain white on hover, EXCEPT label buttons */
.btn:not(.btn-link):not([class*="btn-label-"]):hover,
[class*="btn-outline-"]:hover,
[class*="btn-outline-"]:hover i,
[class*="btn-outline-"]:hover svg {
    color: #fff !important;
}

/* Ensure icons in transformed buttons are white by default */
[class*="btn-outline-"] i,
[class*="btn-outline-"] svg {
    color: #fff !important;
}

/* =================================================================================
 * DATATABLE & GLOBAL ACTION BUTTONS - High Specificity Color Fixes
 * ================================================================================= */
/* Base icon button style for all tables */
.table .btn-icon,
.datatables-table .btn-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    padding: 0.5rem !important;
    min-width: 32px !important;
    height: 32px !important;
    border-radius: 0.375rem !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.wallet-btn {
    color: #fff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    padding: 0.5rem !important;
    min-width: 32px !important;
    height: 32px !important;
    border-radius: 0.375rem !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* Force white icons ONLY for buttons with our custom backgrounds or specific color classes */
.table .btn-edit i,
.table .btn-view i,
.table .btn-delete i,
.table .btn-approve i,
.table .btn-reject i,
.table .btn-unblock i,
.table .btn-success.btn-icon i,
.table .btn-danger.btn-icon i,
.table .btn-secondary.btn-icon i,
.table .btn-primary.btn-icon i,
.table .btn-info.btn-icon i,
.datatables-table .btn-edit i,
.datatables-table .btn-view i,
.datatables-table .btn-delete i,
.wallet-btn i {
    color: #fff !important;
    font-size: 1.1rem !important;
}

/* Action button background colors - Applied globally to .btn-* class combinations */
.btn-approve,
.btn-unblock,
.btn-success.btn-icon,
.btn-reject,
.btn-danger.btn-icon.btn-reject,
.btn-delete,
.btn-danger.btn-icon.btn-delete,
.btn-outline-danger.btn-icon,
.btn-view,
.btn-secondary.btn-icon,
.wallet-btn,
.btn-info.btn-icon,
.btn-edit,
.btn-primary.btn-icon {
    color: #fff !important;
}

.btn-approve,
.btn-unblock,
.btn-success.btn-icon {
    background-color: #28c76f !important;
}

.btn-reject,
.btn-danger.btn-icon.btn-reject {
    background-color: #ff4c51 !important;
}

.btn-delete,
.btn-danger.btn-icon.btn-delete,
.btn-outline-danger.btn-icon {
    background-color: #ea5455 !important;
}

.btn-view,
.btn-secondary.btn-icon {
    background-color: #a8aaae !important;
}

/* Unified View/Edit color */
.wallet-btn,
.btn-info.btn-icon {
    background-color: #00cfe8 !important;
}

.btn-edit,
.btn-primary.btn-icon {
    background-color: #7367f0 !important;
}

/* Ensure colors persist on Row Hover for ALL tables - EXCEPT label buttons */
.table tr:hover .btn-icon:not([class*="btn-label-"]),
.table tr:hover .wallet-btn,
.datatables-table tr:hover .btn-icon:not([class*="btn-label-"]),
.datatables-table tr:hover .wallet-btn {
    opacity: 1 !important;
    color: #fff !important;
}

/* Label buttons should keep their original color on row hover */
.table tr:hover .btn-label-primary i {
    color: #7367f0 !important;
}

.table tr:hover .btn-label-success i {
    color: #28c76f !important;
}

.table tr:hover .btn-label-danger i {
    color: #ea5455 !important;
}

.table tr:hover .btn-label-warning i {
    color: #ff9f43 !important;
}

.table tr:hover .btn-label-info i {
    color: #00cfe8 !important;
}

.table tr:hover .btn-label-secondary i {
    color: #a8aaae !important;
}

/* Explicit Hover Backgrounds for action buttons */
.btn-edit:hover,
.btn-primary.btn-icon:hover {
    background-color: #5a4fcf !important;
}

/* Slightly darker on hover */
.btn-delete:hover,
.btn-danger.btn-icon:hover {
    background-color: #bd2130 !important;
}

.btn-success:hover,
.btn-icon.btn-success:hover {
    background-color: #23ad60 !important;
}

.btn-view:hover,
.btn-secondary.btn-icon:hover {
    background-color: #919191 !important;
}

/* Icon color retention on ALL hover states - Excluding Label Buttons */
.table tr:hover .btn-icon:not([class*="btn-label-"]) i,
.table tr:hover .btn-icon:not([class*="btn-label-"]) svg,
.datatables-table tr:hover .btn-icon:not([class*="btn-label-"]) i,
.datatables-table tr:hover .btn-icon:not([class*="btn-label-"]) svg,
.btn-icon:not([class*="btn-label-"]):hover i,
.btn-icon:not([class*="btn-label-"]):hover svg {
    color: #fff !important;
}

/* Explicit text color for label buttons on hover */
.btn-label-primary.btn-icon:hover i,
.btn-label-primary.btn-icon:hover svg {
    color: #7367f0 !important;
}

.btn-label-secondary.btn-icon:hover i,
.btn-label-secondary.btn-icon:hover svg {
    color: #a8aaae !important;
}

.btn-label-success.btn-icon:hover i,
.btn-label-success.btn-icon:hover svg {
    color: #28c76f !important;
}

.btn-label-danger.btn-icon:hover i,
.btn-label-danger.btn-icon:hover svg {
    color: #ea5455 !important;
}

.btn-label-warning.btn-icon:hover i,
.btn-label-warning.btn-icon:hover svg {
    color: #ff9f43 !important;
}

.btn-label-info.btn-icon:hover i,
.btn-label-info.btn-icon:hover svg {
    color: #00cfe8 !important;
}

.btn-label-dark.btn-icon:hover i,
.btn-label-dark.btn-icon:hover svg {
    color: #4b4b4b !important;
}

/* =================================================================================
 * DATATABLE TRUNCATE TEXT STYLING
 * ================================================================================= */
table.dataTable tbody td .text-truncate {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: help;
}

/* Tooltip styling for truncated text */
table.dataTable tbody td .text-truncate[title]:hover {
    position: relative;
}

/* Enhanced tooltip using CSS (fallback if Bootstrap tooltip not available) */
table.dataTable tbody td .text-truncate[title] {
    position: relative;
}

/* Dark mode support */
html.dark-style table.dataTable tbody td .text-truncate {
    color: #b4b7bd;
}

/* =================================================================================
 * 1. SWEETALERT2 MINIMAL STYLING
 * ================================================================================= */

/* تطبيق التصميم الأساسي فقط */
.swal2-popup {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 1.5rem !important;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.12) !important;
    font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Dark mode */
html.dark-style .swal2-popup {
    background: rgba(40, 48, 70, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

modal-footer {
    text-align: center !important;
}

/* العنوان */
.swal2-popup .swal2-title {
    color: #2b2c40 !important;
    font-size: 1.5rem !important;
    font-weight: 600 !important;
}

html.dark-style .swal2-popup .swal2-title {
    color: #d0d2d6 !important;
}

/* المحتوى */
.swal2-popup .swal2-html-container {
    color: #5d596c !important;
    font-size: 1rem !important;
    line-height: 1.6 !important;
}

html.dark-style .swal2-popup .swal2-html-container {
    color: #b4b7bd !important;
}

/* الأيقونة */
.swal2-popup .swal2-icon {
    width: 5rem !important;
    height: 5rem !important;
    margin: 1rem auto 1rem !important;
    border: none !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
}

.swal2-popup .swal2-icon::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, rgba(115, 103, 240, 0.1), rgba(115, 103, 240, 0.2)) !important;
    z-index: -1 !important;
}

.swal2-popup .swal2-icon-content {
    font-size: 2.5rem !important;
    font-weight: 700 !important;
    z-index: 1 !important;
    position: relative !important;
}

/* ألوان الأيقونات */
.swal2-popup .swal2-icon.swal2-warning .swal2-icon-content {
    color: #ff9f43 !important;
}

.swal2-popup .swal2-icon.swal2-warning::before {
    background: linear-gradient(135deg, rgba(255, 159, 67, 0.1), rgba(255, 159, 67, 0.2)) !important;
}

.swal2-popup .swal2-icon.swal2-success .swal2-icon-content {
    color: #28c76f !important;
}

.swal2-popup .swal2-icon.swal2-success::before {
    background: linear-gradient(135deg, rgba(40, 199, 111, 0.1), rgba(40, 199, 111, 0.2)) !important;
}

.swal2-popup .swal2-icon.swal2-error .swal2-icon-content {
    color: #ea5455 !important;
}

.swal2-popup .swal2-icon.swal2-error::before {
    background: linear-gradient(135deg, rgba(234, 84, 85, 0.1), rgba(234, 84, 85, 0.2)) !important;
}

.swal2-popup .swal2-icon.swal2-info .swal2-icon-content {
    color: #00cfe8 !important;
}

.swal2-popup .swal2-icon.swal2-info::before {
    background: linear-gradient(135deg, rgba(0, 207, 232, 0.1), rgba(0, 207, 232, 0.2)) !important;
}

.swal2-popup .swal2-icon.swal2-question .swal2-icon-content {
    color: #7367f0 !important;
}

.swal2-popup .swal2-icon.swal2-question::before {
    background: linear-gradient(135deg, rgba(115, 103, 240, 0.1), rgba(115, 103, 240, 0.2)) !important;
}

/* الأزرار */
.swal2-popup .swal2-styled,
.swal2-popup button[class*="swal2-"] {
    border-radius: 1rem !important;
    padding: 1rem 2rem !important;
    font-weight: 600 !important;
    font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: none !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    z-index: 999999 !important;
    position: relative !important;
    font-size: 1rem !important;
    letter-spacing: 0.025em !important;
    min-width: 8rem !important;
    overflow: hidden !important;
}

/* زر التأكيد */
.swal2-popup .swal2-styled.swal2-confirm {
    background: linear-gradient(135deg, #7367f0, #5a4fcf) !important;
    color: white !important;
    box-shadow: 0 4px 16px rgba(115, 103, 240, 0.4), 0 0 0 1px rgba(115, 103, 240, 0.1) !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 999999 !important;
    position: relative !important;
}

/* زر التأكيد - جميع الأنواع */
.swal2-popup .swal2-styled.swal2-confirm,
.swal2-popup .swal2-styled.swal2-accept,
.swal2-popup .swal2-styled.swal2-ok,
.swal2-popup button.swal2-confirm {
    background: linear-gradient(135deg, #7367f0, #5a4fcf) !important;
    color: white !important;
    box-shadow: 0 4px 16px rgba(115, 103, 240, 0.4), 0 0 0 1px rgba(115, 103, 240, 0.1) !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 999999 !important;
    position: relative !important;
}

.swal2-popup .swal2-styled.swal2-confirm::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1)) !important;
    border-radius: 1rem !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
}

.swal2-popup .swal2-styled.swal2-confirm:hover,
.swal2-popup .swal2-styled.swal2-accept:hover,
.swal2-popup .swal2-styled.swal2-ok:hover,
.swal2-popup button.swal2-confirm:hover {
    background: linear-gradient(135deg, #685dd8, #7367f0) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 32px rgba(115, 103, 240, 0.5), 0 0 0 1px rgba(115, 103, 240, 0.2) !important;
}

.swal2-popup .swal2-styled.swal2-confirm:hover::before {
    opacity: 1 !important;
}

.swal2-popup .swal2-styled.swal2-confirm:active,
.swal2-popup .swal2-styled.swal2-accept:active,
.swal2-popup .swal2-styled.swal2-ok:active,
.swal2-popup button.swal2-confirm:active {
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(115, 103, 240, 0.4) !important;
}

/* زر الإلغاء */
.swal2-popup .swal2-styled.swal2-cancel,
.swal2-popup .swal2-styled.swal2-deny,
.swal2-popup button.swal2-cancel,
.swal2-popup button.swal2-deny {
    background: rgba(255, 255, 255, 0.8) !important;
    color: #5d596c !important;
    border: 2px solid #e0e0e0 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 999999 !important;
    position: relative !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

.swal2-popup .swal2-styled.swal2-cancel::before,
.swal2-popup .swal2-styled.swal2-deny::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.02)) !important;
    border-radius: 1rem !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
}

html.dark-style .swal2-popup .swal2-styled.swal2-cancel,
html.dark-style .swal2-popup .swal2-styled.swal2-deny,
html.dark-style .swal2-popup button.swal2-cancel,
html.dark-style .swal2-popup button.swal2-deny {
    background: rgba(40, 48, 70, 0.8) !important;
    color: #b4b7bd !important;
    border: 2px solid #404656 !important;
}

html.dark-style .swal2-popup .swal2-styled.swal2-cancel::before,
html.dark-style .swal2-popup .swal2-styled.swal2-deny::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)) !important;
}

.swal2-popup .swal2-styled.swal2-cancel:hover,
.swal2-popup .swal2-styled.swal2-deny:hover,
.swal2-popup button.swal2-cancel:hover,
.swal2-popup button.swal2-deny:hover {
    background: rgba(248, 247, 250, 0.9) !important;
    color: #2b2c40 !important;
    border-color: #7367f0 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;
}

.swal2-popup .swal2-styled.swal2-cancel:hover::before,
.swal2-popup .swal2-styled.swal2-deny:hover::before {
    opacity: 1 !important;
}

html.dark-style .swal2-popup .swal2-styled.swal2-cancel:hover,
html.dark-style .swal2-popup .swal2-styled.swal2-deny:hover,
html.dark-style .swal2-popup button.swal2-cancel:hover,
html.dark-style .swal2-popup button.swal2-deny:hover {
    background: rgba(52, 61, 85, 0.9) !important;
    color: #d0d2d6 !important;
    border-color: #7367f0 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

.swal2-popup .swal2-styled.swal2-cancel:active,
.swal2-popup .swal2-styled.swal2-deny:active,
.swal2-popup button.swal2-cancel:active,
.swal2-popup button.swal2-deny:active {
    transform: translateY(0) !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1) !important;
}

/* خلفية الحاوية */
.swal2-container {
    background-color: rgba(0, 0, 0, 0.4) !important;
}

/* إصلاح مشكلة الأزرار */
.swal2-popup .swal2-actions {
    pointer-events: auto !important;
    z-index: 999999 !important;
    position: relative !important;
    gap: 1rem !important;
    margin-top: 2rem !important;
}

.swal2-popup {
    pointer-events: auto !important;
}

/* تأثيرات إضافية للأزرار */
.swal2-popup .swal2-styled {
    text-shadow: none !important;
    outline: none !important;
}

.swal2-popup .swal2-styled:focus {
    outline: 2px solid rgba(115, 103, 240, 0.5) !important;
    outline-offset: 2px !important;
}

/* تحسين النص داخل الأزرار */
.swal2-popup .swal2-styled span {
    position: relative !important;
    z-index: 1 !important;
}

/* Mobile responsive */
@media (max-width: 640px) {
    .swal2-popup {
        max-width: 95vw !important;
        margin: 1rem !important;
    }

    .swal2-popup .swal2-title {
        font-size: 1.25rem !important;
    }

    .swal2-popup .swal2-actions {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    .swal2-popup .swal2-styled {
        width: 100% !important;
    }

    .swal2-popup .swal2-icon {
        width: 4rem !important;
        height: 4rem !important;
    }

    .swal2-popup .swal2-icon-content {
        font-size: 2rem !important;
    }
}

/* =================================================================================
 * 2. MODAL BUTTON POSITION FIX
 * ================================================================================= */

/* إصلاح مشكلة موضع أزرار المودال */
.modal-footer {
    position: relative !important;
    z-index: 1050 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    /* center buttons always */
    gap: 0.75rem !important;
    padding: 1rem 1.5rem !important;
    border-top: 1px solid #e0e0e0 !important;
    background-color: #ffffff !important;
}

/* الوضع الداكن */
html.dark-style .modal-footer {
    background-color: #2f3349 !important;
    border-top: 1px solid #404656 !important;
}

/* أزرار المودال */
.modal-footer .btn {
    position: relative !important;
    z-index: 1051 !important;
    margin: 0 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* زر الحذف */
.modal-footer .btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
    color: white !important;
    border: none !important;
    border-radius: 0.5rem !important;
    padding: 0.75rem 1.5rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.modal-footer .btn-danger:hover {
    background: linear-gradient(135deg, #c82333, #bd2130) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3) !important;
}

/* زر الإلغاء */
.modal-footer .btn-secondary {
    background: #ffffff !important;
    color: #6c757d !important;
    border: 1px solid #d1d3d4 !important;
    border-radius: 0.5rem !important;
    padding: 0.75rem 1.5rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

html.dark-style .modal-footer .btn-secondary {
    background: #404656 !important;
    color: #b4b7bd !important;
    border: 1px solid #5d596c !important;
}

.modal-footer .btn-secondary:hover {
    background: #f8f9fa !important;
    color: #495057 !important;
    border-color: #adb5bd !important;
}

html.dark-style .modal-footer .btn-secondary:hover {
    background: #5d596c !important;
    color: #d0d2d6 !important;
}

/* التأكد من أن المودال نفسه لا يمنع النقر */
.modal-content {
    position: relative !important;
    z-index: 1050 !important;
}

.modal-dialog {
    position: relative !important;
    z-index: 1050 !important;
}

/* إصلاح مشكلة الـ backdrop */
.modal-backdrop {
    z-index: 1040 !important;
}

/* التأكد من أن الأزرار مرئية */
.modal-footer * {
    pointer-events: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* إصلاح مشكلة مودال الصورة */
#imageModal {
    z-index: 20000 !important;
    position: fixed !important;
}

#imageModal .modal-dialog {
    z-index: 20001 !important;
}

#imageModal .modal-content {
    z-index: 20002 !important;
}

#imageModal .modal-backdrop {
    z-index: 19999 !important;
}

/* التأكد من أن مودال الصورة يظهر فوق جميع المودالات الأخرى */
.modal.show+#imageModal,
#imageModal.modal.show {
    z-index: 20000 !important;
}

/* إصلاح مشكلة الـ backdrop للمودالات المتعددة */
.modal-backdrop.show {
    z-index: 1040 !important;
}

.modal-backdrop.show+.modal-backdrop.show {
    z-index: 1041 !important;
}

/* إصلاح خاص لمودال الصورة */
body>#imageModal {
    z-index: 20000 !important;
}

body>#imageModal .modal-dialog {
    z-index: 20001 !important;
}

body>#imageModal .modal-content {
    z-index: 20002 !important;
}

/* منع التكرار في النقر على الصور */
img.clicked {
    pointer-events: none !important;
    opacity: 0.7 !important;
    transition: opacity 0.3s ease !important;
}

/* تحسين عرض الصور في المودال */
#imageModal img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
}

/* تأثيرات تفاعلية للصور */
.view-image {
    transition: all 0.3s ease !important;
}

.view-image:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

/* =================================================================================
 * 3. MODAL FIX SYSTEM
 * ================================================================================= */

/* إعدادات الـ z-index للمودالات */
.modal-backdrop {
    z-index: 1040 !important;
}

.modal {
    z-index: 1050 !important;
}

/* مودال الصورة - أعلى مستوى من الـ header */
#imageModal {
    z-index: 9999 !important;
    /* أعلى من الـ header */
}

#imageModal .modal-dialog {
    z-index: 10000 !important;
}

#imageModal .modal-content {
    z-index: 10001 !important;
}

/* التأكد من أن الـ header لا يتداخل مع المودالات */
.navbar-fixed-top {
    z-index: 1030 !important;
}

.layout-navbar-fixed .layout-navbar {
    z-index: 1030 !important;
}

/* منع التداخل في الخلفية المظلمة */
body.modal-open {

    overflow: hidden !important;
    padding-right: 0 !important;
}

/* تحسين مظهر مودال الصورة - صورة دائرية */
#imageModal .modal-body img {
    max-width: 300px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease-in-out;
    display: block;
    margin: 0 auto;
}

#imageModal .modal-body img:hover {
    transform: scale(1.02);
}

/* خلفية مودال الصورة مثل المودالات الأخرى */
#imageModal .modal-content {
    background: #ffffff !important;
    border: none !important;
}

html.dark-style #imageModal .modal-content,
html[data-theme="dark"] #imageModal .modal-content,
html[data-bs-theme="dark"] #imageModal .modal-content {
    background: #2f3349 !important;
}

/* خلفية الهيدر مثل خلفية المودال */
#imageModal .modal-header {
    background: #ffffff !important;
    border-bottom: 1px solid #e0e0e0 !important;
}

html.dark-style #imageModal .modal-header,
html[data-theme="dark"] #imageModal .modal-header,
html[data-bs-theme="dark"] #imageModal .modal-header {
    background: #2f3349 !important;
    border-bottom: 1px solid #404656 !important;
}

/* زر الإغلاق بخلفية مثل المودال */
#imageModal .modal-header .btn-close {
    background-color: #ffffff !important;
    opacity: 1 !important;
}

html.dark-style #imageModal .modal-header .btn-close,
html[data-theme="dark"] #imageModal .modal-header .btn-close,
html[data-bs-theme="dark"] #imageModal .modal-header .btn-close {
    background-color: #2f3349 !important;
}

/* خلفية الفوتر مثل المودال */
#imageModal .modal-footer {
    background: #ffffff !important;
    border-top: 1px solid #e0e0e0 !important;
}

html.dark-style #imageModal .modal-footer,
html[data-theme="dark"] #imageModal .modal-footer,
html[data-bs-theme="dark"] #imageModal .modal-footer {
    background: #2f3349 !important;
    border-top: 1px solid #404656 !important;
}

/* منع تكرار الصور في المودال */
#imageModal .modal-body {
    position: relative;
}

#imageModal .modal-body img:not(:first-child) {
    display: none !important;
}

/* زر الإغلاق في الـ footer */
#imageModal .modal-footer .btn {
    padding: 8px 20px;
    font-weight: 500;
    border-radius: 6px;
}

/* تم نقل الأنواع أعلاه */

/* تحسين مظهر العنوان */
#imageModal .modal-title {

    font-weight: 600;
    color: #ddd3d3;
}

/* منع الوميض أثناء الانتقالات */
.modal.fade {
    transition: opacity 0.15s linear;
}

.modal.fade .modal-dialog {
    transition: transform 0.15s ease-out;
}

/* إصلاح مشاكل التركيز */
#imageModal:focus {
    outline: none;
}

/* دعم inert attribute لإدارة إمكانية الوصول */
[inert] {
    pointer-events: none;
    user-select: none;
}

[inert] * {
    pointer-events: none;
    user-select: none;
}

/* إدارة aria-hidden بشكل صحيح */
.modal[aria-hidden="true"] {
    pointer-events: none;
}

.modal[aria-hidden="true"] * {
    pointer-events: none;
}

.modal:not([aria-hidden="true"]) {
    pointer-events: auto;
}

.modal:not([aria-hidden="true"]) * {
    pointer-events: auto;
}

/* تحسين الاستجابة للشاشات الصغيرة */
@media (max-width: 768px) {
    #imageModal .modal-dialog {
        margin: 1rem;
    }

    #imageModal .modal-body img {
        max-height: 60vh;
    }
}

/* =================================================================================
 * MODAL CLOSE BUTTON - ALL MODALS
 * زر الإغلاق في جميع المودالات
 * ================================================================================= */

/* إعادة تعيين زر الإغلاق لجميع المودالات */
.modal .btn-close,
.modal-header .btn-close {
    opacity: 1 !important;
    transition: opacity 0.2s ease !important;
    padding: 0.75rem !important;
    background-color: transparent !important;
    border: none !important;
    border-radius: 50% !important;
    filter: none !important;
}

/* الثيم الداكن فقط - تطبيق الـ invert لجعل الأيقونة بيضاء */
html.dark-style .modal .btn-close,
html.dark-style .modal-header .btn-close,
html[data-theme="dark"] .modal .btn-close,
html[data-theme="dark"] .modal-header .btn-close,
html[data-bs-theme="dark"] .modal .btn-close,
html[data-bs-theme="dark"] .modal-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%) !important;
    opacity: 0.9 !important;
}

/* تأثير hover - الثيم الفاتح */
.modal .btn-close:hover,
.modal-header .btn-close:hover {
    opacity: 0.5 !important;
    background-color: rgba(0, 0, 0, 0.08) !important;
}

/* تأثير hover - الثيم الداكن */
html.dark-style .modal .btn-close:hover,
html.dark-style .modal-header .btn-close:hover,
html[data-theme="dark"] .modal .btn-close:hover,
html[data-theme="dark"] .modal-header .btn-close:hover,
html[data-bs-theme="dark"] .modal .btn-close:hover,
html[data-bs-theme="dark"] .modal-header .btn-close:hover {
    opacity: 1 !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* تحسين مظهر زر الإغلاق عند التركيز */
.modal .btn-close:focus,
.modal-header .btn-close:focus {
    box-shadow: 0 0 0 0.25rem rgba(115, 103, 240, 0.25) !important;
    outline: none !important;
}

/* تحسين مظهر محتوى المودالات */
.modal-content {
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

html.dark-style .modal-content,
html[data-theme="dark"] .modal-content,
html[data-bs-theme="dark"] .modal-content {
    background: #2f3349 !important;
    color: #f9fafb !important;
    border-color: #434968 !important;
}

/* تنسيق عام لـ modal-header */
.modal-header {
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

html.dark-style .modal-header,
html[data-theme="dark"] .modal-header,
html[data-bs-theme="dark"] .modal-header {
    background: #2f3349;
    border-bottom: 1px solid #404656;
}

/* تحسين مظهر body المودال */
.modal-body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

html.dark-style .modal-body,
html[data-theme="dark"] .modal-body,
html[data-bs-theme="dark"] .modal-body {
    background: transparent !important;
    color: #f9fafb !important;
}

/* =================================================================================
 * PASSWORD RESET CONTAINER - مودال تعديل المستخدم
 * حاوية إعادة تعيين كلمة المرور
 * ================================================================================= */
.password-reset-container {
    margin-top: 1rem;
}

.password-reset-card {
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid rgba(115, 103, 240, 0.2);
    background: rgba(115, 103, 240, 0.04);
}

.password-reset-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.9375rem;
    background: linear-gradient(135deg, rgba(115, 103, 240, 0.12) 0%, rgba(115, 103, 240, 0.06) 100%);
    color: #7367f0;
    border-bottom: 1px solid rgba(115, 103, 240, 0.15);
}

.password-reset-header i {
    font-size: 1.125rem;
    opacity: 0.9;
}

.password-reset-body {
    padding: 1.25rem 1rem;
}

.password-reset-body .form-label {
    font-weight: 500;
    color: inherit;
    margin-bottom: 0.5rem;
}

.password-input-group .form-control {
    min-height: 2.5rem;
}

.password-toggle-btn {
    padding: 0.5rem 0.875rem;
    background: var(--bs-tertiary-bg);
    border-color: var(--bs-border-color);
    color: var(--bs-body-color);
    transform: none !important;
    box-shadow: none !important;
}

.password-toggle-btn:hover {
    background: var(--bs-secondary-bg);
    border-color: var(--bs-border-color);
    color: var(--bs-body-color);
    transform: none !important;
}

.password-reset-hints {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.75rem;
}

.password-hint {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--bs-secondary-color) !important;
    font-size: 0.8125rem;
}

.password-hint i {
    font-size: 0.875rem;
    opacity: 0.8;
    flex-shrink: 0;
}

/* Dark theme - حاوية كلمة المرور */
html.dark-style .password-reset-card,
html[data-theme="dark"] .password-reset-card,
html[data-bs-theme="dark"] .password-reset-card {
    border-color: rgba(115, 103, 240, 0.25);
    background: rgba(47, 51, 73, 0.5);
}

html.dark-style .password-reset-header,
html[data-theme="dark"] .password-reset-header,
html[data-bs-theme="dark"] .password-reset-header {
    background: linear-gradient(135deg, rgba(115, 103, 240, 0.2) 0%, rgba(115, 103, 240, 0.08) 100%);
    color: #a5a0f7;
    border-bottom-color: rgba(115, 103, 240, 0.2);
}

html.dark-style .password-reset-body .form-label,
html[data-theme="dark"] .password-reset-body .form-label,
html[data-bs-theme="dark"] .password-reset-body .form-label {
    color: rgba(255, 255, 255, 0.95);
}

html.dark-style .password-hint,
html[data-theme="dark"] .password-hint,
html[data-bs-theme="dark"] .password-hint {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* تحسين مظهر title المودال */
.modal-title {
    transition: color 0.3s ease;
}

html.dark-style .modal-title,
html[data-theme="dark"] .modal-title,
html[data-bs-theme="dark"] .modal-title {
    color: #f9fafb !important;
}

/* =================================================================================
 * 4. TABLE HEADER CUSTOM STYLES
 * ================================================================================= */

/* تصميم عام لـ header الجدول - العنوان فقط */
.table-header-custom {
    border-radius: 0.5rem;
    padding: 1.5rem 2rem;
    margin-bottom: 1rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid rgba(115, 103, 240, 0.2);
    position: relative;
}

/* تأثير خلفية خفيف */
.table-header-custom::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    border-radius: 0.5rem;
    pointer-events: none;
}

/* العنوان في المنتصف */
.table-header-custom .header-title {
    color: var(--bs-primary);
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin: 0;
    position: relative;
    z-index: 2;
}

/* زر الإضافة - خارج الـ header */
.header-action-btn {
    background: var(--bs-primary);
    border: 1px solid var(--bs-primary);
    color: #ffffff;
    padding: 0.2rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.15s ease-in-out;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.header-action-btn:hover {
    background: rgba(115, 103, 240, 0.9);
    border-color: rgba(115, 103, 240, 0.9);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

.header-action-btn:focus {
    outline: none;
    box-shadow: 0 0 0 0.25rem rgba(115, 103, 240, 0.25);
}

/* أيقونة الإضافة */
.header-action-btn .btn-icon {
    font-size: 1rem;
    font-weight: bold;
}

/* دعم اللغة العربية (RTL) - التخطيط الجديد */
[dir="rtl"] .table-header-custom {
    direction: rtl;
}

[dir="rtl"] .table-header-custom .header-title {
    text-align: center;
}

[dir="rtl"] .header-action-btn {
    margin: 1rem;
    margin-left: auto;
}

/* دعم اللغة الإنجليزية (LTR) - التخطيط الجديد */
[dir="ltr"] .table-header-custom {
    direction: ltr;
}

[dir="ltr"] .table-header-custom .header-title {
    text-align: center;
}

[dir="ltr"] .header-action-btn {
    margin: 1rem;
    margin-right: auto;
}

/* تصميم متجاوب - التخطيط الجديد */
@media (max-width: 768px) {
    .table-header-custom {
        padding: 1rem 1.25rem;
        margin-bottom: 0.75rem;
    }

    .table-header-custom .header-title {
        font-size: 1.25rem;
    }

    .header-action-btn {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
        margin-bottom: 0.75rem;
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .table-header-custom {
        padding: 0.75rem 1rem;
        border-radius: 0.375rem;
    }

    .table-header-custom .header-title {
        font-size: 1.125rem;
    }

    .header-action-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
}

/* تأثيرات متوافقة مع ثيم Vuexy */
html.dark-style .table-header-custom {
    background: linear-gradient(135deg, #2f3349 0%, #2f3349 100%);
}

/* الثيم الفاتح - خلفية header الجدول */
html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) .table-header-custom {
    background: #ffffff;
}

/* الثيم الفاتح - لون العنوان */
html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) .table-header-custom .header-title {
    color: #333333 !important;
}

/* الثيم الداكن - لون العنوان */
html.dark-style .table-header-custom .header-title,
html[data-theme="dark"] .table-header-custom .header-title,
html[data-bs-theme="dark"] .table-header-custom .header-title {
    color: #f9fafb !important;
}

.header-action-btn {
    background: linear-gradient(135deg, var(--bs-primary) 0%, rgba(115, 103, 240, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.header-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.header-action-btn:hover::before {
    left: 100%;
}

/* تأثير hover خفيف للـ header */
.table-header-custom:hover {
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

/* تحسينات للوصولية */
.table-header-custom .header-action-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* تأثيرات الحركة المتوافقة مع الثيم */
@media (prefers-reduced-motion: no-preference) {
    .table-header-custom {
        transition: box-shadow 0.15s ease-in-out;
    }
}

/* إخفاء الحركة للمستخدمين الذين يفضلون تقليل الحركة */
@media (prefers-reduced-motion: reduce) {
    .table-header-custom {
        transition: none;
    }

    .table-header-custom:hover {
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    }
}

/* =================================================================================
 * 5. CUSTOM TOAST STYLES
 * ================================================================================= */

/* التوستر الأساسي */
.custom-toast {
    position: fixed;
    bottom: 20px;
    min-width: 300px;
    max-width: 500px;
    z-index: 9000;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: none;
    overflow: hidden;
    animation: slideInUp 0.5s ease-out;
}

/* موضع التوستر للغة الإنجليزية (LTR) - أسفل على الشمال */
.custom-toast.ltr {
    left: 20px;
    right: auto;
    animation: slideInUpLeft 0.5s ease-out;
}

/* موضع التوستر للغة العربية (RTL) - أسفل على الشمال */
.custom-toast.rtl {
    left: 20px;
    right: auto;
    animation: slideInUpRight 0.5s ease-out;
}

/* الرسوم المتحركة */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

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

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

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

@keyframes slideInUpLeft {
    from {
        transform: translate(100%, 100%);
        opacity: 0;
    }

    to {
        transform: translate(0, 0);
        opacity: 1;
    }
}

@keyframes slideInUpRight {
    from {
        transform: translate(-100%, 100%);
        opacity: 0;
    }

    to {
        transform: translate(0, 0);
        opacity: 1;
    }
}

/* رأس التوستر */
.custom-toast-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.custom-toast-header i {
    font-size: 1.2rem;
    margin-right: 8px;
}

.custom-toast-header .toast-title {
    flex: 1;
    font-size: 0.95rem;
}

.custom-toast-header .toast-time {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-left: 8px;
}

.custom-toast-header .btn-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    opacity: 0.8;
    cursor: pointer;
    padding: 0;
    margin-left: 8px;
    color: inherit;
}

.custom-toast-header .btn-close:hover {
    opacity: 1;
}

/* جسم التوستر */
.custom-toast-body {
    padding: 16px;
    font-size: 1rem;
    line-height: 1.4;
}

/* ألوان النجاح - أخضر ناعم */
.custom-toast.success {
    background: rgba(var(--bs-success-rgb), 0.9) !important;
    color: white;
    backdrop-filter: blur(10px);
}

.custom-toast.success .custom-toast-header {
    background: rgba(var(--bs-success-rgb), 0.95) !important;
    color: white !important;
}

.custom-toast.success .custom-toast-header .toast-title,
.custom-toast.success .custom-toast-header .toast-time,
.custom-toast.success .custom-toast-header i,
.custom-toast.success .custom-toast-header .btn-close {
    color: white !important;
}

/* ألوان الخطأ - أحمر ناعم */
.custom-toast.error {
    background: rgba(var(--bs-danger-rgb), 0.9) !important;
    color: white;
    backdrop-filter: blur(10px);
}

.custom-toast.error .custom-toast-header {
    background: rgba(var(--bs-danger-rgb), 0.95) !important;
    color: white;
}

/* ألوان التحذير - برتقالي ناعم */
.custom-toast.warning {
    background: rgba(var(--bs-warning-rgb), 0.9) !important;
    color: white;
    backdrop-filter: blur(10px);
}

.custom-toast.warning .custom-toast-header {
    background: rgba(var(--bs-warning-rgb), 0.95) !important;
    color: white;
}

/* ألوان المعلومات - أزرق ناعم */
.custom-toast.info {
    background: rgba(var(--bs-info-rgb), 0.9) !important;
    color: white;
    backdrop-filter: blur(10px);
}

.custom-toast.info .custom-toast-header {
    background: rgba(var(--bs-info-rgb), 0.95) !important;
    color: white;
}

/* تأثيرات التفاعل */
.custom-toast:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

/* تأثير الإغلاق */
.custom-toast.closing.ltr {
    animation: slideOutRight 0.3s ease-in forwards;
}

.custom-toast.closing.rtl {
    animation: slideOutLeft 0.3s ease-in forwards;
}

/* التجاوب مع الشاشات الصغيرة */
@media (max-width: 768px) {
    .custom-toast {
        top: 10px;
        left: 10px;
        right: 10px;
        min-width: auto;
        max-width: none;
    }

    .custom-toast.ltr,
    .custom-toast.rtl {
        left: 10px;
        right: 10px;
        animation: slideInDown 0.5s ease-out;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

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

/* إخفاء التوستر الافتراضي */
.toastr {
    display: none !important;
}

/* تحسينات إضافية */
.custom-toast .progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    animation: progressBar 3s linear forwards;
}

@keyframes progressBar {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* =================================================================================
 * 6. IMAGE UPLOAD COMPONENT STYLES
 * ================================================================================= */

/* الحاوية الرئيسية لرفع الصور */
.image-upload-container {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    border: 1px solid #dbdade;
    transition: all 0.3s ease;
}

/* الثيم الداكن */
html.dark-style .image-upload-container,
html[data-theme="dark"] .image-upload-container,
html[data-bs-theme="dark"] .image-upload-container {
    background: #2f3349;
    color: #f9fafb;
    border: 1px solid #434968;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* عنوان القسم */
.image-upload-title {
    color: #10b981;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: color 0.3s ease;
}

html.dark-style .image-upload-title,
html[data-theme="dark"] .image-upload-title,
html[data-bs-theme="dark"] .image-upload-title {
    color: #10b981;
}

.image-upload-title i {
    font-size: 1.1rem;
}

/* أقسام الصور */
.image-sections {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

/* قسم الصورة الحالية */
.current-image-section {
    flex: 1;
    text-align: center;
}

.current-image-section h6 {
    color: #374151;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

html.dark-style .current-image-section h6,
html[data-theme="dark"] .current-image-section h6,
html[data-bs-theme="dark"] .current-image-section h6 {
    color: #b6bee3;
}

.current-image-display {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    background: #f8fafc;
    overflow: hidden;
    transition: all 0.3s ease;
}

html.dark-style .current-image-display,
html[data-theme="dark"] .current-image-display,
html[data-bs-theme="dark"] .current-image-display {
    background: #2f3349;
    border-color: #7367f0;
}

.current-image-display img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    cursor: pointer;
}

.current-image-placeholder {
    color: #6b7280;
    font-size: 0.875rem;
    text-align: center;
}

html.dark-style .current-image-placeholder,
html[data-theme="dark"] .current-image-placeholder,
html[data-bs-theme="dark"] .current-image-placeholder {
    color: #8b92a7;
}

/* قسم الصورة الجديدة */
.new-image-section {
    flex: 1;
    text-align: center;
}

.new-image-section h6 {
    color: #374151;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

html.dark-style .new-image-section h6,
html[data-theme="dark"] .new-image-section h6,
html[data-bs-theme="dark"] .new-image-section h6 {
    color: #b6bee3;
}

.new-image-placeholder {
    width: 120px;
    height: 120px;
    border: 2px dashed #d1d5db;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    background: #f9fafb;
    transition: all 0.3s ease;
    cursor: pointer;
}

html.dark-style .new-image-placeholder,
html[data-theme="dark"] .new-image-placeholder,
html[data-bs-theme="dark"] .new-image-placeholder {
    background: #2f3349;
    border-color: #434968;
}

.new-image-placeholder:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

html.dark-style .new-image-placeholder:hover,
html[data-theme="dark"] .new-image-placeholder:hover,
html[data-bs-theme="dark"] .new-image-placeholder:hover {
    border-color: #7367f0;
    background: #3b4253;
}

.new-image-placeholder i {
    font-size: 2.5rem;
    color: #9ca3af;
    margin-bottom: 8px;
    transition: color 0.3s ease;
    display: block;
    line-height: 1;
}

html.dark-style .new-image-placeholder i,
html[data-theme="dark"] .new-image-placeholder i,
html[data-bs-theme="dark"] .new-image-placeholder i {
    color: #7c8ebf;
}

.new-image-placeholder span {
    color: #7367f0;
    font-size: 0.75rem;
    text-align: center;
    line-height: 1.2;
    transition: color 0.3s ease;
}

html.dark-style .new-image-placeholder span,
html[data-theme="dark"] .new-image-placeholder span,
html[data-bs-theme="dark"] .new-image-placeholder span {
    color: #7367f0;
}

/* زر رفع الصورة */
.image-upload-button {
    background: #7367f0;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 12px;
}

.image-upload-button:hover {
    background: #5a4fcf;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(115, 103, 240, 0.4);
}

.image-upload-button i {
    font-size: 1.1rem;
}

/* تنسيقات مدعومة */
.supported-formats {
    color: #6b7280;
    font-size: 0.875rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: color 0.3s ease;
}

html.dark-style .supported-formats,
html[data-theme="dark"] .supported-formats,
html[data-bs-theme="dark"] .supported-formats {
    color: #8b92a7;
}

.supported-formats i {
    font-size: 0.875rem;
}

/* وضع الصورة الواحدة (Create) */
.single-image-upload {
    text-align: center;
}

.single-image-upload .image-sections {
    justify-content: center;
}

.single-image-upload .current-image-section {
    display: none;
}

/* وضع الصورتين (Edit) */
.dual-image-upload .image-sections {
    justify-content: space-between;
}

/* إخفاء input الملف */
.image-file-input {
    display: none;
}

/* معاينة الصورة الجديدة */
.new-image-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid #10b981;
    display: none;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    background: #f0fdf4;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

html.dark-style .new-image-preview,
html[data-theme="dark"] .new-image-preview,
html[data-bs-theme="dark"] .new-image-preview {
    background: #1a2528;
    border-color: #10b981;
}

.new-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.new-image-preview img:hover {
    opacity: 0.9;
}

/* تأثيرات الحركة */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

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

.image-preview-animation {
    animation: fadeIn 0.3s ease-out;
}

/* Image sections responsive layout */
.image-sections {
    display: block;
}

.image-sections .row {
    margin-left: 0;
    margin-right: 0;
}

/* Ensure circular images are centered in columns */
.current-image-display.mx-auto,
.new-image-placeholder.mx-auto {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* التجاوب مع الشاشات الصغيرة */
@media (max-width: 768px) {
    .image-sections .row>div {
        margin-bottom: 1rem;
    }

    .current-image-display,
    .new-image-placeholder,
    .new-image-preview {
        width: 100px;
        height: 100px;
    }

    .image-upload-container {
        padding: 16px;
    }

    .image-upload-title {
        font-size: 1.1rem;
    }
}

/* دعم الوضع الداكن - تحديث للعمل مع نظام الثيم */
html.dark-style .current-image-section h6,
html.dark-style .new-image-section h6,
html[data-theme="dark"] .current-image-section h6,
html[data-theme="dark"] .new-image-section h6,
html[data-bs-theme="dark"] .current-image-section h6,
html[data-bs-theme="dark"] .new-image-section h6 {
    color: #f9fafb;
}

html.dark-style .current-image-display,
html[data-theme="dark"] .current-image-display,
html[data-bs-theme="dark"] .current-image-display {
    background: #374151;
    border-color: #60a5fa;
}

html.dark-style .new-image-placeholder,
html[data-theme="dark"] .new-image-placeholder,
html[data-bs-theme="dark"] .new-image-placeholder {
    background: #2f3349;
    border-color: #4b5563;
}

html.dark-style .new-image-placeholder:hover,
html[data-theme="dark"] .new-image-placeholder:hover,
html[data-bs-theme="dark"] .new-image-placeholder:hover {
    border-color: #60a5fa;
    background: #1e3a8a;
}

html.dark-style .supported-formats,
html[data-theme="dark"] .supported-formats,
html[data-bs-theme="dark"] .supported-formats {
    color: #9ca3af;
}

/* =================================================================================
 * 7. ENHANCED VALIDATION ERROR STYLING
 * ================================================================================= */

/* Show ALL validation messages immediately - no hiding */
.field-validation-error,
[data-valmsg-for],
.field-validation-error span,
[data-valmsg-for] span {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Modern validation error styling with FontAwesome icons - Target only inner spans */
.field-validation-error span.fv-error,
[data-valmsg-for] span.fv-error,
.fv-error {
    display: flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    color: #ff6b6b !important;
    background: rgba(255, 0, 0, 0.08) !important;
    border: 1px solid rgba(255, 0, 0, 0.2) !important;
    border-radius: 0.5rem !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.9rem !important;
    margin-top: 0.35rem !important;
    animation: fadeInUp 0.18s ease-out forwards !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Hide ONLY the inner elements that don't have our class, keep container visible */
.field-validation-error,
[data-valmsg-for] {
    display: block !important;
}

/* Apply modern styling to ALL validation messages (old and new) */
.field-validation-error> :not(.fv-error),
[data-valmsg-for]> :not(.fv-error),
.field-validation-error span,
[data-valmsg-for] span {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    color: #ff6b6b !important;
    background: rgba(255, 0, 0, 0.08) !important;
    border: 1px solid rgba(255, 0, 0, 0.2) !important;
    border-radius: 0.5rem !important;
    padding: 0.4rem 0.6rem !important;
    font-size: 0.85rem !important;
    margin-top: 0.4rem !important;
    animation: fadeInUp 0.18s ease-out forwards !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Add FontAwesome icon to ALL validation messages */
.field-validation-error> :not(.fv-error):before,
[data-valmsg-for]> :not(.fv-error):before,
.field-validation-error span:before,
[data-valmsg-for] span:before {
    content: "\f071" !important;
    /* FontAwesome triangle-exclamation icon */
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-size: 0.9rem !important;
    flex-shrink: 0 !important;
    margin-right: 0.2rem !important;
}

/* Reset outer container styling */
.field-validation-error,
[data-valmsg-for] {
    display: block !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    color: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
    box-shadow: none !important;
    text-decoration: none !important;
    animation: none !important;
}

/* FontAwesome icon styling - Target only inner spans */
.field-validation-error span.fv-error i,
[data-valmsg-for] span.fv-error i,
.fv-error i {
    font-size: 0.9rem !important;
    flex-shrink: 0 !important;
    margin-right: 0.2rem !important;
}

/* Animation for error appearance */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(4px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation for error disappearance */
@keyframes fadeOutDown {
    0% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(4px);
    }
}

/* Class for fade out animation */
.fv-error.fade-out {
    animation: fadeOutDown 0.2s ease-in forwards;
}

/* Dark mode support */
html.dark-style .fv-error,
html[data-theme="dark"] .fv-error,
html[data-bs-theme="dark"] .fv-error {
    color: #ff8a8a;
    background: rgba(255, 0, 0, 0.12);
    border-color: rgba(255, 0, 0, 0.3);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .fv-error {
        font-size: 0.8rem;
        padding: 0.35rem 0.5rem;
        gap: 0.3rem;
    }

    /* =================================================================================
 * INLINE VALIDATION ICONS (INSIDE FIELDS)
 * ================================================================================= */

    .form-field-wrapper {
        position: relative;
        display: block;
    }

    .form-field-wrapper .form-control {
        padding-left: 2.5rem !important;
        /* مساحة للأيقونة على اليسار */
    }

    .validation-icon {
        position: absolute;
        left: 0.75rem;
        top: 50%;
        transform: translateY(-50%);
        font-size: 1.2rem;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.3s ease;
        z-index: 5;
    }

    .validation-icon.show {
        opacity: 1;
    }

    .validation-icon.success {
        color: #10b981;
    }

    .validation-icon.success::before {
        content: '✓';
        font-weight: bold;
    }

    .validation-icon.error {
        color: #ef4444;
    }

    .validation-icon.error::before {
        content: '✗';
        font-weight: bold;
    }

    /* Validation message under field */
    [data-valmsg-for] {
        display: none;
        font-size: 0.85rem;
        color: #ef4444;
        margin-top: 0.35rem;
        padding: 0.4rem 0.6rem;
        background: rgba(239, 68, 68, 0.1);
        border-radius: 0.375rem;
        border-left: 3px solid #ef4444;
    }

    [data-valmsg-for].show {
        display: block;
        animation: fadeInUp 0.2s ease-out;
    }

    /* Success state for input */
    .form-control.is-valid {
        border-color: #10b981 !important;
        background-image: none !important;
    }

    /* Error state for input */
    .form-control.is-invalid {
        border-color: #ef4444 !important;
        background-image: none !important;
    }

    /* Dark mode support */
    html.dark-style .validation-icon.success {
        color: #34d399;
    }

    html.dark-style .validation-icon.error {
        color: #f87171;
    }

    html.dark-style [data-valmsg-for] {
        background: rgba(239, 68, 68, 0.15);
        color: #f87171;
    }

    .fv-error i {
        font-size: 0.85rem;
    }
}

/* Form field validation states */
.form-control.is-invalid,
.form-select.is-invalid,
.form-check-input.is-invalid {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 107, 0.25);
}

.form-control.is-valid,
.form-select.is-valid,
.form-check-input.is-valid {
    border-color: #28c76f;
    box-shadow: 0 0 0 0.2rem rgba(40, 199, 111, 0.25);
}

/* =================================================================================
 * 8. SHORTCUTS STYLES
 * ================================================================================= */

/* Shortcuts Dropdown Container */
.dropdown-shortcuts-list {
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem;
}

/* Grid Layout - 2 columns */
.shortcuts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin: 0;
}

/* Individual Shortcut Card */
.shortcut-card {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    padding: 1.25rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.shortcut-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--bs-primary);
}

/* Dark theme hover effect */
html.dark-style .shortcut-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Icon Circle */
.shortcut-icon-circle {
    width: 3rem;
    height: 3rem;
    background-color: var(--bs-secondary-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--bs-body-color);
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.shortcut-card:hover .shortcut-icon-circle {
    background-color: var(--bs-primary);
    color: white;
    transform: scale(1.1);
}

/* Card Title */
.shortcut-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--bs-body-color);
    margin-bottom: 0.25rem;
    line-height: 1.2;
    text-align: center;
}

/* Card Description */
.shortcut-card-desc {
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
    margin-bottom: 0;
    line-height: 1.3;
    text-align: center;
    opacity: 0.8;
}

/* Empty State */
.shortcuts-empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--bs-secondary-color);
}

.shortcuts-empty-state i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.shortcuts-empty-state h6 {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.shortcuts-empty-state p {
    font-size: 0.75rem;
    margin-bottom: 0;
    opacity: 0.7;
}

/* Loading State */
.shortcuts-loading {
    text-align: center;
    padding: 2rem 1rem;
}

.shortcuts-loading .spinner-border {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--bs-primary);
}

/* Responsive Design */
@media (max-width: 576px) {
    .shortcuts-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .shortcut-card {
        min-height: 100px;
        padding: 1rem 0.75rem;
    }

    .shortcut-icon-circle {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .shortcut-card-title {
        font-size: 0.8125rem;
    }

    .shortcut-card-desc {
        font-size: 0.6875rem;
    }
}

/* Dark Theme Specific Styles */
html.dark-style .shortcut-card {
    background: #2f3349;
    border-color: #3b4253;
}

html.dark-style .shortcut-card:hover {
    background: #3b4253;
    border-color: var(--bs-primary);
}

html.dark-style .shortcut-icon-circle {
    background-color: #3b4253;
    color: #b6bee3;
}

html.dark-style .shortcut-card:hover .shortcut-icon-circle {
    background-color: var(--bs-primary);
    color: white;
}

html.dark-style .shortcut-card-title {
    color: #b6bee3;
}

html.dark-style .shortcut-card-desc {
    color: #8b92a7;
}

/* Animation for card appearance */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.shortcut-card {
    animation: fadeInUp 0.3s ease-out;
}

.shortcut-card:nth-child(1) {
    animation-delay: 0.1s;
}

.shortcut-card:nth-child(2) {
    animation-delay: 0.2s;
}

.shortcut-card:nth-child(3) {
    animation-delay: 0.3s;
}

.shortcut-card:nth-child(4) {
    animation-delay: 0.4s;
}

.shortcut-card:nth-child(5) {
    animation-delay: 0.5s;
}

.shortcut-card:nth-child(6) {
    animation-delay: 0.6s;
}

/* =================================================================================
 * SHORTCUT MANAGEMENT MODAL - Card Style (3 columns)
 * ================================================================================= */

/* Shortcut Option Card in Modal */
.shortcut-option-card {
    background: var(--bs-body-bg);
    border: 2px solid var(--bs-border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.shortcut-option-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--bs-primary);
    background: rgba(115, 103, 240, 0.05);
}

.shortcut-option-card.selected {
    border-color: var(--bs-primary);
    background: rgba(115, 103, 240, 0.1);
}

.shortcut-option-card.selected:hover {
    background: rgba(115, 103, 240, 0.15);
}

/* Checkbox in card */
.shortcut-option-card .form-check-input {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    border-radius: 0.25rem;
}

.shortcut-option-card .form-check-input:checked {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* Icon in card */
.shortcut-option-card .shortcut-icon {
    width: 4rem;
    height: 4rem;
    background: linear-gradient(135deg, rgba(115, 103, 240, 0.1) 0%, rgba(115, 103, 240, 0.05) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--bs-primary);
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.shortcut-option-card.selected .shortcut-icon {
    background: linear-gradient(135deg, rgba(115, 103, 240, 0.2) 0%, rgba(115, 103, 240, 0.15) 100%);
    transform: scale(1.1);
}

.shortcut-option-card:hover .shortcut-icon {
    background: linear-gradient(135deg, rgba(115, 103, 240, 0.2) 0%, rgba(115, 103, 240, 0.15) 100%);
    transform: scale(1.1);
}

/* Content in card */
.shortcut-option-card .shortcut-content {
    flex: 1;
}

.shortcut-option-card .shortcut-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--bs-body-color);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.shortcut-option-card .shortcut-desc {
    font-size: 0.8125rem;
    color: var(--bs-secondary-color);
    line-height: 1.4;
}

/* Dark Theme Support */
html.dark-style .shortcut-option-card {
    background: #2f3349;
    border-color: #3b4253;
}

html.dark-style .shortcut-option-card:hover {
    background: #3b4253;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

html.dark-style .shortcut-option-card.selected {
    background: rgba(115, 103, 240, 0.2);
    border-color: var(--bs-primary);
}

html.dark-style .shortcut-option-card .shortcut-icon {
    background: rgba(115, 103, 240, 0.15);
    color: #b6bee3;
}

html.dark-style .shortcut-option-card.selected .shortcut-icon {
    background: rgba(115, 103, 240, 0.25);
}

html.dark-style .shortcut-option-card .shortcut-title {
    color: #b6bee3;
}

html.dark-style .shortcut-option-card .shortcut-desc {
    color: #8b92a7;
}

/* Responsive */
@media (max-width: 768px) {
    .shortcut-option-card {
        min-height: 120px;
        padding: 1rem;
    }

    .shortcut-option-card .shortcut-icon {
        width: 3rem;
        height: 3rem;
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }

    .shortcut-option-card .shortcut-title {
        font-size: 0.875rem;
    }

    .shortcut-option-card .shortcut-desc {
        font-size: 0.75rem;
    }
}

/* =================================================================================
 * 6. IMAGE UPLOAD COMPONENT STYLES (NEW VERSION)
 * ================================================================================= */

/* دعم .upload-header للثيم الفاتح والداكن */
.upload-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #7367f0;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    transition: color 0.3s ease;
}

html.dark-style .upload-header,
html[data-theme="dark"] .upload-header,
html[data-bs-theme="dark"] .upload-header {
    color: #7367f0;
}

.upload-header i {
    font-size: 1.5rem;
}

.upload-title {
    transition: color 0.3s ease;
}

html.dark-style .upload-title,
html[data-theme="dark"] .upload-title,
html[data-bs-theme="dark"] .upload-title {
    color: #f9fafb;
}

/* دعم النصوص في .image-upload-container */
.image-upload-container .form-text.text-muted {
    color: #6b7280;
    transition: color 0.3s ease;
}

html.dark-style .image-upload-container .form-text.text-muted,
html[data-theme="dark"] .image-upload-container .form-text.text-muted,
html[data-bs-theme="dark"] .image-upload-container .form-text.text-muted {
    color: #8b92a7;
}

/* دعم العناوين في .image-upload-container */
.image-upload-container h6 {
    color: #374151;
    transition: color 0.3s ease;
}

html.dark-style .image-upload-container h6,
html[data-theme="dark"] .image-upload-container h6,
html[data-bs-theme="dark"] .image-upload-container h6 {
    color: #b6bee3;
}

/* مودال الصورة المنفصل */
#imagePreviewModal .modal-content {
    background: #ffffff;
    border: none;
}

html.dark-style #imagePreviewModal .modal-content,
html[data-theme="dark"] #imagePreviewModal .modal-content,
html[data-bs-theme="dark"] #imagePreviewModal .modal-content {
    background: #2f3349;
}

#imagePreviewModal .modal-header {
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
}

html.dark-style #imagePreviewModal .modal-header,
html[data-theme="dark"] #imagePreviewModal .modal-header,
html[data-bs-theme="dark"] #imagePreviewModal .modal-header {
    background: #2f3349;
    border-bottom: 1px solid #404656;
}

#imagePreviewModal .modal-title {
    color: inherit;
}

html.dark-style #imagePreviewModal .modal-title,
html[data-theme="dark"] #imagePreviewModal .modal-title,
html[data-bs-theme="dark"] #imagePreviewModal .modal-title {
    color: #f3f4f6;
}

#imagePreviewModal .btn-close {
    filter: none;
}

html.dark-style #imagePreviewModal .btn-close,
html[data-theme="dark"] #imagePreviewModal .btn-close,
html[data-bs-theme="dark"] #imagePreviewModal .btn-close {
    filter: invert(1);
}


/* Validation Messages - Red Style */
.validation-message:not(:empty) {
    color: #ef4444 !important;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.validation-message:not(:empty)::before {
    content: '⚠';
    font-size: 1rem;
}

.validation-message:empty {
    display: none;
}

/* Dark mode support */
html.dark-style .image-upload-area {
    background: #2f3349;
    border-color: #4a5073;
}

/* =================================================================================
 * IMAGE VALIDATION MESSAGE CENTERING
 * Center validation text in image upload containers
 * ================================================================================= */
.image-upload-container [data-valmsg-for],
.image-upload-container .field-validation-error,
.image-upload-container span.text-danger.d-block {
    text-align: center !important;
}

.image-upload-container [data-valmsg-for] span,
.image-upload-container .field-validation-error span,
.image-upload-container span.text-danger.d-block span {
    justify-content: center !important;
    display: flex !important;
    align-items: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.image-upload-container [data-valmsg-for]> :not(.fv-error),
.image-upload-container .field-validation-error> :not(.fv-error),
.image-upload-container [data-valmsg-for] span:not(.fv-error),
.image-upload-container .field-validation-error span:not(.fv-error) {
    justify-content: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* =================================================================================
 * 9. LAYOUT & NAVBAR STYLES
 * ================================================================================= */

/* Layout Menu Scrollbar */
.layout-menu {
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar styling */
#layout-menu::-webkit-scrollbar {
    width: 8px;
}

#layout-menu::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

#layout-menu::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#layout-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* Dark theme scrollbar */
[data-theme="dark"] #layout-menu::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] #layout-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] #layout-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Firefox scrollbar */
#layout-menu {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.3) rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] #layout-menu {
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
}

/* Ensure menu content can scroll */
.menu-inner {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overflow-x: hidden;
}

/* =================================================================================
 * Sidebar Menu - Dropdown/Expand states - أوضح لون عند النقر والتمرير
 * ================================================================================= */
/* Light theme - لون أوضح عند فتح/تفعيل/تمرير عناصر القائمة */
html:not(.dark-style):not([data-theme="dark"]) #layout-menu .menu-inner .menu-item.open > .menu-link.menu-toggle,
html:not(.dark-style):not([data-theme="dark"]) #layout-menu .menu-inner .menu-item.active > .menu-link.menu-toggle,
html:not(.dark-style):not([data-theme="dark"]) #layout-menu .layout-menu-hover.layout-menu-collapsed .menu-inner .menu-item.open > .menu-link.menu-toggle,
html:not(.dark-style):not([data-theme="dark"]) #layout-menu .layout-menu-hover.layout-menu-collapsed .menu-inner .menu-item.active > .menu-link.menu-toggle {
    background: rgba(115, 103, 240, 0.14) !important;
    color: #5d596c !important;
}
html:not(.dark-style):not([data-theme="dark"]) #layout-menu .menu-inner .menu-item:not(.active) .menu-link:hover {
    background: rgba(115, 103, 240, 0.12) !important;
}
/* Dark theme - لون أوضح عند فتح/تفعيل/تمرير عناصر القائمة */
html.dark-style #layout-menu .menu-inner .menu-item.open > .menu-link.menu-toggle,
html.dark-style #layout-menu .menu-inner .menu-item.active > .menu-link.menu-toggle,
html.dark-style #layout-menu .layout-menu-hover.layout-menu-collapsed .menu-inner .menu-item.open > .menu-link.menu-toggle,
html.dark-style #layout-menu .layout-menu-hover.layout-menu-collapsed .menu-inner .menu-item.active > .menu-link.menu-toggle,
html[data-theme="dark"] #layout-menu .menu-inner .menu-item.open > .menu-link.menu-toggle,
html[data-theme="dark"] #layout-menu .menu-inner .menu-item.active > .menu-link.menu-toggle,
html[data-theme="dark"] #layout-menu .layout-menu-hover.layout-menu-collapsed .menu-inner .menu-item.open > .menu-link.menu-toggle,
html[data-theme="dark"] #layout-menu .layout-menu-hover.layout-menu-collapsed .menu-inner .menu-item.active > .menu-link.menu-toggle {
    background: rgba(115, 103, 240, 0.25) !important;
    color: #dbdade !important;
}
html.dark-style #layout-menu .menu-inner .menu-item:not(.active) .menu-link:hover,
html[data-theme="dark"] #layout-menu .menu-inner .menu-item:not(.active) .menu-link:hover {
    background: rgba(115, 103, 240, 0.2) !important;
}

/* Fix for app-brand taking space */
.app-brand {
    flex-shrink: 0;
}

/* Menu search container */
.menu-search-container {
    flex-shrink: 0;
}

/* Ensure navbar is visible */
.layout-navbar {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 1030 !important;
}

/* Ensure navbar content is visible */
.layout-navbar .navbar {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure navbar nav items are visible */
.layout-navbar .navbar-nav {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure navbar nav right is visible */
.navbar-nav-right {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

[dir="ltr"] .modal-footer {
    flex-direction: row !important;
    /* save appears on left */
}

/* =================================================================================
 * 10. SIMPLE PAGE HEADER STYLES
 * ================================================================================= */

/* Simple Page Header */
.page-header-simple {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.page-header-simple:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.page-header-simple .card-body {
    padding: 1.5rem 2rem;
}

.page-header-simple .header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

/* Icon Container */
.page-header-simple .header-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #7367f0 0%, #9e95f5 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(115, 103, 240, 0.3);
}

.page-header-simple .header-icon i {
    font-size: 1.5rem;
    color: white;
}

/* Text Content */
.page-header-simple .header-text h4 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #2b2c40;
    line-height: 1.3;
}

.page-header-simple .header-text p {
    margin: 0;
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 400;
}

/* Dark Mode Support */
html.dark-style .page-header-simple {
    background: #2f3349;
    border-color: #3b4253;
}

html.dark-style .page-header-simple .header-text h4 {
    color: #d0d2d6;
}

html.dark-style .page-header-simple .header-text p {
    color: #a8aaae;
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-header-simple .card-body {
        padding: 1.25rem 1.5rem;
    }

    .page-header-simple .header-icon {
        width: 45px;
        height: 45px;
    }

    .page-header-simple .header-icon i {
        font-size: 1.25rem;
    }

    .page-header-simple .header-text h4 {
        font-size: 1.25rem;
    }

    .page-header-simple .header-text p {
        font-size: 0.8rem;
    }

    .page-header-simple .header-content {
        gap: 0.875rem;
    }
}

@media (max-width: 576px) {
    .page-header-simple .card-body {
        padding: 1rem;
    }

    .page-header-simple .header-icon {
        width: 40px;
        height: 40px;
    }

    .page-header-simple .header-icon i {
        font-size: 1.125rem;
    }

    .page-header-simple .header-text h4 {
        font-size: 1.125rem;
    }

    .page-header-simple .header-text p {
        font-size: 0.75rem;
    }
}

/*
 * CSS for Global Loading Buttons
 */

.btn {
    /* تأكد أن الزر له position: relative ليحتوي الـ spinner */
    position: relative;
}

.btn .btn-spinner {
    /* 1. إخفاء الـ spinner في الوضع العادي */
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    /* تصميم الـ spinner - يمكنك تغييره */
    width: 1.2rem;
    height: 1.2rem;
    border: 2px solid currentColor;
    border-bottom-color: transparent;
    border-radius: 50%;
    animation: 0.75s linear infinite spinner-border;
}

.btn .btn-text {
    /* 2. إظهار النص في الوضع العادي */
    display: inline-block;
    transition: opacity 0.15s ease-in-out;
    opacity: 1;
}

/*
 * الحالة النشطة: عند التحميل
 */

.btn.btn-loading {
    /* تعطيل الزر ومنع أي نقرات إضافية */
    pointer-events: none;
    opacity: 0.85;
}

.btn.btn-loading .btn-spinner {
    /* 3. إظهار الـ spinner عند التحميل */
    display: inline-block;
}

.btn.btn-loading .btn-text {
    /* 4. إخفاء النص عند التحميل */
    opacity: 0;
    visibility: hidden;
}

/* تحسين الـ loader في المودالات - يظهر بجانب النص */
.modal .btn.btn-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.modal .btn.btn-loading .btn-text {
    opacity: 1 !important;
    visibility: visible !important;
    margin-left: 0;
}

.modal .btn.btn-loading .btn-spinner {
    position: static;
    display: inline-block;
    transform: none;
    margin: 0;
    order: -1;
    width: 14px;
    height: 14px;
    border-width: 2px;
}

/* تعريف حركة الدوران */
@keyframes spinner-border {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* =================================================================================
 * 11. DATATABLE FLOATING CARDS STYLING
 * تصميم الجداول بنمط البطاقات العائمة (Floating Cards)
 * ================================================================================= */

/* ---- 1. الكود الأساسي (The Foundation) - قواعد قوية جداً ---- */
.table,
table.table,
.dataTables_wrapper .table,
.dataTables_wrapper table.table {
    /* هذه هي الأوامر السحرية */
    border-collapse: separate !important;
    border-spacing: 0 0.75rem !important;
    /* 0 أفقي، 0.75rem (حوالي 12px) رأسي */
    width: 100% !important;
    padding: 0 0.5rem !important;
    /* إضافة مسافة صغيرة يمين ويسار الجدول */
    border: none !important;
}

/* إزالة أي حدود من الجدول */
.table,
table.table,
.dataTables_wrapper .table {
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
}

/* ---- 2. رأس الجدول (The Header) - شفاف تماماً ---- */
.table thead th,
table.table thead th,
.dataTables_wrapper .table thead th {
    background-color: transparent !important;
    /* شفاف تماماً */
    background: transparent !important;
    /* للتأكد */
    border: none !important;
    /* بدون أي حدود */
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
    padding: 0 1rem !important;
    padding-top: 0 !important;
    padding-bottom: 0.5rem !important;
    color: #8a8d93 !important;
    /* لون رمادي خافت جداً */
    font-size: 0.8rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    font-weight: 600 !important;
    vertical-align: bottom !important;
}

/* الثيم الداكن - رأس الجدول */
html.dark-style .table thead th,
html[data-theme="dark"] .table thead th,
html[data-bs-theme="dark"] .table thead th {
    color: #8a8d93 !important;
}

/* الثيم الفاتح - رأس الجدول */
html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) .table thead th {
    color: #6c757d !important;
}

/* إزالة أي حدود من رأس الجدول */
.table thead {
    border: none !important;
}

.table thead tr {
    border: none !important;
}

/* ---- 3. الصفوف (The "Floating" Rows) - بطاقات عائمة احترافية - قطعة واحدة ---- */
/* خلفية موحدة للصف ككل - مختلفة قليلاً عن الخلفية العامة مع حدود واضحة */
.table tbody tr,
table.table tbody tr,
.dataTables_wrapper .table tbody tr {
    /* خلفية مختلفة قليلاً عن الخلفية العامة */
    background: var(--bs-card-bg, #ffffff) !important;
    background-color: var(--bs-card-bg, #ffffff) !important;
    /* حدود واضحة للصف */
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-top: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
    /* ظل خفيف احترافي للصف ككل */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08) !important;
}

.table tbody td,
table.table tbody td,
.dataTables_wrapper .table tbody td {
    /* خلفية شفافة للخلايا - الخلفية من الصف الأب */
    background: transparent !important;
    background-color: transparent !important;
    padding: 1.25rem 1rem !important;
    /* مساحات داخلية كبيرة ومريحة */
    vertical-align: middle !important;
    color: #e0e0e0 !important;
    border: none !important;
    /* الأهم: إلغاء أي حدود */
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
    /* انتقالات سلسة احترافية */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    /* إزالة الظل من الخلايا - الظل من الصف */
    box-shadow: none !important;
}

/* الثيم الداكن - خلفية الصفوف - مختلفة قليلاً عن الخلفية العامة مع حدود واضحة */
html.dark-style .table tbody tr,
html.dark-style table.table tbody tr,
html.dark-style .dataTables_wrapper .table tbody tr,
html[data-theme="dark"] .table tbody tr,
html[data-theme="dark"] table.table tbody tr,
html[data-theme="dark"] .dataTables_wrapper .table tbody tr,
html[data-bs-theme="dark"] .table tbody tr,
html[data-bs-theme="dark"] table.table tbody tr,
html[data-bs-theme="dark"] .dataTables_wrapper .table tbody tr {
    /* خلفية أفتح قليلاً من الخلفية العامة (#25293c) - مميزة فقط */
    background: #2d3042 !important;
    background-color: #2d3042 !important;
    /* حدود واضحة للثيم الداكن */
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08) !important;
}

html.dark-style .table tbody td,
html[data-theme="dark"] .table tbody td,
html[data-bs-theme="dark"] .table tbody td {
    background: transparent !important;
    background-color: transparent !important;
    color: #e0e0e0 !important;
    box-shadow: none !important;
}

/* الثيم الفاتح - خلفية الصفوف - مختلفة قليلاً عن الخلفية العامة مع حدود واضحة */
html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) .table tbody tr,
html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) table.table tbody tr,
html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) .dataTables_wrapper .table tbody tr {
    /* خلفية أغمق قليلاً من الأبيض - مميزة فقط */
    background: #f8f9fa !important;
    background-color: #f8f9fa !important;
    /* حدود واضحة للثيم الفاتح */
    border: 1px solid rgba(0, 0, 0, 0.12) !important;
    border-top: 1px solid rgba(0, 0, 0, 0.12) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) .table tbody td {
    background: transparent !important;
    background-color: transparent !important;
    color: #5d596c !important;
    box-shadow: none !important;
}

/* إزالة أي فواصل بين الخلايا - الصف قطعة واحدة */
.table tbody tr td {
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: none !important;
    /* إزالة أي border-radius من الخلايا الفردية */
    border-radius: 0 !important;
}

/* إضافة مسافة بين الصفوف لظهور الحدود بشكل واضح */
.table tbody tr {
    margin-bottom: 0.5rem !important;
}

.table tbody tr+tr {
    margin-top: 0.5rem !important;
}

/* ---- 4. اللمسة الاحترافية (The Hover Effect) - التوهج الاحترافي على الصف ---- */
/* تأثير hover على الصف كامل - الصف قطعة واحدة متصلة */
.table tbody tr,
table.table tbody tr,
.dataTables_wrapper .table tbody tr {
    /* حواف دائرية للصف ككل (كقطعة واحدة) */
    border-radius: 0.6rem !important;
    overflow: hidden !important;
    /* لتطبيق border-radius بشكل صحيح */
    /* انتقالات سلسة */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    cursor: pointer !important;
}

/* تطبيق border-radius على الخلية الأولى والأخيرة فقط */
.table tbody tr td:first-child,
table.table tbody tr td:first-child,
.dataTables_wrapper .table tbody tr td:first-child {
    border-top-left-radius: 0.6rem !important;
    border-bottom-left-radius: 0.6rem !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.table tbody tr td:last-child,
table.table tbody tr td:last-child,
.dataTables_wrapper .table tbody tr td:last-child {
    border-top-right-radius: 0.6rem !important;
    border-bottom-right-radius: 0.6rem !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

/* عند hover على الصف، نحرك الصف كامل للأعلى مع ظل احترافي */
.table tbody tr:hover {
    transform: translateY(-4px) !important;
    z-index: 10 !important;
    /* لون hover متناسق مع الثيم - أفتح قليلاً من الخلفية الأساسية */
    background: #363b52 !important;
    background-color: #363b52 !important;
    /* حدود أوضح عند hover */
    border-color: rgba(255, 255, 255, 0.15) !important;
    /* ظل احترافي قوي عند hover */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2), 0 4px 8px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(105, 108, 255, 0.1) !important;
}

/* الخلايا تبقى شفافة عند hover - الخلفية من الصف */
.table tbody tr:hover td {
    /* لا نحرك الخلايا منفصلة - فقط الصف كامل */
    transform: none !important;
    position: relative !important;
    z-index: 1 !important;
    /* الخلفية شفافة - تأتي من الصف */
    background: transparent !important;
    background-color: transparent !important;
    /* إزالة الظل من الخلايا */
    box-shadow: none !important;
    /* التأكد من عدم ظهور أي حدود */
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
    outline: none !important;
}

/* الثيم الفاتح - تأثير hover احترافي - متناسق مع الثيم العام */
html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) .table tbody tr:hover {
    background: #f0f2f5 !important;
    background-color: #f0f2f5 !important;
    /* حدود أوضح عند hover */
    border-color: rgba(0, 0, 0, 0.18) !important;
    /* ظل احترافي للثيم الفاتح */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(105, 108, 255, 0.08) !important;
}

html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) .table tbody tr:hover td {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    /* التأكد من عدم ظهور أي حدود */
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
    outline: none !important;
}

/* منع تغيير استايلات الأزرار عند hover على الصف */
/* الأزرار ستبقى كما هي - لا نطبق أي قواعد عليها */
/* الأزرار ستحافظ على hover effects الخاصة بها فقط عند hover مباشرة عليها */

/* ---- 5. تحسين العناصر (Badges & Placeholders) ---- */
/* الشارات الناعمة (Soft Badges) - قواعد قوية جداً */
.badge.bg-label-success,
.badge.badge-soft-success,
.table .badge.bg-label-success,
.table tbody td .badge.bg-label-success,
.dataTables_wrapper .badge.bg-label-success,
.dataTables_wrapper .table .badge.bg-label-success {
    background-color: rgba(40, 199, 111, 0.1) !important;
    background: rgba(40, 199, 111, 0.1) !important;
    color: #28c76f !important;
    font-weight: 600 !important;
    padding: 0.5rem 0.75rem !important;
    border-radius: 0.3rem !important;
    border: none !important;
    border-width: 0 !important;
}

html.dark-style .badge.bg-label-success,
html.dark-style .badge.badge-soft-success,
html[data-theme="dark"] .badge.bg-label-success,
html[data-theme="dark"] .badge.badge-soft-success,
html[data-bs-theme="dark"] .badge.bg-label-success,
html[data-bs-theme="dark"] .badge.badge-soft-success {
    background-color: rgba(40, 199, 111, 0.15) !important;
    color: #34d399 !important;
}

/* شارات أخرى - Danger */
.badge.bg-label-danger,
.badge.badge-soft-danger {
    background-color: rgba(234, 84, 85, 0.1) !important;
    color: #ea5455 !important;
    font-weight: 600 !important;
    padding: 0.5rem 0.75rem !important;
    border-radius: 0.3rem !important;
    border: none !important;
}

html.dark-style .badge.bg-label-danger,
html.dark-style .badge.badge-soft-danger,
html[data-theme="dark"] .badge.bg-label-danger,
html[data-theme="dark"] .badge.badge-soft-danger,
html[data-bs-theme="dark"] .badge.bg-label-danger,
html[data-bs-theme="dark"] .badge.badge-soft-danger {
    background-color: rgba(234, 84, 85, 0.15) !important;
    color: #f87171 !important;
}

/* شارات أخرى - Warning */
.badge.bg-label-warning,
.badge.badge-soft-warning {
    background-color: rgba(255, 159, 67, 0.1) !important;
    color: #ff9f43 !important;
    font-weight: 600 !important;
    padding: 0.5rem 0.75rem !important;
    border-radius: 0.3rem !important;
    border: none !important;
}

html.dark-style .badge.bg-label-warning,
html.dark-style .badge.badge-soft-warning,
html[data-theme="dark"] .badge.bg-label-warning,
html[data-theme="dark"] .badge.badge-soft-warning,
html[data-bs-theme="dark"] .badge.bg-label-warning,
html[data-bs-theme="dark"] .badge.badge-soft-warning {
    background-color: rgba(255, 159, 67, 0.15) !important;
    color: #fbbf24 !important;
}

/* شارات أخرى - Info */
.badge.bg-label-info,
.badge.badge-soft-info {
    background-color: rgba(0, 207, 232, 0.1) !important;
    color: #00cfe8 !important;
    font-weight: 600 !important;
    padding: 0.5rem 0.75rem !important;
    border-radius: 0.3rem !important;
    border: none !important;
}

html.dark-style .badge.bg-label-info,
html.dark-style .badge.badge-soft-info,
html[data-theme="dark"] .badge.bg-label-info,
html[data-theme="dark"] .badge.badge-soft-info,
html[data-bs-theme="dark"] .badge.bg-label-info,
html[data-bs-theme="dark"] .badge.badge-soft-info {
    background-color: rgba(0, 207, 232, 0.15) !important;
    color: #22d3ee !important;
}

/* ---- 6. الصور الاحتياطية (Image Placeholders) ---- */
/* Avatar Placeholder - دائرة رمادية مع أيقونة */
.avatar-placeholder,
.image-placeholder {
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    background-color: #3f4254 !important;
    /* لون داكن محايد */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #8a8d93 !important;
    font-size: 1.2rem !important;
    flex-shrink: 0 !important;
}

html.dark-style .avatar-placeholder,
html.dark-style .image-placeholder,
html[data-theme="dark"] .avatar-placeholder,
html[data-theme="dark"] .image-placeholder,
html[data-bs-theme="dark"] .avatar-placeholder,
html[data-bs-theme="dark"] .image-placeholder {
    background-color: #3f4254 !important;
    color: #8a8d93 !important;
}

html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) .avatar-placeholder,
html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) .image-placeholder {
    background-color: #e9ecef !important;
    color: #6c757d !important;
}

/* Avatar Initials - أول حرفين من الاسم */
.avatar-initials {
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #7367f0 0%, #9e95f5 100%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    text-transform: uppercase !important;
    flex-shrink: 0 !important;
}

/* تحسين مظهر الصور في الجدول */
.table tbody td img {
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 2px solid rgba(255, 255, 255, 0.1) !important;
    transition: all 0.2s ease !important;
}

html.dark-style .table tbody td img,
html[data-theme="dark"] .table tbody td img,
html[data-bs-theme="dark"] .table tbody td img {
    border: 2px solid rgba(255, 255, 255, 0.1) !important;
}

html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) .table tbody td img {
    border: 2px solid rgba(0, 0, 0, 0.1) !important;
}

.table tbody td img:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

/* ---- 7. الأزرار - إضافة مسافات ---- */
.table td .d-flex,
.table td .action-buttons-wrapper,
.table td .btn-group,
.table tbody td .d-flex,
.table tbody td .action-buttons-wrapper,
.table tbody td .btn-group,
table.table tbody td .d-flex,
.dataTables_wrapper .table tbody td .d-flex {
    gap: 0.5rem !important;
    /* فجوة بين الأزرار */
    display: flex !important;
}

/* Reduce gap for action buttons to save space */
.table tbody td .d-flex.gap-1 {
    gap: 0.25rem !important;
}

.table td .d-flex .btn,
.table td .action-buttons-wrapper .btn,
.table td .btn-group .btn,
.table tbody td .d-flex .btn,
.table tbody td .action-buttons-wrapper .btn,
.table tbody td .btn-group .btn {
    margin: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* إذا كانت الأزرار مباشرة بدون wrapper */
.table tbody td .btn+.btn {
    margin-left: 0.5rem !important;
}

[dir="rtl"] .table tbody td .btn+.btn {
    margin-left: 0 !important;
    margin-right: 0.5rem !important;
}

/* ---- 8. تحسين مظهر الأيقونات ---- */
.table tbody td i {
    font-size: 1.1rem !important;
    color: inherit !important;
    transition: color 0.2s ease !important;
}

/* Removed broad row-hover icon color override to preserve specific icon colors (e.g. status badges) */

/* Keep action button icon colors unchanged on hover */
.table tbody tr:hover td .btn i,
.table tbody tr:hover td .btn:hover i,
.table tbody td .btn i,
.table tbody td .btn:hover i {
    color: inherit !important;
}

/* Specific rules for each button type to maintain their icon colors */
.table tbody tr:hover td .btn-outline-info i,
.table tbody tr:hover td .btn-outline-info:hover i,
.table tbody td .btn-outline-info i,
.table tbody td .btn-outline-info:hover i {
    color: var(--bs-info) !important;
}

.table tbody tr:hover td .btn-outline-primary i,
.table tbody tr:hover td .btn-outline-primary:hover i,
.table tbody td .btn-outline-primary i,
.table tbody td .btn-outline-primary:hover i {
    color: var(--bs-primary) !important;
}

.table tbody tr:hover td .btn-outline-warning i,
.table tbody tr:hover td .btn-outline-warning:hover i,
.table tbody td .btn-outline-warning i,
.table tbody td .btn-outline-warning:hover i {
    color: var(--bs-warning) !important;
}

.table tbody tr:hover td .btn-outline-danger i,
.table tbody tr:hover td .btn-outline-danger:hover i,
.table tbody td .btn-outline-danger i,
.table tbody td .btn-outline-danger:hover i {
    color: var(--bs-danger) !important;
}

/* Ensure all action buttons have borders matching icon color */
.table tbody td .btn-icon.btn-outline-info {
    border: 1px solid var(--bs-info) !important;
    border-width: 1px !important;
    border-style: solid !important;
    border-color: var(--bs-info) !important;
    box-sizing: border-box !important;
}

.table tbody td .btn-icon.btn-outline-primary {
    border: 1px solid var(--bs-primary) !important;
    border-width: 1px !important;
    border-style: solid !important;
    border-color: var(--bs-primary) !important;
    box-sizing: border-box !important;
}

.table tbody td .btn-icon.btn-outline-warning {
    border: 1px solid var(--bs-warning) !important;
    border-width: 1px !important;
    border-style: solid !important;
    border-color: var(--bs-warning) !important;
    box-sizing: border-box !important;
}

.table tbody td .btn-icon.btn-outline-danger {
    border: 1px solid var(--bs-danger) !important;
    border-width: 1px !important;
    border-style: solid !important;
    border-color: var(--bs-danger) !important;
    box-sizing: border-box !important;
}

/* Keep borders visible on hover - match icon color and prevent border from disappearing */
.table tbody td .btn-icon.btn-outline-info:hover,
.table tbody td .btn-icon.btn-outline-info:focus,
.table tbody td .btn-icon.btn-outline-info:active,
.table tbody td .btn-icon.btn-outline-info:focus-visible,
.table tbody tr:hover td .btn-icon.btn-outline-info,
.table tbody tr:hover td .btn-icon.btn-outline-info:hover {
    border: 1px solid var(--bs-info) !important;
    border-width: 1px !important;
    border-style: solid !important;
    border-color: var(--bs-info) !important;
}

.table tbody td .btn-icon.btn-outline-primary:hover,
.table tbody td .btn-icon.btn-outline-primary:focus,
.table tbody td .btn-icon.btn-outline-primary:active,
.table tbody td .btn-icon.btn-outline-primary:focus-visible,
.table tbody tr:hover td .btn-icon.btn-outline-primary,
.table tbody tr:hover td .btn-icon.btn-outline-primary:hover {
    border: 1px solid var(--bs-primary) !important;
    border-width: 1px !important;
    border-style: solid !important;
    border-color: var(--bs-primary) !important;
}

.table tbody td .btn-icon.btn-outline-warning:hover,
.table tbody td .btn-icon.btn-outline-warning:focus,
.table tbody td .btn-icon.btn-outline-warning:active,
.table tbody td .btn-icon.btn-outline-warning:focus-visible,
.table tbody tr:hover td .btn-icon.btn-outline-warning,
.table tbody tr:hover td .btn-icon.btn-outline-warning:hover {
    border: 1px solid var(--bs-warning) !important;
    border-width: 1px !important;
    border-style: solid !important;
    border-color: var(--bs-warning) !important;
}

.table tbody td .btn-icon.btn-outline-danger:hover,
.table tbody td .btn-icon.btn-outline-danger:focus,
.table tbody td .btn-icon.btn-outline-danger:active,
.table tbody td .btn-icon.btn-outline-danger:focus-visible,
.table tbody tr:hover td .btn-icon.btn-outline-danger,
.table tbody tr:hover td .btn-icon.btn-outline-danger:hover {
    border: 1px solid var(--bs-danger) !important;
    border-width: 1px !important;
    border-style: solid !important;
    border-color: var(--bs-danger) !important;
}

/* Reduce gap for action buttons to save space */
.table tbody td .d-flex.gap-1 {
    gap: 0.25rem !important;
}

/* Ensure Individual Clients table fits without horizontal scroll */
#individualClientsTable {
    width: 100% !important;
}

#individualClientsTable th,
#individualClientsTable td {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Allow table-responsive to work properly on small screens */
.card-datatable.table-responsive {
    overflow-x: auto;
}

/* On normal PC screens (1200px+), ensure table fits without horizontal scroll */
@media (min-width: 1200px) {
    .card-datatable.table-responsive {
        overflow-x: auto !important;
    }

    #individualClientsTable_wrapper {
        width: 100% !important;
        max-width: 100% !important;
    }

    #individualClientsTable {
        max-width: 100% !important;
    }
}

/* ---- 9. البيانات الثانوية (النصوص الخافتة) ---- */
.table tbody td.text-muted,
.table tbody td .text-muted,
.table tbody td.secondary-data {
    color: #a0a0a0 !important;
    /* لون خافت للتاريخ مثلاً */
}

html.dark-style .table tbody td.text-muted,
html.dark-style .table tbody td .text-muted,
html.dark-style .table tbody td.secondary-data,
html[data-theme="dark"] .table tbody td.text-muted,
html[data-theme="dark"] .table tbody td .text-muted,
html[data-theme="dark"] .table tbody td.secondary-data,
html[data-bs-theme="dark"] .table tbody td.text-muted,
html[data-bs-theme="dark"] .table tbody td .text-muted,
html[data-bs-theme="dark"] .table tbody td.secondary-data {
    color: #a0a0a0 !important;
}

html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) .table tbody td.text-muted,
html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) .table tbody td .text-muted,
html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) .table tbody td.secondary-data {
    color: #8b92a7 !important;
}

/* ---- 10. تحسين استجابة الجدول للشاشات الصغيرة ---- */
@media (max-width: 768px) {
    .table {
        border-spacing: 0 0.5rem !important;
        padding: 0 0.25rem !important;
    }

    .table th,
    .table td {
        padding: 1rem 0.75rem !important;
        font-size: 0.875rem !important;
    }

    .table thead th {
        font-size: 0.75rem !important;
        padding: 0 0.75rem !important;
    }

    .table tbody td img,
    .avatar-placeholder,
    .avatar-initials,
    .image-placeholder {
        width: 40px !important;
        height: 40px !important;
    }

    .badge.bg-label-success,
    .badge.badge-soft-success,
    .badge.bg-label-danger,
    .badge.badge-soft-danger,
    .badge.bg-label-warning,
    .badge.badge-soft-warning,
    .badge.bg-label-info,
    .badge.badge-soft-info {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.75rem !important;
    }
}

/* ---- 11. DataTable specific enhancements ---- */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    padding: 0.5rem 0.75rem !important;
    border-radius: 0.5rem !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    transition: all 0.2s ease !important;
}

html.dark-style .dataTables_wrapper .dataTables_filter input,
html.dark-style .dataTables_wrapper .dataTables_length select,
html[data-theme="dark"] .dataTables_wrapper .dataTables_filter input,
html[data-theme="dark"] .dataTables_wrapper .dataTables_length select,
html[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter input,
html[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length select {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #e0e0e0 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) .dataTables_wrapper .dataTables_filter input,
html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) .dataTables_wrapper .dataTables_length select {
    background-color: #ffffff !important;
    color: #5d596c !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    outline: none !important;
    border-color: #7367f0 !important;
    box-shadow: 0 0 0 0.2rem rgba(115, 103, 240, 0.25) !important;
}

/* إزالة أي حدود افتراضية من الجدول */
.table tbody tr,
table.table tbody tr,
.dataTables_wrapper .table tbody tr {
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
    background-color: transparent !important;
    background: transparent !important;
}

.table tbody,
table.table tbody,
.dataTables_wrapper .table tbody {
    border: none !important;
    background-color: transparent !important;
    background: transparent !important;
}

/* ملاحظة: تم تعطيل هذا القسم لأننا نريد الظلال الاحترافية */
/* لا نزال نحتفظ بالظلال المخصصة في القواعد أعلاه */

/* إزالة أي خلفية من thead */
.table thead,
table.table thead,
.dataTables_wrapper .table thead {
    background-color: transparent !important;
    background: transparent !important;
    border: none !important;
}

/* إزالة أي خلفية من thead tr */
.table thead tr,
table.table thead tr,
.dataTables_wrapper .table thead tr {
    background-color: transparent !important;
    background: transparent !important;
    border: none !important;
}

/* =================================
   تأكيد المسافة بين أزرار الإجراءات
   ( index.js يضيف كلاس d-flex gap-2 )
   =================================
*/
.table tbody td .d-flex.gap-2 {
    /* gap-2 في بوتستراب تعني 0.5rem (أي 8 بكسل)
      نحن نؤكد تطبيقها هنا
    */
    gap: 0.5rem !important;
}

/* =================================
   التصميم الاحترافي لأزرار الإجراءات
   =================================
*/

/* Removed conflicting transparent button styles */

/* =================================
   إزالة التحديد من خلايا الجدول
   =================================
*/
.table tbody td,
table.table tbody td,
.dataTables_wrapper .table tbody td {
    /* منع تحديد النص في خلايا الجدول */
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

/* إزالة التحديد من جميع العناصر داخل الخلايا */
.table tbody td *,
table.table tbody td *,
.dataTables_wrapper .table tbody td * {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

/* منع highlight التحديد */
.table tbody td::selection,
table.table tbody td::selection,
.dataTables_wrapper .table tbody td::selection {
    background: transparent !important;
}

.table tbody td *::selection,
table.table tbody td *::selection,
.dataTables_wrapper .table tbody td *::selection {
    background: transparent !important;
}

/* =================================
   تصميم احترافي لأسهم الترتيب (Sorting Arrows)
   =================================
*/

/* تحسين مظهر رأس الجدول مع أسهم الترتيب */
table.dataTable thead th.sorting,
table.dataTable thead th.sorting_asc,
table.dataTable thead th.sorting_desc,
table.dataTable thead td.sorting,
table.dataTable thead td.sorting_asc,
table.dataTable thead td.sorting_desc {
    position: relative !important;
    cursor: pointer !important;
    padding-right: 2rem !important;
    transition: all 0.2s ease !important;
}

/* تأثير hover على رأس الجدول */
table.dataTable thead th.sorting:hover,
table.dataTable thead th.sorting_asc:hover,
table.dataTable thead th.sorting_desc:hover {
    color: #696cff !important;
    transition: color 0.2s ease !important;
}

/* تحسين أسهم الترتيب - تصميم احترافي */
table.dataTable thead .sorting::before,
table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::before,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::before,
table.dataTable thead .sorting_desc::after,
table.dataTable thead .sorting_asc_disabled::before,
table.dataTable thead .sorting_asc_disabled::after,
table.dataTable thead .sorting_desc_disabled::before,
table.dataTable thead .sorting_desc_disabled::after {
    /* تحسين المظهر */
    font-size: 0.7rem !important;
    opacity: 0.4 !important;
    transition: all 0.2s ease !important;
    /* Use readable carets to avoid glyph mismatch (x icon) */
    font-family: inherit !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    right: 0.75rem !important;
}

/* Default state: show both arrows with clear spacing */
table.dataTable thead .sorting::before {
    content: "⌃" !important;
    top: calc(50% - 7px) !important;
    bottom: auto !important;
}

table.dataTable thead .sorting::after {
    content: "⌄" !important;
    top: calc(50% + 7px) !important;
    bottom: auto !important;
}

/* Asc state: show one up arrow only */
table.dataTable thead .sorting_asc::before {
    content: "" !important;
}

table.dataTable thead .sorting_asc::after {
    content: "⌃" !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
}

/* Desc state: show one down arrow only */
table.dataTable thead .sorting_desc::before {
    content: "" !important;
}

table.dataTable thead .sorting_desc::after {
    content: "⌄" !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
}

html[dir="rtl"] table.dataTable thead th.sorting,
html[dir="rtl"] table.dataTable thead th.sorting_asc,
html[dir="rtl"] table.dataTable thead th.sorting_desc,
html[dir="rtl"] table.dataTable thead td.sorting,
html[dir="rtl"] table.dataTable thead td.sorting_asc,
html[dir="rtl"] table.dataTable thead td.sorting_desc {
    padding-right: 0.75rem !important;
    padding-left: 2rem !important;
}

html[dir="rtl"] table.dataTable thead .sorting::before,
html[dir="rtl"] table.dataTable thead .sorting::after,
html[dir="rtl"] table.dataTable thead .sorting_asc::before,
html[dir="rtl"] table.dataTable thead .sorting_asc::after,
html[dir="rtl"] table.dataTable thead .sorting_desc::before,
html[dir="rtl"] table.dataTable thead .sorting_desc::after {
    right: auto !important;
    left: 0.75rem !important;
}

/* عند التفعيل - السهم النشط يكون أوضح */
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::after {
    opacity: 1 !important;
    color: #696cff !important;
    font-size: 0.8rem !important;
}

/* تأثير hover على الأسهم */
table.dataTable thead th.sorting:hover::before,
table.dataTable thead th.sorting:hover::after,
table.dataTable thead th.sorting_asc:hover::before,
table.dataTable thead th.sorting_desc:hover::after {
    opacity: 0.7 !important;
    color: #696cff !important;
}

/* للثيم الفاتح */
html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) table.dataTable thead .sorting_asc::before {
    color: #696cff !important;
}

html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) table.dataTable thead .sorting_desc::after {
    color: #696cff !important;
}

html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) table.dataTable thead th.sorting:hover::before,
html:not(.dark-style):not([data-theme="dark"]):not([data-bs-theme="dark"]) table.dataTable thead th.sorting:hover::after {
    color: #696cff !important;
}

/* Final clean sorting indicators (override previous experimental styles) */
table.dataTable thead th.sorting::before,
table.dataTable thead th.sorting_asc::before,
table.dataTable thead th.sorting_desc::before,
table.dataTable thead td.sorting::before,
table.dataTable thead td.sorting_asc::before,
table.dataTable thead td.sorting_desc::before {
    content: "" !important;
}

table.dataTable thead th.sorting::after,
table.dataTable thead td.sorting::after {
    content: "⇅" !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    opacity: 0.45 !important;
    font-size: 0.72rem !important;
}

table.dataTable thead th.sorting_asc::after,
table.dataTable thead td.sorting_asc::after {
    content: "▲" !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    opacity: 1 !important;
    font-size: 0.62rem !important;
    color: #696cff !important;
}

table.dataTable thead th.sorting_desc::after,
table.dataTable thead td.sorting_desc::after {
    content: "▼" !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    opacity: 1 !important;
    font-size: 0.62rem !important;
    color: #696cff !important;
}

html[dir="rtl"] table.dataTable thead th.sorting::after,
html[dir="rtl"] table.dataTable thead th.sorting_asc::after,
html[dir="rtl"] table.dataTable thead th.sorting_desc::after,
html[dir="rtl"] table.dataTable thead td.sorting::after,
html[dir="rtl"] table.dataTable thead td.sorting_asc::after,
html[dir="rtl"] table.dataTable thead td.sorting_desc::after {
    right: auto !important;
    left: 0.75rem !important;
}

#btnDeleteSelected {
    display: none;
}

/* Wider filter controls for dashboard table filters */
#filter-controls .form-select.form-select-sm {
    min-width: 110px;
}

#filter-controls #usertype-filter {
    min-width: 130px;
}

#filter-controls #datatable-search {
    width: 240px;
    min-width: 220px;
}

/* Final sort icon alignment override */
table.dataTable thead th.sorting::before,
table.dataTable thead th.sorting_asc::before,
table.dataTable thead th.sorting_desc::before,
table.dataTable thead th.sorting_asc_disabled::before,
table.dataTable thead th.sorting_desc_disabled::before,
table.dataTable thead td.sorting::before,
table.dataTable thead td.sorting_asc::before,
table.dataTable thead td.sorting_desc::before,
table.dataTable thead td.sorting_asc_disabled::before,
table.dataTable thead td.sorting_desc_disabled::before {
    content: "" !important;
    display: none !important;
}

table.dataTable thead th.sorting::after,
table.dataTable thead td.sorting::after,
table.dataTable thead th.sorting_asc::after,
table.dataTable thead td.sorting_asc::after,
table.dataTable thead th.sorting_desc::after,
table.dataTable thead td.sorting_desc::after,
table.dataTable thead th.sorting_asc_disabled::after,
table.dataTable thead td.sorting_asc_disabled::after,
table.dataTable thead th.sorting_desc_disabled::after,
table.dataTable thead td.sorting_desc_disabled::after {
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    line-height: 1 !important;
}

table.dataTable thead th.sorting::after,
table.dataTable thead td.sorting::after {
    content: "⇅" !important;
    opacity: 0.45 !important;
    font-size: 0.72rem !important;
}

table.dataTable thead th.sorting_asc::after,
table.dataTable thead td.sorting_asc::after {
    content: "▲" !important;
    opacity: 1 !important;
    font-size: 0.62rem !important;
    color: #696cff !important;
}

table.dataTable thead th.sorting_desc::after,
table.dataTable thead td.sorting_desc::after {
    content: "▼" !important;
    opacity: 1 !important;
    font-size: 0.62rem !important;
    color: #696cff !important;
}

html[dir="rtl"] table.dataTable thead th.sorting::after,
html[dir="rtl"] table.dataTable thead td.sorting::after,
html[dir="rtl"] table.dataTable thead th.sorting_asc::after,
html[dir="rtl"] table.dataTable thead td.sorting_asc::after,
html[dir="rtl"] table.dataTable thead th.sorting_desc::after,
html[dir="rtl"] table.dataTable thead td.sorting_desc::after {
    right: auto !important;
    left: 0.75rem !important;
}

@media (max-width: 767.98px) {
    #filter-controls #datatable-search {
        width: 100%;
        min-width: 0;
    }
}

/* Keep Country action icons readable on clicked/selected rows */
#countriesTable tbody td .btn.btn-icon.border-0.text-primary,
#countriesTable tbody td .btn.btn-icon.border-0.text-danger {
    opacity: 1 !important;
    filter: none !important;
    background-color: transparent !important;
}

#countriesTable tbody td .btn.btn-icon.border-0.text-primary i,
#countriesTable tbody td .btn.btn-icon.border-0.text-danger i {
    opacity: 1 !important;
    filter: none !important;
}

#countriesTable tbody tr:hover td .btn.btn-icon.border-0.text-primary,
#countriesTable tbody tr:hover td .btn.btn-icon.border-0.text-danger,
#countriesTable tbody tr:active td .btn.btn-icon.border-0.text-primary,
#countriesTable tbody tr:active td .btn.btn-icon.border-0.text-danger,
#countriesTable tbody tr.selected td .btn.btn-icon.border-0.text-primary,
#countriesTable tbody tr.selected td .btn.btn-icon.border-0.text-danger,
#countriesTable tbody tr.table-active td .btn.btn-icon.border-0.text-primary,
#countriesTable tbody tr.table-active td .btn.btn-icon.border-0.text-danger {
    opacity: 1 !important;
    filter: none !important;
}

#countriesTable tbody tr:hover td .btn.btn-icon.border-0.text-primary i,
#countriesTable tbody tr:hover td .btn.btn-icon.border-0.text-danger i,
#countriesTable tbody tr:active td .btn.btn-icon.border-0.text-primary i,
#countriesTable tbody tr:active td .btn.btn-icon.border-0.text-danger i,
#countriesTable tbody tr.selected td .btn.btn-icon.border-0.text-primary i,
#countriesTable tbody tr.selected td .btn.btn-icon.border-0.text-danger i,
#countriesTable tbody tr.table-active td .btn.btn-icon.border-0.text-primary i,
#countriesTable tbody tr.table-active td .btn.btn-icon.border-0.text-danger i {
    opacity: 1 !important;
    filter: none !important;
}

/* Disable global hover brightness/lift for Country edit/delete icons */
#countriesTable tbody td .btn.btn-icon.border-0.text-primary:hover,
#countriesTable tbody td .btn.btn-icon.border-0.text-danger:hover,
#countriesTable tbody tr:hover td .btn.btn-icon.border-0.text-primary,
#countriesTable tbody tr:hover td .btn.btn-icon.border-0.text-danger {
    transform: none !important;
    box-shadow: none !important;
    filter: none !important;
    background-color: transparent !important;
}

#countriesTable tbody td .btn.btn-icon.border-0.text-primary i,
#countriesTable tbody tr:hover td .btn.btn-icon.border-0.text-primary i {
    color: #7367f0 !important;
}

#countriesTable tbody td .btn.btn-icon.border-0.text-danger i,
#countriesTable tbody tr:hover td .btn.btn-icon.border-0.text-danger i {
    color: #ea5455 !important;
}

/* Unified width for DataTables rows-count selector across all pages */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_length .form-select,
.dataTables_wrapper select[name$="_length"] {
    min-width: 120px !important;
    width: 120px !important;
}

/* =================================================================================
 * PROFILE AVATAR IMAGE - Unified Design
 * تصميم موحد لصور الملف الشخصي في dropdown بغض النظر عن الحجم والأبعاد
 * ================================================================================= */

/* تطبيق الأنماط على جميع صور الملف الشخصي */
.navbar-dropdown.dropdown-user .avatar img.profile-avatar-img,
.dropdown-user .avatar img.profile-avatar-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    border-radius: 50% !important;
    display: block !important;
}

/* التأكد من أن container الصورة له أبعاد ثابتة */
.navbar-dropdown.dropdown-user .avatar,
.dropdown-user .avatar {
    overflow: hidden !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* للصورة في dropdown toggle (الهيدر) */
.navbar-dropdown.dropdown-user .nav-link .avatar img.profile-avatar-img {
    min-width: 100% !important;
    min-height: 100% !important;
}

/* للصورة داخل dropdown menu */
.dropdown-user .dropdown-menu .avatar img.profile-avatar-img {
    min-width: 100% !important;
    min-height: 100% !important;
}

/* =================================================================================
 * PASSWORD TOGGLE ICON - Inside Input Field (Left Side)
 * أيقونة إظهار/إخفاء كلمة المرور داخل الحقل على اليسار
 * ================================================================================= */
.form-password-toggle {
    position: relative;
}

.form-password-toggle .password-toggle-icon {
    position: absolute !important;
    left: 0.75rem !important;
    right: auto !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 10 !important;
    color: var(--bs-body-color);
    transition: color 0.2s ease;
    pointer-events: auto !important;
    user-select: none;
    margin-left: 0.5rem !important;
    margin-right: 0 !important;
}

/* Override any conflicting styles */
.form-password-toggle .password-toggle-icon[class*="end-0"],
.form-password-toggle .password-toggle-icon[style*="right"] {
    left: 0.75rem !important;
    right: auto !important;
}

.form-password-toggle .password-toggle-icon:hover {
    color: var(--bs-primary);
}

.form-password-toggle input.ps-5,
.form-password-toggle input[class*="ps-5"] {
    padding-left: 2.75rem !important;
    padding-right: 0.75rem !important;
}

/* للثيم الداكن */
html.dark-style .form-password-toggle .password-toggle-icon,
html[data-theme="dark"] .form-password-toggle .password-toggle-icon,
html[data-bs-theme="dark"] .form-password-toggle .password-toggle-icon {
    color: var(--bs-body-color);
}

html.dark-style .form-password-toggle .password-toggle-icon:hover,
html[data-theme="dark"] .form-password-toggle .password-toggle-icon:hover,
html[data-bs-theme="dark"] .form-password-toggle .password-toggle-icon:hover {
    color: var(--bs-primary);
}

.modal-footer {
    display: flex !important;
    flex-direction: row-reverse !important;
}

/* Custom state (RTL - Arabic)
 * 1. Use natural order (row) as in HTML (Close button then Save button)
 * 2. Align to end (flex-end) which is "right" in RTL mode
 */
html[dir="rtl"] .modal-footer {
    flex-direction: row !important;
}

/* =================================================================================
 * MENU SEARCH RESULTS
 * ================================================================================= */
.search-results {
    position: relative;
    width: 100%;
    z-index: 10;
    background: transparent;
    max-height: none;
    overflow-y: visible;
    border: none;
    box-shadow: none;
    margin-top: 1rem !important;
    padding: 0 1rem;
}

html.dark-style .search-results {
    background: transparent !important;
}

.search-result-item {
    transition: all 0.2s ease;
    text-decoration: none !important;
    display: block;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
}

.search-result-item:hover {
    background-color: rgba(115, 103, 240, 0.08);
}

html.dark-style .search-result-item:hover {
    background-color: rgba(115, 103, 240, 0.15);
}

.menu-search-container {
    position: relative;
    transition: opacity 0.3s ease;
    padding: 0.5rem 1rem !important;
}

/* Fix Menu Search Bar Styling - Unified Pill Design */
.menu-search-container .input-group {
    background: rgba(115, 103, 240, 0.08) !important;
    border: 1px solid rgba(115, 103, 240, 0.2) !important;
    border-radius: 50px !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    overflow: hidden !important;
}

.menu-search-container .input-group:focus-within {
    background: rgba(115, 103, 240, 0.12) !important;
    border-color: #7367f0 !important;
    box-shadow: 0 0 0 3px rgba(115, 103, 240, 0.15) !important;
}

.menu-search-container .input-group-text {
    background: transparent !important;
    border: none !important;
    padding: 0 12px !important;
    color: #7367f0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.menu-search-container .form-control {
    background: transparent !important;
    border: none !important;
    height: 38px !important;
    padding: 0 12px !important;
    color: var(--bs-body-color) !important;
    font-weight: 500 !important;
    box-shadow: none !important;
}

/* RTL Specific Fixes */
[dir="rtl"] .menu-search-container .input-group {
    flex-direction: row-reverse !important;
}

[dir="rtl"] .menu-search-container .form-control {
    text-align: right !important;
}

/* Dark Mode Adjustments */
html.dark-style .menu-search-container .input-group {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}


/* Custom Scrollbar for Search Results */
.search-results {
    background: var(--bs-body-bg) !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
    max-height: 350px !important;
    overflow-y: auto !important;
    z-index: 1000 !important;
    border: 1px solid rgba(115, 103, 240, 0.1) !important;
    padding: 5px 0 !important;
}

html.dark-style .search-results {
    background: #2f3349 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
}

.search-result-item {
    padding: 12px 18px !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: flex !important;
    align-items: center !important;
    color: var(--bs-body-color) !important;
    text-decoration: none !important;
    font-size: 0.9rem !important;
}

html.dark-style .search-result-item {
    border-bottom-color: rgba(255, 255, 255, 0.05) !important;
}

.search-result-item:last-child {
    border-bottom: none !important;
}

.search-result-item i {
    font-size: 1.1rem !important;
    margin-right: 12px !important;
    color: #7367f0 !important;
}

[dir="rtl"] .search-result-item i {
    margin-right: 0 !important;
    margin-left: 12px !important;
}

.search-result-item:hover {
    background: rgba(115, 103, 240, 0.1) !important;
    color: #7367f0 !important;
    padding-left: 22px !important;
}

[dir="rtl"] .search-result-item:hover {
    padding-left: 18px !important;
    padding-right: 22px !important;
}

.search-results::-webkit-scrollbar {
    width: 5px;
}


.search-results::-webkit-scrollbar-thumb {
    background: #7367f0;
    border-radius: 10px;
}

.search-results::-webkit-scrollbar-track {
    background: transparent;
}

/* Export Button Aesthetic Consistency */
.dt-buttons .btn-primary.dropdown-toggle {
    background-color: #7367f0 !important;
    border-color: #7367f0 !important;
    color: #fff !important;
}

.dt-buttons .btn-primary.dropdown-toggle i,
.dt-buttons .btn-primary.dropdown-toggle span {
    color: #fff !important;
}

/* Export Button Aesthetic Consistency Fix */
.dt-buttons .btn-primary.dropdown-toggle,
.dt-buttons .btn-primary.dropdown-toggle:hover,
.dt-buttons .btn-primary.dropdown-toggle:active,
.dt-buttons .btn-primary.dropdown-toggle:focus {
    background-color: #7367f0 !important;
    border-color: #7367f0 !important;
    color: #fff !important;
}

.dt-buttons .btn-primary.dropdown-toggle i,
.dt-buttons .btn-primary.dropdown-toggle span {
    color: #fff !important;
}

/* =================================================================================
 * GLOBAL TABLE ROW HOVER FIX - اصلاح تباين الأيقونات عند تحويم الصف
 * ================================================================================= */

/* Ensure label buttons maintain their color and background on row hover */
.table tbody tr:hover .btn-label-primary,
.datatables-table tbody tr:hover .btn-label-primary {
    background-color: rgba(115, 103, 240, 0.12) !important;
    color: #7367f0 !important;
}

.table tbody tr:hover .btn-label-primary i,
.datatables-table tbody tr:hover .btn-label-primary i {
    color: #7367f0 !important;
}

.table tbody tr:hover .btn-label-success,
.datatables-table tbody tr:hover .btn-label-success {
    background-color: rgba(40, 199, 111, 0.12) !important;
    color: #28c76f !important;
}

.table tbody tr:hover .btn-label-success i,
.datatables-table tbody tr:hover .btn-label-success i {
    color: #28c76f !important;
}

.table tbody tr:hover .btn-label-danger,
.datatables-table tbody tr:hover .btn-label-danger {
    background-color: rgba(234, 84, 85, 0.12) !important;
    color: #ea5455 !important;
}

.table tbody tr:hover .btn-label-danger i,
.datatables-table tbody tr:hover .btn-label-danger i {
    color: #ea5455 !important;
}

.table tbody tr:hover .btn-label-warning,
.datatables-table tbody tr:hover .btn-label-warning {
    background-color: rgba(255, 159, 67, 0.12) !important;
    color: #ff9f43 !important;
}

.table tbody tr:hover .btn-label-warning i,
.datatables-table tbody tr:hover .btn-label-warning i {
    color: #ff9f43 !important;
}

.table tbody tr:hover .btn-label-info,
.datatables-table tbody tr:hover .btn-label-info {
    background-color: rgba(0, 207, 232, 0.12) !important;
    color: #00cfe8 !important;
}

.table tbody tr:hover .btn-label-info i,
.datatables-table tbody tr:hover .btn-label-info i {
    color: #00cfe8 !important;
}

.table tbody tr:hover .btn-label-secondary,
.datatables-table tbody tr:hover .btn-label-secondary {
    background-color: rgba(168, 170, 174, 0.12) !important;
    color: #a8aaae !important;
}

.table tbody tr:hover .btn-label-secondary i,
.datatables-table tbody tr:hover .btn-label-secondary i {
    color: #a8aaae !important;
}

/* Fix for icons inside normal buttons or standalone icons */
.table tbody tr:hover td i:not([class*="btn-label-"]):not(.text-white),
.datatables-table tbody tr:hover td i:not([class*="btn-label-"]):not(.text-white) {
    opacity: 1 !important;
}

/* Ensure action icons inside rows don't get too light on hover */
.table tbody tr:hover .btn-icon i,
.datatables-table tbody tr:hover .btn-icon i {
    filter: brightness(0.9);
    /* Slightly darken to increase contrast */
}

/* Dark mode specific adjustments for row hover */
html.dark-style .table tbody tr:hover .btn-label-primary,
html.dark-style .datatables-table tbody tr:hover .btn-label-primary {
    background-color: rgba(115, 103, 240, 0.2) !important;
}

html.dark-style .table tbody tr:hover .btn-label-success,
html.dark-style .datatables-table tbody tr:hover .btn-label-success {
    background-color: rgba(40, 199, 111, 0.2) !important;
}

html.dark-style .table tbody tr:hover .btn-label-danger,
html.dark-style .datatables-table tbody tr:hover .btn-label-danger {
    background-color: rgba(234, 84, 85, 0.2) !important;
}

/* DataTables Export Dropdown RTL Fix */
html[dir="rtl"] .dt-button-collection,
html[dir="rtl"] .dt-button-collection .dropdown-menu {
    direction: rtl !important;
    text-align: right !important;
    left: auto !important;
    right: 0 !important;
}

html[dir="rtl"] .dt-button-collection .dropdown-item {
    text-align: right !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
}

html[dir="rtl"] .dt-button-collection .dropdown-item i {
    margin-left: 0.5rem !important;
    margin-right: 0 !important;
}