/* ===== إعادة تعيين الأساسيات ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

/* ===== متغيرات التصميم الجديد ===== */
:root {
    /* الألوان الأساسية - تدرج أزرق أنيق */
    --primary: #1e40af;
    --primary-light: #3b82f6;
    --primary-dark: #1e3a8a;
    --primary-gradient: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    
    /* الألوان الثانوية - تدرج أخضر */
    --secondary: #059669;
    --secondary-light: #10b981;
    --secondary-dark: #047857;
    --secondary-gradient: linear-gradient(135deg, #059669 0%, #10b981 100%);
    
    /* الألوان المحايدة */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* ألوان الحالة */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    
    /* الظلال */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* الانتقالات */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease-out;
    
    /* الحدود المنحنية */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
    --radius-full: 9999px;
    
    /* نظام الخطوط الموحد */
    --font-family-primary: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-family-secondary: 'Tajawal', 'Cairo', sans-serif;
    
    /* أحجام الخطوط */
    --font-size-xs: 0.75rem;      /* 12px */
    --font-size-sm: 0.875rem;     /* 14px */
    --font-size-base: 1rem;       /* 16px */
    --font-size-lg: 1.125rem;     /* 18px */
    --font-size-xl: 1.25rem;      /* 20px */
    --font-size-2xl: 1.5rem;      /* 24px */
    --font-size-3xl: 1.875rem;    /* 30px */
    --font-size-4xl: 2.25rem;     /* 36px */
    
    /* أوزان الخطوط */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;
    
    /* ارتفاع الأسطر */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
}

/* ===== الخط والنص ===== */
body {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: var(--gray-800);
    background: var(--gray-50);
    direction: rtl;
    text-align: right;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== العناوين الموحدة ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--gray-900);
    margin: 0;
}

h1 {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-extrabold);
}

h2 {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
}

h3 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
}

h4 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
}

h5 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
}

h6 {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
}

/* ===== الفقرات والنصوص ===== */
p {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-relaxed);
    margin: 0;
}

small {
    font-size: var(--font-size-sm);
}

strong, b {
    font-weight: var(--font-weight-bold);
}

/* ===== التسميات والعناوين الفرعية ===== */
label, .form-label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--gray-700);
}

.section-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--gray-900);
}

.card-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--gray-900);
}

.stat-label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--gray-600);
}

/* ===== شريط التمرير المخصص ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: var(--radius-full);
    transition: var(--transition);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ===== الحاوية الرئيسية - متجاوبة 80% ===== */
.container {
    margin: 0 auto;
    padding: 0 2rem;
    width: 80%;
    max-width: 80%;
}

@media (max-width: 1280px) {
    .container {
        width: 90%;
        max-width: 90%;
        padding: 0 1.5rem;
    }
}

@media (max-width: 1024px) {
    .container {
        width: 95%;
        max-width: 95%;
        padding: 0 1.5rem;
    }
}

@media (max-width: 768px) {
    .container {
        width: 98%;
        max-width: 98%;
        padding: 0 1rem;
    }
}

@media (max-width: 640px) {
    .container {
        width: 100%;
        max-width: 100%;
        padding: 0 1rem;
    }
}

/* ===== الهيدر الجديد - تصميم مينيمال أنيق ===== */
.header {
    background: #ffffff;
    position: relative;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.header-content {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    padding: 1rem 0;
}

/* زر تسجيل الخروج */
.logout-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-base);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
}

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

.logout-btn i {
    font-size: 1.1rem;
}

.logout-btn span {
    font-weight: var(--font-weight-semibold);
}

@media (max-width: 640px) {
    .logout-btn span {
        display: none;
    }
    
    .logout-btn {
        padding: 0.65rem;
        min-width: 42px;
        justify-content: center;
    }
    
    .logo-text h1 {
        font-size: var(--font-size-base);
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(30, 64, 175, 0.25);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.logo-icon::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.6s ease;
}

.logo-icon:hover::before {
    left: 100%;
}

.logo-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30, 64, 175, 0.4);
}

.logo-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.logo-text p {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 500;
}

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

.candidate-info-center {
    text-align: center;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    padding: 0.65rem 1.75rem;
    border-radius: 16px;
    color: #ffffff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.2);
    transition: all 0.3s ease;
    min-width: 260px;
}

.candidate-info-center::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -30px);
}

.candidate-info-center:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.candidate-info-center h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    position: relative;
    z-index: 2;
    letter-spacing: 0.3px;
}

.candidate-info-center p {
    font-size: 0.8rem;
    opacity: 0.9;
    font-weight: 500;
    position: relative;
    z-index: 2;
}




/* ===== التنقل الجديد المحسن ===== */
.nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 999;
    padding: 0.75rem 0;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.nav-container {
    display: flex;
    justify-content: center;
}

.nav-list {
    display: flex;
    list-style: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.9) 100%);
    border-radius: 20px;
    padding: 0.5rem;
    gap: 0.35rem;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    color: #4b5563;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    white-space: nowrap;
    overflow: hidden;
}

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

.nav-link:hover::before {
    left: 100%;
}

.nav-link:hover {
    color: #1e40af;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(30, 64, 175, 0.1);
    transform: translateY(-2px);
}

.nav-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 
        0 10px 30px rgba(102, 126, 234, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: #fbbf24;
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.5);
}

.nav-link i {
    font-size: 0.95rem;
    transition: transform 0.3s ease;
}

.nav-link:hover i {
    transform: scale(1.08);
}

.nav-link.active i {
    transform: scale(1.02);
}

/* ===== المحتوى الرئيسي ===== */
.main {
    padding: 2rem 0 4rem;
    min-height: calc(100vh - 200px);
}

.section {
    display: none;
    opacity: 0;
    transform: translateY(20px);
}

