/* Shared staff presentation. Loaded after the existing feature styles. */
body:has(#staff-root) {
  --staff-ink: #183d37;
  --staff-muted: #61716c;
  --staff-green: #087650;
  --staff-border: #dbe5df;
  --staff-bg: #f3f6f4;
  margin: 0;
  background: var(--staff-bg);
  color: var(--staff-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}
#staff-root *, #staff-root *::before, #staff-root *::after { box-sizing: border-box; }
#staff-root [hidden] { display: none !important; }
#staff-root button, #staff-root input, #staff-root select, #staff-root textarea { font-family: inherit; }
#staff-root button { min-height: 44px; line-height: 1.35; }
#staff-root button:disabled { cursor: not-allowed; }
#staff-root a { text-underline-offset: 3px; }
#staff-root :focus-visible { outline: 3px solid #09895e; outline-offset: 3px; }

/* Login: a single, readable card with a clear route back to the site. */
#staff-root .staff-login {
  width: min(100%, 480px);
  max-width: 480px;
  margin: clamp(28px, 8vh, 88px) auto;
  padding: 0 20px 32px;
}
#staff-root .staff-login > .staff-brand { display: inline-block; margin: 0 0 22px; font-size: 28px; }
#staff-root .staff-login section {
  margin: 0 0 22px;
  padding: 32px;
  border: 1px solid var(--staff-border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 38px #163e3010;
}
#staff-root .staff-login h1 { margin: 6px 0 10px; font-size: 30px; letter-spacing: -.7px; }
#staff-root .staff-login section > p:not(.staff-kicker) { color: var(--staff-muted); margin: 0 0 24px; }
#staff-root .staff-login label { margin: 0 0 18px; line-height: 1.4; }
#staff-root .staff-login input { min-height: 48px; border-color: #b9c9c0; border-radius: 9px; }
#staff-root .staff-login form > button { min-height: 48px; margin-top: 6px; border-radius: 9px; background: var(--staff-green); }
#staff-root .staff-login details { border-top: 1px solid var(--staff-border); padding-top: 20px; margin-top: 24px; color: var(--staff-muted); }
#staff-root .staff-login summary { cursor: pointer; color: var(--staff-ink); line-height: 1.5; }
#staff-root .staff-login > a:last-child:not(.staff-brand) { font-size: 14px; }
#staff-root .staff-error:empty { display: none; }

/* Brand and account on one row; navigation gets its own full-width row. */
#staff-root .staff-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px 24px;
  padding: 20px max(24px, calc((100vw - 1432px) / 2)) 0;
  background: #fff;
  border-bottom: 1px solid var(--staff-border);
  box-shadow: none;
}
#staff-root .staff-nav .staff-brand { grid-column: 1; grid-row: 1; font-size: 26px; letter-spacing: -.8px; }
#staff-root .staff-person { grid-column: 2; grid-row: 1; max-width: 320px; min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
#staff-root .staff-avatar { width: 34px; height: 34px; flex-shrink: 0; }
#staff-root .staff-nav nav {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 0 0 14px;
  width: 100%;
  min-width: 0;
}
#staff-root .staff-nav nav button {
  order: 4;
  padding: 10px 14px;
  min-height: 44px;
  font-size: 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #51665e;
  background: transparent;
  white-space: nowrap;
}
#staff-root .staff-nav nav button:first-child { order: 0; }
#staff-root .staff-nav nav [data-enquiries-nav] { order: 1; }
#staff-root .staff-nav nav [data-completed-nav] { order: 2; }
#staff-root .staff-nav nav [data-payments-nav] { order: 3; }
#staff-root .staff-nav nav button:hover { background: #f0f6f2; color: #086a4b; }
#staff-root .staff-nav nav button[aria-current="page"] { background: #e5f3eb; color: #075b40; border-color: #c7e4d2; }
#staff-root .staff-nav nav .dp-nav-link { order: 5; margin-left: auto; padding: 10px 8px; color: #476358; font-size: 13px; line-height: 1.4; }

