@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@200..1000&family=Passero+One&family=Scheherazade+New:wght@400;500;600;700&display=swap');

/* متغيرات الألوان (مطابقة لـ common.css) */
:root {
    --primary-color: #22C0B0;
    --secondary-color: #23272A;
    --success-color: #2EC8A6;
    --danger-color: #F46F61;
    --warning-color: #E3C15D;
    --info-color: #3BA4F8;
    --light-color: #EAF5F4;
    --dark-color: #263238;
    --text-color: #263238;
    --border-color: #DADFE3;
    --card-shadow: 0 4px 16px rgba(38, 50, 56, 0.12);
    --transition: all 0.3s ease;
}

/* إعادة تعيين عام + الخط الأساسي */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: linear-gradient(135deg, #f5f6f8 0%, #eef0f3 100%);
    color: var(--text-color);
    direction: rtl;
    min-height: 100vh;
    font-family: "Cairo", sans-serif;
}

/* المحتوى الرئيسي */
.main-content {
    margin-top: 70px;
    padding: 2rem;
    min-height: calc(100vh - 70px);
    transition: margin-right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}


/* إحصائيات */
.stats-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    align-items: stretch;
}

.card-full-icon .value {
    font-size: 2.8rem;
    font-weight: 800;
    margin: 0.5rem 0;
}

.card-full-icon .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* البطاقات العادية */
.card-large {
    background: white;
    border-radius: 1px;
    padding: 1.5rem;
    box-shadow: none;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 120px;
}

.card-large:hover {
    transform: none;
}

.card-large .card-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-color);
    flex-shrink: 0;
    margin-left: 1rem;
    border: 1px solid var(--border-color);
}

.card-large .card-content {
    flex: 1;
}

.card-large .card-value {
    font-weight: bold;
    font-size: 1.5rem;
    color: var(--dark-color);
    margin-bottom: 0.25rem;
}

.card-large .card-subtitle {
    color: #666;
    font-size: 0.9rem;
}

/* بطاقة التحويلات الناجحة */
.card-success-new {
    background: white;
    color: var(--text-color);
    border:none;
    position: relative;
    padding: 1.5rem;
}

.card-success-new .card-icon {
    background: white;
    color: #fdca6d;
    border: none;
}

.card-success-new .card-value {
    color: #000;
    font-weight: bold;
    font-size: 1.5rem;
}

.card-success-new .card-value::after {
    content: ' ';
    font-size: 0.9rem;
    margin-right: 5px;
    color: black;
}

.card-success-new .card-subtitle {
    color: #666;
    font-size: 0.9rem;
}

.messages-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.messages-header h3 {
    font-size: 1.25rem;
    color: var(--dark-color);
    margin: 0;
}

.messages-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    height: 100%;
    padding: 0 2rem;
}

.message-stat {
    text-align: center;
    padding: 1rem;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.message-stat i {
    color: #5ad092;
    font-size: 1.2rem;
    margin-right: 5px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f8f9fa;
    margin-bottom: 1.2rem;
}

.chart-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark-color);
}

.chart-period {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 600;
    background: rgba(34, 192, 176, 0.1);
    padding: 0.4rem 0.9rem;
    border-radius: 30px;
}

.chart-container {
    position: relative;
    height: calc(100% - 70px);
    padding: 0.5rem 0;
}

.chart-card canvas {
    max-height: 100% !important;
}

/* بطاقة التحويلات الناجحة */

.card-triple .main-icon {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: #d6f3e4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: #2ec8a6;
    flex-shrink: 0;
    position: relative !important;
    top: 0px !important;
    margin-bottom: -25px !important;
    align-self: flex-start !important;
    margin-top: 0 !important;
}

.card-triple .triple-items {
    display: flex;
    flex: 1;
    justify-content: space-between;
}

.triple-item {
    text-align: center;
    padding: 0.5rem 1rem;
    transition: all 0.3s;
    position: relative;
    background: transparent !important;
    box-shadow: none !important;
}

.triple-item:hover {
    transform: none;
}

.triple-item i {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.triple-item .label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.4rem;
}