.section.active {
    display: block;
    animation: sectionFadeIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.section.fade-out {
    animation: sectionFadeOut 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes sectionFadeIn {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes sectionFadeOut {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@keyframes titleSlideIn {
    0% {
        opacity: 0;
        transform: translateX(-15px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* تأثيرات العناصر داخل الأقسام */
.section.active .card,
.section.active .stat-card,
.section.active .dashboard-card {
    animation: cardSlideIn 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: calc(var(--card-index, 0) * 0.05s);
    opacity: 0;
}

@keyframes cardSlideIn {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.section.active .card:nth-child(1) { --card-index: 1; }
.section.active .card:nth-child(2) { --card-index: 2; }
.section.active .card:nth-child(3) { --card-index: 3; }
.section.active .card:nth-child(4) { --card-index: 4; }
.section.active .card:nth-child(5) { --card-index: 5; }
.section.active .card:nth-child(6) { --card-index: 6; }

.section.active .stat-card:nth-child(1) { --card-index: 1; }
.section.active .stat-card:nth-child(2) { --card-index: 2; }
.section.active .stat-card:nth-child(3) { --card-index: 3; }
.section.active .stat-card:nth-child(4) { --card-index: 4; }

/* ===== عناوين الأقسام ===== */
.section-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 2rem;
    font-weight: 800;
    animation: titleSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    color: var(--gray-900);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-200);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 60px;
    height: 2px;
    background: var(--primary-gradient);
    border-radius: var(--radius-full);
}

.section-title i {
    color: var(--primary);
    font-size: 1.75rem;
}

/* ===== البطاقات الجديدة ===== */
.card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    overflow: hidden;
}

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

.card-header {
    padding: 1.5rem 2rem 1rem;
    border-bottom: 1px solid var(--gray-100);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-title i {
    color: var(--primary);
    font-size: 1.1rem;
}

.card-body {
    padding: 2rem;
}

/* ===== الإحصائيات الجديدة ===== */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
}

@media (min-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
        margin-bottom: 2rem;
    }
}

/* تنسيق قائمة الداعمين بدون هواتف */
.no-phone-list {
    padding: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 768px) {
    .no-phone-list {
        padding: 1rem;
        max-height: 400px;
    }
}

.no-phone-list .table-responsive {
    overflow-x: auto;
    margin: 0 -0.5rem;
    padding: 0 0.5rem;
}

.no-phone-list table {
    width: 100%;
    min-width: 400px;
    border-collapse: collapse;
    margin-top: 0.5rem;
    background: var(--white);
}

.no-phone-list th,
.no-phone-list td {
    padding: 0.75rem 1rem;
    text-align: right;
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}

.no-phone-list th {
    font-weight: 600;
    background-color: var(--gray-50);
    color: var(--gray-700);
    position: sticky;
    top: 0;
    z-index: 1;
}

.no-phone-list tr:hover {
    background-color: var(--gray-50);
}

.no-phone-list tr:last-child td {
    border-bottom: none;
}

.no-phone-list .btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.no-phone-list .btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.no-phone-list .no-results {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--success);
    background: var(--gray-50);
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.no-phone-list .no-results i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
    color: var(--success);
}

.no-phone-list .no-results p {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.no-phone-list .no-results small {
    color: var(--gray-600);
    display: block;
}

.stat-info {
    padding: 0.5rem 1rem;
    color: var(--gray-600);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--gray-200);
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

@media (min-width: 640px) {
    .stat-card {
        padding: 1.5rem;
        border-radius: var(--radius-lg);
    }
}

@media (min-width: 1024px) {
    .stat-card {
        padding: 2rem;
        border-radius: var(--radius-xl);
    }
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-gradient);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* ===== الرسم البياني ===== */
.chart-container {
    margin: 2rem 0;
}

.chart-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}

.chart-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-200);
}

.chart-header h3 {
    font-size: 1.5rem;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chart-header h3 i {
    color: var(--primary);
    font-size: 1.75rem;
}

.chart-body {
    position: relative;
    height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 20px;
}

.chart-body canvas {
    max-height: 100%;
    max-width: 100%;
}

@media (max-width: 768px) {
    .chart-card {
        padding: 1.5rem;
    }
    
    .chart-header h3 {
        font-size: 1.25rem;
    }
    
    .chart-body {
        height: 300px;
    }
}

/* ===== الحفظ التلقائي ===== */
.auto-backup-status {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 2rem;
    color: white;
    box-shadow: var(--shadow-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.backup-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
}

.backup-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.backup-details h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.backup-details p {
    opacity: 0.9;
    margin-bottom: 0.75rem;
}

.last-update {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    opacity: 0.95;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: inline-flex;
}

.last-update i {
    font-size: 1rem;
}

.quick-backup-buttons {
    display: flex;
    gap: 1rem;
    flex-direction: column;
}

.btn-sm {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .auto-backup-status {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }
    
    .backup-info {
        flex-direction: column;
        text-align: center;
    }
    
    .quick-backup-buttons {
        width: 100%;
    }
    
    .quick-backup-buttons .btn {
        width: 100%;
    }
}

/* ===== Backup Actions - تم نقلها إلى table-header ===== */
/* الأزرار الآن ضمن .table-actions في رأس الجدول */

/* ===== قوائم المناطق والهواتف ===== */
.districts-list-container {
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    width: 100%;
    max-height: 500px;
    overflow-y: auto;
}

.no-phone-list-container {
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    max-width: 400px;
    max-height: 400px;
    overflow-y: auto;
}

.search-box-inline {
    position: relative;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius);
    padding: 0.5rem 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-box-inline i.fa-search {
    color: var(--gray-500);
    margin-left: 0.5rem;
}

.search-input-inline {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.95rem;
    color: var(--gray-800);
    font-family: 'Cairo', sans-serif;
}

.search-input-inline::placeholder {
    color: var(--gray-400);
}

.clear-search-btn {
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    border-radius: 50%;
    width: 24px;
    height: 24px;
}

.clear-search-btn:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.top-districts-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.district-item {
    background: rgba(255, 255, 255, 0.95);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.district-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.district-rank {
    font-size: 2.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.district-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.district-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--gray-800);
    font-size: 1rem;
}

.district-count {
    background: var(--primary);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    display: inline-block;
}

/* ===== Gender Chart with Stats ===== */
.chart-with-stats-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.total-supporters-card {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    border-radius: var(--radius-xl);
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}

.total-supporters-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.total-icon {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.total-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.total-number {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-extrabold);
    color: white;
    line-height: 1;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.total-label {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: rgba(255, 255, 255, 0.95);
}

.chart-card-enhanced {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.chart-header-enhanced {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 1.5rem 2rem;
    border-bottom: 2px solid var(--gray-200);
}

.chart-header-enhanced h3 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

.chart-header-enhanced i {
    color: var(--primary);
    font-size: 1.5rem;
}

.chart-body-enhanced {
    padding: 2rem;
}

.chart-canvas-wrapper {
    position: relative;
    max-width: 400px;
    margin: 0 auto 2rem;
}

/* النص المركزي - غير مستخدم بعد التحويل إلى Column Chart */
/*
.chart-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}

.center-number {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-extrabold);
    color: var(--gray-900);
    line-height: 1;
}

.center-label {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--gray-600);
    margin-top: 0.25rem;
}
*/

.gender-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.gender-stat-item {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
    border: 2px solid transparent;
}

.gender-stat-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.male-stat {
    border-color: rgba(59, 130, 246, 0.2);
}

.male-stat:hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.female-stat {
    border-color: rgba(236, 72, 153, 0.2);
}

.female-stat:hover {
    border-color: #ec4899;
    background: rgba(236, 72, 153, 0.05);
}

.stat-icon-small {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.male-stat .stat-icon-small {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.female-stat .stat-icon-small {
    background: linear-gradient(135deg, #ec4899 0%, #f472b6 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

.stat-details {
    flex: 1;
}

.stat-number-small {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-extrabold);
    color: var(--gray-900);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label-small {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.stat-percentage {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
}

.male-stat .stat-percentage {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.female-stat .stat-percentage {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

@media (max-width: 1024px) {
    .chart-with-stats-container {
        grid-template-columns: 1fr;
    }
    
    .total-supporters-card {
        flex-direction: row;
        padding: 2rem;
    }
    
    .total-icon {
        width: 80px;
        height: 80px;
        font-size: 2.5rem;
    }
}

@media (max-width: 640px) {
    .gender-stats {
        grid-template-columns: 1fr;
    }
    
    .total-supporters-card {
        flex-direction: column;
    }
}

/* ===== Top Districts Card ===== */
.top-districts-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    margin-bottom: 2rem;
}

.top-districts-header {
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 50%, #c4b5fd 100%);
    padding: 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
}

.top-districts-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.top-districts-header::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.15) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: white;
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.2),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.3);
    animation: pulse-trophy 2s ease-in-out infinite;
}

@keyframes pulse-trophy {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
    }
}

.header-text h3 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: white;
    margin: 0 0 0.5rem 0;
}

.header-text p {
    font-size: var(--font-size-base);
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.total-districts-badge {
    background: rgba(255, 255, 255, 0.98);
    padding: 1.2rem 1.8rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.15),
        0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.total-districts-badge:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 32px rgba(0, 0, 0, 0.2),
        0 4px 12px rgba(0, 0, 0, 0.15);
}

.total-districts-badge i {
    font-size: 1.5rem;
    color: #7c3aed;
}

.total-districts-badge span {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-extrabold);
    color: #7c3aed;
    line-height: 1;
}

.total-districts-badge small {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    font-weight: var(--font-weight-medium);
}

.top-districts-body {
    padding: 2.5rem;
    background: linear-gradient(to bottom, #fafafa 0%, #f5f5f5 100%);
}

.top-districts-chart-wrapper {
    position: relative;
    height: 500px;
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.top-districts-chart-wrapper canvas {
    max-height: 100%;
    max-width: 100%;
}

/* Top 3 Districts Special Styling */
.top-district-1 {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 50%, #fde68a 100%);
    border: 3px solid #fbbf24;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 10px 30px rgba(251, 191, 36, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.1);
}

.top-district-1::before {
    content: '🥇';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 2.5rem;
    opacity: 0.3;
    z-index: 0;
}

.top-district-1::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(to bottom, #fbbf24 0%, #f59e0b 100%);
    box-shadow: -2px 0 8px rgba(251, 191, 36, 0.5);
}

.top-district-1:hover {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 50%, #fcd34d 100%);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 15px 40px rgba(251, 191, 36, 0.4),
        0 8px 20px rgba(0, 0, 0, 0.15);
}

.top-district-2 {
    background: linear-gradient(135deg, #f9fafb 0%, #e5e7eb 50%, #d1d5db 100%);
    border: 3px solid #9ca3af;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 10px 30px rgba(156, 163, 175, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.1);
}

.top-district-2::before {
    content: '🥈';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 2.5rem;
    opacity: 0.3;
    z-index: 0;
}

.top-district-2::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(to bottom, #9ca3af 0%, #6b7280 100%);
    box-shadow: -2px 0 8px rgba(156, 163, 175, 0.5);
}

.top-district-2:hover {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 50%, #b8bcc4 100%);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 15px 40px rgba(156, 163, 175, 0.4),
        0 8px 20px rgba(0, 0, 0, 0.15);
}

.top-district-3 {
    background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 50%, #fdba74 100%);
    border: 3px solid #f97316;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 10px 30px rgba(249, 115, 22, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.1);
}

.top-district-3::before {
    content: '🥉';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 2.5rem;
    opacity: 0.3;
    z-index: 0;
}

.top-district-3::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(to bottom, #f97316 0%, #ea580c 100%);
    box-shadow: -2px 0 8px rgba(249, 115, 22, 0.5);
}

.top-district-3:hover {
    background: linear-gradient(135deg, #fed7aa 0%, #fdba74 50%, #fb923c 100%);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 15px 40px rgba(249, 115, 22, 0.4),
        0 8px 20px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
    .top-districts-header {
        flex-direction: column;
        text-align: center;
    }
    
    .header-content {
        flex-direction: column;
    }
    
    .total-districts-badge {
        width: 100%;
        justify-content: center;
    }
}

.no-phone-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.no-phone-item {
    background: rgba(255, 255, 255, 0.95);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    color: var(--gray-800);
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.no-phone-item:hover {
    transform: translateX(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.no-phone-item i {
    color: var(--danger);
}

/* Scrollbar styling */
.districts-list-container::-webkit-scrollbar,
.no-phone-list-container::-webkit-scrollbar {
    width: 8px;
}

.districts-list-container::-webkit-scrollbar-track,
.no-phone-list-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.districts-list-container::-webkit-scrollbar-thumb,
.no-phone-list-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.districts-list-container::-webkit-scrollbar-thumb:hover,
.no-phone-list-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
    .districts-list-container,
    .no-phone-list-container {
        max-width: 100%;
        max-height: 250px;
    }
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.stat-icon {
    width: 45px;
    height: 45px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--white);
    background: var(--primary-gradient);
    box-shadow: var(--shadow-md);
}

@media (min-width: 640px) {
    .stat-icon {
        width: 50px;
        height: 50px;
        border-radius: var(--radius-md);
    }
}

@media (min-width: 1024px) {
    .stat-icon {
        width: 60px;
        height: 60px;
        border-radius: var(--radius-lg);
    }
}

.stat-icon.male {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.stat-icon.female {
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
}

.stat-icon.contact {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
}

.stat-number {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-extrabold);
    line-height: var(--line-height-tight);
    color: var(--gray-900);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    color: var(--gray-600);
    font-weight: 500;
}

.stat-change {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

/* ===== الشرائح العمرية ===== */
.age-groups-card {
    min-width: 320px;
}

.age-groups-container {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.age-group-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-100);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.age-group-item:hover {
    background: var(--primary-50);
    border-color: var(--primary-200);
}

.age-range {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
    min-width: 50px;
}

.age-count {
    font-weight: 700;
    color: var(--primary-600);
    font-size: 1rem;
    min-width: 30px;
    text-align: center;
}

.age-percentage {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 500;
    min-width: 35px;
    text-align: left;
}

/* شريط تقدم للشرائح العمرية */
.age-group-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--progress-width, 0%);
    background: linear-gradient(90deg, var(--primary-200), var(--primary-300));
    border-radius: var(--radius);
    opacity: 0.3;
    transition: width 0.3s ease;
    z-index: 0;
}

.age-group-item > * {
    position: relative;
    z-index: 1;
}

/* ===== أكثر المناطق الداعمة ===== */
.top-districts-card {
    min-width: 320px;
}

.stat-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1rem;
}

.stat-title i {
    color: var(--primary);
}

.stat-total {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.top-districts-container {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.district-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

.district-item:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.district-name {
    font-weight: 500;
    color: var(--gray-700);
    font-size: 0.95rem;
}

.district-count {
    font-size: 0.9rem;
    color: var(--gray-600);
    background: var(--gray-50);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
}

.no-districts {
    text-align: center;
    color: var(--gray-500);
    padding: 2rem;
}

/* Reserved for future sections */

.empty-phones {
    text-align: center;
    color: var(--gray-500);
    padding: 3rem 2rem;
    font-size: 0.95rem;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--gray-300);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.empty-phones::before {
    content: '📱';
    font-size: 2rem;
    opacity: 0.5;
}

/* ===== النماذج الجديدة ===== */
.form-container {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.form-header {
    background: var(--gray-50);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--gray-200);
}

.form-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.form-title i {
    color: var(--primary);
}

.form-body {
    padding: 2rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-label i {
    color: var(--primary);
    font-size: 0.875rem;
}

.form-input {
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-normal);
    color: var(--gray-800);
}

.form-input.invalid-date {
    border-color: var(--error);
    background-color: rgba(239, 68, 68, 0.05);
    background: var(--white);
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input::placeholder {
    color: var(--gray-400);
    font-weight: 400;
}

/* ===== Custom Select Styling ===== */
select.form-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234b5563' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 1rem center;
    background-size: 12px;
    padding-left: 2.5rem;
    cursor: pointer;
}

select.form-input:hover {
    border-color: var(--primary-light);
    background-color: var(--gray-50);
}

select.form-input:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%233b82f6' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

select.form-input option {
    padding: 0.75rem;
    background: white;
    color: var(--gray-800);
    font-weight: 500;
}

select.form-input option:hover,
select.form-input option:checked {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: var(--primary);
}

/* Custom styling for date inputs */
input[type="date"].form-input {
    position: relative;
    cursor: pointer;
}

input[type="date"].form-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

input[type="date"].form-input:hover::-webkit-calendar-picker-indicator {
    opacity: 1;
}

/* ===== الأزرار الجديدة ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.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;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 2px solid var(--gray-200);
}

.btn-secondary:hover {
    background: var(--gray-200);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--secondary-gradient);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-warning {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #92400e;
    border: 2px solid #fbbf24;
    font-weight: 600;
    box-shadow: var(--shadow-md);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    border-color: #f59e0b;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
    margin-top: 1.5rem;
}

/* ===== البحث الجديد ===== */
.search-container {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    margin-bottom: 2rem;
    overflow: hidden;
}

.search-header {
    background: var(--gray-50);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--gray-200);
}

.search-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.search-title i {
    color: var(--primary);
}

.search-body {
    padding: 2rem;
}

.search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Sort Section */
.sort-section {
    padding: 1.5rem 0;
    border-top: 1px solid var(--gray-200);
    margin-top: 1.5rem;
}

.sort-section .form-label {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--gray-700);
}

.sort-section .form-label i {
    color: var(--primary);
}

.sort-options {
    max-width: 400px;
}

.search-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--gray-200);
    flex-wrap: wrap;
}

.sort-section-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-section-inline .form-label {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.sort-section-inline select {
    min-width: 180px;
    padding: 0.5rem 1rem;
}

.search-actions .action-buttons .btn {
    padding: 0.75rem 1.5rem !important;
    min-width: auto !important;
    width: auto !important;
    height: auto !important;
    font-size: 1rem !important;
    white-space: nowrap;
}

.search-actions .action-buttons .btn i {
    margin-left: 0.5rem;
    font-size: 1rem !important;
}

.search-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn-warning i {
    margin-left: 0.5rem;
}

@media (max-width: 768px) {
    .search-buttons {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .search-buttons .btn {
        width: 100%;
        justify-content: center;
    }
}

.search-results-info {
    font-size: 0.95rem;
    color: var(--gray-600);
    font-weight: 500;
}

.results-count {
    font-weight: 700;
    color: var(--primary);
}

/* ===== الجداول الجديدة ===== */
.table-container {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.table-header {
    background: var(--gray-50);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.table-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    order: 1;
}

.table-title i {
    color: var(--primary);
}

.table-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: nowrap;
    order: 2;
    margin: 0 auto;
}

.table-actions .btn {
    white-space: nowrap;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.table-actions .btn:hover::before {
    left: 100%;
}

.table-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

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

.table-actions .btn-success {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.table-actions .btn-info {
    background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
}

.table-actions .btn-danger {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
}

@media (max-width: 1024px) {
    .table-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .table-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .table-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .table-actions .btn {
        flex: 1 1 auto;
        min-width: 140px;
        justify-content: center;
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }
}

.table-wrapper {
    overflow-x: auto;
    max-height: 70vh;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    background: white;
    border: 1px solid var(--gray-200);
}

/* تحسين شريط التمرير */
.table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

.supporters-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: var(--font-size-sm);
    table-layout: auto; /* عرض تلقائي حسب المحتوى */
    min-width: 100%;
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-normal);
}

/* ===== قسم واتساب الرئيسي ===== */
.whatsapp-main-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.whatsapp-main-header {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: white;
}

.whatsapp-main-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    flex-shrink: 0;
}

.whatsapp-main-header h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.whatsapp-main-header p {
    margin: 0;
    opacity: 0.95;
    font-size: 1rem;
}

.whatsapp-main-body {
    padding: 2rem;
}

.info-alert {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 2px solid #3b82f6;
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
}

.info-alert i {
    font-size: 1.5rem;
    color: #3b82f6;
    margin-top: 0.2rem;
}

.info-alert strong {
    color: #1e40af;
}

.whatsapp-textarea {
    font-size: 1.05rem;
    line-height: 1.6;
    min-height: 150px;
}

.char-counter-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.char-hint {
    color: var(--gray-600);
    font-size: 0.875rem;
}

.char-hint i {
    color: var(--info);
}

.whatsapp-main-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.whatsapp-main-actions .btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1.05rem;
}

.usage-instructions {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 2rem;
}

.usage-instructions h4 {
    margin: 0 0 1rem 0;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.usage-instructions h4 i {
    color: var(--primary);
}

.usage-instructions ol {
    margin: 0;
    padding-right: 1.5rem;
}

.usage-instructions li {
    margin-bottom: 0.75rem;
    color: var(--gray-700);
    line-height: 1.6;
}

.usage-instructions li:last-child {
    margin-bottom: 0;
}

.whatsapp-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.whatsapp-stat-item {
    background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.whatsapp-stat-item:hover {
    border-color: #25D366;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.1);
}

.whatsapp-stat-item i {
    font-size: 2rem;
    color: #25D366;
}

.whatsapp-stat-item .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.whatsapp-stat-item .stat-label {
    display: block;
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* ===== Message Templates Section ===== */
.message-templates-section {
    margin-bottom: 2rem;
}

.templates-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-200);
}

.templates-header h4 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.templates-header i {
    color: #25D366;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.template-card {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.template-card:hover {
    border-color: #25D366;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.15);
    transform: translateY(-2px);
}

.template-card.active {
    border-color: #25D366;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.2);
}

.template-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.template-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.template-card.active .template-name {
    color: #166534;
}

.template-badges {
    display: flex;
    gap: 0.5rem;
}

.template-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.template-badge.active {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
}

.template-message {
    color: var(--gray-700);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    max-height: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.template-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-200);
}

.template-actions .btn {
    flex: 1;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
}

/* Active Message Card */
.active-message-card {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.active-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary);
}

.active-message-header h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.active-badge {
    padding: 0.35rem 0.75rem;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.active-message-content {
    background: white;
    padding: 1rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    color: var(--gray-800);
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 150px;
    overflow-y: auto;
    border-left: 4px solid var(--primary);
    margin-bottom: 0.75rem;
}

.active-message-name {
    font-size: 0.9rem;
    color: var(--primary-dark);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.active-message-name::before {
    content: '📝';
}

/* Checkbox Label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    transition: all 0.3s ease;
}

.checkbox-label:hover {
    background: var(--gray-100);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-label span {
    font-size: 1rem;
    font-weight: 500;
    color: var(--gray-800);
}

/* ===== WhatsApp Log Styles ===== */
.whatsapp-log-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-top: 2rem;
}

.whatsapp-log-header {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.log-header-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
}

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

.log-header-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.whatsapp-log-stats {
    background: var(--gray-50);
    padding: 1rem 1.5rem;
    display: flex;
    gap: 2rem;
    border-bottom: 1px solid var(--gray-200);
    flex-wrap: wrap;
}

.log-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-700);
    font-size: 0.95rem;
}

.log-stat i {
    color: #25D366;
    font-size: 1.1rem;
}

.log-stat strong {
    color: var(--gray-900);
    font-weight: 700;
}

.whatsapp-log-body {
    padding: 1.5rem;
    max-height: 500px;
    overflow-y: auto;
}

.empty-log {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-500);
}

.empty-log i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-log p {
    font-size: 1.1rem;
    margin: 0;
}

.log-entry {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: var(--transition);
}

.log-entry:hover {
    border-color: #25D366;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.1);
}

.log-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.log-entry-name {
    font-weight: 700;
    color: var(--gray-900);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.log-entry-name i {
    color: #25D366;
}

.log-entry-time {
    font-size: 0.85rem;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.log-entry-time i {
    font-size: 0.75rem;
}

.log-entry-phone {
    color: var(--gray-700);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.log-entry-phone i {
    color: var(--primary);
    font-size: 0.85rem;
}

.log-entry-message {
    background: white;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--gray-700);
    line-height: 1.5;
    border-left: 3px solid #25D366;
    max-height: 100px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .whatsapp-main-header {
        flex-direction: column;
        text-align: center;
    }
    
    .whatsapp-main-actions {
        flex-direction: column;
    }
    
    .whatsapp-main-actions .btn {
        width: 100%;
    }
}

/* ===== قسم الإعدادات ===== */
.settings-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    overflow: hidden;
}

.settings-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
}

.settings-title i {
    font-size: 1.3rem;
}

.settings-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.settings-badge.danger {
    background: var(--danger);
}

.settings-body {
    padding: 1.5rem;
}

.settings-description {
    background: var(--info-light);
    color: var(--info-dark);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.settings-description i {
    margin-top: 0.2rem;
}

.char-counter {
    text-align: left;
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.settings-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    gap: 1rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 2px solid var(--gray-200);
    transition: var(--transition);
}

.setting-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.setting-info {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.setting-info > i {
    font-size: 1.5rem;
    color: var(--primary);
    margin-top: 0.25rem;
}

.setting-info h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    color: var(--gray-900);
}

.setting-info p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray-300);
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--success);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Data Stats */
.data-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.data-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 2px solid var(--gray-200);
}

.data-stat i {
    font-size: 2rem;
    color: var(--primary);
}

.data-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.data-label {
    display: block;
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* Danger Zone */
.danger-zone {
    background: #fff5f5;
    border: 2px solid var(--danger);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.danger-zone h4 {
    color: var(--danger);
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.danger-zone p {
    color: var(--gray-700);
    margin: 0 0 1rem 0;
}

.danger-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* About Info */
.about-info {
    display: grid;
    gap: 1rem;
}

.about-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.about-item strong {
    color: var(--gray-700);
}

.about-item span {
    color: var(--gray-900);
    font-weight: 600;
}

@media (max-width: 768px) {
    .settings-actions,
    .danger-actions {
        flex-direction: column;
    }
    
    .settings-actions .btn,
    .danger-actions .btn {
        width: 100%;
    }
}

/* ===== قسم رسالة واتساب (قديم - للتوافق) ===== */
.whatsapp-message-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    overflow: hidden;
}

.whatsapp-header {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.whatsapp-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
}

.whatsapp-title i {
    font-size: 1.3rem;
}

.whatsapp-body {
    padding: 1.5rem;
}

.form-textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: 'Cairo', sans-serif;
    resize: vertical;
    transition: var(--transition);
    min-height: 100px;
}

.form-textarea:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.form-hint {
    display: block;
    margin-top: 0.5rem;
    color: var(--gray-600);
    font-size: 0.9rem;
}

.form-hint i {
    color: var(--info);
    margin-left: 0.25rem;
}

.whatsapp-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .whatsapp-actions {
        flex-direction: column;
    }
    
    .whatsapp-actions .btn {
        width: 100%;
    }
}

/* ===== أزرار الهاتف والواتساب ===== */
.phone-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: space-between;
}

