:root {
  --bg: #f8f6f2;
  --panel: #fffdfa;
  --line: #d6dce5;
  --text: #111d33;
  --muted: #4c5c72;
  --blue: #163fc2;
  --gold: #163fc2;
}
body, h1, h2 { font-family: "Geist", "Segoe UI", sans-serif; }
body:has(#workspace:not([hidden])) > header { display: none; }
main:has(#workspace:not([hidden])) { max-width: none; padding: 0; }
#workspace:not([hidden]) { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.workspace-sidebar {
  background-color: #0b162d;
  background-image: linear-gradient(#3e68cc26 1px, transparent 1px), linear-gradient(90deg, #3e68cc26 1px, transparent 1px);
  background-size: 22px 22px;
  color: #f5f7ff;
}
.workspace-brand { display: flex; align-items: center; gap: 10px; padding: 21px 16px; background: #0b162d; font-weight: 750; }
.workspace-brand span { border: 1px solid #a5baff; border-radius: 5px; padding: 5px 6px; }
#nav {
  position: sticky; top: 0; max-height: 100dvh; overflow: auto; margin: 0;
  display: flex; flex-direction: column; gap: 2px; padding: 6px 10px 18px;
  border: 0; background: #0b162d;
}
#nav button { text-align: left; color: #e5ecfb; background: transparent; border: 1px solid transparent; padding: 8px 10px; min-height: 36px; box-shadow: none; }
#nav button:hover { background: #192b50; }
#nav button.active { background: #1b3980; border-color: #4466bc; color: white; }
#nav .nav-label { color: #aebddc; font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; margin: 13px 10px 4px; }
.workspace-main { min-width: 0; padding: 20px clamp(14px,2vw,30px); }
.workspace-account { background: transparent; box-shadow: none; border: 0; padding: 0; margin: 0 0 12px; justify-content: space-between; }
#message:empty { display: none; }
.overview-heading { display: none; }
.workspace-main:has(.overview-jobs) .overview-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0 14px; }
.overview-heading h1 { margin: 0; font-size: clamp(28px,3vw,44px); }
button.primary { background: #163fc2; border-color: #163fc2; color: white; }
.stats .stat { border: 1px solid var(--line); box-shadow: none; }
.stats .stat .label { color: var(--muted); }
#view:has(.overview-jobs) { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 14px; align-items: start; }
#view:has(.overview-jobs) > section { margin: 0; min-width: 0; padding: 16px; box-shadow: none; }
.overview-jobs table { min-width: 0; font-size: .86rem; }
.overview-jobs th, .overview-jobs td { padding: 10px 8px; vertical-align: top; }
.overview-jobs tbody th { text-transform: none; letter-spacing: normal; font-weight: 400; color: var(--text); }
.overview-jobs tbody th span { display: block; color: var(--muted); margin-top: 4px; }
.overview-jobs button { color: #163fc2; border-color: #4667ce; }
.overview-jobs .badge { white-space: nowrap; }
#jobMapPanel .topline { gap: 8px; }
#jobMapCanvas { height: 350px; }
@media(max-width: 1200px) {
  #view:has(.overview-jobs) { grid-template-columns: minmax(0, 1fr); }
}
@media(max-width: 760px) {
  #workspace:not([hidden]) { grid-template-columns: minmax(0, 1fr); }
  .workspace-brand { padding: 12px 14px; }
  #nav { position: static; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; padding: 6px 10px; }
  #nav button { flex: 0 0 auto; white-space: nowrap; }
  #nav .nav-label { display: none; }
  .overview-jobs table { min-width: 510px; }
  .workspace-account { flex-wrap: wrap; }
}
@media print {
  .workspace-sidebar, .workspace-account, .overview-heading button { display: none !important; }
  #workspace:not([hidden]) { display: block; }
  #view:has(.overview-jobs) { display: block; }
}

button.job-detail-link {
  background: transparent;
  border: 0;
  color: var(--blue);
  padding: 0;
  font-weight: 700;
  text-align: left;
}
button.job-detail-link:hover { text-decoration: underline; }
.rent-filter[aria-pressed="true"] { background: #163fc2; border-color: #163fc2; color: white; }
.badge.rental-badge { display: inline-block; background: #d8e4ff; color: #193781; }
.job-detail-heading, .job-detail-title { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.job-detail-heading { justify-content: space-between; margin: 14px 0 18px; }
.job-detail-title h1, .job-detail-heading p { margin: 0; }
.job-detail-heading p { margin-top: 5px; }
.job-detail-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.job-detail-stack { display: grid; gap: 16px; min-width: 0; }
.job-detail-stack > section { margin: 0; }
.job-detail-list { list-style: none; margin: 0; padding: 0; }
.job-detail-list li { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); }
.job-detail-list li:last-child { border-bottom: 0; }
.job-detail-list .report-text { width: 100%; }
.job-detail-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; }
.job-detail-facts dt { font-weight: 650; }
.job-detail-facts dd { margin: 0; overflow-wrap: anywhere; }
.job-detail-map { height: 210px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; z-index: 0; }
#jobDetailLocation a { color: var(--blue); font-weight: 650; }
@media (max-width: 900px) { .job-detail-grid { grid-template-columns: minmax(0, 1fr); } }

/* Workspace theme */
:root {
  --bg:#f3f5f8; --panel:#fff; --line:#dfe5ed; --text:#17243a;
  --muted:#53647a; --blue:#24456e; --gold:#76561b;
}
body, h1, h2, h3, button, input, select, textarea {font-family:"Segoe UI",system-ui,sans-serif}
body {background:var(--bg)}
#workspace:not([hidden]) {grid-template-columns:246px minmax(0,1fr)}
.workspace-sidebar {
  position:sticky;top:0;height:100dvh;display:flex;flex-direction:column;
  background:#111e32;background-image:linear-gradient(165deg,#162943 0%,#111e32 52%);
}
.workspace-brand {
  padding:24px 20px 19px;gap:12px;background:transparent;font-size:1.05rem;
  letter-spacing:-.015em;border-bottom:1px solid #ffffff19;
}
.workspace-brand span {
  display:grid;place-items:center;width:34px;height:34px;padding:0;
  border:1px solid #d7b36c;color:#f1cf86;background:#bc8a2820;border-radius:8px;
  font-size:.82rem;letter-spacing:.07em;
}
#nav {
  position:static;max-height:none;min-height:0;overflow-y:auto;
  padding:12px 12px 22px;gap:3px;background:transparent;
  scrollbar-width:thin;scrollbar-color:#456181 transparent;
}
#nav .nav-label {margin:15px 10px 4px;color:#aabbd1;font-size:.66rem;letter-spacing:.115em}
#nav button {
  min-height:34px;padding:7px 11px;font-size:.87rem;border-radius:7px;
  font-weight:550;border:1px solid transparent;color:#ced9e9;letter-spacing:0;
}
#nav button:hover {background:#ffffff12;color:white}
#nav button[aria-current="page"] {
  color:#fff;background:#294362;border-color:#41607f;
  box-shadow:inset 3px 0 #e4b65c;font-weight:700;
}
.workspace-main {padding:23px clamp(18px,2.8vw,42px) 42px}
.workspace-account {
  min-height:44px;margin-bottom:17px;padding:0 0 13px;gap:10px;
  border:0;border-bottom:1px solid var(--line);background:transparent;border-radius:0;box-shadow:none;
}
#accountLabel {font-size:.84rem;font-weight:650;color:#3c4e65}
#syncLabel {font-size:.8rem}
.workspace-main button {border-radius:8px}
.workspace-main button.primary,.workspace-main button.gold {
  background:#233f63;border-color:#233f63;color:white;
}
.workspace-main button.primary:hover,.workspace-main button.gold:hover {background:#304f77}
.workspace-main button:focus-visible,.workspace-main input:focus-visible,.workspace-main select:focus-visible,#nav button:focus-visible {outline:3px solid #d5a64e;outline-offset:2px}
.workspace-main .stats {gap:12px;margin-bottom:19px}
.workspace-main .stat {
  background:#fff;border:1px solid var(--line);border-radius:12px;padding:13px 16px;
  box-shadow:0 1px 2px #162b4510;
}
.workspace-main .stat .label {font-size:.75rem;font-weight:650;letter-spacing:.025em}
.workspace-main .stat .num {font-size:1.52rem;font-variant-numeric:tabular-nums;color:#1c3554;line-height:1.2}
.workspace-main #view>section,.workspace-main #editor {
  border:1px solid var(--line);border-radius:15px;background:white;
  padding:clamp(16px,2vw,27px);box-shadow:0 2px 7px #172b4210;
}
.workspace-main h2 {font-size:clamp(1.35rem,2.1vw,1.8rem);line-height:1.16;letter-spacing:-.025em}
.workspace-main .topline {align-items:center;gap:12px}
.workspace-main #view .topline> :first-child {min-width:0}
.workspace-main #view .topline .tools {justify-content:flex-end}
.workspace-main .scroll {border-radius:9px}
.workspace-main table {border-collapse:collapse}
.workspace-main table thead th {
  color:#435770;background:#eef2f7;font-size:.7rem;letter-spacing:.055em;
}
.workspace-main table th,.workspace-main table td {padding:10px 12px;vertical-align:middle}
.workspace-main table tbody tr:nth-child(even) {background:#f8fafc}
.workspace-main table tbody th[scope="row"] {text-transform:none;letter-spacing:0;background:transparent}
.workspace-main table td[data-numeric],.workspace-main table th[data-numeric] {
  text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums;
}
#ironRows td:nth-child(4),#partsRows td:nth-child(2),
#ironPanel thead th:nth-child(4),#partsPanel thead th:nth-child(2),
.payroll-table td:nth-child(n+2),.payroll-table th:nth-child(n+2) {text-align:right;font-variant-numeric:tabular-nums}
.payroll-table input[type="number"] {text-align:right;font-variant-numeric:tabular-nums}
#ironPanel form,#partsPanel form {margin:0 0 16px;padding:16px;background:#f7f9fc;border:1px solid var(--line);border-radius:11px}
#ironPanel form h3,#partsPanel form h3 {margin:0}
.field-schedule>.filters {margin-top:17px}
.field-schedule>.filters input {width:min(100%,328px)}
.field-schedule .field-status-board {
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;align-items:start;
}
.field-schedule .field-status-board:not(:has(.hitch-panel-upcoming)) {grid-template-columns:repeat(2,minmax(0,1fr))}
.field-schedule .hitch-status-panel {
  --accent:#5279a9;background:#fff;border:1px solid #dde5ef;border-top:3px solid var(--accent);
  border-radius:11px;padding:0;box-shadow:0 2px 6px #142b4510;min-width:0;
}
.field-schedule .hitch-status-panel.hitch-panel-working {--accent:#32805e}
.field-schedule .hitch-status-panel.hitch-panel-off {--accent:#b74953}
.field-schedule .field-status-heading {
  margin:0;padding:15px 14px 12px;display:flex;align-items:center;justify-content:space-between;gap:7px;
  border-bottom:1px solid #e9edf3;font-size:.97rem;color:#1d314b;
}
.field-schedule .field-status-heading span {
  min-width:22px;padding:2px 6px;text-align:center;border-radius:6px;
  font-size:.75rem;color:var(--accent);background:#edf2f8;font-variant-numeric:tabular-nums;
}
.field-schedule .hitch-status-panel>.muted {margin:0;padding:14px}
.field-schedule .hitch-status-panel .scroll {border:0;border-radius:0 0 10px 10px}
.field-schedule .hitch-status-panel .hitch-summary {min-width:0;margin:0;width:100%;font-size:.82rem}
.field-schedule .hitch-status-panel .hitch-summary td {min-width:0;padding:9px 9px;vertical-align:top}
.field-schedule .hitch-status-panel .hitch-summary td:first-child {padding-left:13px;overflow-wrap:anywhere}
.field-schedule .hitch-status-panel .hitch-summary td:last-child {width:48%;padding-right:12px}
.field-schedule .hitch-status-panel .hitch-summary tr:last-child td {border-bottom:0}
.field-schedule .hitch-status-panel .hitch-summary td .muted {margin-top:2px;font-size:.73rem}
.field-schedule .hitch-transition-date {padding:0}
.field-schedule .hitch-transition-date strong {font-size:.73rem}
.field-schedule .hitch-transition-soon .hitch-transition-date {
  padding:3px 6px;box-shadow:none;border:1px solid var(--transition-glow);border-radius:6px;
}
.field-schedule #scheduleDetails {margin:17px 0 0;padding:12px;border:1px solid var(--line);border-radius:9px}
@media(max-width:1280px) {
  .field-schedule .field-status-board {grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:850px) {
  #workspace:not([hidden]) {grid-template-columns:minmax(0,1fr)}
  .workspace-sidebar {position:static;height:auto}
  .workspace-brand {padding:12px 16px}
  #nav {flex-direction:row;flex-wrap:nowrap;overflow-x:auto;padding:7px 10px}
  #nav button {flex:0 0 auto;white-space:nowrap}
  #nav .nav-label {display:none}
  .workspace-main {padding:15px 12px 28px}
}
@media(max-width:600px) {
  .workspace-main #view .topline .tools {justify-content:flex-start}
  .field-schedule .field-status-board,.field-schedule .field-status-board:not(:has(.hitch-panel-upcoming)) {grid-template-columns:minmax(0,1fr)}
}
