:root {
  color-scheme: light;
  --ink: #172534;
  --ink-2: #304152;
  --muted: #738291;
  --navy: #122235;
  --navy-2: #1b3045;
  --teal: #168b72;
  --teal-dark: #0d705c;
  --orange: #ed784b;
  --line: #e3e9ed;
  --paper: #f3f6f8;
  --white: #fff;
  --shadow-sm: 0 2px 8px rgba(18, 34, 53, .045);
  --shadow-md: 0 12px 30px rgba(18, 34, 53, .075);
  font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--paper); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid rgba(22, 139, 114, .3); outline-offset: 2px; }

.app { min-height: 100vh; }
.sidebar {
  width: 258px; position: fixed; inset: 0 auto 0 0; z-index: 20;
  display: flex; flex-direction: column; padding: 22px 16px 15px;
  color: #f5f8fb; background: linear-gradient(180deg, #14283d 0%, #101e2f 100%);
  border-right: 1px solid rgba(255,255,255,.055);
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; font-weight: 850; letter-spacing: -.035em; font-size: 16px; }
.brand b { color: #64d0b0; }
.brand small { display: block; margin-top: 1px; color: #9eb0bf; font-size: 8px; font-weight: 750; letter-spacing: .18em; }
.brandmark { width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.1); border-radius: 11px; display: grid; place-items: center; color: white; background: linear-gradient(145deg, #25ae8d, #13755f); box-shadow: 0 6px 15px rgba(18, 153, 121, .25); font-size: 19px; }
.company-chip { display: flex; align-items: center; gap: 11px; padding: 12px; margin: 27px 0 13px; border: 1px solid rgba(255,255,255,.09); border-radius: 13px; background: rgba(255,255,255,.055); }
.company-icon, .avatar { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 11px; color: #eafff8; background: #236451; font-weight: 850; }
.company-chip b, .profile b { display: block; max-width: 160px; overflow: hidden; color: #f4f8fa; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.company-chip small, .profile small { display: block; margin-top: 2px; color: #98a9b7; font-size: 10px; }
.switch { display: flex; gap: 6px; margin: 0 0 16px; }
.switch select { min-width: 0; flex: 1; padding: 8px; border: 1px solid rgba(255,255,255,.13); border-radius: 8px; color: #eaf0f4; background: #1c3044; }
.icon-btn { border: 0; border-radius: 8px; color: white; background: #2e4a60; padding: 0 11px; }
.sidebar nav { display: grid; gap: 4px; }
.navlink { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 9px 11px; border: 1px solid transparent; border-radius: 10px; color: #b7c5d0; text-decoration: none; font-size: 12px; font-weight: 650; transition: color .15s ease, background .15s ease, border-color .15s ease; }
.navlink:hover { color: white; background: rgba(255,255,255,.06); }
.navlink.active { color: #f7fffc; border-color: rgba(81, 204, 166, .17); background: linear-gradient(90deg, rgba(35, 146, 116, .24), rgba(35, 146, 116, .09)); box-shadow: inset 3px 0 #49c49c; }
.navlink i { width: 20px; color: #a9c4c2; text-align: center; font-style: normal; font-size: 16px; }
.navlink.active i { color: #6ce0b9; }
.side-bottom { margin-top: auto; }
.privacy { padding: 13px 5px; border-top: 1px solid rgba(255,255,255,.09); color: #9cabb8; font-size: 10px; }
.profile { display: grid; grid-template-columns: 38px 1fr; gap: 9px; align-items: center; padding: 13px 2px 2px; border-top: 1px solid rgba(255,255,255,.09); }
.profile form { grid-column: 2; }
.text-btn { padding: 0; border: 0; color: #55c9a0; background: none; font-size: 11px; font-weight: 650; cursor: pointer; }
.main { min-height: 100vh; margin-left: 258px; }
.topbar { position: sticky; top: 0; z-index: 10; height: 62px; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; border-bottom: 1px solid rgba(217,226,232,.85); color: #687988; background: rgba(255,255,255,.88); backdrop-filter: blur(16px); font-size: 12px; }
.topbar b { margin: 0 8px; color: #a7b2bb; }
.top-user { color: #718191; font-size: 11px; }
.mobile-brand { display: none; }
.content { width: min(100%, 1650px); margin: 0 auto; padding: 27px 30px 58px; }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 4px 0 22px; }
.page-title h1 { margin: 4px 0 0; color: var(--ink); font-size: 29px; line-height: 1.15; letter-spacing: -.05em; font-weight: 780; }
.kicker { margin: 0; color: var(--teal); font-size: 9px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.title-actions { display: flex; gap: 8px; }

.panel { margin-bottom: 17px; padding: 21px; border: 1px solid var(--line); border-radius: 15px; background: var(--white); box-shadow: var(--shadow-sm); }
.panel h2 { margin: 0 0 6px; color: #1d2e3d; font-size: 16px; letter-spacing: -.025em; }
.panel h3 { color: #263747; }
.panel p { margin: 0 0 14px; color: var(--muted); font-size: 12px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.panel-head p { margin: 3px 0 0; }
.button { display: inline-flex; min-height: 39px; align-items: center; justify-content: center; gap: 8px; padding: 9px 14px; border: 1px solid transparent; border-radius: 9px; color: white; background: linear-gradient(135deg, #1a9c7b, #11745f); box-shadow: 0 5px 12px rgba(19, 129, 101, .18); text-decoration: none; font-size: 12px; font-weight: 760; cursor: pointer; transition: transform .14s ease, box-shadow .14s ease; }
.button:hover { transform: translateY(-1px); box-shadow: 0 8px 17px rgba(19,129,101,.23); }
.button.secondary { border-color: #dce4e9; color: #33485a; background: white; box-shadow: none; }
.button.secondary:hover { border-color: #aec8bf; color: #176f5a; background: #f5fbf8; }
.small-btn { min-height: 30px; padding: 6px 10px; border: 1px solid #cae5db; border-radius: 7px; color: #12694f; background: #ecf8f3; font-size: 10px; font-weight: 750; cursor: pointer; }
.compact-button { min-height: 34px; padding: 7px 10px; font-size: 10px; }
.notice { margin: 0 0 16px; padding: 11px 14px; border: 1px solid transparent; border-radius: 10px; font-size: 12px; }
.notice.success { border-color: #cae8dc; color: #17694f; background: #eef9f4; }
.notice.error { border-color: #f4d7ce; color: #a54631; background: #fff5f1; }
.subtle { color: var(--muted); font-size: 11px; }

.table-wrap { width: 100%; overflow: auto; }
table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 12px; }
th { color: #778795; background: #f7f9fa; text-align: left; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
td, th { padding: 11px 12px; border-bottom: 1px solid #edf1f3; vertical-align: top; }
td { color: #344454; }
td small { display: block; margin-top: 4px; color: #81909c; font-size: 10px; }
.empty { padding: 27px; border: 1px dashed #d7e0e5; border-radius: 11px; color: #7f8d99; background: #fbfcfd; text-align: center; font-size: 12px; }

.form-panel { padding: 23px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 13px; margin: 15px 0; }
label { display: grid; gap: 6px; color: #536575; font-size: 10px; font-weight: 680; }
input, select, textarea { width: 100%; min-height: 39px; padding: 9px 11px; border: 1px solid #dce4e9; border-radius: 8px; outline: none; color: #243748; background: #fff; transition: border .15s ease, box-shadow .15s ease; }
input::placeholder, textarea::placeholder { color: #a1acb5; }
input:focus, select:focus, textarea:focus { border-color: #65b69e; box-shadow: 0 0 0 3px rgba(27,146,114,.11); }
textarea { min-height: 88px; resize: vertical; }
.form > button { margin-top: 3px; }
.form { margin: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 13px; margin-bottom: 17px; }
.stat { position: relative; overflow: hidden; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: var(--shadow-sm); }
.stat:after { position: absolute; right: -15px; bottom: -26px; width: 92px; height: 92px; border-radius: 50%; background: rgba(26,156,123,.055); content: ""; }
.stat small { display: block; color: #82909c; font-size: 10px; font-weight: 650; }
.stat strong { display: block; margin-top: 8px; color: #1b2c3b; font-size: 27px; line-height: 1; letter-spacing: -.045em; }
.stat span { display: block; margin-top: 8px; color: #82909c; font-size: 10px; }
.snapshot { display: grid; grid-template-columns: 1fr auto; gap: 10px; color: #687988; font-size: 12px; }
.snapshot b { color: #213546; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.quick-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 13px; }
.quick { display: grid; gap: 5px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; color: #18876e; background: white; box-shadow: var(--shadow-sm); text-decoration: none; font-size: 17px; transition: transform .15s ease, box-shadow .15s ease; }
.quick:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.quick b { color: var(--ink); font-size: 12px; }
.quick span { color: var(--muted); font-size: 10px; }
.inline-input { max-width: 100px; margin: 2px; }

/* Dispatch workspace */
.dispatch-layout { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(360px,.95fr); align-items: start; gap: 17px; }
.dispatch-panel { min-width: 0; overflow: hidden; padding: 0; }
.dispatch-panel > .panel-head { align-items: flex-start; margin: 0; padding: 20px 21px 16px; }
.dispatch-panel > .panel-head h2 { margin: 0; font-size: 16px; }
.dispatch-panel > .panel-head p { margin-top: 4px; }
.dispatch-panel > .panel-head .button { white-space: nowrap; flex: 0 0 auto; }
.queue-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 0 15px; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.queue-tab { display: flex; min-height: 47px; align-items: center; gap: 7px; padding: 0 10px; border-bottom: 2px solid transparent; color: #6e7d8a; text-decoration: none; white-space: nowrap; font-size: 10px; font-weight: 720; }
.queue-tab:hover, .queue-tab.active { border-bottom-color: var(--teal); color: #146e58; }
.queue-tab b { display: grid; min-width: 20px; height: 20px; place-items: center; border-radius: 99px; color: #617281; background: #eef2f4; font-size: 9px; }
.queue-tab.active b { color: #116950; background: #e3f4ed; }
.queue-tab[href*="view=unassigned"] b { color: #955a16; background: #fff3de; }
.queue-tab.active[href*="view=unassigned"] b { color: #8c510f; background: #ffebc5; }
.dispatch-search { display: flex; gap: 8px; padding: 14px 18px 12px; }
.dispatch-panel > .panel-head .button { margin-top: 1px; }
.dispatch-search input { max-width: none; min-width: 0; flex: 1; background: #fafcfd; }
.dispatch-search .button { min-height: 39px; font-size: 11px; }
.dispatch-search > a { min-height: 39px; padding: 9px 12px; font-size: 11px; }
.dispatch-job-list { display: grid; gap: 10px; padding: 0 14px 17px; }
.dispatch-job { display: grid; grid-template-columns: minmax(0,1fr) 210px; gap: 17px; padding: 16px; border: 1px solid #e4eaed; border-radius: 13px; background: white; box-shadow: 0 2px 7px rgba(22,39,56,.025); transition: border .15s ease, box-shadow .15s ease, transform .15s ease; }
.dispatch-job:hover { transform: translateY(-1px); border-color: #d2e3dd; box-shadow: 0 7px 18px rgba(22,39,56,.055); }
.dispatch-job-main { min-width: 0; }
.dispatch-job-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dispatch-job-number { display: flex; align-items: baseline; gap: 8px; margin-right: 3px; }
.dispatch-job-number span { color: #1b3042; font-size: 14px; font-weight: 820; letter-spacing: -.025em; }
.dispatch-job-number small { color: #8b98a2; font-size: 9px; }
.status-pill { display: inline-flex; align-items: center; min-height: 23px; padding: 4px 8px; border-radius: 99px; color: #24745f; background: #e8f5f0; font-size: 9px; font-weight: 790; letter-spacing: .02em; white-space: nowrap; }
.status-pill.suspended { color: #a8462e; background: #fff0eb; }
.status-new, .status-quote { color: #956117; background: #fff5e6; }
.status-scheduled { color: #5456a0; background: #eff0ff; }
.status-assigned { color: #2c6297; background: #eaf3ff; }
.status-en_route { color: #126d61; background: #e5f5f2; }
.status-on_scene { color: #287552; background: #e8f6ee; }
.status-in_yard { color: #6c5495; background: #f0edf8; }
.status-completed { color: #24745f; background: #e8f5f0; }
.status-cancelled { color: #78838a; background: #f0f2f3; }
.priority-tag, .locked-tag { display: inline-flex; align-items: center; min-height: 22px; padding: 3px 7px; border-radius: 7px; color: #687783; background: #f2f5f6; font-size: 9px; font-weight: 720; }
.priority-emergency { color: #a63f32; background: #fff0eb; }
.priority-low { color: #817354; background: #f7f4e9; }
.locked-tag { color: #75519a; background: #f4effa; }
.dispatch-job-service { margin: 9px 0 12px; color: #33495b; font-size: 12px; font-weight: 760; }
.dispatch-job-service span { color: #83909b; font-weight: 500; }
.dispatch-job-details { display: grid; grid-template-columns: .95fr .95fr 1.3fr 1fr; gap: 10px; }
.dispatch-job-details > div { min-width: 0; display: grid; gap: 3px; }
.dispatch-job-details small { color: #8b98a2; font-size: 8px; font-weight: 760; letter-spacing: .075em; text-transform: uppercase; }
.dispatch-job-details strong { overflow: hidden; color: #304354; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 700; }
.dispatch-job-details span { overflow: hidden; color: #86939d; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.dispatch-job-foot { display: flex; gap: 15px; justify-content: space-between; margin-top: 13px; padding-top: 10px; border-top: 1px solid #eef1f3; color: #7c8994; font-size: 9px; }
.dispatch-job-foot strong { color: #293e50; font-size: 10px; }
.dispatch-job-controls { display: flex; flex-direction: column; gap: 8px; justify-content: flex-start; padding-left: 14px; border-left: 1px solid #edf1f3; }
.dispatch-action-links { display: flex; align-items: center; gap: 7px; }
.dispatch-job-controls form { display: grid; gap: 5px; margin: 0; }
.dispatch-job-controls .assignment-label { gap: 4px; font-size: 9px; }
.dispatch-job-controls select { min-height: 33px; padding: 6px 8px; font-size: 10px; }
.dispatch-job-controls .micro-copy { margin: -2px 0 0; color: #8a97a1; font-size: 8px; line-height: 1.4; }
.dispatch-job-controls .text-btn { justify-self: start; color: #8a6570; font-size: 9px; }
.dispatch-empty { display: grid; justify-items: center; padding: 52px 22px 60px; text-align: center; }
.dispatch-empty-icon { width: 50px; height: 50px; display: grid; place-items: center; margin-bottom: 12px; border-radius: 15px; color: #168b72; background: #e8f6f0; font-size: 24px; }
.dispatch-empty h3 { margin: 0 0 5px; color: #293b4b; font-size: 14px; }
.dispatch-empty p { margin: 0; color: #7c8994; font-size: 11px; }
.dispatch-intake { position: sticky; top: 77px; max-height: calc(100vh - 94px); overflow: auto; padding: 0; scrollbar-width: thin; }
.dispatch-intake-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; gap: 10px; padding: 19px 20px 15px; border-bottom: 1px solid #edf1f3; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); }
.dispatch-intake-head h2 { margin: 0; color: #1d3041; font-size: 15px; letter-spacing: -.025em; }
.dispatch-intake-head p { margin: 4px 0 0; color: #7c8a96; font-size: 10px; }
.dispatch-intake-body { padding: 14px 18px 18px; }
.call-mode-picker { display: grid; grid-template-columns: repeat(4,1fr); gap: 5px; margin-bottom: 13px; }
.call-mode-picker label { position: relative; display: block; }
.call-mode-picker input { position: absolute; opacity: 0; pointer-events: none; }
.call-mode-picker span { display: grid; min-height: 36px; place-items: center; padding: 5px 4px; border: 1px solid #e3e9ed; border-radius: 8px; color: #788692; background: #fafbfc; text-align: center; font-size: 9px; font-weight: 680; cursor: pointer; }
.call-mode-picker input:checked + span { border-color: #a7d9c7; color: #126f57; background: #edf9f3; box-shadow: inset 0 0 0 1px #d6eee4; }
.intake-section { margin: 0 0 13px; padding: 12px; border: 1px solid #e9eef1; border-radius: 11px; background: #fbfcfd; }
.intake-section h3 { display: flex; align-items: center; gap: 7px; margin: 0 0 9px; color: #35495a; font-size: 10px; font-weight: 800; letter-spacing: .035em; }
.intake-section h3 span { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; color: #16775f; background: #e8f5ef; font-size: 10px; }
.intake-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.intake-grid .full-width { grid-column: 1/-1; }
.intake-grid label { gap: 4px; font-size: 9px; }
.intake-grid input, .intake-grid select, .intake-grid textarea { min-height: 35px; padding: 7px 9px; border-radius: 7px; font-size: 10px; }
.intake-grid textarea { min-height: 55px; }
.address-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.address-fields .street-field, .address-fields .city-field { grid-column: 1/-1; }
.address-fields label { gap: 4px; }
.address-fields input { min-height: 34px; padding: 7px 8px; font-size: 10px; }
.address-hint { grid-column: 1/-1; margin: 0; color: #8996a0; font-size: 8px; }
.intake-submit { width: 100%; min-height: 42px; }
.subtle-notice { margin: 8px 0 0; color: #87939d; font-size: 8px; line-height: 1.45; }
.places-status { grid-column: 1/-1; min-height: 12px; color: #758a88; font-size: 8px; }
.vehicle-lookup-status { min-height: 11px; color: #758a88; font-size: 8px; }
.dispatch-panel + .form-panel { scroll-margin-top: 16px; }

.fleet-edit-list { display: grid; gap: 10px; }
.fleet-edit-list > .form { margin: 0; }
.fleet-edit-row { display: grid; align-items: end; gap: 10px; padding: 13px; border: 1px solid #e7ecef; border-radius: 11px; background: #fbfcfc; }
.truck-edit-row { grid-template-columns: repeat(7,minmax(90px,1fr)) auto; }
.driver-edit-row { grid-template-columns: repeat(6,minmax(100px,1fr)) auto; }
.fleet-edit-row label { font-size: 9px; }
.fleet-edit-row input, .fleet-edit-row select { min-height: 35px; padding: 7px; font-size: 10px; }
.fleet-edit-row .small-btn { height: 35px; white-space: nowrap; }
.call-edit-card > .panel-head { align-items: flex-start; }
.call-edit-card .form-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.call-edit-card .notice { margin: 15px 0; }

.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 25px; background: radial-gradient(circle at 18% 15%, #e3f2ed 0, transparent 33%), linear-gradient(135deg,#edf2f5,#f9fbfc); }
.auth-card { width: min(100%, 510px); padding: 36px; border: 1px solid #e1e8ec; border-radius: 20px; background: white; box-shadow: 0 25px 70px rgba(19,42,61,.12); }
.auth-card h1 { margin: 8px 0; color: #1b2d3e; font-size: 30px; letter-spacing: -.05em; }
.auth-card p { color: #748390; font-size: 12px; line-height: 1.65; }
.auth-card form { display: grid; gap: 13px; margin-top: 20px; }
.auth-card .brand { margin-bottom: 28px; color: var(--navy); }
.public-wrap { width: min(1080px, calc(100% - 40px)); margin: 40px auto 80px; }
.public-hero { margin: 28px 0 18px; padding: 50px; border-radius: 18px; color: white; background: radial-gradient(circle at 88% 12%, rgba(43,181,143,.2), transparent 28%), linear-gradient(135deg,#14283d,#0f1b2b); box-shadow: 0 24px 60px rgba(14,31,47,.17); }
.public-hero h1 { max-width: 800px; margin: 12px 0; color: white; font-size: clamp(32px,5vw,54px); line-height: 1.04; letter-spacing: -.055em; }
.public-hero p { max-width: 650px; color: #c1ccd5; font-size: 13px; line-height: 1.7; }
.demo-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; }
.demo-grid .panel p { padding-bottom: 9px; border-bottom: 1px solid #edf1f3; color: #596c7a; }
.public-wrap > .brand { color: var(--navy); }

.owner-nav { margin-top: 28px; }
.owner-company-list { display: grid; gap: 13px; margin-top: 16px; }
.owner-company { padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.owner-company-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.owner-company h3 { margin: 0; font-size: 15px; }
.owner-company p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.owner-form-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 11px; margin: 12px 0; }
.owner-company form > label { margin: 0 0 12px; }
.owner-company form > .button { margin-top: 2px; }
.owner-search { display: flex; gap: 8px; max-width: 650px; margin: 16px 0; }
.owner-search input { flex: 1; }
.owner-company .subtle { margin: 0 0 12px; color: #a34b30; }

@media (max-width: 1320px) {
  .content { padding-right: 22px; padding-left: 22px; }
  .dispatch-layout { grid-template-columns: minmax(0,1.25fr) minmax(340px,.9fr); gap: 13px; }
  .dispatch-job { grid-template-columns: minmax(0,1fr) 190px; gap: 12px; padding: 13px; }
  .dispatch-job-details { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .owner-form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 1050px) {
  .sidebar { width: 226px; padding-right: 13px; padding-left: 13px; }
  .main { margin-left: 226px; }
  .dispatch-layout { grid-template-columns: 1fr; }
  .dispatch-intake { position: static; max-height: none; overflow: visible; }
  .dispatch-job { grid-template-columns: minmax(0,1fr) 210px; }
  .form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .quick-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 700px) {
  .sidebar { position: fixed; inset: auto 0 0; width: 100%; height: 66px; flex-direction: row; padding: 5px 6px max(5px, env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,.12); border-right: 0; box-shadow: 0 -7px 24px rgba(13,28,43,.18); }
  .sidebar > .brand, .sidebar > .company-chip, .sidebar > .switch, .side-bottom { display: none; }
  .sidebar nav { width: 100%; display: flex; align-items: stretch; justify-content: space-around; gap: 2px; overflow-x: auto; }
  .navlink, .navlink:not(.active) { min-width: 59px; min-height: 53px; flex: 1 0 auto; flex-direction: column; justify-content: center; gap: 2px; padding: 4px 4px; border-radius: 9px; color: #b8c6d1; font-size: 8px; white-space: nowrap; }
  .navlink.active { box-shadow: inset 0 2px #49c49c; }
  .navlink i { width: auto; font-size: 16px; }
  .main { width: 100%; margin: 0; padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .topbar { height: 54px; padding: 0 15px; font-size: 10px; }
  .top-user { display: none; }
  .mobile-brand { display: inline; color: #213648; font-size: 10px; font-weight: 850; letter-spacing: .03em; }
  .content { padding: 19px 12px 32px; }
  .page-title { align-items: flex-start; margin-bottom: 16px; }
  .page-title h1 { font-size: 25px; }
  .panel { padding: 15px; border-radius: 13px; }
  .form-panel { padding: 16px; }
  .form-grid, .call-edit-card .form-grid, .two-col, .demo-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .stat { padding: 13px; }
  .stat strong { font-size: 21px; }
  .quick-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .quick { padding: 12px; }
  .dispatch-panel > .panel-head { align-items: flex-start; gap: 8px; padding: 16px 14px 13px; }
  .dispatch-panel > .panel-head p { max-width: 220px; }
  .dispatch-panel > .panel-head .button { min-height: 35px; padding: 7px 9px; font-size: 10px; }
  .dispatch-panel > .panel-head .button { min-height: 35px; padding: 7px 9px; font-size: 10px; }
  .queue-tabs { padding: 0 8px; }
  .queue-tab { min-height: 42px; gap: 5px; padding: 0 7px; font-size: 9px; }
  .dispatch-search { flex-wrap: wrap; padding: 11px 12px; }
  .dispatch-search input { flex: 1 1 100%; }
  .dispatch-search .button, .dispatch-search > a { min-height: 35px; padding: 7px 10px; }
  .dispatch-job-list { gap: 9px; padding: 0 9px 11px; }
  .dispatch-job { grid-template-columns: 1fr; gap: 11px; padding: 13px; }
  .dispatch-job-title { gap: 6px; }
  .dispatch-job-number { width: 100%; justify-content: space-between; }
  .dispatch-job-details { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .dispatch-job-details > div:nth-child(3) { grid-column: 1/-1; }
  .dispatch-job-controls { display: grid; grid-template-columns: 1fr 1fr; align-items: start; padding: 10px 0 0; border-top: 1px solid #edf1f3; border-left: 0; }
  .dispatch-action-links { grid-column: 1/-1; }
  .dispatch-job-controls form:last-child { grid-column: 1/-1; }
  .dispatch-intake-head { padding: 15px; }
  .dispatch-intake-body { padding: 12px; }
  .intake-section { padding: 10px; }
  .fleet-edit-row, .truck-edit-row, .driver-edit-row { grid-template-columns: 1fr; }
  .owner-form-grid { grid-template-columns: 1fr; }
  .owner-search { align-items: stretch; }
  .owner-company-head { flex-direction: column; }
  .auth-card { padding: 25px; }
  .public-hero { padding: 30px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Dispatch address intake and live fleet map */
.address-block { margin: 0 0 11px; padding: 10px; border: 1px solid #e7ecef; border-radius: 9px; background: #fff; }
.address-block > label { margin-bottom: 8px; }
.address-title { margin-bottom: 8px; color: #35495a; font-size: 10px; font-weight: 800; }
.address-fields { margin-top: 0; }
.address-fields .city-field { grid-column: auto; }
.address-fields .address-hint { font-size: 8px; }
.live-indicator { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 99px; color: #26725c; background: #edf8f3; white-space: nowrap; font-size: 8px; font-weight: 820; letter-spacing: .06em; }
.live-indicator i { width: 6px; height: 6px; border-radius: 50%; background: #28ad80; box-shadow: 0 0 0 3px rgba(40,173,128,.13); }
.truck-link-note { margin: 0; padding: 7px 9px; border-radius: 7px; color: #687e88; background: #f0f6f5; font-size: 8px; line-height: 1.45; }
.map-panel { padding: 0; overflow: hidden; }
.map-panel > .panel-head { margin: 0; padding: 18px 20px 14px; }
.map-legend { display: flex; align-items: center; gap: 15px; padding: 0 20px 13px; color: #70808c; font-size: 10px; }
.map-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.map-legend #map-updated { margin-left: auto; color: #8996a0; font-size: 9px; }
.map-dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 2px white, 0 0 0 3px #dfe6e9; }
.call-dot { background: #e5794f; }
.driver-dot { background: #168b72; }
.fleet-map { width: 100%; height: min(62vh, 610px); min-height: 360px; background: #edf2f4; }
.map-message { padding: 10px 16px; border-top: 1px solid #edf1f3; color: #71818d; background: #fbfcfd; font-size: 10px; }
.map-setup { display: grid; justify-items: center; padding: 72px 22px; color: #657887; background: radial-gradient(circle at 50% 0%, #effaf5, #fbfcfd 65%); text-align: center; }
.map-setup-icon { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 14px; border-radius: 16px; color: #16775f; background: #e4f5ed; font-size: 28px; }
.map-setup h3 { margin: 0 0 6px; color: #263a4a; font-size: 15px; }
.map-setup p { max-width: 530px; margin: 0 0 16px; line-height: 1.65; }
.map-feed-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.map-feed-grid > .panel { min-width: 0; }
.map-feed-grid h2 { margin: 0 0 4px; font-size: 14px; }
.map-feed-grid p { margin: 0 0 13px; font-size: 10px; }
.map-list { display: grid; gap: 7px; }
.map-list-item { display: grid; gap: 4px; padding: 10px 11px; border: 1px solid #e8edef; border-radius: 9px; background: #fbfcfd; }
.map-list-title { color: #2c4051; font-size: 10px; font-weight: 780; }
.map-list-detail { color: #7b8994; font-size: 9px; line-height: 1.45; }
.map-popup { display: grid; gap: 4px; min-width: 160px; padding: 2px; color: #304354; font: 12px/1.4 system-ui, sans-serif; }
.map-popup strong { color: #203447; }
.map-popup span { color: #61717e; }
@media (max-width: 700px) {
  .map-legend { flex-wrap: wrap; gap: 9px 12px; padding: 0 14px 12px; font-size: 9px; }
  .map-legend #map-updated { flex-basis: 100%; margin-left: 0; }
  .fleet-map { height: 55vh; min-height: 300px; }
  .map-feed-grid { grid-template-columns: 1fr; gap: 0; }
  .map-panel > .panel-head { padding: 15px 14px 12px; }
  .address-block { padding: 9px; }
}

.places-search-wrap { display: grid; gap: 5px; margin: 4px 0 9px; }
.places-search-label { color: #71818d; font-size: 9px; font-weight: 680; }
.geoapify-search-wrap { position: relative; width: 100%; }
.geoapify-search { width: 100%; min-height: 39px; padding: 9px 11px; border: 1px solid #dce4e9; border-radius: 8px; background: #fff; color: #263a4a; font: inherit; }
.geoapify-suggestions { position: absolute; z-index: 1100; top: calc(100% + 3px); right: 0; left: 0; max-height: 260px; overflow-y: auto; border: 1px solid #dce4e9; border-radius: 9px; background: #fff; box-shadow: 0 12px 32px #18334b24; }
.geoapify-suggestions[hidden] { display: none; }
.geoapify-suggestion { display: block; width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid #edf1f3; background: #fff; color: #263a4a; text-align: left; font: inherit; cursor: pointer; }
.geoapify-suggestion:hover, .geoapify-suggestion:focus { background: #eff8f5; outline: none; }
.geoapify-no-results { padding: 11px 12px; color: #71818d; font-size: 12px; }
.fleet-map-marker { display: flex; width: 27px; height: 27px; align-items: center; justify-content: center; border: 2px solid #fff; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 750; box-shadow: 0 2px 8px #18334b55; cursor: pointer; }
.fleet-map-marker.call-marker { background: #e5794f; }
.fleet-map-marker.driver-marker { background: #168b72; }
.map-credit a { color: inherit; text-decoration: underline; }
@media (max-width: 700px) { .geoapify-search { min-height: 38px; } }

/* Mobile driver portal and call chat */
.driver-welcome { display:flex; align-items:center; justify-content:space-between; gap:18px; margin-bottom:14px; padding:21px 23px; border:1px solid #dce9e7; border-radius:14px; background:linear-gradient(115deg,#e9f7f2,#fff 68%); }
.driver-welcome h2 { margin:2px 0 4px; color:#20364a; font-size:21px; }
.driver-welcome p { margin:0; color:#72828f; font-size:11px; }
.driver-tools { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:7px; }
.driver-tools > span { flex-basis:100%; color:#72828f; font-size:9px; text-align:right; }
.driver-refresh-row { display:flex; justify-content:space-between; gap:12px; margin:0 2px 10px; color:#738291; font-size:10px; }
.driver-refresh-row b { color:#34495a; }
.driver-call-list { display:grid; gap:13px; }
.driver-call { overflow:hidden; border:1px solid #e1e8ec; border-radius:14px; background:#fff; box-shadow:var(--shadow-sm); }
.driver-call-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:14px 16px; border-bottom:1px solid #edf1f3; background:#fbfcfd; }
.driver-call-heading > div { display:flex; align-items:center; flex-wrap:wrap; gap:7px; }
.driver-call-heading > strong { color:#314558; font-size:11px; text-align:right; }
.driver-call-number { color:#21394e; font-size:14px; font-weight:850; }
.driver-call-details { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 20px; padding:15px 17px; }
.driver-call-details > div { display:grid; align-content:start; gap:3px; min-width:0; }
.driver-call-details small { color:#87939d; font-size:9px; font-weight:750; letter-spacing:.07em; text-transform:uppercase; }
.driver-call-details b { color:#304558; font-size:11px; overflow-wrap:anywhere; }
.driver-call-details span,.driver-call-details a { color:#71818d; font-size:10px; overflow-wrap:anywhere; }
.driver-call-details a { color:#14795f; font-weight:700; }
.driver-call-actions { display:flex; align-items:center; gap:12px; padding:0 17px 14px; }
.driver-call-timing { color:#798893; font-size:10px; }
.driver-empty { display:grid; justify-items:center; padding:40px 22px; text-align:center; }
.driver-empty h2 { margin:10px 0 3px; font-size:16px; }
.driver-empty p { max-width:450px; margin:0; color:#758490; font-size:11px; line-height:1.6; }
.driver-empty-icon { display:grid; width:42px; height:42px; place-items:center; border-radius:13px; color:#13795f; background:#e4f5ee; font-size:21px; }
.driver-chat { padding:13px 16px 15px; border-top:1px solid #edf1f3; background:#fbfcfd; }
.driver-chat > summary { display:flex; align-items:center; justify-content:space-between; gap:10px; color:#304558; cursor:pointer; font-size:11px; font-weight:780; list-style-position:inside; }
.driver-chat[open] > summary { margin-bottom:8px; }
.chat-panel { padding-top:3px; }
.chat-head { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.chat-head p { margin:3px 0 0; color:#85929b; font-size:9px; }
.chat-live { padding:3px 7px; border-radius:20px; color:#19765e; background:#e7f6ef; font-size:8px; font-weight:750; white-space:nowrap; }
.chat-messages { display:grid; gap:6px; max-height:190px; overflow:auto; margin:10px 0; padding:2px; }
.chat-message { padding:8px 10px; border:1px solid #e8edef; border-radius:9px; background:#fff; }
.chat-message-meta { display:flex; justify-content:space-between; gap:10px; color:#445968; font-size:9px; }
.chat-message-meta time { color:#8a969f; font-size:8px; }
.chat-message p { margin:4px 0 0; color:#304456; font-size:10px; line-height:1.5; white-space:pre-wrap; overflow-wrap:anywhere; }
.chat-compose { display:flex; align-items:flex-end; gap:7px; }
.chat-compose textarea { flex:1; min-height:38px; max-height:110px; resize:vertical; padding:9px 10px; border:1px solid #dce4e9; border-radius:8px; font:inherit; font-size:10px; }
.chat-compose .button { min-height:37px; padding:0 13px; }
.chat-error { min-height:0; margin:4px 0 0; color:#a44239; font-size:9px; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
@media(max-width:700px) {
  .driver-welcome { align-items:stretch; flex-direction:column; padding:16px; }
  .driver-tools { justify-content:flex-start; }
  .driver-tools > span { text-align:left; }
  .driver-call-heading { align-items:flex-start; flex-direction:column; }
  .driver-call-heading > strong { text-align:left; }
  .driver-call-details { grid-template-columns:1fr; gap:10px; padding:13px 14px; }
  .driver-call-actions { align-items:flex-start; flex-direction:column; padding:0 14px 13px; }
  .chat-compose .button { min-width:65px; }
  .driver-refresh-row { flex-direction:column; gap:3px; }
}

/* Multi-step business signup and monthly call allowance */
.auth-card.signup-card { width: min(100%, 720px); }
.signup-card .brand { margin-bottom: 20px; }
.signup-progress { display:flex; align-items:center; gap:8px; margin:4px 0 24px; }
.signup-progress > span { display:flex; min-width:74px; height:34px; align-items:center; justify-content:center; gap:6px; border:1px solid #e0e7eb; border-radius:99px; color:#7d8b96; background:#f5f7f8; font-size:11px; font-weight:800; }
.signup-progress > span.active,.signup-progress > span.complete { border-color:#a8d7c8; color:#126e57; background:#eaf8f2; }
.signup-progress small { font-size:9px; font-weight:700; }
.signup-progress > i { height:1px; flex:1; background:#dfe6ea; }
.signup-intro { margin-bottom:19px; }
.signup-intro h1 { margin:5px 0; }
.signup-intro p:last-child { margin-bottom:0; }
.signup-step h2 { margin:0 0 14px; color:#223747; font-size:16px; }
.signup-step[hidden] { display:none !important; }
.signup-plan-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-bottom:10px; }
.signup-plan { position:relative; display:block; cursor:pointer; }
.signup-plan input { position:absolute; width:1px; height:1px; opacity:0; }
.signup-plan-body { display:grid; gap:4px; min-height:88px; padding:14px; border:1px solid #e1e8eb; border-radius:11px; background:#fff; transition:border .15s,background .15s,box-shadow .15s; }
.signup-plan input:checked + .signup-plan-body { border-color:#49ae8b; background:#f0faf5; box-shadow:0 0 0 2px #d9f0e6; }
.signup-plan input:focus-visible + .signup-plan-body { outline:3px solid rgba(22,139,114,.25); outline-offset:2px; }
.signup-plan-body b { color:#263b4c; font-size:12px; }
.signup-plan-body strong { color:#15745c; font-size:16px; }
.signup-plan-body small { color:#72818c; font-size:10px; }
.signup-billing-note { margin:8px 0 15px; padding:11px 12px; border-radius:9px; color:#77551d !important; background:#fff7e9; font-size:10px !important; }
.signup-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:14px 0 17px; }
.signup-step-actions { display:flex; justify-content:space-between; gap:10px; margin-top:17px; }
.signup-footer { margin-top:17px; text-align:center; }
.call-usage { display:grid; grid-template-columns:minmax(220px,auto) minmax(120px,1fr) auto; align-items:center; gap:16px; margin:0 0 14px; padding:13px 16px; border:1px solid var(--line); border-radius:12px; background:#fff; box-shadow:var(--shadow-sm); }
.call-usage-copy { display:grid; gap:2px; }
.call-usage-copy strong { color:#26394a; font-size:11px; }
.call-usage-copy span { color:#748390; font-size:10px; }
.call-usage-track { height:8px; overflow:hidden; border-radius:99px; background:#e8eef0; }
.call-usage-track i { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,#21a27f,#f2a34b); }
.call-usage > a { color:#14725a; font-size:10px; font-weight:750; text-decoration:none; white-space:nowrap; }
@media(max-width:700px){.signup-plan-grid,.signup-form-grid{grid-template-columns:1fr}.signup-progress{gap:4px}.signup-progress > span{min-width:66px}.call-usage{grid-template-columns:1fr auto;gap:10px}.call-usage-track{grid-row:2;grid-column:1/-1}.call-usage > a{grid-row:1;grid-column:2}}