/* One shared canvas, typography and control rhythm across every staff screen. */
#staff-root .website-staff { min-width: 0; }
#staff-root .website-staff > .de,
#staff-root .website-staff > .dp,
#staff-root .website-staff > .dispatch {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  background: transparent;
  color: var(--staff-ink);
  font-family: inherit;
}
#staff-root .website-staff h1 { font-size: clamp(27px, 2.6vw, 34px); letter-spacing: -.8px; line-height: 1.2; }
#staff-root .de h2, #staff-root .dp h2 { font-size: 22px; letter-spacing: -.4px; }
#staff-root .de-heading, #staff-root .dp-heading, #staff-root .dispatch-title { gap: 20px; margin: 0 0 20px; align-items: center; }
#staff-root .de-heading > div, #staff-root .dp-heading > div { min-width: 0; }
#staff-root .de-heading p:last-child, #staff-root .dp-heading p:last-child { margin: 8px 0 0; font-size: 14px; color: var(--staff-muted); }
#staff-root .de-kicker, #staff-root .dp-kicker, #staff-root .staff-kicker { color: var(--staff-green); font-size: 11px; letter-spacing: .12em; }
#staff-root .de label, #staff-root .dp label { margin: 0; gap: 7px; line-height: 1.4; color: #355448; }
#staff-root .de input, #staff-root .de select, #staff-root .de textarea,
#staff-root .dp input, #staff-root .dp select, #staff-root .dp textarea {
  width: 100%; min-width: 0; margin: 0; min-height: 44px;
  border-color: #b7c9be; border-radius: 8px; color: var(--staff-ink);
}
#staff-root .de textarea, #staff-root .dp textarea { resize: vertical; }
#staff-root .de button, #staff-root .dp button { border-color: #b7c9be; border-radius: 8px; color: #245440; min-height: 44px; }
#staff-root .de button:hover, #staff-root .dp button:hover { background: #edf6f0; }
#staff-root .de .de-primary, #staff-root .dp #dp-add, #staff-root .dp button[type="submit"] { background: var(--staff-green); color: #fff; border-color: var(--staff-green); }
#staff-root .de .de-primary:hover, #staff-root .dp #dp-add:hover, #staff-root .dp button[type="submit"]:hover { background: #056441; }
#staff-root .de-message, #staff-root .dp-message { min-height: 0; font-size: 13px; }
#staff-root .de-message:empty, #staff-root .dp-message:empty { display: none; }

/* Search and period stay visible; the remaining filters share one group. */
#staff-root .de-toolbar {
  display: grid; grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  gap: 18px 14px; align-items: end; margin: 18px 0 10px;
  padding: 22px; background: #fff; border: 1px solid var(--staff-border); border-radius: 14px;
}
#staff-root .de-toolbar > label { min-width: 0; }
#staff-root .de-toolbar .de-search { grid-column: auto; min-width: 0 !important; }
#staff-root .de-toolbar-actions { grid-column: 1 / -1; display: flex; gap: 10px; min-width: 0; }
#staff-root .de-toolbar-actions button { flex: 1; min-width: 0; padding: 10px; }
#staff-root .de-toolbar .de-check { grid-column: 1 / -1; margin: 0; width: auto; font-size: 13px; font-weight: 400; }
#staff-root .de-filter-options { grid-column: 1 / -1; min-width: 0; }
#staff-root .de-filter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 14px; }
#staff-root .de-filter-grid > label { min-width: 0; }
#staff-root .de-disclosure, #staff-root .de-mobile-scope { display: none; }
#staff-root .de .de-check input { width: 18px; height: 18px; min-height: 18px; margin: 0; accent-color: var(--staff-green); }
#staff-root .de-caption { color: var(--staff-muted); font-size: 13px; }
#staff-root .de-caption button { padding: 5px 9px; min-height: 34px; margin-top: 5px; font-size: 12px; }
#staff-root .de-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin: 24px 0; }
#staff-root .de-metrics article, #staff-root .dp-totals article { min-width: 0; border: 1px solid var(--staff-border); background: #fff; padding: 18px; border-radius: 12px; box-shadow: none; }
#staff-root .de-metrics article:nth-last-child(-n+3) { grid-column: span 2; border-color: #c8dfd0; background: #f8fcf9; }
#staff-root .de-metrics span, #staff-root .dp-totals span { font-size: 12px; color: #3e5c4e; }
#staff-root .de-metrics strong, #staff-root .dp-totals strong { font-size: clamp(25px, 2.3vw, 32px); line-height: 1.15; letter-spacing: -.6px; margin: 10px 0 8px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#staff-root .de-metrics small, #staff-root .dp-totals small { font-size: 12px; line-height: 1.5; color: var(--staff-muted); }
#staff-root .dp-totals .dp-overdue { background: #fff3f1; border-color: #e6b9b1; }
#staff-root .de-table-head { gap: 14px; margin: 30px 0 14px; }
#staff-root .de-table-head h2 { margin: 0; }
#staff-root .de-table-head > span { white-space: nowrap; background: #e6ede8; border-radius: 20px; padding: 5px 10px; font-size: 12px; }
#staff-root .de-scroll, #staff-root .dp-scroll { max-width: 100%; border-color: var(--staff-border); border-radius: 12px; }
#staff-root .de table { min-width: 1260px; }
#staff-root .de th, #staff-root .dp th { background: #edf3ef; color: #4c6557; font-size: 11px; padding: 14px 12px; }
#staff-root .de td { padding: 18px 12px; line-height: 1.45; border-color: #e4ebe6; }
#staff-root .de td strong { font-size: 14px; }
#staff-root .de td small { font-size: 12px; color: #637269; }
#staff-root .de-won { background: #f8fcf9; }
#staff-root .de-lost { background: #fafafa; }
#staff-root .de-report-link, #staff-root .dp .dp-open-link { color: #087650; }
#staff-root .de td:last-child > button { white-space: nowrap; font-size: 12px; padding: 9px 12px; }
#staff-root .de-contact-details { font-size: 12px; }

