/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

/* ===== HEADER ===== */
header {
    background: white;
    border-radius: 20px;
    padding: 20px 30px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-left i {
    font-size: 2.2rem;
    color: #3b82f6;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-left h1 {
    font-size: 1.8rem;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.stats-badge {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-admin {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-admin:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
}

/* ===== DASHBOARD ===== */
main {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.dashboard-header {
    margin-bottom: 30px;
}

.dashboard-header h2 {
    color: #1e40af;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.subtitle {
    color: #6b7280;
    font-size: 1rem;
}

/* ===== SERVICES GRID ===== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.service-card {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border-radius: 16px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.service-card:hover {
    transform: translateY(-5px);
    border-color: #3b82f6;
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.15);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
}

.service-icon {
    font-size: 2rem;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.service-card h3 {
    color: #1e40af;
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.service-card p {
    color: #6b7280;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 15px;
}

.service-price {
    color: #059669;
    font-size: 1.8rem;
    font-weight: 700;
    margin-top: 10px;
}

/* ===== QUICK STATS ===== */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: #3b82f6;
    transform: translateY(-3px);
}

.stat-card i {
    font-size: 2rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-card h3 {
    font-size: 2rem;
    color: #1e40af;
    margin: 10px 0;
}

.stat-card p {
    color: #6b7280;
    font-size: 0.9rem;
}

/* ===== ANALYTICS PANEL ===== */
.analytics-panel {
    position: fixed;
    top: 0;
    right: -500px;
    width: 480px;
    height: 100vh;
    background: white;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow-y: auto;
}

.analytics-panel.active {
    right: 0;
}

.analytics-header {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: white;
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.analytics-header h2 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.analytics-content {
    padding: 30px;
}

/* ===== ANALYTICS SUMMARY ===== */
.analytics-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid #e5e7eb;
}

.summary-card i {
    font-size: 2rem;
}

.summary-card.primary i { color: #3b82f6; }
.summary-card.success i { color: #10b981; }
.summary-card.warning i { color: #f59e0b; }
.summary-card.info i { color: #8b5cf6; }

.summary-card h3 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.summary-card p {
    color: #6b7280;
    font-size: 0.9rem;
}

/* ===== TRANSACTIONS TABLE ===== */
.transactions-section {
    margin-bottom: 30px;
}

.transactions-section h3 {
    color: #1e40af;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}

th {
    padding: 15px;
    text-align: left;
    color: #475569;
    font-weight: 600;
    border-bottom: 2px solid #e5e7eb;
}

td {
    padding: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.empty-message {
    text-align: center;
    color: #94a3b8;
    padding: 40px !important;
}

/* ===== CHART SECTION ===== */
.chart-section h3 {
    color: #1e40af;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-container {
    background: white;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #e5e7eb;
}

.chart-bar {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.bar-label {
    width: 80px;
    font-weight: 600;
    color: #475569;
}

.bar-track {
    flex: 1;
    height: 20px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 1s ease;
}

#ahmerBar { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
#khalidBar { background: linear-gradient(90deg, #10b981, #34d399); }

/* ===== POPUP OVERLAY ===== */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.popup-container {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    animation: popupSlide 0.3s ease;
}

@keyframes popupSlide {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.popup-header {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    padding: 25px 30px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#detailsForm {
    padding: 30px;
}

/* ===== FORM STYLES ===== */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #475569;
    font-weight: 600;
    margin-bottom: 10px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

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

.worker-select {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.worker-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.worker-option:hover {
    border-color: #3b82f6;
    background: #f8fafc;
}

.worker-option.selected {
    border-color: #3b82f6;
    background: #eff6ff;
}

.worker-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn-confirm {
    flex: 1;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.btn-cancel {
    flex: 1;
    background: #f1f5f9;
    color: #64748b;
    border: none;
    padding: 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: #e2e8f0;
}

/* ===== TOAST NOTIFICATION ===== */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-left: 5px solid #10b981;
    transform: translateX(150%);
    transition: transform 0.3s ease;
    z-index: 3000;
    max-width: 350px;
}

.toast.show {
    transform: translateX(0);
}

.toast-icon {
    font-size: 1.8rem;
    color: #10b981;
}

.toast-content strong {
    color: #1e40af;
    font-size: 1rem;
}

.toast-content p {
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 5px;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 20px;
    }
    
    .header-left, .header-right {
        width: 100%;
        justify-content: center;
    }
    
    .services-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .analytics-panel {
        width: 100%;
        right: -100%;
    }
    
    .analytics-summary {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
}