/* Shared visual layer for driver/agent jobs and customer orders.
   Scoped to these dialogs so global DataTables and jBox styles stay unchanged. */
.job-history-modal.jBox-Modal { width: auto; height: auto; }
.job-history-modal.jBox-Modal .jBox-container {
    height: auto;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 18px 64px #20233b30;
}
.job-history-modal.jBox-Modal .jBox-content {
    padding: 0;
    width: min(1240px, 96vw) !important;
    max-width: 96vw !important;
    height: auto !important;
    overflow: hidden;
}
.job-history-modal .jBox-closeButton {
    top: 22px;
    right: 24px;
    width: 32px;
    height: 32px;
    border: 1px solid #cdcef2;
    border-radius: 5px;
    background: #fff;
}
.job-history-modal .jBox-closeButton svg {
    position: absolute;
    width: 12px;
    height: 12px;
    top: 50%;
    left: 50%;
    right: auto;
    margin: 0;
    transform: translate(-50%, -50%);
}
.job-history-modal .jBox-closeButton svg path { fill: #343986; }
.job-history-modal .jBox-closeButton:hover { background: #f3f3fc; }
.job-history-modal :is(.driver-jobs-popup, .customer-orders-popup) {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: calc(100dvh - 32px);
    border-radius: 0;
    font: 13px/1.5 "Titillium Web", Arial, sans-serif;
    color: #30323e;
}
.job-history-modal .title {
    flex: none;
    padding: 20px 72px 18px 28px;
    border-bottom: 1px solid #ededf1;
}
.job-history-modal .title > span { font-size: 20px; font-weight: 600; color: #20212b; }
.job-history-modal .title > p { margin: 4px 0 0; font-size: 13px; line-height: 1.5; color: #747783; }
.job-history-modal .job-history-progress {
    display: flex;
    flex: none;
    align-items: stretch;
    gap: 24px;
    padding: 0 28px;
    overflow-x: auto;
    border-bottom: 1px solid #ededf1;
}
.job-history-modal .job-history-progress-tab {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 10px 0;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: #666b77;
    font: 600 13px/1.5 "Titillium Web", Arial, sans-serif;
    box-shadow: none;
    cursor: pointer;
}
.job-history-modal .job-history-progress-tab:hover { color: #343986; }
.job-history-modal .job-history-progress-tab[aria-pressed="true"] { color: #343986; border-bottom-color: #343986; }
.job-history-modal .job-history-progress-tab:focus-visible { outline: 2px solid #5658ab; outline-offset: -3px; }
.job-history-modal .job-history-progress-count {
    min-width: 19px;
    padding: 1px 5px;
    border-radius: 20px;
    background: #f5f5f7;
    font-size: 11px;
    font-weight: 400;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.job-history-modal .job-history-progress-tab[aria-pressed="true"] .job-history-progress-count { background: #f0f0fc; }
.job-history-modal :is(.driver-jobs-toolbar, .customer-orders-toolbar) {
    flex: none;
    padding: 14px 28px;
    background: #fafafb;
    border-bottom: 1px solid #ededf1;
}
.job-history-modal :is(.driver-jobs-filter-row, .customer-orders-filter-row) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 170px;
    gap: 12px;
    margin-bottom: 12px;
}
.job-history-modal :is(.driver-jobs-filter-row, .customer-orders-filter-row, .driver-jobs-date-range, .customer-orders-date-range) :is(input, select) {
    height: 40px;
    min-width: 0;
    font-size: 13px !important;
    color: #30323e;
    border-color: #d8d9df;
    border-radius: 6px;
    background-color: #fff;
}
.job-history-modal :is(#driver_jobs_search, #customer_orders_search) {
    padding-left: 36px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23747783' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m16 16 4 4'/%3E%3C/svg%3E") no-repeat 12px center;
}
.job-history-modal :is(.driver-jobs-market-pills, .customer-orders-market-pills) { align-items: center; gap: 8px; }
.job-history-modal .job-history-filter-label { margin-right: 4px; color: #747783; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.job-history-modal :is(.driver-jobs-market-pill, .customer-orders-market-pill) { position: relative; margin: 0; }
/* Visually hidden, but available to keyboard navigation. */
.job-history-modal :is(.driver-jobs-market-pill, .customer-orders-market-pill) input {
    display: block;
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
.job-history-modal :is(.driver-jobs-market-pill, .customer-orders-market-pill) span,
.job-history-modal .job-history-all-markets {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 3px 12px;
    border: 1px solid #d7d8f1;
    border-radius: 20px;
    background: #fff;
    color: #343986;
    font: 600 12px/1.5 "Titillium Web", Arial, sans-serif;
    letter-spacing: 0;
    text-transform: none;
    box-shadow: none;
    cursor: pointer;
}
.job-history-modal :is(.driver-jobs-market-pill, .customer-orders-market-pill).active span,
.job-history-modal .job-history-all-markets[aria-pressed="true"] {
    color: #fff;
    background: #343986;
    border-color: #343986;
    box-shadow: none;
}
.job-history-modal :is(.driver-jobs-market-pill, .customer-orders-market-pill):hover span,
.job-history-modal .job-history-all-markets:hover { border-color: #343986; }
.job-history-modal :is(.driver-jobs-market-pill, .customer-orders-market-pill) input:focus-visible + span,
.job-history-modal .job-history-all-markets:focus-visible { outline: 2px solid #5658ab; outline-offset: 2px; }
.job-history-modal :is(.driver-jobs-summary, .customer-orders-summary) {
    flex: none;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 16px 28px;
    border: 0;
}
.job-history-modal :is(.driver-jobs-summary-card, .customer-orders-summary-card) {
    padding: 12px 16px;
    border: 1px solid #e9e9ee;
    border-radius: 9px;
    box-shadow: none;
}
.job-history-modal :is(.driver-jobs-summary-card, .customer-orders-summary-card) > span {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #747783;
}
.job-history-modal :is(.driver-jobs-summary-card, .customer-orders-summary-card) > strong {
    margin-top: 4px;
    font-size: 22px;
    line-height: 1.3;
    font-weight: 600;
    color: #20212b;
    font-variant-numeric: tabular-nums;
}
.job-history-modal :is(.driver-jobs-body, .customer-orders-body) {
    flex: 0 1 auto;
    min-height: 0;
    padding: 0 28px 20px;
    overflow: auto;
    scrollbar-gutter: auto;
}
.job-history-modal :is(.driver-jobs-table-wrap, .customer-orders-table-wrap) {
    border: 1px solid #e9e9ee;
    border-radius: 9px;
    overflow: auto;
}
.job-history-modal table.dataTable {
    border: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    margin: 0 !important;
    min-width: 1000px;
    font-size: 13px;
}
/* DataTables' display class adds sorted-column shadows; retain sort arrows only. */
.job-history-modal table.dataTable > :is(thead, tbody) > tr > :is(th, td) {
    border: 0 !important;
    box-shadow: none !important;
    vertical-align: middle;
}
.job-history-modal table.dataTable > thead > tr > th {
    padding: 11px 12px !important;
    background: #f8f8fa;
    color: #666b77;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.job-history-modal table.dataTable > tbody > tr > td {
    padding: 12px 12px !important;
    border-top: 1px solid #ededf1 !important;
    background: #fff !important;
    color: #666b77;
    line-height: 1.45;
}
.job-history-modal table.dataTable > tbody > tr:hover > td { background: #fafaff !important; }
.job-history-modal table.dataTable > thead > tr > th:first-child,
.job-history-modal table.dataTable > tbody > tr > td:first-child { padding-left: 16px !important; }
.job-history-modal table.dataTable > thead > tr > th:last-child,
.job-history-modal table.dataTable > tbody > tr > td:last-child { padding-right: 16px !important; }
.job-history-modal table.dataTable :is(.driver-job-no, .customer-order-no) { font-weight: 600; }
.job-history-modal :is(.driver-job-route strong, .customer-order-route .main) { color: #30323e; font-weight: 600; }
.job-history-modal .customer-order-route { gap: 2px; }
.job-history-modal :is(.driver-job-route span, .customer-order-route .sub) { color: #747783; font-size: 12px; }
.job-history-modal table.dataTable :is(.driver-job-money, .customer-order-money) { color: #30323e; font-weight: 600; font-variant-numeric: tabular-nums; }
.job-history-modal table.dataTable .negative { color: #b13e31; }
.job-history-modal .job-status-indicators .job-indicator { border-radius: 50%; }
/* Compact icon columns, independent of DataTables' numeric alignment. */
.job-history-modal table.dataTable > :is(thead, tbody) > tr > :is(th, td):is(.job-status-cell, .job-followup-cell) {
    padding-left: 4px !important;
    padding-right: 4px !important;
    text-align: center !important;
    white-space: nowrap;
}
.job-history-modal table.dataTable :is(.job-status-cell, .job-followup-cell) { width: 56px; min-width: 56px; }
.job-history-modal table.dataTable th.job-status-cell .dt-column-order { right: 2px; width: 8px; }
.job-history-modal .job-status-cell .job-status-indicators {
    min-width: 0;
    gap: 4px;
    justify-content: center;
    vertical-align: middle;
}
.job-history-modal .job-followup-cell .jdf-slot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    width: 30px;
    height: 30px;
}
.job-history-modal .job-followup-cell .jdf-notification { width: 30px; height: 30px; }
.job-history-modal .job-followup-cell .jdf-notification svg { width: 18px; height: 18px; }
.job-history-modal .job-followup-cell :is(.jdf-loading, .jdf-quiet) { width: 30px; }
.job-history-modal .job-history-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #ededf1;
}
.job-history-modal .job-history-footer .dt-info { display: block !important; padding: 0; margin: 0; font-size: 12px; color: #747783; }
.job-history-modal .job-history-footer .dt-paging { float: none; padding: 0; margin: 0 0 0 auto; border: 0; }
.job-history-modal .job-history-footer .dt-paging-button {
    min-width: 30px;
    min-height: 30px;
    padding: 4px 9px !important;
    border: 1px solid transparent !important;
    border-radius: 6px !important;
    background: #fff !important;
    color: #666b77 !important;
    font: 13px/1.5 "Titillium Web", Arial, sans-serif;
    box-shadow: none !important;
}
.job-history-modal .job-history-footer .dt-paging-button.current,
.job-history-modal .job-history-footer .dt-paging-button:not(.disabled):hover { background: #f2f2fd !important; color: #343986 !important; border-color: #d7d8f1 !important; }
.job-history-modal .job-history-footer .dt-paging-button.disabled { opacity: .4; }
.job-history-modal :is(.driver-jobs-empty, .customer-orders-empty) { padding: 44px 20px; border-color: #e9e9ee; }
.job-history-modal :is(.driver-jobs-loading, .customer-opportunities-loading) { padding: 72px 28px; }
@media (max-width: 700px) {
    .job-history-modal .job-history-progress { padding: 0 18px; gap: 20px; }
    .job-history-modal .title { padding: 18px 60px 16px 18px; }
    .job-history-modal .jBox-closeButton { top: 18px; right: 18px; }
    .job-history-modal :is(.driver-jobs-toolbar, .customer-orders-toolbar) { padding: 14px 18px; }
    .job-history-modal :is(.driver-jobs-summary, .customer-orders-summary) { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 16px 18px; gap: 8px; }
    .job-history-modal :is(.driver-jobs-body, .customer-orders-body) { padding: 0 18px 18px; }
}
@media (max-width: 480px) {
    .job-history-modal :is(.driver-jobs-popup, .customer-orders-popup) { overflow: auto; }
    .job-history-modal :is(.driver-jobs-filter-row, .customer-orders-filter-row) { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .job-history-modal :is(.driver-jobs-body, .customer-orders-body) { flex-shrink: 0; }
}