.triple-item .value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0.2rem 0;
}

/* Vertical dividers between triple items */
.triple-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background-color: var(--border-color);
}

/* اختيار الفترة */
.period-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.period-btn {
    background: white;
    border: 1.5px solid var(--border-color);
    color: var(--text-color);
    padding: 0.6rem 1.4rem;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.period-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.period-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* بطاقات الرسوم البيانية والجداول */
.chart-card,
.table-card {
    background: white;
    border-radius: 1px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: none;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    color: var(--dark-color);
    font-size: 1.35rem;
    font-weight: 700;
    font-family: "Scheherazade New", serif;
}

/* الجداول */
.table-responsive {
    overflow-x: auto;
    border-radius: 1px;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

.data-table th {
    background: var(--light-color);
    padding: 1rem 1.2rem;
    text-align: center;
    font-weight: 700;
    color: var(--dark-color);
    font-size: 1.02rem;
}

.data-table td {
    padding: 1rem 1.2rem;
    background: white;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr:hover {
    background: var(--light-color);
    box-shadow: 0 6px 20px rgba(34, 192, 176, 0.08);
}


/* ========== SYNC BUTTON ========== */
.sync-btn {
    background: var(--primary-color) !important;
    color: white !important;
    border: none !important;
    padding: 0.8rem 1.6rem !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: var(--transition) !important;
    box-shadow: 0 4px 12px rgba(34,192,176,0.3) !important;
}
.sync-btn:hover {
    background: #1AA89A !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(34,192,176,0.4) !important;
}
.sync-btn:disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* ========== CUSTOMERS PAGINATION ========== */
.customers-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 2rem;
    user-select: none;
}
.customers-pagination .page-arrow,
.customers-pagination .page-num {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}
.customers-pagination .page-arrow {
    background: white;
    color: var(--primary-color);
}
.customers-pagination .page-num {
    background: var(--light-color);
    color: var(--primary-color);
    min-width: 40px;
}
.customers-pagination .page-num.active,
.customers-pagination .page-num:hover,
.customers-pagination .page-arrow:hover {
    background: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
}
.customers-pagination .page-arrow:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* حالة الرسائل */
.status-badge {
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.completed  { background: rgba(46, 200, 166, 0.15); color: var(--success-color); }
.status-badge.pending    { background: rgba(227, 193, 93, 0.15); color: var(--warning-color); }
.status-badge.failed     { background: rgba(244, 111, 97, 0.15); color: var(--danger-color); }
.status-badge.recovered  { background: rgba(34, 192, 176, 0.15); color: var(--primary-color); }

/* أزرار عامة داخل الداشبورد */
.btn {
    padding: 0.75rem 1.6rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #1AA89A;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(34, 192, 176, 0.3);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #e55a50;
}

/* الإشعارات */
/* ========== IMPROVED NOTIFICATIONS DESIGN ========== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border-left: 4px solid;
    min-width: 320px;
    max-width: 400px;
    z-index: 10000;
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.notification::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8));
    animation: progressBar 5s linear forwards;
}

.notification.success {
    border-left-color: var(--success-color);
    background: linear-gradient(135deg, #f8fff8, #ffffff);
}

.notification.error {
    border-left-color: var(--danger-color);
    background: linear-gradient(135deg, #fff8f8, #ffffff);
}

.notification.info {
    border-left-color: var(--primary-color);
    background: linear-gradient(135deg, #f8fdff, #ffffff);
}

.notification.warning {
    border-left-color: var(--warning-color);
    background: linear-gradient(135deg, #fffbf8, #ffffff);
}

/* محتوى الإشعار */
.notification-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.notification-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.notification.success .notification-icon {
    background: var(--success-color);
    color: white;
}

.notification.error .notification-icon {
    background: var(--danger-color);
    color: white;
}

.notification.info .notification-icon {
    background: var(--primary-color);
    color: white;
}

.notification.warning .notification-icon {
    background: var(--warning-color);
    color: white;
}

.notification-message {
    flex: 1;
    color: var(--dark-color);
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* زر الإغلاق المحسن */
.notification-close {
    background: none;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #999;
    font-size: 1.1rem;
    font-weight: 300;
    flex-shrink: 0;
}

.notification-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--danger-color);
    transform: rotate(90deg);
}

.notification-close::before {
    content: '×';
}

/* شريط التقدم الزمني */
.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.notification-progress-bar {
    height: 100%;
    width: 100%;
    transform-origin: left;
    animation: progressShrink 5s linear forwards;
}

.notification.success .notification-progress-bar {
    background: var(--success-color);
}

.notification.error .notification-progress-bar {
    background: var(--danger-color);
}

.notification.info .notification-progress-bar {
    background: var(--primary-color);
}

.notification.warning .notification-progress-bar {
    background: var(--warning-color);
}

/* الأنيميشن */
@keyframes slideInRight {
    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 progressShrink {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

.notification.hiding {
    animation: slideOutRight 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* تصميم متجاوب */
@media (max-width: 768px) {
    .notification {
        min-width: unset;
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
        max-width: unset;
    }
}

@media (max-width: 480px) {
    .notification {
        padding: 16px;
        right: 10px;
        left: 10px;
        width: calc(100% - 20px);
    }
    
    .notification-content {
        gap: 10px;
    }
    
    .notification-message {
        font-size: 0.9rem;
    }
}

/* تحميل */
.loading-spinner {
    border: 4px solid #f0f0f0;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

/* أنيميشنات */
@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(30px, -30px) rotate(10deg); }
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.messages-slide {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.8rem;
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease;
    align-items: center;
    padding: 0 0.5rem;
}

/* Adjust card layouts for the other two cards */

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 1rem;
    flex-shrink: 0;
    font-size: 1.8rem;
    color: white;
}

.card-content {
    flex: 1;
}











/* Update the triple card layout and styles */
.messages-main-card {
    grid-area: 1 / 5 / 2 / 9;
    padding: 1rem;
    background: white;
    border-radius: 1px;
    box-shadow: var(--card-shadow);
    border: none;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Main icon on the right */
.main-card-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-left: 1.5rem;
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(34, 192, 176, 0.1);
    border-radius: 12px;
    position: relative;
    top: -10px; /* Adjusted from -20px to -10px */
    margin-bottom: -10px; /* Added to compensate for the negative top */
}

/* Messages stats slider adjustments */
.messages-stats-slider {
    position: relative;
    flex: 1;
    overflow: hidden;
}

.messages-slide.active {
    opacity: 1;
    visibility: visible;
    position: relative;
}

.message-stat {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 0 0.4rem;
}

.message-stat:nth-child(1)::after,
.message-stat:nth-child(2)::after,
.message-stat:nth-child(3)::after {
    content: '';
    position: absolute;
    right: -0.9rem;
    top: 50%;
    transform: translateY(-50%);
    height: 58px;
    width: 1px;
    background-color: #e0e0e0;
    opacity: 0.75;
}

.message-stat .label {
    font-size: 0.84rem;
    color: #666;
    margin-bottom: 0.25rem;   /* قللنا المسافة لرفع الـ value عن الـ dots */
    font-weight: 500;
    opacity: 0.95;
}

.message-stat .value-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    direction: ltr; /* مهم جدًا لعكس الترتيب في الـ RTL */
    justify-content: center;
}

.message-stat .value {
    font-size: 1.35rem;     /* أصغر قليلاً من قبل للتوازن */
    font-weight: 700;
    color: var(--dark-color);
}

.message-stat .value-container i {
    order: 1;
    font-size: 1.32rem;
    color: #5acf91 !important;   /* اللون المطلوب بالضبط */
}

.message-stat .value-container .value {
    order: 2;
    font-size: 1.32rem;
    font-weight: 700;
    color: var(--dark-color);
}
.message-stat i {
    font-size: 1.35rem;     /* أصغر من السابق للتناسق */
    color: var(--primary-color);
    opacity: 0.9;
}


/* Adjust the main card layout */
.card-triple {
    align-items: flex-end; /* Align content to bottom */
    padding-bottom: 0.5rem; /* Reduce bottom padding */
}

/* Ensure slider container takes full width */
.slider-container {
    flex: 1;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Slider arrows positioning */
.slider-arrows {
    position: absolute;
    bottom: 2px;
    left: 0;
    transform: translateX(-35%);
    display: flex;
    gap: 2px;
    z-index: 10;
    padding: 0 15px;
}

.slider-arrow {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--primary-color);
    font-size: 14px;
    box-shadow: none;
}

.slider-arrow:hover { 
    transform: translateY(-2px);
}

.slider-arrow:active {
    transform: translateY(0);
}

.slider-arrow i {
    transition: transform 0.2s ease;
}

.slider-arrow:active i {
    transform: scale(0.9);
}

/* Make sure the success conversions icon is visible */
.card-success-new .card-icon {
    background: #fef0d7;
    color: #fdca6d ;
}

.charts-wrapper {
    display: grid;
    gap: 1.8rem;
    margin-top: 1rem;
}

@media (min-width: 1200px) {
    .charts-wrapper {
        grid-template-columns: 3fr 4fr;  /* الأيسر 3 أجزاء، الأيمن 4 أجزاء */
    }
    .chart-left  { grid-column: 1; }
    .chart-right { grid-column: 2; }
}

@media (min-width: 1024px) and (max-width: 1199px) {
    .charts-wrapper {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1400px) {
    .stats-grid {
        grid-template-columns: 2fr 2fr 3fr;
    }
    .card-triple { grid-column: span 1; }
    .charts-fullwidth-wrapper {
        grid-template-columns: 2fr 3fr;   /* الأيسر 40% - الأيمن 60% */
        gap: 2.5rem;
    }
}

@media (min-width: 1024px) and (max-width: 1199px) {
    .charts-fullwidth-wrapper {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1024px) and (max-width: 1399px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.8rem;
    }
    .card-triple {
        grid-column: 1 / -1;
    }
}
@media (max-width: 1023px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .card-large,
    .card-triple {
        grid-column: 1 / -1;
    }
    .charts-wrapper {
        grid-template-columns: 1fr;
    }
    .chart-card {
        height: 420px !important;
    }
    .charts-fullwidth-wrapper {
        grid-template-columns: 1fr;
        gap: 1.8rem;
        margin: 2rem 0;
    }
}

/* لاب توب وتابلت كبير (1025px - 1399px) */
@media (max-width: 1399px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .card-triple {
        grid-column: 1 / -1; /* تأخذ الصف كامل */
    }
}

/* تابلت (768px - 1024px) */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .card-large,
    .card-triple {
        grid-column: 1 / -1;
    }
}

/* موبايل (≤768px) */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem 0.8rem;
        margin-top: 65px;
    }

    .period-selector {
        justify-content: center;
        gap: 0.6rem;
        flex-wrap: wrap;
    }

    .period-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        flex: 1;
        min-width: 75px;
    }

    /* إخفاء الأيقونة الكبيرة في البطاقة الثالثة على الموبايل */
    .card-triple .main-icon {
        display: none;
    }

    .card-triple {
        padding: 1.2rem;
        height: auto;
        min-height: 110px;
    }

    .slider-arrows {
        bottom: 6px;
        left: 50%;
        transform: translateX(-50%);
    }

    /* تقليص النصوص الطويلة بنقاط */
    .card-subtitle,
    .message-stat .label {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        font-size: 0.85rem !important;
    }

    .card-value,
    .message-stat .value {
        font-size: 1.4rem !important;
    }

    .chart-card {
        height: 360px;
        padding: 1.2rem;
    }
    .charts-fullwidth-wrapper {
        margin: 1.5rem 0;
        gap: 1.5rem;
    }

    .slider-arrows {
        position: absolute;
        bottom: 2px;
        left: 0;
        transform: translateX(-35%);
        display: flex;
        gap: 2px;
        z-index: 10;
        padding: 0 15px;
    }

    .slider-arrow {
        width: 16px;
        height: 16px;
        border-radius: 50%;
        background: white;
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        color: var(--primary-color);
        font-size: 14px;
        box-shadow: none;
    }
}