/* Editors and reporting remain visually separate from the record list. */
#staff-root .de-form, #staff-root .dp-form { padding: 28px; border-color: #b8d1c1; border-radius: 14px; box-shadow: 0 5px 20px #183d3705; }
#staff-root .de-form-heading { align-items: center; margin-bottom: 24px; }
#staff-root .de-form-heading h2 { margin: 0; }
#staff-root .de-fields, #staff-root .dp-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
#staff-root .de-form fieldset { margin-top: 28px; padding-top: 22px; border-color: var(--staff-border); }
#staff-root .de legend { color: #244e3c; font-size: 16px; }
#staff-root .de-contact { padding: 20px; background: #f7faf8; border-color: var(--staff-border); }
#staff-root .de-reason-grid .de-check { padding: 12px; gap: 10px; font-weight: 400; }
#staff-root .de-form-actions { border-top: 1px solid var(--staff-border); padding-top: 22px; gap: 10px; }
#staff-root .de-cost-preview { background: #e9f5ed; padding: 18px; font-size: 14px; line-height: 1.7; }
#staff-root .de-reports { border-color: var(--staff-border); padding-top: 28px; }
#staff-root .de-breakdowns { gap: 18px; }
#staff-root .de-breakdown, #staff-root .dp-price-box { border-color: var(--staff-border); padding: 24px; box-shadow: none; }
#staff-root .de-bar { background: #edf2ee; }
#staff-root .de-bar i { background: #249166; }
#staff-root .de-report-heading { align-items: center; }
#staff-root .dp-tools { display: grid; grid-template-columns: 180px minmax(180px, 1fr) auto auto auto; gap: 14px; align-items: end; padding: 20px; background: #fff; border: 1px solid var(--staff-border); border-radius: 12px; }
#staff-root .staff-settings { width: 100%; max-width: 1080px; margin: 32px auto; padding: 0 24px 48px; }
#staff-root .password-settings { max-width: 600px; }
#staff-root .staff-invite, #staff-root .staff-invite-result, #staff-root .staff-accounts article, #staff-root .password-settings form { border-color: var(--staff-border); border-radius: 12px; padding: 24px; }
#staff-root .staff-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Delivery desk: stable sidebar, spacious detail and readable fields. */
#staff-root .dispatch .dispatch-workspace { grid-template-columns: 260px minmax(0, 1fr); gap: 20px; }
#staff-root .dispatch .dispatch-workspace > aside, #staff-root .dispatch .dispatch-detail { padding: 24px !important; border-color: var(--staff-border); box-shadow: none; }
#staff-root .dispatch .dispatch-workspace > aside { max-height: none; }
#staff-root .dispatch .dispatch-detail { min-width: 0; }
#staff-root .dispatch .dispatch-title h1 { font-size: clamp(27px, 2.6vw, 34px); }
#staff-root .dispatch .dispatch-title p { font-size: 14px; }
#staff-root .dispatch .job-browser input, #staff-root .dispatch .job-browser select { min-height: 44px; font-size: 14px !important; }
#staff-root .dispatch .job-browser label { margin: 12px 0 !important; }
#staff-root .dispatch .booking-columns { grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: 24px; }
#staff-root .dispatch .dispatch-grid, #staff-root .dispatch .booking-main > .dispatch-grid:first-child { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
#staff-root .dispatch .route-editor .dispatch-grid { grid-template-columns: 1fr; }
#staff-root .dispatch label { font-size: 14px; line-height: 1.4; margin: 12px 0; }
#staff-root .dispatch input:not([type="checkbox"]), #staff-root .dispatch select, #staff-root .dispatch textarea { font-size: 16px; min-height: 44px; height: auto; padding: 10px 12px; border-radius: 8px; border-color: #b7c9be; }
#staff-root .dispatch textarea { min-height: 82px; resize: vertical; }
#staff-root .dispatch button { font-size: 14px; min-height: 44px; }
#staff-root .dispatch .booking-heading { padding-bottom: 14px; margin-bottom: 16px; }
#staff-root .dispatch .booking-heading h2, #staff-root .dispatch .job-heading h2 { font-size: 25px; }
#staff-root .dispatch .job-heading { gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
#staff-root .dispatch .booking-submit { margin-top: 24px; padding-top: 20px; gap: 12px; }
#staff-root .dispatch .desk-metrics { gap: 14px; }
#staff-root .dispatch .desk-metrics button { min-height: 112px; padding: 20px; }
#staff-root .dispatch .job-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 22px; }
#staff-root .dispatch .job-tabs button { padding: 10px 12px !important; }
#staff-root .dispatch .billing-line { grid-template-columns: minmax(0, 1fr) 150px auto; }

