/* Base */

.job-app {
    font-family: "Source Sans 3", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    background: #ffffff;
    font-size: 14px;
    line-height: 1.4;
}

.job-app-blue-text {
    color: #007cba;
}

/* Header / Search */

.job-app-header {
    margin-bottom: 12px;
}

.job-app-search-label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    color: #007cba;
    font-size: 14px;
}

.job-app-search-input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 14px;
}

/* Layout */

.job-app-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Desktop/tablet layout */
@media (min-width: 800px) {
    .job-app-body {
        flex-direction: row;
    }

    .job-app-list {
        width: 40%;
        max-height: 80vh;
        overflow-y: auto;
        border-right: 1px solid #eee;
        padding-right: 8px;
    }

    .job-app-detail {
        width: 60%;
        max-height: 80vh;
        overflow-y: auto;
        padding-left: 8px;
    }
}

/* Customer clusters */

.job-app-customer {
    margin-bottom: 16px;
}

.job-app-customer-name {
    font-size: 14px;
    font-weight: 700;
    margin: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #333;
}

/* Job listings */

.job-app-job {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    margin-bottom: 6px;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    background: #fff;
}

.job-app-job:hover {
    background: #f8fafc;
    box-shadow: 0 0 0 1px #e0e0e0;
}

.job-app-job.is-active {
    border-color: #007cba;
    background: #f0f7ff;
    box-shadow: 0 0 0 1px #007cba33;
}

.job-app-job-id {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    color: #111;
}

.job-app-job-meta {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.job-app-job-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.job-app-job-meta-item {
    display: inline-flex;
    align-items: center;
}

.job-app-job-meta-item i {
    margin-right: 4px;
    font-size: 11px;
}

/* Date and engineer on same row */
.job-app-job-meta-date {
    /* left by default */
}

.job-app-job-meta-tech {
    /* sits to the right of date on same row */
}

/* Address text should not open Maps / not look like link */
.job-app-job-meta-address,
.job-app-address-text {
    pointer-events: none;
    -webkit-touch-callout: none;
}

/* Amount (no icon, just text) */

.job-app-job-amount {
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
    color: #111;
}

.job-app-job-amount-value {
    /* already contains the £ sign from PHP */
}

/* Detail view */

.job-app-detail-header {
    margin-bottom: 8px;
    border-bottom: 1px solid #eee;
    padding-bottom: 6px;
}

.job-app-detail-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px;
}

.job-app-detail-meta {
    font-size: 13px;
    color: #555;
}

.job-app-detail-description {
    margin: 8px 0 12px;
    font-size: 14px;
}

.job-app-detail-placeholder {
    font-size: 14px;
    color: #777;
    padding: 8px 0;
}

/* Pricing block */

.job-app-pricing {
    margin-top: 12px;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #e4e4e4;
    background: #fafafa;
}

.job-app-pricing-title {
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.job-app-pricing-title i {
    font-size: 13px;
}

.job-app-pricing-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 12px;
    font-size: 13px;
}

@media (max-width: 500px) {
    .job-app-pricing-grid {
        grid-template-columns: 1fr;
    }
}

.job-app-pricing-item {
    display: flex;
    justify-content: space-between;
}

.job-app-pricing-label {
    color: #555;
}

.job-app-pricing-value {
    font-weight: 600;
    color: #111;
}

/* Notes block */

.job-app-notes {
    margin-top: 16px;
    background: #f5f5f5;
    border-radius: 4px;
    padding: 8px;
}

.job-app-notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.job-app-notes-title {
    font-size: 14px;
    font-weight: 700;
    color: #333;
}

.job-app-notes-filters {
    font-size: 12px;
    display: flex;
    gap: 10px;
}

.job-app-notes-filters label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.job-app-notes-list {
    border-top: 1px dotted #d0d0d0;
    margin-top: 6px;
    padding-top: 4px;
}

/* Individual notes */

.job-app-note {
    border-radius: 0;
    border: none;
    border-bottom: 1px dotted #d0d0d0;
    padding: 8px 0;
    font-size: 13px;
}

.job-app-note:last-child {
    border-bottom: none;
}

.job-app-note-header {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.job-app-note-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
    margin-right: 6px;
    color: #ffffff;
}

.job-app-note-badge.work {
    background: #007cba;
}

.job-app-note-badge.tech {
    background: #6f42c1;
}

.job-app-note-meta {
    font-size: 11px;
    color: #555;
}

.job-app-note-text {
    margin: 0;
    white-space: pre-wrap;
}

/* Sticky CTA footer */

.job-app-footer {
    position: sticky;
    bottom: 0;
    padding-top: 8px;
    margin-top: 12px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: #ffffff;
}

.job-app-footer-cta {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: #007cba;
    color: #ffffff;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.job-app-footer-cta:hover {
    background: #005f8f;
}

/* Mobile modal */

.job-app-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.job-app-modal.is-visible {
    display: flex;
}

.job-app-modal-inner {
    background: #ffffff;
    width: 100%;
    max-width: 700px;
    max-height: calc(100vh - 24px);
    margin: 12px;
    border-radius: 6px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.job-app-modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #555;
    z-index: 2;
}

.job-app-modal-content {
    margin-top: 0;
    padding: 12px;
    padding-top: 30px;
    overflow-y: auto;
    flex: 1 1 auto;
}

/* On very small screens, list & search */

@media (max-width: 799px) {
    .job-app-list {
        max-height: 100vh;
        overflow-y: auto;
    }

    /* Hide side panel; we use modal instead */
    .job-app-detail {
        display: none;
    }
}