/* موبايل صغير جدًا (≤480px) */
@media (max-width: 480px) {
    .card-large,
    .card-triple {
        flex-direction: column;
        text-align: center;
        padding: 1.3rem 1rem;
        height: auto;
    }

    .card-large .card-icon {
        margin: 0 auto 0.8rem;
        margin-left: auto;
    }

    .card-value {
        font-size: 1.5rem !important;
    }

    .card-subtitle {
        font-size: 0.8rem !important;
    }

    .message-stat .label {
        font-size: 0.78rem !important;
    }

    .chart-card {
        height: 340px;
    }

    .chart-header h3 {
        font-size: 1rem;
    }
}

/* تحسين عرض الرسوم البيانية على الموبايل */
.chart-card {
    background: white;
    border-radius: 1px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
    padding: 1.8rem;
    height: 520px;
    transition: all 0.4s ease;
}

@media (max-width: 768px) {
    .chart-card {
        height: 400px;
    }
}

@media (max-width: 480px) {
    .chart-card {
        height: 340px !important;
        padding: 1rem;
    }
    .chart-header h3 {
        font-size: 0.95rem;
    }
    .chart-period {
        font-size: 0.75rem;
}

/* جعل النصوص الطويلة تتقطع بنقاط في كل مكان */
.card-subtitle,
.message-stat .label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* تحسين السلايدر على الموبايل */
@media (max-width: 768px) {
    .messages-slide {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 0.8rem;
        padding: 0.5rem;
    }
    
    .message-stat {
        padding: 0.5rem 0.2rem;
    }
    
    .message-stat .value-container {
        flex-direction: column;
        gap: 0.3rem;
    }
    
    .message-stat i {
        font-size: 1.1rem;
    }
}
}