@media (max-width: 1250px) {
  #staff-root .de-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #staff-root .de-metrics article:nth-last-child(-n+3) { grid-column: span 1; }
  #staff-root .dispatch .dispatch-workspace { grid-template-columns: 230px minmax(0, 1fr); }
  #staff-root .dispatch .booking-columns { grid-template-columns: 1fr; }
  #staff-root .dispatch .booking-routes { margin-top: 0; }
  #staff-root .dp-tools { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #staff-root .dp-tools > label:nth-child(2) { grid-column: span 2; }
}
@media (max-width: 900px) {
  #staff-root .staff-nav nav .dp-nav-link { margin-left: 0; }
  #staff-root .dispatch .dispatch-workspace { grid-template-columns: 1fr; }
  #staff-root .dispatch .dispatch-workspace > aside { max-height: 300px; overflow: auto; }
  #staff-root .de-fields, #staff-root .dp-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #staff-root .de-heading, #staff-root .dp-heading { flex-direction: column; align-items: flex-start; }
  #staff-root .de-breakdowns { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  #staff-root .staff-login { padding: 0 16px 24px; }
  #staff-root .staff-login section { padding: 24px; }
  #staff-root .staff-nav { padding: 18px 16px 0; gap: 16px 12px; }
  #staff-root .staff-nav .staff-brand { font-size: 24px; }
  #staff-root .staff-person { max-width: 140px; font-size: 12px; gap: 6px; }
  #staff-root .staff-avatar { width: 28px; height: 28px; }
  #staff-root .staff-nav nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  #staff-root .staff-nav nav button { width: 100%; text-align: center; white-space: normal; padding: 10px 8px; font-size: 13px; }
  #staff-root .staff-nav nav .dp-nav-link { grid-column: 1 / -1; text-align: center; font-size: 12px; }
  #staff-root .website-staff > .de, #staff-root .website-staff > .dp, #staff-root .website-staff > .dispatch { padding: 24px 16px 48px !important; }
  #staff-root .de-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; padding: 18px; }
  #staff-root .de-toolbar .de-search, #staff-root .de-toolbar-actions { grid-column: 1 / -1; }
  #staff-root .de-toolbar-actions { flex-wrap: nowrap; }
  #staff-root .de-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #staff-root .de-metrics article { padding: 15px; }
  #staff-root .de-metrics article:last-child { grid-column: 1 / -1; }
  #staff-root .de-metrics strong { font-size: 27px; }
  #staff-root .de-form, #staff-root .dp-form { padding: 20px 16px; }
  #staff-root .de-form-heading { align-items: flex-start; gap: 12px; }
  #staff-root .de-fields, #staff-root .dp-fields, #staff-root .staff-grid { grid-template-columns: 1fr; }
  #staff-root .de-form-actions button { flex: 1 1 140px; }
  #staff-root .de-report-heading { flex-direction: column; align-items: flex-start; gap: 12px; }
  #staff-root .de-reason-grid { grid-template-columns: 1fr; }
  #staff-root .de-contact { padding: 16px; }
  #staff-root .dp-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 18px; }
  #staff-root .dp-tools > label { grid-column: 1 / -1; }
  #staff-root .dp-tools > label:nth-child(2) { grid-column: 1 / -1; }
  #staff-root .dp-tools #dp-add { grid-column: 1 / -1; }
  #staff-root .dp-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #staff-root .dp-totals article { padding: 15px; }
  #staff-root .dp-totals strong { font-size: 24px; }
  #staff-root .staff-settings { padding: 0 16px 40px; }
  #staff-root .dispatch .dispatch-workspace > aside, #staff-root .dispatch .dispatch-detail { padding: 18px !important; }
  #staff-root .dispatch .dispatch-grid, #staff-root .dispatch .booking-main > .dispatch-grid:first-child { grid-template-columns: 1fr; gap: 0; }
  #staff-root .dispatch .dispatch-title { align-items: flex-start; flex-wrap: wrap; }
  #staff-root .dispatch .desk-metrics { grid-template-columns: 1fr; gap: 10px; }
  #staff-root .dispatch .desk-metrics button { min-height: 88px; }
  #staff-root .dispatch .booking-times, #staff-root .dispatch .journey-details { grid-template-columns: 1fr; gap: 18px; }
  #staff-root .dispatch .billing-line { grid-template-columns: minmax(0, 1fr) 110px; }
  #staff-root .dispatch .billing-line button { grid-column: 1 / -1; justify-self: start; }
  /* Preserve all nine fields while presenting each job as a readable card. */
  #staff-root .de-scroll { overflow: visible; border: 0; background: transparent; }
  #staff-root .de table, #staff-root .de tbody { display: block; width: 100%; min-width: 0; }
  #staff-root .de thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  #staff-root .de tr { display: block; margin: 0 0 16px; padding: 6px 16px; border: 1px solid var(--staff-border); border-radius: 12px; background: #fff; }
  #staff-root .de tr.de-won { border-left: 4px solid #249166; }
  #staff-root .de tr.de-lost { background: #fafafa; }
  #staff-root .de td { display: grid; grid-template-columns: 1fr; width: 100%; max-width: none; border: 0; border-bottom: 1px solid #edf1ee; padding: 12px 0; }
  #staff-root .de td::before { content: attr(data-label); display: block; margin-bottom: 6px; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: #657b6d; font-weight: 700; }
  #staff-root .de td:first-child { border-left: 0; }
  #staff-root .de td:first-child strong { font-size: 17px; }
  #staff-root .de td:last-child { border-bottom: 0; }
  #staff-root .de td[colspan]::before { display: none; }
  #staff-root .de td:last-child > button { width: 100%; }
  #staff-root .de td .de-status { justify-self: start; }
}
@media (max-width: 360px) {
  #staff-root .de-toolbar { grid-template-columns: 1fr; }
  #staff-root .de-toolbar .de-search, #staff-root .de-toolbar-actions { grid-column: 1; }
  #staff-root .staff-person { max-width: 105px; }
}

