* {
    box-sizing: border-box;
}
body {
    background: linear-gradient(135deg, #ffffff 0%, #fff5f0 50%, #ffe8d6 100%);
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
}
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="1" fill="rgba(255,140,0,0.1)"/><circle cx="80" cy="80" r="1" fill="rgba(255,140,0,0.1)"/><circle cx="40" cy="60" r="0.5" fill="rgba(255,140,0,0.08)"/><circle cx="90" cy="30" r="1.5" fill="rgba(255,140,0,0.06)"/></svg>') repeat;
    animation: float 20s ease-in-out infinite;
    z-index: -1;
}
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}
@keyframes slideInFromRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInFromLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInFromBottom {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
.main-header {
    position: fixed;
    top: 20px;
    right: 30px;
    z-index: 1000;
    animation: slideInFromRight 0.8s ease-out;
}
.main-logo {
    width: 180px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
    transition: transform 0.3s ease;
}
.main-logo:hover {
    transform: scale(1.05);
}
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    min-height: 100vh;
    align-items: start;
}
.sidebar {
    position: sticky;
    top: 120px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideInFromRight 1s ease-out;
}
.welcome-section {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.1);
}
.date-time-display {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #ff8c00, #ff7700);
    color: white;
    padding: 20px 24px;
    border-radius: 16px;
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 700;
    gap: 12px;
    box-shadow: 0 6px 20px rgba(255, 140, 0, 0.3);
    text-align: center;
}

.date-time-display .dates-container {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    justify-content: center;
}

.date-time-display .date-separator {
    width: 2px;
    height: 30px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
}

.date-time-display .date-item {
    font-size: 1.1rem;
    font-weight: 600;
}
.user-greeting {
    color: #ff8c00;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 15px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 20px 0;
}
.action-btn {
    background: linear-gradient(135deg, #ff8c00, #ff7700);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 140, 0, 0.3);
    cursor: pointer;
}
.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 140, 0, 0.4);
}
.action-btn.disabled {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    cursor: not-allowed;
    opacity: 0.6;
}
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
}
.stat-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-radius: 15px;
    padding: 18px;
    text-align: center;
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: transform 0.3s ease;
}
.stat-card:hover {
    transform: scale(1.02);
}
.stat-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}
.stat-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
}
.incomplete-stat { color: #e74c3c; }
.completed-stat { color: #ff8c00; }
.amount-cards {
    margin-top: 20px;
}
.amount-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    border-left: 4px solid;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}
.amount-card:hover {
    transform: translateX(-5px);
}
.collected-card { border-left-color: #28a745; }
.pending-card { border-left-color: #ffc107; }
.logout-btn {
    width: 100%;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
}
.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}
.main-content {
    animation: slideInFromBottom 1.2s ease-out;
}
.content-header {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 40px;
}
.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ff8c00, #ff7700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.page-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.2rem;
    font-weight: 400;
}
.cases-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.case-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    max-height: 800px;
}

.case-section:hover {
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.2);
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.1);
    flex-shrink: 0;
}

/* حاوية القضايا القابلة للتمرير */
.cases-container {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    padding-right: 8px;
    max-height: 650px;
}

.cases-container::-webkit-scrollbar {
    width: 8px;
}

.cases-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.cases-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #ff8c00, #ff7700);
    border-radius: 10px;
}

.cases-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #ff7700, #ff6600);
}
.section-icon {
    font-size: 1.8rem;
    margin-left: 12px;
    animation: pulse 2s infinite;
}
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    flex: 1;
}
.section-count {
    background: linear-gradient(135deg, #ff8c00, #ff7700);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}
.case-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.case-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.case-item:hover::before {
    opacity: 1;
}

.case-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.12);
    border-left-width: 5px;
}

.case-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
    height: 32px;
}

.case-number {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    display: flex;
    align-items: center;
    height: 32px;
    line-height: 1;
}

.case-divider {
    width: 2px;
    height: 20px;
    background: linear-gradient(135deg, #ff8c00, #ff7700);
    margin: 0 10px 0 10px;
    border-radius: 2px;
}

.case-brand {
    font-size: 1rem;
    font-weight: 600;
    color: #ff8c00;
    display: flex;
    align-items: center;
    height: 32px;
    line-height: 1;
}

.case-details {
    color: #666;
    line-height: 1.5;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
    font-size: 0.95rem;
}

.case-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    position: relative;
    z-index: 1;
    align-items: stretch;
}

.case-actions form {
    flex: 1;
    margin: 0;
    display: flex;
}