.charts-fullwidth-wrapper {
    display: grid;
    gap: 2rem;
    margin: 2.5rem 0;
    grid-template-columns: 1fr; /* افتراضيًا تحت بعض */
}

/* تحسين تصميم Select2 البسيط */
.select2-container {
    width: 300px !important;
}

.select2-container--default .select2-selection--single {
    background: white;
    border: 2px solid #E8ECEF;
    border-radius: 10px;
    height: 48px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.select2-container--default .select2-selection--single:hover {
    border-color: var(--primary-color);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--dark-color);
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 48px;
    padding: 0 45px 0 15px;
    text-align: right;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 48px;
    width: 40px;
    left: 0;
    right: auto;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--primary-color) transparent transparent transparent;
    border-width: 6px 6px 0 6px;
}

/* Dropdown تحسينات بسيطة */
.select2-container--default .select2-dropdown {
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.select2-container--default .select2-results__option {
    padding: 10px 15px;
    text-align: right;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--primary-color);
    color: white;
}

/* جعل العناصر على نفس السطر */
.sync-container {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

/* تصميم متجاوب */
@media (max-width: 768px) {
    .sync-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .select2-container {
        width: 100% !important;
    }
    
    #syncCustomers {
        width: 100%;
    }
}
/* ========== GLOBAL SELECT2 STYLING ========== */
.select2-container .select2-selection--single {
    height: 45px !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    background-color: #fff !important;
    transition: var(--transition);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-color) !important;
    line-height: 45px !important;
    padding-right: 15px !important;
    padding-left: 30px !important;
    font-size: 0.95rem;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 43px !important;
    right: auto !important;
    left: 10px !important;
}

.select2-dropdown {
    border: 1px solid var(--border-color) !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1) !important;
    overflow: hidden !important;
    z-index: 9999 !important;
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid var(--border-color) !important;
    border-radius: 6px !important;
    padding: 8px !important;
    outline: none !important;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: var(--primary-color) !important;
}

.select2-results__option {
    padding: 10px 15px !important;
    font-size: 0.9rem !important;
}

.select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.select2-container--default .select2-selection--single:focus,
.select2-container--open .select2-selection--single {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(34, 192, 176, 0.1) !important;
}

