
/* تنسيقات سلايد رحلة الدواء */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.step-transition { transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1); }
.progress-line { transition: width 1s ease-in-out; }
#steps-container .icon-circle { transition: all 0.7s ease; }
#steps-container { display: flex !important; flex-direction: row !important; justify-content: space-between !important; flex-wrap: nowrap !important; }
#steps-container > div { flex: 0 0 18% !important; max-width: 18% !important; }


    /* --- الأساسيات --- */
    * { -webkit-tap-highlight-color: rgba(0,0,0,0.1); -webkit-touch-callout: none; box-sizing: border-box; }
    html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
    body { overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; font-family: 'Cairo', sans-serif; }
    button, .btn, .card, .amount-btn { cursor: pointer; }

    /* --- Toast Notifications --- */
    #toast-container { position: fixed; top: 20px; left: 20px; z-index: 999999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
    .toast { pointer-events: auto; display: flex; align-items: center; min-width: 320px; max-width: 400px; background: #fff; border-radius: 12px; padding: 16px; box-shadow: 0 10px 40px rgba(0,0,0,0.15); overflow: hidden; animation: slideInLeft 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards; border-right: 5px solid transparent; direction: rtl; }
    .toast.hiding { animation: slideOutLeft 0.3s forwards; }
    @keyframes slideInLeft { from { transform: translateX(-120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
    @keyframes slideOutLeft { to { transform: translateX(-120%); opacity: 0; } }
    .toast.success { border-right-color: #10B981; } .toast.success .t-icon { color: #10B981; }
    .toast.error { border-right-color: #EF4444; } .toast.error .t-icon { color: #EF4444; }
    .toast.warning { border-right-color: #F59E0B; } .toast.warning .t-icon { color: #F59E0B; }
    .toast.info { border-right-color: #3B82F6; } .toast.info .t-icon { color: #3B82F6; }
    .t-icon { width: 24px; height: 24px; margin-left: 12px; font-size: 20px; display: flex; align-items: center; justify-content: center; }
    .t-content { flex: 1; } .t-title { font-weight: 800; font-size: 14px; margin-bottom: 2px; color: #333; }
    .t-msg { font-size: 13px; color: #666; line-height: 1.4; }
    .t-close { background:none; border:none; color:#bbb; cursor:pointer; font-size:18px; padding:0; margin-right:10px; } .t-close:hover { color:#333; }

    /* --- Modals (Compact & Optimized) --- */
    .modal-backdrop { 
        position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
        background: rgba(0,0,0,0.6); z-index: 100000; 
        display: flex; justify-content: center; align-items: center; 
        backdrop-filter: blur(2px);
        padding: 10px;
    }

       .funds-section {
        padding: 60px 0;
        background: #f3f4f6;
    }
    
    .funds-header {
        text-align: center;
        margin-bottom: 40px;
    }
    
    .funds-header h2 {
        font-size: 36px;
        font-weight: 900;
        color: #1e3a8a;
        margin-bottom: 12px;
    }
    
    .funds-header p {
        font-size: 16px;
        color: #6b7280;
        max-width: 550px;
        margin: 15px auto 0;
        line-height: 1.6;
    }
    
    .funds-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 20px;
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 20px;
    }
    
    .fund-card {
        background: white;
        border-radius: 20px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        transition: all 0.3s ease;
        border: 1px solid #e5e7eb;
        display: flex;
        flex-direction: column;
    }
    
    .fund-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 16px rgba(0,0,0,0.1);
    }
    
    .fund-icon-wrapper {
        display: flex;
        justify-content: center;
        padding: 20px 20px 15px;
    }
    
    .fund-icon-box {
        width: 75px;
        height: 75px;
        background: #1e40af;
        border-radius: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 12px rgba(30, 64, 175, 0.2);
    }
    
    .fund-icon-box i {
        font-size: 38px;
        color: white;
    }
    
    .fund-body {
        padding: 0 20px 20px;
        text-align: center;
        flex: 1;
        display: flex;
        flex-direction: column;
    }
    
    .fund-title {
        font-size: 18px;
        font-weight: 900;
        color: #1e3a8a;
        margin-bottom: 15px;
        line-height: 1.3;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .fund-stats-compact {
        display: flex;
        justify-content: space-around;
        margin-bottom: 14px;
        padding: 10px 0;
        border-top: 1px solid #f3f4f6;
        border-bottom: 1px solid #f3f4f6;
    }
    
    .fund-stat-item {
        text-align: center;
    }
    
    .fund-stat-number {
        font-size: 16px;
        font-weight: 900;
        color: #1e40af;
        display: block;
        margin-bottom: 3px;
    }
    
    .fund-stat-text {
        font-size: 10px;
        color: #6b7280;
        font-weight: 600;
    }
    
    .fund-progress {
        margin-bottom: 14px;
    }
    
    .fund-progress-info {
        display: flex;
        justify-content: space-between;
        margin-bottom: 5px;
        font-size: 11px;
    }
    
    .fund-collected {
        color: #10b981;
        font-weight: 800;
    }
    
    .fund-target {
        color: #6b7280;
        font-weight: 600;
    }
    
    .fund-progress-bar {
        width: 100%;
        height: 5px;
        background: #e5e7eb;
        border-radius: 10px;
        overflow: hidden;
    }
    
    .fund-progress-fill {
        height: 100%;
        background: linear-gradient(90deg, #10b981, #34d399);
        transition: width 0.5s ease;
    }
    
    .fund-progress-percent {
        text-align: center;
        margin-top: 4px;
        font-size: 9px;
        color: #6b7280;
        font-weight: 600;
    }
    
    .fund-donate-btn {
        width: 100%;
        padding: 11px;
        background: #1e40af;
        color: white;
        border: none;
        border-radius: 10px;
        font-size: 14px;
        font-weight: 800;
        cursor: pointer;
        transition: all 0.3s ease;
        margin-top: auto;
    }
    
    .fund-donate-btn:hover {
        background: #1e3a8a;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(30, 64, 175, 0.25);
    }
    
    @media (max-width: 768px) {
        .funds-section {
            padding: 40px 0;
        }
        
        .funds-header h2 {
            font-size: 28px;
        }
        
        .funds-header p {
            font-size: 14px;
        }
        
        .funds-grid {
            grid-template-columns: 1fr;
            padding: 0 15px;
            gap: 15px;
        }
        
        .fund-title {
            font-size: 18px;
            min-height: auto;
        }
        
        .fund-icon-box {
            width: 70px;
            height: 70px;
        }
        
        .fund-icon-box i {
            font-size: 34px;
        }
    }
    
    @media (min-width: 769px) and (max-width: 1024px) {
        .funds-grid {
            grid-template-columns: repeat(2, 1fr);
        }
    }
    
    @media (min-width: 1025px) and (max-width: 1280px) {
        .funds-grid {
            grid-template-columns: repeat(3, 1fr);
        }
    }
    
    @media (min-width: 1281px) {
        .funds-grid {
            grid-template-columns: repeat(4, 1fr);
        }
    }

/* --- Registration Modal (Wide & Professional) --- */
.reg-modal-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.reg-modal-container .modal-head {
       background: linear-gradient(135deg, #3b82f6 0%, #3b82f6 100%);
    color: white;
    padding: 5px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid #10b981;
}

.reg-modal-container .modal-head b {
    font-size: 24px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
}

.reg-modal-container .modal-head b::before {
    content: '🏢';
    font-size: 28px;
}

.reg-modal-container .modal-head button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reg-modal-container .modal-head button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.reg-modal-container .modal-body {
    padding: 32px;
    overflow-y: auto;
    max-height: calc(90vh - 100px);
}

/* Form Grid Layout - العرض الأفقي */
#regFields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.field {
    display: flex;
    flex-direction: column;
}

.field label {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.field label::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 16px;
    background: #006C35;
    border-radius: 2px;
}

.reg-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s;
    background: #f9fafb;
}

.reg-input:focus {
    outline: none;
    border-color: #006C35;
    background: white;
    box-shadow: 0 0 0 4px rgba(0, 108, 53, 0.1);
}

textarea.reg-input {
    resize: vertical;
    min-height: 80px;
}

/* Submit Button Enhancement */
.reg-modal-container .btn.primary {
    width: 100%;
    margin-top: 24px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 800;
    background: linear-gradient(135deg, #006C35 0%, #004d25 100%);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 108, 53, 0.3);
}

.reg-modal-container .btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 108, 53, 0.4);
}

.reg-modal-container .btn.primary:active {
    transform: translateY(0);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .reg-modal-container {
        width: 95%;
        max-width: none;
    }
    
    .reg-modal-container .modal-head {
        padding: 20px;
    }
    
    .reg-modal-container .modal-head b {
        font-size: 18px;
    }
    
    .reg-modal-container .modal-body {
        padding: 20px;
    }
    
    #regFields {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}


    .payment-modal { 
        background: white; 
        width: 100%; 
        max-width: 400px;
        border-radius: 12px;
        box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3); 
        
        display: flex;
        flex-direction: column;
        max-height: 85vh;
        overflow: hidden;
        animation: scaleUp 0.25s ease-out; 
    }

    .payment-header { 
        background: #fff; 
        padding: 12px 15px; 
        border-bottom: 1px solid #f1f5f9; 
        display: flex; justify-content: space-between; align-items: center; 
        flex: 0 0 auto;
        z-index: 10;
    }

    .payment-body { 
        padding: 15px; 
        overflow-y: auto;
        overscroll-behavior: contain;
        flex: 1 1 auto;
    }

    .case-summary { 
        padding: 8px 12px; 
        margin-bottom: 12px; 
        font-size: 0.85em; 
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 6px;
    }

    .field { margin-bottom: 10px; }
    .field label { font-size: 0.9em; color: #4b5563; margin-bottom: 4px; display: block; font-weight: 600; }
    
    .amount-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
    .amount-btn { 
        padding: 8px; 
        border: 1px solid #e2e8f0; 
        background: #fff; 
        border-radius: 6px; 
        cursor: pointer; 
        font-weight: 600; 
        color: #64748b; 
        font-size: 13px;
        text-align: center;
        transition: 0.2s; 
    }
    .amount-btn:hover { border-color: #cbd5e1; background: #f8fafc; } 
    .amount-btn.active { border-color: #006C35; background: #f0fdf4; color: #006C35; }
    
    .reg-input { 
        width: 100%;
        padding: 8px 10px; 
        border: 1px solid #cbd5e1;
        border-radius: 6px;
        font-size: 14px;
        outline: none;
        height: 38px;
    }
    .reg-input:focus { border-color: #006C35; }

    .close-btn {
        width: 30px; height: 30px;
        border-radius: 50%;
        border: none;
        background: #f1f5f9;
        color: #64748b;
        font-size: 18px;
        cursor: pointer;
        display: flex; align-items: center; justify-content: center;
        transition: 0.2s;
    }
    .close-btn:hover { background: #e2e8f0; color: #ef4444; }

    @keyframes scaleUp { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

    /* --- تحسين عرض الأرقام في بطاقات الحالات --- */
    .amount-summary {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        margin-bottom: 12px;
    }
    
    .amount-item {
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 10px 8px;
        text-align: center;
        transition: all 0.2s;
    }
    
    .amount-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.08);
    }
    
    .amount-item.target {
        border-color: #cbd5e1;
    }
    
    .amount-item.collected {
        background: #f0fdf4;
        border-color: #bbf7d0;
    }
    
    .amount-item.remaining {
        background: #fef3c7;
        border-color: #fde68a;
    }
    
    .amount-label {
        display: block;
        font-size: 10px;
        color: #64748b;
        font-weight: 600;
        text-transform: uppercase;
        margin-bottom: 4px;
        letter-spacing: 0.3px;
    }
    
    .amount-value {
        display: block;
        font-size: 14px;
        font-weight: 800;
        color: #1e293b;
    }
    
    .amount-item.collected .amount-value {
        color: #166534;
    }
    
    .amount-item.remaining .amount-value {
        color: #d97706;
    }

    /* --- تحسين شريط التقدم --- */
    .bar {
        height: 12px;
        background: #e2e8f0;
        border-radius: 6px;
        overflow: hidden;
        position: relative;
        box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    }
    
    .bar > div {
        height: 100%;
        background: linear-gradient(90deg, #10b981 0%, #059669 100%);
        border-radius: 6px;
        transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
        position: relative;
        overflow: hidden;
    }
    
    .bar > div::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
        animation: shimmer 2s infinite;
    }
    
    @keyframes shimmer {
        0% { transform: translateX(-100%); }
        100% { transform: translateX(100%); }
    }

    /* --- تحسين KPIs في الداشبورد --- */
    .kpis {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin-top: 20px;
    }
    
    .kpi {
        background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
        border: 3px solid #006c35;
        border-radius: 12px;
        padding: 20px;
        text-align: center;
        transition: all 0.3s;
        position: relative;
        overflow: hidden;
    }
    
    .kpi::before {
        content: '';
        position: absolute;
        top: -50%;
        right: -50%;
        width: 100%;
        height: 100%;
        background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
        transition: all 0.3s;
    }
    
    .kpi:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 20px rgba(16, 185, 129, 0.2);
        border-color: #10b981;
    }
    
    .kpi:hover::before {
        top: -25%;
        right: -25%;
    }
    
    .kpi b {
        display: block;
        font-size: 32px;
        font-weight: 900;
        color: #166534;
        margin-bottom: 8px;
        position: relative;
        z-index: 1;
        text-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }
    
    .kpi span {
        display: block;
        font-size: 13px;
        color: #15803d;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        position: relative;
        z-index: 1;
    }

    /* --- باقي الستايلات كما هي --- */
    .card-medicines { background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%); border: 1.5px solid #000000; border-radius: 12px; padding: 12px; margin-top: 12px; }
    .medicines-header { display: flex; align-items: center; gap: 8px; font-weight: 700; color: #166534; font-size: 13px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid #bbf7d0; }
    .medicines-header-icon {
        width: 20px;
        height: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #059669;
    }
    .medicines-header-icon svg {
        width: 100%;
        height: 100%;
    }
    .medicines-grid { display: grid; gap: 8px; }
    .medicine-pill { background: white; border: 1px solid #bbf7d0; border-radius: 8px; padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; transition: all 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
    .medicine-pill:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(22, 101, 52, 0.15); border-color: #86efac; }
    .medicine-info-left { display: flex; align-items: center; gap: 8px; flex: 1; }
    .medicine-icon { 
        width: 36px; 
        height: 36px; 
        border-radius: 8px; 
        display: flex; 
        align-items: center; 
        justify-content: center; 
        flex-shrink: 0;
        position: relative;
        overflow: hidden;
    }
    .medicine-icon svg {
        width: 20px;
        height: 20px;
        position: relative;
        z-index: 1;
    }
    
    /* ألوان مختلفة حسب نوع الدواء */
    .medicine-icon {
        background: linear-gradient(135deg, #059669 0%, #10b981 100%);
        color: white;
    }
    .medicine-icon-كبسول,
    .medicine-icon-capsule {
        background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
    }
    .medicine-icon-شراب,
    .medicine-icon-syrup,
    .medicine-icon-سائل {
        background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    }
    .medicine-icon-حقن,
    .medicine-icon-injection,
    .medicine-icon-أمبول {
        background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    }
    .medicine-icon-مرهم,
    .medicine-icon-كريم,
    .medicine-icon-cream,
    .medicine-icon-ointment {
        background: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
    }
    .medicine-icon-قطرة,
    .medicine-icon-drops {
        background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    }
    
    /* تأثير لامع للأيقونات */
    .medicine-icon::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.3) 50%, transparent 70%);
        transform: rotate(45deg);
        animation: shine 3s infinite;
    }
    
    @keyframes shine {
        0%, 100% { transform: rotate(45deg) translateX(-100%); }
        50% { transform: rotate(45deg) translateX(100%); }
    }
    .medicine-name { font-weight: 700; color: #166534; font-size: 13px; margin-bottom: 2px; }
    .medicine-meta { font-size: 11px; color: #16a34a; display: flex; gap: 8px; }
    .medicine-badge { background: #dcfce7; color: #166534; padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 600; }
    .medicine-quantity { background: linear-gradient(135deg, #166534 0%, #15803d 100%); color: white; padding: 4px 10px; border-radius: 6px; font-weight: 700; font-size: 11px; }
    .btn-show-more { background: none; border: 1px solid #86efac; color: #166534; padding: 6px 16px; border-radius: 6px; font-size: 11px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
    .btn-show-more:hover { background: white; border-color: #10b981; color: #059669; }

    /* --- Case Details & Modal Styles --- */
    .case-detail-section { margin-bottom: 20px; border-bottom: 1px solid #eee; padding-bottom: 15px; }
    .section-title { font-weight: bold; font-size: 1.1em; color: var(--primary); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
    .detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 15px; }
    .detail-label { font-size: 0.8em; color: #777; } .detail-value { font-weight: 600; color: #333; }
    .medicines-modal-list { display: grid; gap: 10px; margin-top: 12px; }
    .medicine-modal-card { background: white; border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px; }
    .medicine-modal-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed #e5e7eb; }
    .medicine-modal-icon { 
        width: 44px; 
        height: 44px; 
        border-radius: 10px; 
        display: flex; 
        align-items: center; 
        justify-content: center;
        flex-shrink: 0;
        position: relative;
        overflow: hidden;
        background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
        color: white;
    }
    .medicine-modal-icon svg {
        width: 24px;
        height: 24px;
        position: relative;
        z-index: 1;
    }
    
    /* ألوان الأيقونات في Modal */
    .medicine-modal-icon.medicine-icon-capsule {
        background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
    }
    .medicine-modal-icon.medicine-icon-syrup {
        background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    }
    .medicine-modal-icon.medicine-icon-injection {
        background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    }
    .medicine-modal-icon.medicine-icon-cream {
        background: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
    }
    .medicine-modal-icon.medicine-icon-drops {
        background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    }
    
    .medicine-modal-icon::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.3) 50%, transparent 70%);
        transform: rotate(45deg);
        animation: shine 3s infinite;
    }
    
    .medicine-modal-title {
        flex: 1;
    }
    .medicine-modal-name {
        font-size: 15px;
        font-weight: 700;
        color: #1e293b;
        margin-bottom: 4px;
    }
    .medicine-modal-scientific {
        font-size: 12px;
        color: #64748b;
        font-style: italic;
    }
    .medicine-modal-body { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 10px; }
    .medicine-modal-field { background: #f9fafb; padding: 10px; border-radius: 8px; }
    .medicine-modal-label { font-size: 11px; color: #6b7280; font-weight: 600; text-transform: uppercase; }
    .medicine-modal-value { font-size: 14px; color: #111827; font-weight: 600; }
    .medicine-modal-instructions { background: #fef3c7; border: 1px solid #fde68a; border-radius: 8px; padding: 12px; }

    /* --- Dashboard Panel Styles --- */
    .dashboard-panel {
        background: white;
        border-radius: 16px;
        padding: 24px;
        margin: 20px auto;
        box-shadow: 0 4px 16px rgba(0,0,0,0.08);
        max-width: 1200px;
    }
    
    .dashboard-title {
        margin-bottom: 20px;
    }
    
    .dashboard-title h3 {
        font-size: 24px;
        font-weight: 800;
        color: #1e293b;
        margin-bottom: 8px;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .dashboard-title span {
        font-size: 14px;
        color: #64748b;
        font-weight: 500;
    }
    
    .filters {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
        margin-bottom: 20px;
        padding: 20px;
        background: #f8fafc;
        border-radius: 12px;
        border: 1px solid #e2e8f0;
    }
    
    .filters .field label {
        display: block;
        font-size: 13px;
        font-weight: 700;
        color: #334155;
        margin-bottom: 6px;
    }
    
    .filters select,
    .filters input[type="text"] {
        width: 100%;
        padding: 10px 12px;
        border: 2px solid #cbd5e1;
        border-radius: 25px;
        font-size: 11px;
        background: white;
        transition: all 0.2s;
    }
    
    .filters select:focus,
    .filters input:focus {
        border-color: #006C35;
        outline: none;
        box-shadow: 0 0 0 3px rgba(0, 108, 53, 0.1);
    }
    
    .filters button {
        background: white;
        border: 2px solid #cbd5e1;
        color: #64748b;
        font-weight: 700;
        padding: 10px 20px;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.2s;
    }
    
    .filters button:hover {
        border-color: #006C35;
        color: #006C35;
        background: #f0fdf4;
    }

    /* ========================================
        📱 MOBILE RESPONSIVE - التوافق الكامل
        ======================================== */
    
    @media (max-width: 768px) {
        /* تحسين Container العام */
        .container {
            padding: 0 10px;
        }
        
        /* تحسين Dashboard Panel */
        .dashboard-panel {
            padding: 16px 12px;
            margin: 15px 0;
            border-radius: 12px;
        }
        
        .dashboard-title h3 {
            font-size: 18px;
            margin-bottom: 6px;
        }
        
        .dashboard-title span {
            font-size: 12px;
            line-height: 1.4;
        }
        
        .filters {
            grid-template-columns: 1fr;
            gap: 10px;
            margin-top: 15px;
            padding: 15px 12px;
            background: #f8fafc;
            border-radius: 10px;
        }
        
        .filters .field {
            margin-bottom: 0;
        }
        
        .filters .field label {
            font-size: 13px;
            margin-bottom: 6px;
            font-weight: 700;
            color: #334155;
        }
        
        .filters select,
        .filters input {
            width: 100%;
            height: 44px !important;
            font-size: 15px !important;
            padding: 12px 14px !important;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            background: white;
        }
        
        .filters select:focus,
        .filters input:focus {
            border-color: #006C35;
            outline: none;
            box-shadow: 0 0 0 3px rgba(0, 108, 53, 0.1);
        }
        
        .filters button#clearBtn {
            margin-top: 5px;
            height: 44px;
            font-size: 14px;
            font-weight: 700;
            border-radius: 8px;
            border: 2px solid #e2e8f0;
            background: white;
            color: #64748b;
        }
        
        .filters button#clearBtn:active {
            background: #f8fafc;
            transform: scale(0.98);
        }
        
        /* تحسين Grid الحالات */
        .grid {
            grid-template-columns: 1fr !important;
            gap: 15px;
            padding: 0;
        }
        
        .card {
            margin: 0;
        }
        
        .empty {
            padding: 40px 20px;
            font-size: 14px;
        }
        
        /* تحسين عرض الأرقام على الموبايل */
        .amount-summary {
            grid-template-columns: 1fr;
            gap: 8px;
        }
        
        .amount-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 14px;
        }
        
        .amount-label {
            font-size: 11px;
            margin-bottom: 0;
            text-align: right;
        }
        
        .amount-value {
            font-size: 16px;
            text-align: left;
        }
        
        /* تحسين شريط التقدم */
        .bar {
            height: 10px;
            margin-top: 10px;
        }
        
        /* تحسين KPIs */
        .kpis {
            display: flex;
            gap: 10px;
            margin-top: 15px;
        }
        
        .kpi {
            flex: 1;
            padding: 16px 12px;
            border-radius: 10px;
            min-height: 100px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }
        
        .kpi b {
            font-size: 26px;
            margin-bottom: 6px;
            line-height: 1;
        }
        
        .kpi span {
            font-size: 11px;
            text-align: center;
            line-height: 1.3;
        }
        
        /* تحسين بطاقات الأدوية */
        .card-medicines {
            padding: 10px;
        }
        
        .medicines-header {
            font-size: 12px;
        }
        
        .medicine-pill {
            padding: 10px;
            flex-direction: column;
            align-items: flex-start;
            gap: 8px;
        }
        
        .medicine-info-left {
            width: 100%;
        }
        
        .medicine-quantity {
            align-self: flex-end;
            font-size: 12px;
            padding: 6px 12px;
        }
        
        .medicine-name {
            font-size: 12px;
        }
        
        .medicine-meta {
            font-size: 10px;
            flex-wrap: wrap;
        }
        
        /* تحسين Modal على الموبايل */
        .payment-modal {
            max-width: 95%;
            max-height: 90vh;
        }
        
        .payment-header {
            padding: 10px 12px;
        }
        
        .payment-header b {
            font-size: 1em;
        }
        
        .payment-body {
            padding: 12px;
        }
        
        /* تحسين الفورم */
        .amount-grid {
            gap: 6px;
        }
        
        .amount-btn {
            padding: 10px 6px;
            font-size: 12px;
        }
        
        .reg-input {
            font-size: 16px; /* منع الزوم التلقائي في iOS */
            padding: 10px 12px;
        }
        
        /* تحسين Toast على الموبايل */
        #toast-container {
            top: 10px;
            left: 10px;
            right: 10px;
        }
        
        .toast {
            min-width: auto;
            max-width: 100%;
            padding: 12px;
        }
        
        .t-title {
            font-size: 13px;
        }
        
        .t-msg {
            font-size: 12px;
        }
        
        /* تحسين Modal التفاصيل */
        .case-modal {
            max-width: 95%;
            max-height: 90vh;
        }
        
        .medicine-modal-body {
            grid-template-columns: 1fr;
            gap: 8px;
        }
        
        .medicine-modal-field {
            padding: 8px;
        }
        
        .detail-grid {
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
        }
    }
    
    @media (max-width: 480px) {
        /* تحسينات إضافية للشاشات الصغيرة جداً */
        .dashboard-panel {
            padding: 14px 10px;
            margin: 10px 0;
            border-radius: 10px;
        }
        
        .dashboard-title h3 {
            font-size: 16px;
        }
        
        .dashboard-title span {
            font-size: 11px;
        }
        
        .filters {
            gap: 8px;
            margin-top: 12px;
        }
        
        .filters select,
        .filters input {
            height: 42px !important;
            font-size: 14px !important;
            padding: 10px 12px !important;
        }
        
        .filters button#clearBtn {
            height: 42px;
            font-size: 13px;
        }
        
        .kpis {
            gap: 8px;
            margin-top: 12px;
        }
        
        .kpi {
            padding: 14px 10px;
            min-height: 90px;
        }
        
        .kpi b {
            font-size: 22px;
        }
        
        .kpi span {
            font-size: 10px;
        }
        
        .amount-value {
            font-size: 14px;
        }
        
        .kpi b {
            font-size: 24px;
        }
        
        .kpi span {
            font-size: 11px;
        }
        
        .medicine-icon {
            width: 28px;
            height: 28px;
            font-size: 14px;
        }
        
        .close-btn {
            width: 28px;
            height: 28px;
            font-size: 16px;
        }
        
        .detail-grid {
            grid-template-columns: 1fr;
        }
        
        .payment-modal {
            border-radius: 10px;
        }
        
        /* تحسين الأزرار على الموبايل */
        .btn-row {
            flex-direction: column;
            gap: 8px;
        }
        
        .btn-row .btn {
            width: 100%;
        }
    }
    
    /* تحسين اللمس على الأجهزة التي تعمل باللمس */
    @media (hover: none) and (pointer: coarse) {
        .amount-btn,
        .btn,
        .medicine-pill,
        .kpi {
            min-height: 44px; /* Apple's recommended touch target */
        }
        
        .close-btn {
            min-width: 44px;
            min-height: 44px;
        }
        
        /* إزالة hover effects على الأجهزة اللمسية */
        .amount-item:hover,
        .medicine-pill:hover,
        .kpi:hover {
            transform: none;
            box-shadow: none;
        }
        
        /* تفعيل active states بدلاً من hover */
        .amount-item:active,
        .medicine-pill:active {
            transform: scale(0.98);
        }
    }
    


    
    /* تحسين الطباعة (إذا احتاج المستخدم طباعة الصفحة) */
    @media print {
        .hero,
        .filters,
        .modal-backdrop,
        #toast-container,
        button {
            display: none !important;
        }
        
        .card {
            page-break-inside: avoid;
            border: 1px solid #000;
        }
        
        .amount-summary {
            grid-template-columns: repeat(3, 1fr);
        }
    }
    
    /* تحسين الوضع الأفقي على الموبايل */
    @media (max-width: 768px) and (orientation: landscape) {
        .payment-modal,
        .case-modal {
            max-height: 85vh;
        }
        
        .payment-body,
        .case-modal-body {
            padding: 10px 15px;
        }
        
        .amount-summary {
            grid-template-columns: repeat(3, 1fr);
            gap: 6px;
        }
        
        .amount-item {
            flex-direction: column;
            text-align: center;
            padding: 8px 6px;
        }
        
        .amount-value {
            font-size: 13px;
        }
        
        .amount-label {
            font-size: 9px;
            text-align: center;
        }
    }

 