.phone-number {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--gray-700);
}

.phone-buttons {
    display: flex;
    gap: 0.5rem;
}

.phone-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.call-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.call-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.whatsapp-btn {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
}

.whatsapp-btn:hover {
    background: linear-gradient(135deg, #128C7E 0%, #075E54 100%);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

.phone-btn i {
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .phone-actions {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .phone-buttons {
        width: 100%;
        justify-content: flex-start;
    }
}

.supporters-table th {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 0.875rem 1rem;
    text-align: center;
    font-family: var(--font-family-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--gray-900);
    border-bottom: 3px solid var(--primary);
    border-right: 1px solid var(--gray-200);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
    letter-spacing: 0.3px;
    vertical-align: middle;
}

.supporters-table th:first-child {
    border-right: none;
    border-top-right-radius: var(--radius);
}

.supporters-table th:last-child {
    border-left: none;
    border-top-left-radius: var(--radius);
}

.supporters-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    border-right: 1px solid var(--gray-200);
    text-align: center;
    font-family: var(--font-family-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: var(--gray-800);
    background: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.supporters-table td:first-child {
    border-right: none;
    font-weight: 700;
    color: var(--primary);
}

.supporters-table td:last-child {
    border-left: none;
    background: var(--gray-50);
}

/* ===== ضبط عرض الأعمدة بشكل تلقائي ===== */
/* عمود الرقم التسلسلي */
.supporters-table th:nth-child(1),
.supporters-table td:nth-child(1) {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
}

/* عمود الاسم الرباعي */
.supporters-table th:nth-child(2),
.supporters-table td:nth-child(2) {
    min-width: 200px;
    max-width: 300px;
    text-align: right;
    padding-right: 1.5rem;
}

.supporters-table .name-cell {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--gray-900);
}

/* عمود رقم الهاتف */
.supporters-table th:nth-child(3),
.supporters-table td:nth-child(3) {
    width: 130px;
    min-width: 130px;
    direction: ltr;
    text-align: center;
}

.supporters-table .phone-cell {
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-normal);
    color: var(--gray-800);
    letter-spacing: 0.5px;
}

.supporters-table .phone-number-display {
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-normal);
    color: var(--gray-800);
}

/* عمود الجنس */
.supporters-table th:nth-child(4),
.supporters-table td:nth-child(4) {
    width: 80px;
    min-width: 80px;
    font-family: var(--font-family-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
}

/* عمود تاريخ الولادة */
.supporters-table th:nth-child(5),
.supporters-table td:nth-child(5) {
    width: 120px;
    min-width: 120px;
    font-family: var(--font-family-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-normal);
    color: var(--gray-800);
}

/* عمود القضاء/الناحية */
.supporters-table th:nth-child(6),
.supporters-table td:nth-child(6) {
    min-width: 150px;
    max-width: 200px;
    font-family: var(--font-family-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-normal);
    color: var(--gray-800);
}

/* عمود الإجراءات */
.supporters-table th:nth-child(7),
.supporters-table td:nth-child(7) {
    width: 200px;
    min-width: 200px;
}

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

/* ===== تصنيف الجنس ===== */
.gender-male {
    color: var(--primary) !important;
    font-weight: 700;
}

.gender-female {
    color: #ec4899 !important;
    font-weight: 700;
}

/* ===== إجراءات الجدول ===== */
.table-actions {
    white-space: nowrap;
    width: 140px;
    text-align: center;
    padding: 0.5rem !important;
}

.action-buttons {
    display: flex !important;
    gap: 0.25rem;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    min-height: 35px;
}

.action-buttons .btn {
    padding: 0;
    min-width: 32px;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-size: 0.875rem;
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    margin: 0;
}

.action-buttons .btn i {
    font-size: 0.875rem;
    margin: 0;
}

.action-buttons .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.table-actions .btn {
    padding: 0.4rem 0.5rem;
    min-width: 30px;
    height: 30px;
    border-radius: 4px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    margin: 0 1px;
}

.table-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.table-actions .btn i {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
    display: block;
}

/* تحسين ألوان أزرار الإجراءات */
.table-actions .btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.table-actions .btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

.table-actions .btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

.table-actions .btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.table-actions .btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.table-actions .btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

/* التأكد من ظهور الأزرار */
.table-actions .btn {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
}

.table-actions .btn i {
    opacity: 1 !important;
    visibility: visible !important;
}

/* إصلاح مشكلة عدم ظهور الأزرار */
.supporters-table .table-actions .btn {
    background-color: var(--primary) !important;
    color: white !important;
    border: 1px solid var(--primary) !important;
}

.supporters-table .table-actions .btn-secondary {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
}

.supporters-table .table-actions .btn-danger {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
}

/* ===== تفاصيل التواريخ ===== */
.supporter-info-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--primary-100) 100%);
    border-radius: var(--radius);
    border: 1px solid var(--primary-200);
}

