/* loads pages. */

/* ───────── load page (detail.js) ───────── */
.ld-hero { background: linear-gradient(150deg, var(--navy) 0%, var(--navy-dark) 100%); color: #fff; border-radius: 18px; padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.ld-route { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-size: 26px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; overflow-wrap: anywhere; }
.ld-arrow { color: var(--accent); display: inline-flex; }
.ld-facts { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px 16px; background: rgba(255,255,255,.08); border-radius: 14px; padding: 12px 14px; }
.ld-fact { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ld-fact-label { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #8FA6CC; }
.ld-fact-value { font-weight: 800; overflow-wrap: anywhere; }
.ld-fact-value.gold { color: #F2B84B; }
.ld-chip { display: inline-block; background: rgba(255,255,255,.1); color: #DCE6F7; border-radius: 999px; padding: 4px 11px; font-size: 12.5px; font-weight: 700; }
.ld-notes { color: rgba(255,255,255,.82); font-size: 13px; white-space: pre-line; }
.ld-cancelled { color: #FFD2CC; font-size: 13px; }
.ld-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.ld-steps li { display: flex; flex-direction: column; gap: 5px; min-width: 0; color: rgba(255,255,255,.55); }
.ld-step-bar { height: 5px; border-radius: 99px; background: rgba(255,255,255,.18); }
.ld-steps li.past .ld-step-bar, .ld-steps li.now .ld-step-bar { background: var(--accent); }
.ld-step-label { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-steps li.past .ld-step-label { color: #F2B84B; }
.ld-steps li.now .ld-step-label { color: #fff; }
.ld-step-day { font-size: 12px; color: rgba(255,255,255,.6); min-height: 16px; }
@media (max-width: 1000px) { .ld-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .ld-hero { padding: 16px; border-radius: 16px; }
  .ld-route { font-size: 21px; }
  .ld-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ld-step-label { font-size: 12px; }
}

.ld-next { display: flex; align-items: center; gap: 12px 16px; padding: 12px 16px; border-left: 4px solid var(--accent); flex-wrap: wrap; }
.ld-next-text { flex: 1 1 260px; color: var(--text2); font-weight: 600; }
.ld-next-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 600px) { .ld-next-actions { width: 100%; } .ld-next-actions .btn { flex: 1 1 auto; } }

.ld-menu { position: relative; }
.ld-menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 25; min-width: 200px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 4px; display: flex; flex-direction: column; }
.ld-menu-item { text-align: left; background: none; border: 0; padding: 9px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--text); text-decoration: none; white-space: nowrap; }
.ld-menu-item:hover { background: var(--muted-bg); }
.ld-menu-item.danger { color: var(--bad); }

.ld-halves { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ld-half { background: #F6F8FB; border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ld-half.warn { background: var(--warn-bg); }
.ld-half.warn .ld-half-title { color: var(--warn); }
.ld-half-label { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text2); }
.ld-half-amount { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; }
.ld-half-title { font-size: 16px; font-weight: 800; }
.ld-half-action { margin-top: auto; display: flex; align-items: center; justify-content: center; min-height: 38px; border-radius: 10px; font-weight: 800; text-decoration: none; }
.ld-half-action.good { background: var(--good-bg); color: #0B6B3A; }
.ld-half-action.info { background: var(--info-bg); color: var(--navy); }
.ld-half-action:hover { filter: brightness(.97); }
.ld-bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.ld-bar span { display: block; height: 100%; border-radius: 99px; }
.ld-bar span.good { background: var(--good); }
.ld-bar span.info { background: var(--blue); }
@media (max-width: 480px) { .ld-halves { grid-template-columns: minmax(0, 1fr); } }
.ld-add-row { display: flex; gap: 10px; }
.ld-add { flex: 1 1 0; display: flex; align-items: center; justify-content: center; min-height: 40px; border-radius: 10px; font-weight: 800; text-decoration: none; background: var(--muted-bg); color: var(--text2); }
.ld-add.expense { background: var(--warn-bg); color: #8A4B05; }
.ld-add.dashed { background: transparent; border: 1.5px dashed #B8C3D4; color: var(--navy); }
.ld-add:hover { filter: brightness(.97); }
.ld-toggle { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; }
.ld-breakdown { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px 22px; }
.ld-break-col { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ld-break-col .section-title { margin: 0 0 4px; }
.ld-break-note { grid-column: 1 / -1; }
.ld-line { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.ld-line.strong { font-weight: 700; border-top: 1px dashed var(--line); padding-top: 5px; }

.ld-plate { display: inline-block; background: #FFD44D; color: var(--on-accent); border: 2px solid var(--on-accent); border-radius: 6px; padding: 3px 9px; font-weight: 800; letter-spacing: .06em; white-space: nowrap; }
.ld-empty-box { border: 1.5px dashed #B8C3D4; border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.ld-contact, .ld-item { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ld-contact { background: #F6F8FB; border-radius: 14px; padding: 8px 8px 8px 12px; }
.ld-contact .grow > div { overflow-wrap: anywhere; }
.ld-round { width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; flex: none; text-decoration: none; }
.ld-round.good { background: var(--good-bg); color: #0B6B3A; }
.ld-round.info { background: var(--info-bg); color: var(--navy); }
.ld-round.muted { background: var(--muted-bg); color: var(--text2); }
a.ld-round:hover { filter: brightness(.95); }
.ld-docs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ld-docs li { display: flex; flex-direction: column; min-width: 0; }
.ld-docs .link { text-align: left; overflow-wrap: anywhere; }
.ld-rule { border: 0; border-top: 1px solid var(--line); margin: 2px 0; width: 100%; }
.ld-old-bill { display: flex; justify-content: space-between; align-items: center; gap: 8px; text-decoration: none; }

.ld-entries { list-style: none; margin: 0; padding: 0; }
.ld-entries li + li { border-top: 1px solid var(--line); }
.ld-entry { display: flex; align-items: flex-start; gap: 12px; padding: 10px 4px; width: 100%; text-align: left; background: none; border: 0; color: inherit; text-decoration: none; font: inherit; border-radius: 8px; }
a.ld-entry, button.ld-entry { cursor: pointer; }
a.ld-entry:hover, button.ld-entry:hover { background: #F7F9FD; }
.ld-entry .grow { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.ld-entry-title { font-weight: 700; }
.ld-entry-sub { overflow-wrap: anywhere; }
.ld-entry .money { padding-top: 1px; }
.ld-struck { color: var(--text2); text-decoration: line-through; }
.ld-entry-icon { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; background: var(--muted-bg); color: var(--text2); }
.ld-entry-icon.good { background: var(--good-bg); color: #0B6B3A; }
.ld-entry-icon.bad { background: var(--bad-bg); color: var(--bad); }
.ld-entry-icon.warn { background: var(--warn-bg); color: var(--warn); }
.ld-entry-icon.status-NEW_LOAD { background: #F7E6F2; color: #B4419E; }
.ld-entry-icon.status-TRUCK_ASSIGNED { background: var(--info-bg); color: #1D5FD1; }
.ld-entry-icon.status-DELIVERED { background: var(--warn-bg); color: #D98600; }
.ld-entry-icon.status-COMPLETED { background: var(--good-bg); color: #137A45; }
.ld-entry-icon.status-CANCELLED { background: var(--bad-bg); color: var(--bad); }

.ld-review { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ld-review li { display: flex; gap: 10px; align-items: flex-start; }
.ld-review li .grow { display: flex; flex-direction: column; }
.ld-review-mark { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; color: var(--good); flex: none; margin-top: 1px; }
.ld-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--warn); }
.ld-review-detail { color: var(--text2); }
.ld-review li.pending .ld-review-detail { color: var(--warn); font-weight: 600; }
.ld-danger-link { color: var(--bad); }

/* The load slip: only on paper. */
.ld-print { display: none; }
@media print {
  .ld-page .page-head, .ld-screen { display: none !important; }
  .ld-print { display: block; color: #000; font-size: 13px; }
  .ld-print-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #000; padding-bottom: 8px; margin-bottom: 12px; font-size: 15px; }
  .ld-print-company { font-size: 20px; font-weight: 800; }
  .ld-print-status { font-weight: 700; }
  .ld-print-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
  .ld-print-table th, .ld-print-table td { text-align: left; padding: 7px 10px; border: 1px solid #999; vertical-align: top; }
  .ld-print-table th { width: 32%; background: #f2f2f2; }
  .ld-print-notes { white-space: pre-line; margin-top: 8px; }
  .ld-print-sign { display: flex; justify-content: space-between; margin-top: 64px; }
  .ld-print-sign span { border-top: 1px solid #000; padding-top: 4px; width: 38%; text-align: center; }
}

/* ───────── adjustment form (adjustment.js) ───────── */
.ld-reasons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ld-reason { min-height: 48px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: #F6F8FB; color: var(--navy); font-weight: 700; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 1px; }
.ld-reason:hover { border-color: var(--line-strong); }
.ld-reason.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.ld-reason:focus-visible { outline: 3px solid rgba(29, 95, 209, .35); outline-offset: 1px; }
.ld-reason-used { font-size: 11px; font-weight: 600; opacity: .7; }
@media (max-width: 600px) { .ld-reasons { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ───────── load list (list.js) ───────── */
.ll-toolbar { display: flex; gap: 10px; align-items: center; min-width: 0; }
.ll-search { flex: 0 1 340px; min-width: 200px; }
.ll-toolbar .chips { flex: 1 1 auto; }
.ll-flags { display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.ll-flag { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 760px) { .ll-toolbar { flex-direction: column; align-items: stretch; } .ll-search { flex: none; min-width: 0; } }
.ll-todo { display: grid; grid-template-columns: repeat(3, minmax(0, 180px)); gap: 10px; }
.ll-todo-box { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; border: 0; border-radius: 12px; padding: 10px 14px; cursor: pointer; text-align: left; min-width: 0; }
.ll-todo-box b { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ll-todo-box span { font-size: 12px; font-weight: 800; }
.ll-todo-box.warn { background: var(--warn-bg); color: var(--warn); }
.ll-todo-box.info { background: var(--info-bg); color: var(--navy); }
.ll-todo-box.bad { background: var(--bad-bg); color: var(--bad); }
.ll-todo-box:hover { filter: brightness(.97); }
.ll-ref { font-weight: 800; color: var(--navy); white-space: nowrap; }
.ll-route { font-weight: 700; }
.ll-arrow { color: var(--accent); font-weight: 800; }
.ll-next { color: var(--navy); font-weight: 700; margin-top: 4px; white-space: nowrap; }
.ll-indicators { display: flex; gap: 6px; flex-wrap: nowrap; align-items: center; }
.ll-table .table td .cell-sub .pill { margin-top: 4px; }
.ll-cards { display: none; flex-direction: column; gap: 10px; }
.ll-card { display: flex; flex-direction: column; gap: 6px; padding: 13px 14px; color: inherit; text-decoration: none; }
.ll-card:hover { border-color: var(--line-strong); }
.ll-card-route { font-size: 16px; font-weight: 800; align-items: flex-start; }
.ll-card-route .ll-route { font-weight: 800; }
.ll-card-route b { color: var(--navy); }
.ll-card .ll-indicators { padding-top: 2px; }
.ll-card-next { display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--line); padding-top: 8px; color: var(--navy); font-size: 13px; font-weight: 800; }
@media (max-width: 700px) {
  .ll-table { display: none; }
  .ll-cards { display: flex; }
  .ll-todo { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ───────── New Load, Edit, Assign (form.js, assign.js) ───────── */
.lf-layout { display: grid; grid-template-columns: minmax(0, 760px) minmax(260px, 320px); gap: 18px; align-items: start; }
.lf-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.lf-side { position: sticky; top: 16px; }
@media (max-width: 1100px) {
  .lf-layout { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
  /* On a narrower screen Save stays in reach at the bottom, as the app's save bar does. */
  .lf-side { position: sticky; top: auto; bottom: 0; z-index: 15; margin: 0 -4px; }
  .lf-side .lf-save { box-shadow: 0 -6px 20px rgba(15, 23, 42, .12); }
}
.lf-required { font-size: 13px; font-weight: 800; border-radius: 999px; padding: 6px 12px; background: var(--muted-bg); color: var(--text2); white-space: nowrap; }
.lf-required.ready { background: var(--accent); color: var(--on-accent); }
.lf-section { border-radius: 16px; transition: border-color .15s, box-shadow .15s; }
.lf-section:focus-within { border-color: #AFC0DD; box-shadow: 0 6px 18px rgba(15, 23, 42, .08); }
.lf-section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.lf-section-head h2 { font-size: 16px; font-weight: 800; }
.lf-section-icon { width: 40px; height: 40px; flex: none; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--info-bg); color: var(--navy); }
.lf-section-icon.accent { background: var(--accent-bg); color: var(--accent-dark); }
.lf-need { font-size: 12px; font-weight: 800; border-radius: 999px; padding: 4px 10px; background: var(--muted-bg); color: var(--text2); white-space: nowrap; }
.lf-need.required { background: var(--warn-bg); color: #8A4B05; }
.lf-need.done { background: var(--good-bg); color: #0B6B3A; }
.lf-chosen { display: flex; align-items: center; gap: 12px; background: #F3F6FC; border: 1px solid #DDE6F5; border-radius: 14px; padding: 10px 10px 10px 12px; }
.lf-chosen-body { display: flex; align-items: center; gap: 12px; }
.lf-chosen-title { font-weight: 800; font-size: 15px; overflow-wrap: anywhere; }
.lf-chosen .avatar { background: var(--navy); color: #fff; }
.lf-plate { display: inline-block; background: #FFD54A; color: var(--on-accent); border: 1.5px solid var(--on-accent); border-radius: 6px; padding: 1px 7px; font-size: 12px; font-weight: 800; letter-spacing: .05em; white-space: nowrap; }
.lf-plate.large { font-size: 15px; padding: 4px 9px; border-width: 2px; }
.lf-route { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: start; }
.lf-swap { margin-top: 25px; border: 1px solid var(--line-strong); color: var(--navy); }
@media (max-width: 700px) {
  .lf-route { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .lf-swap { margin: 0 0 0 auto; width: 34px; height: 34px; }
}
.lf-dot { width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--navy); display: inline-block; }
.lf-dot.square { border: 0; border-radius: 3px; background: var(--accent); }
.lf-material-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; }
.lf-older { background: rgba(255, 241, 214, .7); color: #8A4B05; font-size: 12.5px; font-weight: 700; border-radius: 10px; padding: 8px 10px; }
.lf-note { font-weight: 500; font-size: 12px; }
.lf-paper { display: flex; flex-direction: column; gap: 8px; }
.lf-paper .segmented { width: 100%; }
.lf-paper .seg { flex: 1 1 0; }
.lf-add-chip { border: 1.5px dashed #B8C3D4; background: none; border-radius: 999px; padding: 8px 14px; font-weight: 800; color: var(--navy); cursor: pointer; }
.lf-add-chip:hover { background: var(--muted-bg); }
.lf-payment { background: var(--muted-bg); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.lf-payment .segmented { background: var(--surface); }
.lf-save { display: flex; flex-direction: column; gap: 12px; }
.lf-save-sum { display: flex; align-items: center; gap: 10px; }
.lf-save-amount { font-size: 18px; font-weight: 800; }
.lf-margin { font-size: 13px; font-weight: 800; border-radius: 999px; padding: 6px 12px; background: var(--good-bg); color: #0B6B3A; white-space: nowrap; }
.lf-margin.bad { background: var(--bad-bg); color: var(--bad); }
.lf-save-actions { display: flex; gap: 8px; }
.lf-save-actions .btn.grow { flex: 1 1 auto; }
@media (max-width: 1100px) { .lf-save { padding: 12px 14px; gap: 8px; } .lf-save-amount { font-size: 16px; } }
.lf-date { max-width: 260px; }
@media (max-width: 700px) { .lf-date { max-width: none; } }