.case-btn {
    flex: 1;
    padding: 10px 14px;
    border-radius: 10px;
    text-decoration: none;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-complete {
    background: linear-gradient(135deg, #ff8c00, #ff7700);
    color: white;
}
.btn-complete:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 140, 0, 0.4);
}
.btn-view {
    background: linear-gradient(135deg, #ff8c00, #ff7700);
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
    border: none;
    cursor: pointer;
}
.btn-view:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 140, 0, 0.4);
    color: white;
    text-decoration: none;
}
.empty-state {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}
.empty-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.6;
}
.empty-text {
    font-size: 1.1rem;
    font-weight: 500;
}
@media (max-width: 768px) {
    .dashboard-container {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 15px;
    }
    .sidebar {
        position: static;
        order: 2;
    }
    .main-content {
        order: 1;
    }
    .page-title {
        font-size: 2rem;
    }
    .case-actions {
        flex-direction: column;
    }
    .quick-actions {
        grid-template-columns: 1fr;
    }
}

/* CSS للنافذة المنبثقة لتصدير PDF */
.pdf-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease-out;
    align-items: center;
    justify-content: center;
}

.pdf-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.pdf-modal-close {
    position: absolute;
    top: 15px;
    left: 20px;
    font-size: 24px;
    font-weight: bold;
    color: #95a5a6;
    cursor: pointer;
    transition: color 0.3s ease;
    background: none;
    border: none;
    padding: 5px;
}

.pdf-modal-close:hover {
    color: #e74c3c;
}

.pdf-modal-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #ff8c00, #ff6b35);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pdf-modal-description {
    color: #7f8c8d;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.case-selection {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
}

.case-option {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.case-option:hover {
    background: rgba(255, 140, 0, 0.1);
    border-color: #ff8c00;
}

.case-option.selected {
    background: linear-gradient(135deg, #ff8c00, #ff6b35);
    color: white;
    border-color: #ff8c00;
}

.case-option input[type="radio"] {
    margin-left: 15px;
    transform: scale(1.2);
}

.case-info {
    flex: 1;
    text-align: right;
}

.case-number {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.case-details {
    font-size: 0.9rem;
    opacity: 0.8;
}

.pdf-generate-btn {
    background: linear-gradient(135deg, #ff8c00, #ff6b35);
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(255, 140, 0, 0.3);
    min-width: 200px;
}

.pdf-generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(255, 140, 0, 0.4);
}

.pdf-generate-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.pdf-loader {
    display: none;
    margin: 20px auto;
    text-align: center;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* تصميم نافذة Excel المنبثقة */
.excel-modal-content {
    font-family: 'Cairo', sans-serif;
}

.excel-export-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 140, 0, 0.4) !important;
    opacity: 1 !important;
}

.excel-export-btn:not(:disabled) {
    cursor: pointer !important;
    opacity: 1 !important;
}

#excelCaseSelection::-webkit-scrollbar {
    width: 8px;
}

#excelCaseSelection::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 10px;
}

#excelCaseSelection::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #ff8c00, #ff7700);
    border-radius: 10px;
}

#excelCaseSelection::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #ff7700, #ff6b35);
}

/* تأثير hover لعناصر القضايا في نافذة Excel */
#excelCaseSelection .case-option:hover {
    border-color: #ff8c00;
    box-shadow: 0 4px 15px rgba(255, 140, 0, 0.1);
    transform: translateX(-3px);
}

/* فاصل المحتوى */
.content-spacer {
    height: 20px;
    clear: both;
}

/* مربع المزايا التجريبية */
.experimental-features-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 17px;
    padding: 40px 23px 32px 23px;
    margin: 23px 0;
    position: relative;
    overflow: visible;
    box-shadow: 0 11px 28px rgba(102, 126, 234, 0.2);
    color: white;
    text-align: center;
    max-width: 100%;
    z-index: 1;
    min-height: 420px;
}

.experimental-features-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.05), transparent);
    transform: rotate(45deg);
    animation: shine 4s infinite;
    pointer-events: none;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.experimental-header {
    position: relative;
    z-index: 2;
    margin-bottom: 17px;
}

.experimental-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 140, 0, 0.9);
    padding: 7px 14px;
    border-radius: 23px;
    font-weight: 600;
    margin-bottom: 11px;
    animation: pulse 2s infinite;
    font-size: 15px;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.badge-icon {
    font-size: 18px;
    margin-left: 7px;
}

.badge-text {
    font-size: 14px;
}

.experimental-description {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
    line-height: 1.4;
}