.supporter-avatar {
    width: 60px;
    height: 60px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: var(--shadow-md);
}

.supporter-basic-info h3 {
    margin: 0 0 0.5rem 0;
    color: var(--gray-800);
    font-size: 1.25rem;
    font-weight: 700;
}

.supporter-basic-info p {
    margin: 0.25rem 0;
    color: var(--gray-600);
    font-size: 0.9rem;
    font-weight: 500;
}



.supporter-basic-info .supporter-location {
    color: var(--gray-500);
    font-size: 0.85rem;
}

.date-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.date-card {
    background: var(--white);
    border: 2px solid var(--gray-100);
    border-radius: var(--radius-lg);
    padding: 0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.date-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
}

.date-card.created::before {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

.date-card.updated::before {
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
}

.date-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem 0.5rem;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 100%);
}

.date-card.created .date-card-header {
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
}

.date-card.updated .date-card-header {
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
}

.date-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-200);
}

.date-card .date-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.date-card.created .date-icon {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: white;
}

.date-card.updated .date-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    color: white;
}

.date-badge {
    background: var(--gray-100);
    color: var(--gray-700);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.date-card.created .date-badge {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: white;
}

.date-card.updated .date-badge {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    color: white;
}

.date-content {
    padding: 1rem 1.5rem 1.5rem;
}

.date-content h4 {
    margin: 0 0 1rem 0;
    color: var(--gray-800);
    font-size: 1.1rem;
    font-weight: 700;
}

.date-display {
    margin-bottom: 1rem;
}

.date-main {
    color: var(--gray-900);
    font-size: 1.1rem;
    font-weight: 700;
    direction: rtl;
    margin-bottom: 0.25rem;
    font-family: 'Cairo', sans-serif;
}

.date-relative {
    color: var(--gray-500);
    font-size: 0.85rem;
    font-weight: 500;
    background: var(--gray-50);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    display: inline-block;
}

.date-details {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-600);
    font-size: 0.85rem;
    line-height: 1.4;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    border-left: 3px solid var(--gray-300);
}