#staff-root .de-contact-roles { margin: 16px 0; padding-top: 14px; border-top: 1px solid var(--staff-border); font-size: 13px; }
#staff-root .de-contact-roles summary { cursor: pointer; font-weight: 600; color: #355448; }
#staff-root .de-contact-roles > p { margin: 10px 0; }

/* Completed jobs and explicit missing-data signals. */
#staff-root .de tr.de-completed { background: #c9efd6; }
#staff-root .de tr.de-completed td:first-child { border-left: 6px solid #087650; }
#staff-root .de-completed .de-status { background: #087650; color: #fff; }
#staff-root .de-completed td, #staff-root .de-completed td small { color: #244b35; }
#staff-root .de-metrics article:nth-child(3) { background: #c9efd6; border-color: #63ae7b; }
#staff-root .de-money-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; min-width: 0; }
#staff-root .de-money-field label { min-width: 0; }
#staff-root .de-money-field .de-zero { min-height: 44px; padding: 10px; font-size: 12px; color: #08623f; border-color: #9abbab; }
#staff-root .de-money-hint { grid-column: 1 / -1; color: #61716c; font-size: 12px; line-height: 1.4; font-weight: 400; }
#staff-root .de-missing-summary { margin: 12px 0; padding: 12px; border: 2px solid #d28c25; border-radius: 9px; background: #fff5dc; color: #6f450b; font-size: 12px; animation: de-missing-pulse 2.5s ease-in-out infinite; }
#staff-root .de-missing-summary > strong { display: block; color: #75480a; font-size: 12px; }
#staff-root .de-missing-summary p, #staff-root .de-missing-summary small { margin: 6px 0 0; color: #75480a; }
#staff-root .de-missing-field { padding: 10px; border: 2px solid #d28c25; border-radius: 9px; background: #fff8e7; animation: de-missing-pulse 2.5s ease-in-out infinite; }
@keyframes de-missing-pulse { 0%,100% { box-shadow: 0 0 0 0 #cc881e00; border-color: #d28c25; } 50% { box-shadow: 0 0 0 4px #cc881e35; border-color: #995600; } }
@media (prefers-reduced-motion: reduce) { #staff-root .de-missing-summary, #staff-root .de-missing-field { animation: none; } }
@media (max-width: 600px) { #staff-root .de tr.de-completed { border-left: 6px solid #087650; background: #c9efd6; } #staff-root .de tr.de-completed td:first-child { border-left: 0; } }

/* Individual job boxes show the first contact, destination and price. */
#staff-root .de-records { display: grid; gap: 10px; }
#staff-root .de-not-accepted .de-status { background: #e9ecea; color: #46574b; }
#staff-root .de-record-card { min-width: 0; border: 1px solid #d1ded5; border-radius: 12px; background: #fff; overflow: hidden; }
#staff-root .de-record-card.de-won { background: #f0f9f2; border-left: 4px solid #249166; }
#staff-root .de-record-card.de-completed { background: #c9efd6; border-color: #82bc93; border-left: 6px solid #087650; }
#staff-root .de-record-summary { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.2fr) minmax(110px,.5fr) 20px; align-items: center; gap: 20px; list-style: none; cursor: pointer; padding: 16px 20px; }
#staff-root .de-record-summary::-webkit-details-marker { display: none; }
#staff-root .de-record-summary:focus-visible { outline: 3px solid #087650; outline-offset: -3px; }
#staff-root .de-record-summary > span { min-width: 0; }
#staff-root .de-record-summary small { display: block; margin-bottom: 4px; color: #526858; font-size: 11px; font-weight: 500; }
#staff-root .de-record-summary strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; line-height: 1.4; }
#staff-root .de-record-price { text-align: right; font-variant-numeric: tabular-nums; }
#staff-root .de-expand-symbol { color: #246241; font-size: 21px; line-height: 1; text-align: center; }
#staff-root .de-record-card[open] .de-expand-symbol { transform: rotate(180deg); }
#staff-root .de-record-missing { animation: de-record-missing-pulse 2.5s ease-in-out infinite; }
@keyframes de-record-missing-pulse { 0%,100% { box-shadow: 0 0 0 1px #d28c2540; } 50% { box-shadow: 0 0 0 3px #d28c25aa; } }
#staff-root .de-record-details { border-top: 1px solid #bfd6c7; padding: 4px 20px 20px; background: #ffffffc9; }
#staff-root .de-record-details dl { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 24px; margin: 0; }
#staff-root .de-record-details dl > div { min-width: 0; padding: 14px 0; border-bottom: 1px solid #dfe8e2; }
#staff-root .de-record-details dt { color: #587161; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
#staff-root .de-record-details dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
#staff-root .de-record-details dd > strong, #staff-root .de-record-details small { display: block; }
#staff-root .de-record-details small { color: #526858; font-size: 12px; margin-top: 4px; }
#staff-root .de-record-details small > strong { display: inline; }
#staff-root .de-record-notes { white-space: pre-wrap; }
#staff-root .de-record-actions { padding-top: 16px; }
@media (max-width: 600px) {
  #staff-root .de-records { display: grid; gap: 10px; }
  #staff-root .de-record-summary { grid-template-columns: minmax(0,1fr) minmax(92px,auto) 16px; gap: 4px 10px; padding: 12px 14px; }
  #staff-root .de-record-sender { grid-column: 1; grid-row: 1; }
  #staff-root .de-record-destination { grid-column: 1; grid-row: 2; }
  #staff-root .de-record-price { grid-column: 2; grid-row: 1 / span 2; }
  #staff-root .de-record-summary .de-expand-symbol { grid-column: 3; grid-row: 1 / span 2; }
  #staff-root .de-record-summary small { font-size: 10px; margin-bottom: 1px; }
  #staff-root .de-record-summary strong { font-size: 14px; }
  #staff-root .de-record-destination small { display: none; }
  #staff-root .de-record-destination strong { color: #526858; font-size: 12px; font-weight: 500; }
  #staff-root .de-record-price strong { font-size: 15px; }
  #staff-root .de-record-details { padding: 4px 14px 16px; }
  #staff-root .de-record-details dl { grid-template-columns: minmax(0,1fr); }
  #staff-root .de-record-actions > button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { #staff-root .de-record-missing { animation: none; } }

#staff-root .de-quote-analysis { margin: 24px 0; padding: 22px; background: #fff; border: 1px solid #d4e2d9; border-radius: 12px; }
#staff-root .de-quote-analysis-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
#staff-root .de-quote-analysis-heading h2 { margin: 0; font-size: 18px; }
#staff-root .de-quote-analysis-heading span, #staff-root .de-quote-analysis > p { font-size: 12px; color: #61716c; }
#staff-root .de-quote-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
#staff-root .de-quote-metrics span { display: block; font-size: 12px; color: #536b5a; }
#staff-root .de-quote-metrics strong { display: block; margin-top: 6px; font-size: 23px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#staff-root .de-estimate-preview { padding: 16px; margin-top: 18px; background: #eef4ff; border: 1px solid #bdcfe5; border-radius: 9px; color: #27486e; font-size: 14px; font-weight: 600; }
@media (max-width: 600px) { #staff-root .de-quote-analysis { padding: 18px; } #staff-root .de-quote-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; } #staff-root .de-quote-metrics strong { font-size: 21px; } }

/* Phone workflow: find a job first, open filters or figures only when needed. */
@media (max-width: 600px) {
  #staff-root .website-staff > .de { padding: 18px 16px 36px !important; }
  #staff-root .de-heading { gap: 12px; margin: 0; }
  #staff-root .de-heading h1 { margin: 0; font-size: 23px; line-height: 1.25; }
  #staff-root .de-heading .de-kicker, #staff-root .de-heading p:last-child { display: none; }
  #staff-root .de-heading > button { width: 100%; padding: 10px 14px; font-size: 14px; }
  #staff-root .de-message { margin: 8px 0 !important; font-size: 12px; }
  #staff-root .de-toolbar { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 14px; margin: 10px 0 8px; border-radius: 12px; }
  #staff-root .de-toolbar label { min-width: 0; font-size: 12px; font-weight: 600; gap: 6px; }
  #staff-root .de-toolbar .de-search { grid-column: 1; order: 0; }
  #staff-root .de-toolbar .de-period { order: 1; }
  #staff-root .de-filter-options { order: 2; border-top: 1px solid var(--staff-border); padding-top: 4px; }
  #staff-root .de input:not([type="checkbox"]), #staff-root .de select, #staff-root .de textarea {
    display: block; width: 100%; max-width: 100%; min-width: 0; min-inline-size: 0;
    box-sizing: border-box; font-size: 16px; font-weight: 400; line-height: 1.4; padding: 10px 12px;
  }
  #staff-root .de input[type="date"], #staff-root .de input[type="datetime-local"] { -webkit-appearance: none; appearance: none; }
  #staff-root .de input::-webkit-date-and-time-value { text-align: left; min-height: 1.4em; }
  #staff-root .de-filter-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; padding-top: 10px; }
  #staff-root .de-filter-grid > label { grid-column: 1; }
  #staff-root .de-toolbar-actions { grid-column: 1; flex-direction: column; gap: 8px; }
  #staff-root .de-toolbar-actions button { flex: none; width: 100%; font-size: 13px; }
  #staff-root .de-toolbar .de-check { font-size: 13px; font-weight: 400; padding: 8px 0; }
  #staff-root .de-disclosure { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; list-style: none; cursor: pointer; min-height: 44px; padding: 8px 0; font-size: 14px; font-weight: 600; color: #244e3c; }
  #staff-root .de-disclosure::-webkit-details-marker { display: none; }
  #staff-root .de-disclosure > span:first-child { min-width: 0; }
  #staff-root .de-disclosure small { display: block; font-size: 12px; font-weight: 400; line-height: 1.5; color: #61716c; }
  #staff-root #de-filter-count { display: inline-block; margin-left: 6px; padding: 2px 6px; border-radius: 12px; background: #e6f2e9; color: #075b40; font-size: 11px; }
  #staff-root .de-disclosure-arrow { font-size: 22px; font-weight: 400; line-height: 1; }
  #staff-root details[open] > .de-disclosure .de-disclosure-arrow { transform: rotate(180deg); }
  #staff-root .de-mobile-scope { display: inline; }
  #staff-root .de-filter-description { display: none; }
  #staff-root #de-filter-note { margin: 2px 0 12px; font-size: 12px; line-height: 1.5; }
  #staff-root .de-overview, #staff-root .de-report-details { min-width: 0; border: 1px solid var(--staff-border); border-radius: 12px; background: #fff; }
  #staff-root .de-overview > .de-disclosure, #staff-root .de-report-details > .de-disclosure { padding: 12px 14px; }
  #staff-root .de-overview .de-metrics { margin: 0; padding: 0 12px 12px; gap: 8px; }
  #staff-root .de-overview .de-metrics article { padding: 12px; }
  #staff-root .de-overview .de-metrics span, #staff-root .de-overview .de-metrics small { font-size: 11px; }
  #staff-root .de-overview .de-metrics strong { font-size: 24px; margin: 6px 0; }
  #staff-root .de-overview .de-quote-analysis { margin: 0 12px 12px; padding: 14px; border-radius: 9px; }
  #staff-root .de-quote-analysis-heading h2 { font-size: 16px; }
  #staff-root .de-quote-metrics strong { font-size: 20px; }
  #staff-root .de-table-head { margin: 20px 0 10px; gap: 8px; }
  #staff-root .de-table-head h2 { font-size: 17px; }
  #staff-root .de-table-head > span { font-size: 11px; }
  #staff-root .de-report-details { margin-top: 24px; }
  #staff-root .de-report-details .de-reports { margin: 0; padding: 0 14px 14px; border-top: 0; }
  #staff-root .de-report-details .de-report-heading h2 { font-size: 19px; }
}





#staff-root .de-record-group + .de-record-group { margin-top: 28px; }
#staff-root .de-record-group > h3 { margin: 0 0 12px; font-size: 17px; }
#staff-root .de-record-phone { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 1.4; color: #294b36; }
@media (max-width: 600px) { #staff-root .de-record-phone { font-size: 12px; } }


/* Completed-job costs and profit are visible without opening the record. */
#staff-root .de-record-quick-costs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; grid-column: 1 / -1; grid-row: 2; min-width: 0; border-top: 1px solid #a9cdb6; padding-top: 10px; }
#staff-root .de-record-quick-costs > span { min-width: 0; }
#staff-root .de-record-quick-costs strong { font-variant-numeric: tabular-nums; }
@media (min-width: 901px) {
  #staff-root .de-record-completed-summary { grid-template-columns: minmax(0,1fr) minmax(0,1.2fr) minmax(110px,.5fr) minmax(200px,1fr) 20px; gap: 16px; }
  #staff-root .de-record-quick-costs { grid-column: 4; grid-row: 1; border-top: 0; padding-top: 0; }
  #staff-root .de-record-completed-summary .de-expand-symbol { grid-column: 5; grid-row: 1; }
}
@media (max-width: 600px) { #staff-root .de-record-quick-costs { grid-row: 3; margin-top: 4px; padding-top: 8px; } }


#staff-root .de-toolbar .de-month-choice { min-width: 0; }
#staff-root .de-toolbar .de-month-choice[hidden] { display: none; }
@media(max-width:600px){#staff-root .de-toolbar .de-month-choice { order: 2; }}

#staff-root .de-cost-list h3 { margin: 0 0 .75rem; }
#staff-root .de-cost-item { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; gap: .75rem; align-items: end; padding: .9rem; border: 1px solid #c5d7cf; border-radius: 12px; margin-bottom: .75rem; }
#staff-root .de-cost-item .de-cost-description { grid-column: 1 / 3; }
#staff-root .de-cost-item [data-cost-remove] { grid-column: 3; grid-row: 1 / 3; align-self: center; }
#staff-root .de-cost-list > small { display: block; margin-top: .5rem; }
#staff-root .de-form-section { border: 1px solid #c5d7cf; border-radius: 12px; margin: 1rem 0; }
#staff-root .de-form-section > summary { padding: 1rem; font-weight: 700; cursor: pointer; }
#staff-root .de-form-section > fieldset { margin: 0; border: 0; }
#staff-root .de-optional-choice { margin-bottom: .4rem; }
#staff-root .de-form input[hidden], #staff-root .de-form textarea[hidden] { display: none; }
#staff-root .de-record-summary button.de-quick-report { grid-column: 1 / -1; justify-self: start; padding: .5rem .8rem; background: #fff; color: #245c49; border: 1px solid #94bbaa; border-radius: 8px; font-size: .9rem; font-weight: 600; }
@media (max-width: 600px) {
  #staff-root .de-cost-item { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: .6rem; }
  #staff-root .de-cost-item [data-cost-remove] { grid-column: 1 / 3; grid-row: auto; justify-self: start; }
}
#staff-root .de-record-summary:not(.de-record-completed-summary) .de-expand-symbol { grid-column: 4; grid-row: 1; }
#staff-root .de-record-summary .de-quick-actions { grid-column: 1 / -1; grid-row: 2; display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
@media (max-width: 600px) {
  #staff-root .de-record-summary:not(.de-record-completed-summary) .de-expand-symbol { grid-column: 3; grid-row: 1 / span 2; }
  #staff-root .de-record-summary .de-quick-actions { grid-row: 3; }
}

#staff-root .de-record-summary button.de-quick-report:hover { background: #e2f1e8; border-color: #548d73; }
#staff-root .de-record-summary button.de-quick-report:focus-visible { outline: 3px solid #548d73; outline-offset: 3px; }
#staff-root .de-record-destination .de-active-attention { display: block; margin-top: 5px; font-size: 11px; line-height: 1.4; color: #80510d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#staff-root .de-active-attention-full { margin: 6px 0 0; font-size: 12px; line-height: 1.5; color: #80510d; }
@media (max-width: 600px) { #staff-root .de-record-destination .de-active-attention { font-size: 10px; } }

/* Delivery Desk sidebar: two lines, with the full booking available on selection. */
#staff-root .dispatch .job-browser .dc-compact-job {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); gap: 2px 8px;
  width: 100%; min-width: 0; min-height: 46px; margin: 4px 0; padding: 6px 9px !important;
  text-align: left;
}
#staff-root .dispatch .job-browser .dc-compact-job .dc-compact-ref {
  align-self: center; min-width: 0; margin: 0; font-size: 12px; letter-spacing: .02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#staff-root .dispatch .job-browser .dc-compact-job .status-pill { min-width: 0; max-width: 130px; justify-self: end; font-size: 10px !important; line-height: 1.3; padding: 1px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#staff-root .dispatch .job-browser .dc-compact-job .dc-compact-meta {
  grid-column: 1 / -1; display: flex; gap: 8px; min-width: 0; margin: 0;
  font-size: 12px; line-height: 1.3;
}
#staff-root .dispatch .job-browser .dc-compact-destination {
  flex: 1 1 60%; min-width: 0; font-size: 12px; font-weight: 650;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#staff-root .dispatch .job-browser .dc-compact-customer {
  flex: 1 1 40%; min-width: 0; font-size: 11px; font-weight: 400; color: #536e62; text-align: right;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 600px) {
  #staff-root .dispatch .job-browser .dc-compact-job { min-height: 44px; }
}