.experimental-features {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-content: center;
    align-items: stretch;
    margin: 30px 0;
    min-height: 80px;
    gap: 40px 32px;
}

.curved-line-container {
    position: relative;
    flex: none;
    height: 60px;
    width: auto;
}

.curved-line-container.left,
.curved-line-container.right {
    margin: 0;
}

.curved-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.curved-line path {
    animation: dash 3s linear infinite;
}

@keyframes dash {
    to {
        stroke-dashoffset: -100;
    }
}

.feature-button {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 100px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}

.feature-button:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.pdf-feature {
    border-left: 3px solid #ff8c00;
}

.excel-feature {
    border-left: 3px solid #27ae60;
}

/* زر الميزة باللون الأصفر */
.yellow-feature {
     border-left: 3px solid #ffd600;
}

.yellow-feature .feature-status {
     background: #ffd600;
     color: #333;
}

.feature-icon {
    font-size: 20px;
    margin-bottom: 2px;
}

.feature-label {
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

.feature-status {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.blue-feature {
    border-left: 3px solid #007bff;
}
.red-feature {
    border-left: 3px solid #e74c3c;
}
.blue-feature .feature-status {
    background: #007bff;
    color: #fff;
}
.red-feature .feature-status {
    background: #e74c3c;
    color: #fff;
}

.pdf-feature .feature-status {
    background: #ff8c00 !important;
}

/* زر الميزة باللون البنفسجي */
.purple-feature {
    border-left: 3px solid #8e44ad;
    background: #fff !important;
}
.purple-feature:hover {
    background: linear-gradient(135deg, #f3e9fc 0%, #e5d4fa 100%) !important;
}
.purple-feature .feature-status {
    background: #8e44ad;
    color: #fff;
}

.pdf-feature {
    border-left: 3px solid #ff8c00;
}

.excel-feature .feature-status {
    background: #27ae60 !important;
    color: #fff !important;
}

.experimental-footer {
    position: relative;
    z-index: 2;
    margin-top: 25px;
    opacity: 0.8;
    clear: both;
}

.experimental-footer small {
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* تحسينات للشاشات الصغيرة */
@media (max-width: 768px) {
    .experimental-features-box {
        margin: 17px 0;
        padding: 17px;
    }

    .experimental-features {
        flex-direction: row;
        gap: 15px;
        min-height: auto;
        justify-content: center;
    }

    .curved-line-container {
        width: auto;
        margin: 0;
        height: auto;
    }

    .feature-button {
        position: relative;
        margin: 0;
        min-width: 102px;
        padding: 11px 14px;
    }

    .curved-line {
        display: none;
    }

    .experimental-badge {
        padding: 6px 11px;
        font-size: 14px;
    }

    .badge-icon {
        font-size: 16px;
    }

    .experimental-description {
        font-size: 15px;
    }
}

/* تحسينات للهاتف المحمول */
@media (max-width: 768px) {
    .main-header {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        left: 0 !important;
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(10px) !important;
        border-bottom: 1px solid #e0e0e0 !important;
        padding: 10px 20px !important;
        z-index: 1000 !important;
        text-align: center !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
        /* مخفي تماماً في البداية على الهاتف */
        display: none !important;
    }

    /* يظهر بعد السكرول */
    .main-header.header-visible {
        display: block !important;
        animation: headerSlideDown 0.3s ease forwards;
    }

    @keyframes headerSlideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    .main-logo {
        width: 80px !important;
        height: auto !important;
    }

    .dashboard-container {
        margin-top: 15px !important;
        grid-template-columns: 1fr !important;
        padding: 10px !important;
        gap: 20px !important;
    }

    .dashboard-container.has-header {
        margin-top: 100px !important;
    }

    .sidebar {
        position: static !important;
        order: 2 !important;
    }

    .main-content {
        order: 1 !important;
    }
    
    /* تحسينات أقسام القضايا للموبايل */
    .cases-grid {
        gap: 15px;
    }
    
    .case-section {
        max-height: 500px;
    }
    
    .cases-container {
        max-height: 400px;
    }
    
    .case-item {
        padding: 14px;
        margin-bottom: 10px;
    }
    
    .case-btn {
        padding: 10px 12px;
        font-size: 0.85rem;
        min-height: 38px;
    }
    
    .case-number {
        font-size: 1rem;
    }
    
    .case-brand {
        font-size: 0.95rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* تحسينات للأجهزة اللوحية */
@media (max-width: 1024px) and (min-width: 769px) {
    .case-section {
        max-height: 600px;
    }
    
    .cases-container {
        max-height: 500px;
    }
}

/* تصميم زر "فهمت!" */
.understood-btn {
    background: linear-gradient(135deg, #ff8c00, #ff7700);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 140, 0, 0.3);
    min-width: 100px;
}

.understood-btn:hover {
    background: linear-gradient(135deg, #ff7700, #ff6600);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 140, 0, 0.4);
}

.understood-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 140, 0, 0.3);
}

.understood-btn-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 16px;
}

/* Quick Actions Styles */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ff8c00;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
    text-align: center;
    font-family: 'Cairo', sans-serif;
}

.sidebar-section .action-btn {
    margin-bottom: 8px;
    font-size: 0.95rem;
    padding: 14px 16px;
    min-height: 50px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
}

.quick-actions > .action-btn {
    min-height: 50px;
    padding: 14px 16px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
}

/* تأثيرات الصفحة */
body.fade-out {
    opacity: 0;
    transition: opacity 0.35s cubic-bezier(.4,0,.2,1);
}

/* شريط التنقل السفلي للموبايل */
.mobile-bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, #fff 0%, #fffaf5 100%);
    border-top: 2px solid #ff8c00;
    box-shadow: 0 -4px 20px rgba(255, 140, 0, 0.15);
    z-index: 10002;
    padding: 8px 0 8px 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 4px;
    max-width: 100vw;
}

.bottom-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    text-decoration: none;
    color: #666;
    transition: all 0.3s ease;
    border-radius: 12px;
    margin: 0 4px;
}

.bottom-bar-item:hover,
.bottom-bar-item.active {
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.1), rgba(255, 165, 0, 0.15));
    color: #ff8c00;
}