.date-card.created .date-details {
    background: #f0fdf4;
    border-left-color: #10b981;
}

.date-card.updated .date-details {
    background: #f0f9ff;
    border-left-color: #3b82f6;
}

.date-details i {
    color: var(--gray-400);
    font-size: 0.75rem;
}

.date-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.date-actions .btn {
    min-width: 140px;
}

/* ===== نافذة التأكيد ===== */
.confirmation-content {
    text-align: center;
    padding: 1rem 0;
}

.confirmation-icon-wrapper {
    margin-bottom: 1.5rem;
}

.confirmation-icon {
    font-size: 3rem;
    color: #f59e0b;
    animation: pulse 2s infinite;
}

.confirmation-message {
    font-size: 1.1rem;
    color: var(--gray-700);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.confirmation-details {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem;
    margin-top: 1rem;
    text-align: right;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@media (max-width: 768px) {
    .supporter-info-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .date-info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .date-card-header {
        padding: 0.75rem 1rem 0.5rem;
    }
    
    .date-content {
        padding: 0.75rem 1rem 1rem;
    }
    
    .date-content h4 {
        font-size: 1rem;
    }
    
    .date-main {
        font-size: 1rem;
    }
    
    .date-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .date-actions .btn {
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    /* تجاوب التصميم الجديد للتواريخ */
    .date-details-container {
        padding: 1rem;
    }
    
    .supporter-avatar-large {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .supporter-name {
        font-size: 1.25rem;
    }
    
    .supporter-meta {
        gap: 0.25rem;
    }
    
    .supporter-meta span {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .divider {
        margin: 1.5rem 0;
    }
    
    .divider-text {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .dates-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .date-header {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .date-icon-wrapper {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .date-header h3 {
        font-size: 1rem;
    }
    
    .date-body {
        padding: 0.75rem 1rem 1rem;
    }
    
    .date-primary {
        font-size: 1rem;
    }
    
    .date-actions-center {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .date-actions-center .btn {
        width: 100%;
    }
}

/* ===== النوافذ المنبثقة الجديدة ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 2000;
    animation: fadeIn 0.3s ease-out;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInModal {
    from {
        opacity: 0;
        transform: scale(0.7) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease-out;
    position: relative;
    animation: slideInModal 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideInModal {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-title i {
    color: var(--primary);
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--gray-100);
    border: none;
    color: var(--gray-500);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1rem 2rem 2rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* ===== الإشعارات الجديدة ===== */
.notification {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--white);
    color: var(--gray-800);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--gray-200);
    z-index: 3000;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.notification.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.notification.success {
    border-left: 4px solid var(--success);
}

.notification.error {
    border-left: 4px solid var(--error);
}

.notification.warning {
    border-left: 4px solid var(--warning);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--white);
}

.notification.success .notification-icon {
    background: var(--success);
}

.notification.error .notification-icon {
    background: var(--error);
}

.notification.warning .notification-icon {
    background: var(--warning);
}

.notification-message {
    font-weight: 500;
    font-size: 0.95rem;
    flex: 1;
}

/* زر إغلاق الإشعار */
.notification-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: rgba(0, 0, 0, 0.05);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--gray-600);
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-right: 0.5rem;
}

.notification-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--gray-800);
    transform: scale(1.1);
}

.notification-close:active {
    transform: scale(0.95);
}

/* تحسين زر الإغلاق للإشعارات الملونة */
.notification.undo-notification .notification-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.notification.undo-notification .notification-close:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

/* ===== حالة فارغة ===== */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray-500);
}

.no-results i {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: 1rem;
}

.no-results h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.no-results p {
    font-size: 1rem;
    color: var(--gray-500);
}

/* ===== تفاصيل الداعم ===== */
.supporter-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.detail-card {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--gray-200);
}

