* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #f8f5ee; /* same cream as the orders page */
    color: #1a1a1a;
}

/* logo | title (centered) | admin button */
.head{
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 18px;
    background-color: #f8f5ee;
    border-bottom: 1px solid #e6e0d4;
    /* logo and Admin line up with the job list below */
    padding: 14px max(24px, calc((100% - 900px) / 2 + 24px));
}

.logo img{
    height: 32px;
    display: block;
}

.head .name{
    font-size: 17px;
    font-weight: 600;
    color: #1a1a1a;
}

/* same look as the Reconcile buttons */
.adminBtn{
    justify-self: end;
    padding: 7px 16px;
    color: #000;
    background-color: #fff;
    text-decoration: none;
    font-size: 14px;
    border: 1px solid #000;
    border-radius: 6px;
}

.adminBtn:hover{
    background-color: #000;
    color: #fff;
}

.body{
    max-width: 900px;
    margin: 0 auto;
    padding: 28px 24px 48px;
}

.toolbar{
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.summary{
    font-size: 13px;
    color: #666;
}

.summaryTotal{
    display: block;
    font-size: 30px;
    font-weight: 700;
    color: #1a1a1a;
    font-variant-numeric: tabular-nums;
}

.jobSearch{
    width: 260px;
    padding: 9px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background-color: #fff;
}

.jobSearch:focus{
    outline: none;
    border-color: #000;
}

.divToDisplay{
    font-size: 14px;
    color: #15803d;
    margin-bottom: 12px;
}

.divToDisplay:empty{
    display: none;
}

/* one row per job: name + spent/reconciled | still open | button */
.jobRow{
    display: flex;
    align-items: center;
    gap: 28px;
    background-color: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 10px;
}

.jobRow:hover{
    border-color: #cfcfcf;
}

.jobInfo{
    flex: 1;
    min-width: 0;
}

.jobName{
    font-size: 16px;
    font-weight: 600;
}

.jobMeta{
    display: flex;
    gap: 40px;
    margin-top: 3px;
    font-size: 13px;
    color: #777;
    font-variant-numeric: tabular-nums;
}

.jobMeta .spent{
    min-width: 140px;
}

.jobOpen{
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.openLabel{
    font-size: 11px;
    color: #999;
}

.openAmount{
    font-size: 20px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.empty{
    text-align: center;
    color: #888;
    padding: 40px 18px;
    background-color: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
}

.reconcileBtn{
    padding: 8px 16px;
    background-color: #fff;
    color: #000;
    border: 1px solid #000;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
}

.reconcileBtn:hover{
    background-color: #000;
    color: #fff;
}

.reconcileBtn:disabled{
    opacity: 0.4;
    cursor: not-allowed;
}

/* reconcile form */

.forms{
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.reconsileForm{
    background-color: #fff;
    width: 400px;
    max-width: 92vw;
    max-height: 88vh;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.formHeader{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.formTitle{
    font-size: 16px;
    font-weight: 600;
}

.formClose{
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    color: #999;
}

.formClose:hover{
    color: #000;
}

.formBody{
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 20px;
}

.openLine{
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #666;
}

.totalAmount{
    font-weight: 600;
    color: #1a1a1a;
}

.field{
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: #444;
}

.field input{
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
}

.field input:focus{
    outline: none;
    border-color: #000;
}

.leftAfter{
    font-size: 13px;
    color: #666;
}

.leftAfter:empty, .formError:empty{
    display: none;
}

.formError{
    font-size: 13px;
    color: #b91c1c;
}

.saveBtn{
    padding: 11px;
    font-size: 14px;
    background-color: #000;
    color: #fff;
}

.saveBtn:hover{
    background-color: #333;
}

.history{
    border-top: 1px solid #eee;
    padding: 14px 20px 18px;
    overflow-y: auto;
}

.historyTitle{
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.historyList{
    font-size: 13px;
    color: #999;
}

.historyRow{
    display: flex;
    gap: 10px;
    padding: 5px 0;
    color: #1a1a1a;
}

.hNote{
    flex: 1;
    color: #888;
}

/* phone: each job becomes a simple block */
@media (max-width: 700px){
    .head{
        padding: 12px 16px;
        gap: 10px;
    }
    .head .name{
        font-size: 15px;
    }
    .adminBtn{
        padding: 6px 12px;
        font-size: 13px;
    }
    .logo img{
        height: 26px;
    }
    .body{
        padding: 16px 12px 40px;
    }
    .toolbar{
        flex-direction: column;
        align-items: stretch;
    }
    .jobSearch{
        width: 100%;
    }
    .summaryTotal{
        font-size: 26px;
    }
    /* name + spent/reconciled on top, still open and button underneath */
    .jobRow{
        flex-wrap: wrap;
        gap: 12px;
        padding: 14px 16px;
    }
    .jobInfo{
        flex-basis: 100%;
    }
    .jobMeta{
        gap: 16px;
    }
    .jobMeta .spent{
        min-width: 0;
    }
    .jobOpen{
        flex: 1;
        align-items: flex-start;
    }
}
