/* ============================ */
/* ======= JOB MODAL ========== */
/* ============================ */

.job-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0, 0, 0, 0.4);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.job-modal-overlay.open {
    display: flex;
}

.job-modal {
    background: var(--white);
    border-radius: 12px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.job-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--bg-accent);
    flex-shrink: 0;
}

.job-modal-head-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.job-modal-body {
    padding: 1.5rem;
    flex: 1;
}

/* Reference + service heading */
.job-modal-ref {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}

.job-modal-service {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Playfair Display', serif;
}

.job-modal-top-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

/* Detail grid */
.modal-detail-grid {
    display: flex;
    flex-direction: column;
    background: var(--bg);
    border: 1px solid var(--bg-accent);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
}

.modal-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    font-size: 13px;
    border-bottom: 1px solid var(--bg-accent);
}

.modal-detail-item:last-child {
    border-bottom: none;
}

.modal-detail-label {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    flex-shrink: 0;
    min-width: 90px;
}

.modal-detail-value {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
}

/* Price breakdown */
.modal-section-title {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
    margin-top: 16px;
}

.modal-breakdown {
    background: var(--bg);
    border: 1px solid var(--bg-accent);
    border-radius: 10px;
    overflow: hidden;
}

.modal-breakdown-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 9px 14px;
    border-bottom: 1px solid var(--bg-accent);
}

.modal-breakdown-row:last-child {
    border-bottom: none;
}

.modal-breakdown-row.is-travel {
    color: var(--primary);
    font-weight: 500;
}

.modal-breakdown-row.is-total {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 14px;
    background: var( --bg-card);
}

/* Action buttons row */
.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn-danger-soft {
    background: #FEF2F2;
    color: #B91C1C;
    border: 1px solid #FECACA;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 7px;
    font-size: 12px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-danger-soft:hover {
    background: #FEE2E2;
    border-color: #FCA5A5;
}

/* Reschedule panel */
.modal-reschedule-panel {
    display: none;
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-accent);
    border: 1px solid var(--primary-light);
    border-radius: 10px;
}

.modal-reschedule-panel.open {
    display: block;
}

.modal-reschedule-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.modal-reschedule-fields {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.modal-reschedule-field {
    flex: 1;
    min-width: 140px;
}

.modal-reschedule-actions {
    display: flex;
    gap: 8px;
}

/* Slots grid inside reschedule panel */
.modal-slots-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.modal-slot-btn {
    padding: 10px 8px;
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: 7px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'DM Sans', sans-serif;
}

.modal-slot-btn:hover:not(:disabled) {
    border-color: var(--primary);
    background: var(--bg-accent);
}

.modal-slot-btn.selected {
    border-color: var(--primary);
    background: var(--bg-accent);
    color: var(--primary);
    font-weight: 600;
}

.modal-slot-btn:disabled {
    background: var( --bg-card);
    color: var(--text-light);
    cursor: not-allowed;
    text-decoration: line-through;
    opacity: 0.5;
}

.modal-slot-time {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: inherit;
}

.modal-slot-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Status badges */
.status-pending {
    background: #FEF3C7;
    color: #92400E;
}

.status-completed {
    background: #D1FAE5;
    color: #065F46;
}

@media (max-width: 850px) {
    .job-modal-overlay {
        padding: 0.5rem;
        align-items: flex-end;
    }

    .job-modal {
        max-width: 100%;
        max-height: 92vh;
        border-radius: 12px 12px 0 0;
    }

    .job-modal-head {
        padding: 1rem 1.1rem;
    }

    .modal-detail-item {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .modal-detail-value {
        text-align: left;
        width: 100%;
    }
}