.detail-card h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-card h4 i {
    color: var(--primary);
    font-size: 0.875rem;
}

.detail-card p {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-900);
}

.detail-card.personal {
    border-left: 4px solid var(--primary);
}

.detail-card.system {
    border-left: 4px solid var(--secondary);
}

/* ===== تفاصيل التواريخ - التصميم الجديد ===== */
.date-details-container {
    padding: 2rem;
    max-width: 100%;
}

/* معلومات الداعم في الوسط */
.supporter-profile-center {
    text-align: center;
    margin-bottom: 2rem;
}

.supporter-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
    margin: 0 auto 1rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    animation: profilePulse 3s ease-in-out infinite;
}

@keyframes profilePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.supporter-name {
    margin: 0 0 0.5rem 0;
    color: var(--gray-900);
    font-size: 1.5rem;
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.supporter-phone-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0 0 1rem 0;
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: white;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Segoe UI', 'Tahoma', monospace;
    direction: ltr;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.2);
    transition: all 0.3s ease;
}

.supporter-phone-display:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(30, 64, 175, 0.3);
}

.supporter-phone-display i {
    font-size: 1rem;
}

.supporter-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.supporter-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--gray-50);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
    transition: all 0.2s ease;
}

.supporter-meta span:hover {
    background: var(--gray-100);
    transform: translateY(-1px);
}



.location-info i {
    color: #ef4444;
}

.gender-info i {
    color: var(--primary);
}

/* الخط الفاصل */
.divider {
    display: flex;
    align-items: center;
    margin: 2rem 0;
    gap: 1rem;
}

.divider-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--gray-300) 50%, transparent 100%);
}

.divider-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-600);
    white-space: nowrap;
}

.divider-text i {
    color: var(--primary);
}

/* تخطيط التواريخ */
.dates-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.date-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    border: 2px solid var(--gray-100);
    transition: all 0.3s ease;
    position: relative;
}

.date-section:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.date-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.created-section::before {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

.updated-section::before {
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
}

.date-header {
    padding: 1.5rem 1.5rem 1rem;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 100%);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.created-section .date-header {
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
}

.updated-section .date-header {
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
}

.date-icon-wrapper {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.created-section .date-icon-wrapper {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
}

.updated-section .date-icon-wrapper {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
}

.date-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-800);
}

.date-body {
    padding: 1rem 1.5rem 1.5rem;
}

.date-primary {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    direction: rtl;
    font-family: 'Cairo', sans-serif;
}

.date-secondary {
    font-size: 0.85rem;
    color: var(--gray-500);
    background: var(--gray-50);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    display: inline-block;
    margin-bottom: 1rem;
    font-weight: 500;
}

.date-description {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: var(--gray-600);
    line-height: 1.4;
    border-right: 3px solid var(--gray-300);
}

.created-section .date-description {
    background: #f0fdf4;
    border-right-color: #10b981;
}

.updated-section .date-description {
    background: #f0f9ff;
    border-right-color: #3b82f6;
}