.bottom-bar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

.bottom-bar-icon img {
    width: 100%;
    height: 100%;
    filter: brightness(0) saturate(100%) invert(46%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(94%) contrast(87%);
    transition: all 0.3s ease;
}

.bottom-bar-item:hover .bottom-bar-icon img,
.bottom-bar-item.active .bottom-bar-icon img {
    filter: brightness(0) saturate(100%) invert(54%) sepia(82%) saturate(2275%) hue-rotate(1deg) brightness(103%) contrast(101%);
}

.bottom-bar-label {
    font-size: 0.7rem;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
}

/* نافذة المحادثة الذكية العائمة */
.chat-widget {
    position: fixed;
    left: 24px;
    bottom: 24px;
    width: 360px;
    max-width: calc(100vw - 48px);
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 3000;
    font-family: 'Cairo', sans-serif;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-header {
    background: linear-gradient(135deg, #ff8c00 0%, #ffda47 100%);
    color: #222;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.chat-header:hover {
    background: linear-gradient(135deg, #ff7700 0%, #ffc933 100%);
}

.chat-body {
    display: block;
    max-height: 420px;
    overflow-y: auto;
}

.chat-messages {
    padding: 20px;
    min-height: 200px;
    max-height: 350px;
    overflow-y: auto;
}

.bot-message {
    display: flex;
    align-items: flex-start;
    margin-bottom: 16px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

.chat-actions {
    padding: 16px 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid #e0e0e0;
}

.chat-btn-primary {
    background: linear-gradient(135deg, #ff8c00, #ffda47);
    color: #222;
    padding: 12px 20px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.chat-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 140, 0, 0.4);
    background: linear-gradient(135deg, #ff7700, #ffc933);
}

.chat-btn-secondary {
    background: white;
    color: #666;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    border: 2px solid #e0e0e0;
    cursor: pointer;
    font-size: 0.95rem;
    font-family: 'Cairo', sans-serif;
}

.chat-btn-secondary:hover {
    background: #fff3e0;
    border-color: #ff8c00;
    color: #ff8c00;
}

/* Responsive Styles */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    
    .dashboard-container {
        display: flex !important;
        flex-direction: column !important;
    }
    
    .sidebar {
        width: 100% !important;
        max-width: 100vw !important;
        order: -1 !important;
        margin-bottom: 24px !important;
    }
    
    .main-content {
        width: 100% !important;
    }
    
    /* إخفاء أزرار الميزات على الجوال */
    .quick-actions,
    .sidebar-section {
        display: none !important;
    }
    
    .mobile-bottom-bar {
        display: grid;
    }
    
    .footer-copyright {
        font-size: 0.85rem !important;
        padding: 12px 0 90px 0 !important;
    }
    
    .footer-copyright span {
        font-size: 1rem !important;
    }

    .chat-widget {
        display: none !important;
    }
}
