/* Premium Task Cards */
.task-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.task-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.task-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.task-priority {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.priority-critical {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fee2e2;
}

.priority-high {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #ffedd5;
}

.priority-medium {
    background: #fefce8;
    color: #854d0e;
    border: 1px solid #fef9c3;
}

.priority-low {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #dcfce7;
}

.task-header h3 {
    font-size: 1.1rem;
    color: #1e293b;
    font-weight: 600;
    line-height: 1.4;
    margin-right: 40px;
    /* Space for priority badge */
}

.task-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #64748b;
}

.meta-item i {
    width: 16px;
    color: #0D8F72;
}

.task-progress {
    margin: 0.5rem 0;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.progress-header span {
    font-size: 0.75rem;
    font-weight: 600;
    color: #e8ebf0;
}

.progress-bar {
    height: 6px;
    background: #f1f5f9;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0D8F72, #10b981);
    border-radius: 10px;
    transition: width 0.6s ease;
}

.task-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
}

.task-btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-accept {
    background: #0D8F72;
    color: white;
}

.btn-accept:hover {
    background: #0a735c;
    box-shadow: 0 4px 12px rgba(13, 143, 114, 0.3);
}

.btn-start {
    background: #3b82f6;
    color: white;
}

.btn-start:hover {
    background: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-complete {
    background: #10b981;
    color: white;
}

.btn-complete:hover {
    background: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-approve-proof {
    background: #0D8F72;
    color: white;
}

.btn-approve-proof:hover {
    background: #0a735c;
    box-shadow: 0 4px 12px rgba(13, 143, 114, 0.3);
}

.btn-reject-proof {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
}

.btn-reject-proof:hover {
    background: #ffedd5;
}

.btn-reject {
    background: #f1f5f9;
    color: #64748b;
}

/* Tricolor Theme Overrides */
.meta-item i {
    color: var(--primary);
}

.progress-header span {
    color: var(--dark);
}

.progress-fill {
    background: linear-gradient(90deg, var(--primary), #2d8a2d);
}

.btn-reject:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.no-data {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: #64748b;
    background: #f8fafc;
    border-radius: 16px;
    border: 2px dashed #e2e8f0;
}

.no-data i {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
    color: #cbd5e1;
}

/* Task Completion Modal Styles */
.form-section {
    margin-bottom: 2.5rem;
}

.form-section h3 {
    font-size: 1rem;
    color: #1e293b;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-section h3 i {
    color: #0D8F72;
}

.photo-upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.photo-upload-item {
    background: #fafafa;
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.photo-upload-item:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.photo-upload-item input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    top: 0;
    left: 0;
}

.photo-preview {
    width: 100%;
    height: 140px;
    background: var(--light);
    border-radius: 10px;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.photo-preview::after {
    content: '\f030';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 2rem;
    color: var(--gray);
    opacity: 0.3;
}

.photo-preview img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

#completionNotes {
    width: 100%;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-family: inherit;
    resize: vertical;
}

#completionNotes:focus {
    outline: none;
    border-color: #0D8F72;
    box-shadow: 0 0 0 3px rgba(13, 143, 114, 0.1);
}

.location-info {
    background: #f0f9ff;
    padding: 1.25rem;
    border-radius: 12px;
    font-size: 0.9rem;
    color: #0369a1;
    border: 1px solid #bae6fd;
    display: flex;
    align-items: center;
    gap: 10px;
}

.location-info i {
    color: #0ea5e9;
    font-size: 1.1rem;
}

/* Status Messages in Task Cards */
.status-msg {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 1rem;
}

.status-msg.warning {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fef3c7;
}

.status-msg.success {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #d1fae5;
}

@media (max-width: 768px) {
    .photo-upload-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .task-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .task-card {
        padding: 1.1rem;
    }

    .task-header h3 {
        margin-right: 0;
        padding-right: 84px;
    }

    .task-priority {
        top: 0.85rem;
        right: 0.85rem;
    }

    .photo-upload-item {
        padding: 1.25rem;
    }

    .photo-preview {
        height: 120px;
    }
}

@media (max-width: 360px) {
    .task-card {
        padding: 0.85rem;
    }

    .task-header h3 {
        font-size: 0.95rem;
        padding-right: 74px;
    }

    .task-priority {
        padding: 3px 8px;
        font-size: 0.6rem;
    }

    .task-btn {
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .photo-upload-item {
        padding: 1rem;
    }

    .photo-preview {
        height: 100px;
    }

    .perf-grade-card {
        min-width: auto;
        width: 100%;
    }

    .perf-grade-badge-large {
        width: 64px;
        height: 64px;
        font-size: 1.4rem;
    }
}

/* =====================================================
   PERFORMANCE SECTION
   ===================================================== */

.performance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.performance-header h2 {
    font-size: 1.4rem;
    color: #1e293b;
    margin: 0;
}

.performance-period-selector {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.performance-period-selector select,
.performance-period-selector input {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.9rem;
}

.performance-period-selector input {
    width: 90px;
}

.perf-score-overview {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    align-items: stretch;
    flex-wrap: wrap;
}

.perf-grade-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #f1f5f9;
    min-width: 220px;
}

.perf-grade-badge-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
}

.perf-grade-badge-large.small { font-size: 0.85rem; }
.perf-grade-badge-large small { font-size: 0.7rem; font-weight: 400; opacity: 0.85; }

.perf-grade-info { display: flex; flex-direction: column; gap: 0.25rem; }
.perf-grade-label { font-size: 0.85rem; color: #64748b; }
.perf-grade-period { font-size: 0.8rem; color: #94a3b8; }

.perf-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.75rem;
    flex: 1;
}

.perf-stat {
    background: #fff;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #f1f5f9;
}

.perf-stat.negative { background: #fef2f2; }

.perf-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
}

.perf-stat-label {
    font-size: 0.72rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.perf-section-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #f1f5f9;
}

.perf-section-card h3 {
    font-size: 1rem;
    color: #1e293b;
    margin-bottom: 1rem;
}

.perf-breakdown-table-wrap { overflow-x: auto; }

.perf-breakdown-table-wrap .group-header td {
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.82rem;
    color: #475569;
}

.perf-payment-card {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
}

.perf-payment-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9rem;
}

.perf-payment-row:last-child { border-bottom: none; }

.perf-payment-row.negative span:last-child { color: #dc2626; }

.perf-payment-row.total {
    font-weight: 700;
    font-size: 1rem;
    border-top: 2px solid #334155;
    padding-top: 0.75rem;
}

.perf-payment-row.hold span:last-child {
    color: #ef4444;
    font-weight: 600;
}

.negative-row td { color: #dc2626 !important; }

/* Grade badge colors (shared with admin) */
.grade-a-plus { background: #059669; }
.grade-a { background: #10b981; }
.grade-b { background: #0ea5e9; }
.grade-c { background: #f59e0b; color: #1e293b; }
.grade-d { background: #f97316; }
.grade-e { background: #ef4444; }
.grade-f { background: #7f1d1d; }
.grade-none { background: #94a3b8; }