.date-description i {
    color: var(--gray-400);
    font-size: 0.75rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

/* أزرار الإجراءات */
.date-actions-center {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

/* ===== نسخ البيانات ===== */
.copy-details {
    margin-top: 1.5rem;
}

.copy-section, .empty-section {
    margin-bottom: 1.5rem;
}

.copy-section h4, .empty-section h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.copy-list, .no-copy-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.copy-item {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.copy-item.copy-yes {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.copy-item.copy-empty {
    background: rgba(156, 163, 175, 0.1);
    color: var(--gray-500);
    border: 1px solid rgba(156, 163, 175, 0.2);
}

/* ===== التصميم المتجاوب ===== */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .search-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .header-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
        padding: 1.5rem 0;
    }
    
    .logo {
        justify-content: center;
        gap: 1rem;
    }
    
    .logo-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .logo-text h1 {
        font-size: 1.25rem;
    }
    
    .logo-text p {
        font-size: 0.8rem;
    }
    
    .header-center {
        order: 2;
    }
    
    .candidate-info-center {
        padding: 1rem 2rem;
        min-width: auto;
        width: 100%;
        max-width: 350px;
        margin: 0 auto;
    }
    
    .candidate-info-center h2 {
        font-size: 1.2rem;
    }
    
    .candidate-info-center p {
        font-size: 0.8rem;
    }
    
    .system-badge-right {
        order: 3;
        padding: 0.5rem 1.5rem;
        gap: 0.5rem;
    }
    
    .badge-icon {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }
    
    .badge-text h3 {
        font-size: 0.875rem;
    }
    
    .badge-text p {
        font-size: 0.7rem;
    }
    
    .nav {
        top: 0;
        position: relative;
    }
    
    .nav-list {
        flex-wrap: wrap;
        justify-content: center;
        padding: 0.5rem;
        gap: 0.25rem;
    }
    
    .nav-link {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
        gap: 0.5rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .form-body, .card-body {
        padding: 1.5rem;
    }
    
    .table-wrapper {
        max-height: 60vh;
    }
    
    .supporters-table {
        font-size: 0.7rem;
        min-width: 1000px; /* عرض أدنى للشاشات الصغيرة */
        font-family: 'Segoe UI', 'Tahoma', 'Arial', sans-serif;
    }
    
    .supporters-table th,
    .supporters-table td {
        padding: 0.4rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .supporters-table th {
        font-size: 0.65rem;
    }
    
    /* الحفاظ على التوزيع المتساوي في الشاشات الصغيرة */
    .supporters-table th:nth-child(2),
    .supporters-table td:nth-child(2) {
        font-size: 0.65rem;
    }
    
    .supporters-table th:nth-child(3),
    .supporters-table td:nth-child(3) {
        font-size: 0.65rem;
    }
    
    .supporters-table th:nth-child(6),
    .supporters-table td:nth-child(6) {
        font-size: 0.6rem;
    }
    
    .supporters-table th:nth-child(7),
    .supporters-table td:nth-child(7) {
        font-size: 0.65rem;
    }
    
    .supporters-table th:nth-child(8),
    .supporters-table td:nth-child(8) {
        font-size: 0.6rem;
    }
    
    .table-actions .btn {
        padding: 0.3rem 0.35rem;
        min-width: 24px;
        height: 24px;
        font-size: 0.6rem;
        gap: 0.1rem;
    }
    
    .table-actions .btn i {
        font-size: 0.6rem;
        font-weight: 600;
    }
    
    .table-actions {
        gap: 0.2rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-header, .modal-body, .modal-footer {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 1rem 0;
        gap: 1rem;
    }
    
    .logo {
        gap: 0.75rem;
    }
    
    .logo-icon {
        width: 45px;
        height: 45px;
        font-size: 1.125rem;
    }
    
    .logo-text h1 {
        font-size: 1.125rem;
    }
    
    .logo-text p {
        font-size: 0.75rem;
    }
    
    .system-badge {
        padding: 0.5rem 1rem;
        gap: 0.5rem;
        border-radius: 30px;
    }
    
    .badge-icon {
        width: 25px;
        height: 25px;
        font-size: 0.7rem;
    }
    
    .badge-text h3 {
        font-size: 0.8rem;
    }
    
    .badge-text p {
        font-size: 0.65rem;
    }
    
    .candidate-info-center {
        padding: 0.75rem 1.5rem;
        border-radius: 20px;
        max-width: 300px;
    }
    
    .candidate-info-center h2 {
        font-size: 1rem;
    }
    
    .candidate-info-center p {
        font-size: 0.75rem;
    }
    
    .system-badge-right {
        padding: 0.5rem 1rem;
        border-radius: 40px;
    }
    
    .nav-list {
        padding: 0.25rem;
        gap: 0.125rem;
        border-radius: 20px;
    }
    
    .nav-link {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        border-radius: 15px;
    }
    
    .nav-link span {
        display: none;
    }
    
    .section-title {
        font-size: 1.25rem;
        gap: 0.5rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .search-actions {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .table-actions {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .table-actions .btn {
        width: 100%;
        min-width: auto;
    }
}

/* ===== تحسينات إضافية ===== */
.loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid var(--gray-300);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== تحسينات الأداء ===== */
* {
    will-change: auto;
}

.btn, .nav-link, .card, .stat-card {
    will-change: transform;
}

.modal {
    will-change: opacity;
}

.notification {
    will-change: transform, opacity;
}

/* ===== نافذة اختيار الحقول للتصدير ===== */
.export-fields-modal {
    max-width: 600px;
    width: 100%;
}

.export-fields-modal h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--gray-800);
    font-size: 1.25rem;
}

.export-fields-modal h3 i {
    color: var(--primary);
}

.modal-description {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.fields-selection {
    margin-bottom: 2rem;
}

.selection-controls {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.75rem;
}

.field-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.field-checkbox:hover {
    background: var(--gray-100);
    border-color: var(--primary-200);
}

.field-checkbox input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-400);
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.field-checkbox input[type="checkbox"]:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.field-checkbox input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.field-label {
    font-size: 0.9rem;
    color: var(--gray-700);
    font-weight: 500;
}

.field-checkbox input[type="checkbox"]:checked ~ .field-label {
    color: var(--primary);
    font-weight: 600;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

/* تجاوب نافذة اختيار الحقول */
@media (max-width: 768px) {
    .export-fields-modal {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    .fields-grid {
        grid-template-columns: 1fr;
    }
    
    .selection-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    
/* Reserved for future styles */
    }
    
    .data-grid {
        grid-template-columns: 1fr;
    }
    
    .copy-family-modal .modal-actions {
        flex-direction: column;
    }
    
    .copy-family-modal .modal-actions .btn {
        width: 100%;
    }

/* ===== تأثيرات الحذف ===== */
.supporters-table tr {
    transition: all 0.3s ease;
}

.supporters-table tbody tr:hover {
    background: #f9fafb;
}

.supporters-table tr.deleting {
    background-color: #fee2e2 !important;
    opacity: 0.5;
    transform: translateX(-20px);
}

.supporters-table tr.deleted {
    opacity: 0;
    transform: translateX(-100%);
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

/* ===== إشعار التراجع ===== */
.notification.undo-notification {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    min-height: 80px;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.3);
}

.notification.undo-notification .notification-message {
    font-size: 14px;
    line-height: 1.5;
}

.undo-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.undo-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
}

.undo-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.undo-btn i {
    margin-left: 5px;
}

.undo-timer {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.undo-timer::after {
    content: "ث";
    margin-right: 2px;
    font-size: 10px;
}

/* تأثيرات متحركة للعداد */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.undo-timer {
    animation: pulse 1s infinite;
}

/* تحسين الإشعار للشاشات الصغيرة */
@media (max-width: 768px) {
    .notification {
        min-width: 280px;
        max-width: calc(100% - 2rem);
        padding: 0.875rem 1rem;
    }
    
    .notification.undo-notification {
        min-height: auto;
        padding: 12px 15px;
    }
    
    .notification-close {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .undo-container {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .undo-btn {
        width: 100%;
        text-align: center;
    }
    
    .undo-timer {
        align-self: center;
    }
}

/* ========================================
   تحسينات إضافية للمظهر
   ======================================== */

/* تحسين الجداول */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

table th,
table td {
    text-align: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
}

table th {
    text-align: center !important;
    background: var(--primary-gradient);
    color: var(--white);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table tbody tr {
    transition: var(--transition-fast);
}

table tbody tr:hover {
    background: var(--gray-50);
    transform: scale(1.01);
}

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

/* تحسين الأزرار */
.btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: -1;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

/* تحسين البطاقات */
.card,
.stat-card,
.dashboard-card {
    position: relative;
    overflow: hidden;
}

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

.card:hover::after,
.stat-card:hover::after {
    opacity: 1;
}

/* تحسين الإدخالات */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--gray-200) 25%,
        var(--gray-100) 50%,
        var(--gray-200) 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--radius);
}

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

/* Smooth Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: var(--radius-full);
    border: 2px solid var(--gray-100);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Selection */
::selection {
    background: var(--primary);
    color: var(--white);
}

::-moz-selection {
    background: var(--primary);
    color: var(--white);
}

/* Focus Visible */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ===== Confirm Modal ===== */
.modal-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.confirm-modal {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: confirmSlideIn 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
    position: relative;
    z-index: 10001;
}

.confirm-header {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.confirm-header i {
    font-size: 2rem;
    animation: pulse 2s infinite;
}

.confirm-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
}

.confirm-body {
    padding: 2rem;
    text-align: center;
}

.confirm-body p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--gray-700);
    margin: 0;
    white-space: pre-line;
}

.confirm-footer {
    padding: 1.5rem;
    background: var(--gray-50);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    border-top: 1px solid var(--gray-200);
}

.confirm-footer .btn {
    min-width: 120px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.confirm-footer .btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 2px solid var(--gray-300);
}

.confirm-footer .btn-secondary:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.confirm-footer .btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
}

.confirm-footer .btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
}

@keyframes confirmSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* ===== Password Management ===== */
.password-management {
    padding: 1rem;
}

.current-passwords {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.password-item {
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.password-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.1);
}

.password-item-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.password-item-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.password-item-details h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.role-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
}

.password-item-details p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.password-item-actions {
    display: flex;
    gap: 0.5rem;
}

.password-item-actions button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-show-password {
    background: var(--info);
    color: white;
}

.btn-show-password:hover {
    background: #0284c7;
    transform: translateY(-2px);
}

.btn-delete-password {
    background: var(--danger);
    color: white;
}

.btn-delete-password:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.empty-passwords {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-500);
}

.empty-passwords i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-passwords p {
    font-size: 1.1rem;
    margin: 0;
}

/* Password Modal */
.password-modal {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(139, 92, 246, 0.3), 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    border: 1px solid rgba(139, 92, 246, 0.1);
}

/* Responsive للشاشات الكبيرة */
@media (min-width: 1200px) {
    .password-modal {
        max-width: 650px;
    }
}

/* Responsive للشاشات المتوسطة */
@media (min-width: 768px) and (max-width: 1199px) {
    .password-modal {
        max-width: 580px;
        width: 90%;
    }
}

/* Responsive للشاشات الصغيرة */
@media (max-width: 767px) {
    .password-modal {
        width: 95%;
        max-width: 100%;
        margin: 1rem;
        border-radius: 16px;
    }
    
    .password-modal-header {
        padding: 1.5rem;
    }
    
    .password-modal-body {
        padding: 1.5rem;
    }
}

@keyframes modalSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-100px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.password-modal-header {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.password-modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: headerGlow 3s ease-in-out infinite;
}

@keyframes headerGlow {
    0%, 100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(-20px, -20px);
    }
}

.password-modal-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

.password-modal-header h3 i {
    font-size: 1.6rem;
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.modal-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    position: relative;
    z-index: 2;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.modal-close-btn:active {
    transform: rotate(90deg) scale(0.95);
}

.password-modal-body {
    padding: 2.5rem;
    background: linear-gradient(135deg, #fdfbff 0%, #f5f3ff 50%, #ede9fe 100%);
}

.password-info-box {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 2px solid #60a5fa;
    border-radius: 14px;
    padding: 1.25rem;
    margin-bottom: 1.75rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
    position: relative;
    overflow: hidden;
}

@media (min-width: 768px) {
    .password-info-box {
        padding: 1.5rem;
        gap: 1.25rem;
    }
}

.password-info-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #3b82f6, #2563eb);
}

.password-info-box i {
    font-size: 1.3rem;
    color: #3b82f6;
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.password-info-box strong {
    color: #1e40af;
    display: block;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.password-info-box ul {
    margin: 0;
    padding-right: 1.25rem;
    color: #1e3a8a;
    font-size: 0.9rem;
    list-style: none;
}

.password-info-box li {
    margin-bottom: 0.65rem;
    line-height: 1.6;
    position: relative;
    padding-right: 0.5rem;
}

.password-info-box li strong {
    color: #2563eb;
    display: inline;
    margin: 0;
    font-size: 0.9rem;
}

.password-info-box li:last-child {
    margin-bottom: 0;
}

@media (max-width: 767px) {
    .password-info-box {
        font-size: 0.85rem;
    }
    
    .password-info-box i {
        font-size: 1.2rem;
    }
    
    .password-info-box ul {
        font-size: 0.85rem;
        padding-right: 1rem;
    }
}

/* Username Input Wrapper */
.username-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.username-input-wrapper input {
    padding-left: 3rem;
    width: 100%;
    border: 2px solid var(--gray-300);
    border-radius: 12px;
    padding: 0.875rem 1rem 0.875rem 3rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.username-input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
    outline: none;
}

.username-input-wrapper .input-icon {
    position: absolute;
    left: 1rem;
    color: var(--gray-500);
    font-size: 1.2rem;
    pointer-events: none;
    transition: color 0.3s ease;
}

.username-input-wrapper input:focus + .input-icon {
    color: var(--primary);
}

/* Password Input Wrapper */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-left: 3rem;
    width: 100%;
    border: 2px solid var(--gray-300);
    border-radius: 12px;
    padding: 0.875rem 1rem 0.875rem 3rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.password-input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
    outline: none;
}

.password-modal-body .form-group label {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.password-modal-body .form-group label i {
    color: var(--primary);
    font-size: 1.1rem;
}

.toggle-password {
    position: absolute;
    left: 1rem;
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.3s ease;
}

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

.toggle-password.active {
    color: var(--primary);
}

.password-strength-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: 8px;
    font-size: 0.9rem;
}

.password-strength-indicator span:first-child {
    color: var(--gray-700);
    font-weight: 500;
}

.password-modal-body .modal-footer {
    padding: 0;
    margin-top: 2rem;
    background: transparent;
    border: none;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.password-modal-body .modal-footer .btn {
    min-width: 140px;
    padding: 0.875rem 1.75rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.password-modal-body .modal-footer .btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 2px solid var(--gray-300);
}

.password-modal-body .modal-footer .btn-secondary:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.password-modal-body .modal-footer .btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    color: white;
    border: none;
}

.password-modal-body .modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
}

.password-modal-body .modal-footer .btn:active {
    transform: translateY(0);
}

/* Responsive للأزرار */
@media (max-width: 767px) {
    .password-modal-body .modal-footer {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .password-modal-body .modal-footer .btn {
        width: 100%;
        min-width: auto;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

.scale-in {
    animation: scaleIn 0.3s ease-out;
}

/* Print Styles */
@media print {
    .header,
    .nav,
    .btn,
    .notification {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .card,
    .table {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}