:root {
  font: 16px system-ui, sans-serif;
  color: #192135;
  background: #f2f3f6;
  color-scheme: light;
  --muted: #525c70;
  --border: #dce0e8;
  --red: #a61519;
  --red-text: #8d191d;
  --red-light: #f8ecec;
}
* { box-sizing: border-box; }
body, h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.65rem, 4vw, 2.4rem); letter-spacing: -.045em; }
h2 { font-size: 1.2rem; margin-bottom: .45rem; }
h3 { font-size: 1rem; margin-block: .75rem .2rem; }
p { line-height: 1.45; }
[hidden] { display: none !important; }
.meta, small { color: var(--muted); font-size: .9rem; }
.stack { display: grid; gap: .85rem; }
.row, .subnav { display: flex; align-items: end; flex-wrap: wrap; gap: .5rem .8rem; }
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100dvh; }
aside { background: white; border-right: 1px solid #e1e4eb; padding: 1.15rem; }
.logo { display: block; width: 145px; height: 65px; object-fit: contain; object-position: left center; }
aside .logo { margin: 0 0 1rem; }
#office-nav { display: grid; gap: .3rem; }
#office-nav :is(button, a.snow-event-link) {
  width: 100%; justify-content: start; text-align: left; border: 0;
  color: #344052; padding: .49rem .8rem;
}
#office-nav :is(button, a):has(> .sidebar-icon) { gap: .55rem; }
#office-nav a:has(> .sidebar-icon) { display: inline-flex; align-items: center; }
#office-nav .sidebar-icon { flex-shrink: 0; }
#office-nav [aria-current=page], .subnav [aria-pressed=true] { color: var(--red-text); background: var(--red-light); }
.subnav [aria-pressed=true] { border-color: #d6a5a7; }
main { min-width: 0; width: 100%; max-width: 1380px; padding: 1.2rem clamp(.8rem, 3vw, 2.4rem) 2rem; }
header { display: flex; gap: .6rem 1.2rem; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.panel { min-width: 0; background: white; border: 1px solid var(--border); border-radius: .55rem; padding: clamp(.85rem, 2.3vw, 1.35rem); }
.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .65rem; margin-top: .8rem; }
.metrics .metric {
  display: grid; gap: .35rem; justify-content: start; align-content: center; width: 100%; min-height: 78px;
  text-align: left; color: inherit; border-color: var(--border); padding: .7rem .85rem;
}
.metric:hover, .metric:focus-visible { background: var(--red-light); border-color: var(--red); }
.metric span { font-size: .88rem; font-weight: 500; color: var(--muted); }
.metric strong { font-size: 1.55rem; font-weight: 750; }
.handoff { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: .7rem; margin-top: .7rem; }
.handoff article { min-width: 0; border: 1px solid var(--border); border-radius: .4rem; padding: .7rem; }
.handoff h3 { margin-top: 0; }
.handoff p { margin-bottom: .65rem; }
.handoff button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
button, input, select { font: inherit; }
button, a { touch-action: manipulation; }
button, #cota-customer-link {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; width: max-content;
  padding: .49rem .8rem; color: #23334d; background: white; border: 1px solid #cdd3de; border-radius: .4rem; font-weight: 650; cursor: pointer;
}
button:hover { background: #f3f5f9; }
button.primary { color: white; background: var(--red); border-color: var(--red); }
button.primary:hover { background: #831316; }
button.danger { color: var(--red-text); border-color: #d6a5a7; }
button.danger:hover { background: var(--red-light); }
:where(button, input, select, a, summary):focus-visible { outline: 2px solid #214471; outline-offset: 2px; }
label { display: grid; gap: .24rem; font-weight: 600; }
input, select { min-width: 0; width: 100%; min-height: 44px; padding: .48rem; border: 1px solid #b9c2d1; border-radius: .35rem; background: white; color: #182035; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); align-items: end; gap: .7rem; }
.signin { min-height: 100dvh; display: grid; place-items: center; padding: 1rem; }
.signin-card { width: min(100%, 460px); display: grid; gap: 1rem; border-top: 4px solid var(--red); box-shadow: 0 14px 42px #19213512; }
.signin-card form { display: grid; gap: .8rem; }
.signin-card button { width: 100%; }
.signin-card #signin-options button { width: auto; }
#manager-invite { margin-top: .75rem; }
#manager-invite-result { display: grid; gap: .5rem; margin-top: .75rem; padding: .75rem; border: 1px solid var(--border); border-radius: .4rem; }
#code { display: grid; gap: .5rem; margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--border); }
#pair-code { max-width: 30rem; }
.table-wrap { max-width: 100%; overflow: auto; margin-top: .7rem; }
.route-actions { align-items: flex-start; gap: .4rem; }
.route-action-menu > summary {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .25rem .6rem;
  border: 1px solid var(--border);
  border-radius: .4rem;
  background: white;
  color: #344052;
  cursor: pointer;
  list-style: none;
}
.route-action-menu > summary::-webkit-details-marker { display: none; }
.route-action-menu > summary::after {
  content: "";
  width: .45em;
  height: .45em;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg);
}
.route-action-menu[open] > summary::after { transform: translateY(1px) rotate(225deg); }
.route-action-menu > summary:hover { background: #f3f5f9; }
.route-action-options {
  display: grid;
  gap: 2px;
  min-width: 8.5rem;
  margin-top: .25rem;
  padding: .22rem;
  border: 1px solid var(--border);
  border-radius: .4rem;
  background: white;
}
.route-action-menu:not([open]) .route-action-options { display: none; }
.route-action-options button { justify-content: start; text-align: left; border-color: transparent; }
.route-action-options button.danger { border-color: transparent; }
.route-print-sheet { display: none; }
@page route-sheet { size: letter portrait; margin: .46in; }
@media print {
  body.route-print-active > :not(.route-print-sheet) { display: none !important; }
  body.route-print-active .route-print-sheet {
    display: block;
    page: route-sheet;
    font: 9pt/1.18 Arial, sans-serif;
    color: #141b24;
    background: #fff;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .route-print-sheet .route-print-brand { font-size: 8pt; font-weight: bold; }
  .route-print-sheet h1 { margin: .12in 0 .06in; font-size: 20pt; line-height: 1.12; letter-spacing: normal; }
  .route-print-sheet .route-print-summary { color: #394653; }
  .route-print-sheet .route-print-assignment { display: flex; flex-wrap: wrap; gap: .4in; margin: .16in 0 .12in; }
  .route-print-sheet table { table-layout: fixed; font-size: 8.5pt; }
  .route-print-sheet thead { display: table-header-group; background: #e9edf1; }
  .route-print-sheet tr { break-inside: avoid; page-break-inside: avoid; }
  .route-print-sheet tbody tr:nth-child(even) { background: #f5f6f8; }
  .route-print-sheet :is(th,td) { padding: 3pt 4pt; vertical-align: top; overflow-wrap: anywhere; }
  .route-print-sheet th:nth-child(1) { width: 6%; }
  .route-print-sheet th:nth-child(2) { width: 19%; }
  .route-print-sheet th:nth-child(4) { width: 21%; }
  .route-print-sheet th:nth-child(5) { width: 7%; }
  .route-print-sheet th:nth-child(6) { width: 11%; }
  .route-print-sheet td:nth-child(2) { font-weight: bold; }
  .route-print-sheet td small { font-size: 7.5pt; }
  .route-print-check { display: inline-block; width: 7pt; height: 7pt; border: .55pt solid #758293; }
}
.cota-editor { padding: .8rem; background: #f6f7fa; border-radius: .4rem; }
.cota-editor h3 { margin: 0; }
.cota-check { display: flex; align-items: center; gap: .45rem; }
.cota-check input { width: auto; min-height: auto; }
.location-choices { grid-column: 1 / -1; }
#billing-rows td:first-child, #callout-list td:first-child { white-space: nowrap; }
#archived-routes, #route-roster:not(:empty) { margin-top: 1rem; }
#route-workbook, #route-draft { margin-block: .75rem; }
#route-workbook input { max-width: min(100%, 25rem); }
#route-save fieldset { margin: 0; border: 1px solid var(--border); border-radius: .4rem; }
#route-stop-form { margin-top: .8rem; padding: .8rem; background: #f6f7fa; border-radius: .4rem; }
#route-stop-title { grid-column: 1 / -1; }
:is(#route-days, #route-stop-form) .check { display: flex; align-items: center; gap: .35rem; }
:is(#route-days, #route-stop-form) input[type=checkbox] { min-height: auto; width: auto; }
.route-order-grip { cursor: grab; user-select: none; margin-right: .35rem; font-weight: bold; }
.crew-editor { margin-top: .4rem; }
.crew-editor form { margin-top: .5rem; }
.coverage-receiver { padding-block: .4rem; }
.coverage-receiver .check { display: flex; align-items: center; gap: .35rem; }
.coverage-receiver input[type=checkbox] { width: auto; min-height: auto; }
#coverage-form > label { max-width: 31rem; }
[data-route-drop] td { box-shadow: inset 0 3px #a61519; }
#route-import-errors:not(:empty) { margin-top: .5rem; color: var(--red-text); }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .92rem; }
th, td { border-bottom: 1px solid #e1e5ed; padding: .56rem .5rem; vertical-align: middle; }
td small { display: block; }
td button { padding: .25rem .48rem; }
.stop { padding: .65rem 0; border-top: 1px solid var(--border); scroll-margin-top: .75rem; }
.stop:first-of-type { margin-top: .7rem; }
.stop summary { cursor: pointer; font-weight: 650; }
.stop-status { display: inline-block; padding: .1rem .45rem; border-radius: .35rem; background: #fff0ad; color: #654b00; }
.stop-status[data-status=Completed] { background: #e4f4e9; color: #155b33; }
.stop-status[data-status=Missed] { background: #fae8e9; color: #8a2028; }
.stop-status[data-status=Occupied] { background: #fed7aa; color: #7c2d12; }
.stop-status[data-status=Follow-up] { background: #111111; color: white; }
#route-progress-list { max-height: 65vh; }
#route-progress-list th { position: sticky; top: 0; background: white; z-index: 1; }
#route-progress-list .stop-status[data-status=Assigned] { background: #e9edf3; color: #344257; }
#route-progress-list tr[data-status=Open] { background: #fff8d7; }
#route-progress-list tr[data-status=Completed] { background: #edf7ef; }
.map-legend { display: flex; flex-wrap: wrap; gap: .45rem; margin-block: .6rem; }
.map-selected-stop > td, details.map-selected-stop > summary { background: #e3efff; color: #142d54; }
.map-selected-stop > td:first-child, details.map-selected-stop > summary { box-shadow: inset 4px 0 #2563a8; }
.stop-editor { margin-block: .5rem; align-items: end; }
.stop-editor input[type=checkbox] { width: 1.1rem; min-height: auto; margin: 0; }
.stop-editor .check { display: flex; align-items: center; gap: .4rem; }
.stop-editor button { align-self: end; }
#dispatch-returns { margin-block: .7rem; }
.proof { display: inline-grid; gap: .2rem; margin: .25rem; vertical-align: top; color: #214471; }
.proof img { display: block; width: 145px; max-width: 100%; height: 100px; object-fit: cover; border-radius: .3rem; }
.office-only { color: #634a05; background: #fff4d2; padding: .4rem .6rem; margin-block: .4rem; }
.office-route-editor { margin-block: .8rem; padding: .8rem; background: #f6f7fa; border-radius: .4rem; }
#field-request-form { margin-block: .8rem; }
#field-request-form textarea { width: 100%; padding: .48rem; border: 1px solid #b9c2d1; border-radius: .35rem; font: inherit; }
#field-request-form fieldset { min-width: 0; border-color: var(--border); border-radius: .35rem; }
.inspection-capture { grid-column: 1 / -1; align-items: center; }
#manager-list .check { display: flex; align-items: center; gap: .4rem; }
#manager-list input[type=checkbox] { width: 1.1rem; min-height: auto; }
#history-results:not(:empty) { margin-top: .8rem; }
#feedback:empty { display: none; }
#feedback { position: fixed; bottom: 1rem; right: 1rem; z-index: 5; max-width: min(90vw, 36rem); color: #192135; background: white; box-shadow: 0 6px 24px #19213520; border: 1px solid #aab4c5; border-radius: .4rem; padding: .7rem 1rem; }
#feedback.error { color: var(--red-text); border-color: #d6a5a7; }
@media (max-width: 900px) { .metrics { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); } }
@media (max-width: 750px) {
  .shell { display: block; }
  .handoff { grid-template-columns: 1fr; }
  aside { border-right: 0; border-bottom: 1px solid #e1e4eb; padding: .65rem .8rem; }
  aside .logo { height: 40px; width: 105px; margin-bottom: .3rem; }
  #office-nav { display: flex; flex-wrap: wrap; }
  #office-nav :is(button, a.snow-event-link) { width: auto; min-height: 40px; padding: .3rem .55rem; }
}

.route-map {
  display: block;
  width: 100%;
  height: 430px;
  border: 1px solid #d9dde6;
  border-radius: 10px;
  margin-block: 12px;
}

.snow-event-link { display: inline-block; padding: .55rem .8rem; border: 1px solid currentColor; border-radius: .55rem; color: var(--red); font-weight: 700; text-decoration: none; }
.snow-event-link:hover { background: var(--red-light); }

#portal-settings label:has(input[type=checkbox]) { display: flex; align-items: center; gap: .45rem; }
#portal-settings input[type=checkbox] { width: 1.1rem; min-height: auto; margin: 0; }
#portal-settings textarea { width: 100%; max-width: 28rem; padding: .48rem; border: 1px solid #b9c2d1; border-radius: .35rem; font: inherit; }

#office-nav #customer-workspace-nav { display: grid; align-items: stretch; gap: .3rem; width: 100%; }
#office-nav .customer-nav-name { margin: .55rem .8rem .15rem; font-size: .85rem; font-weight: 700; }
#workspace:is([data-customer-scope="cota"], [data-customer-scope="other"]) #office-nav > [data-page="customer-portals"] {
  color: var(--red-text);
  background: var(--red-light);
}
@media (max-width: 750px) { #cota-sidebar-name { flex-basis: 100%; } }
[data-customer-scope="other"] #office-nav > :not([data-page="customer-portals"]):not([data-page="server-maintenance"]):not(#customer-workspace-nav),
[data-customer-scope="other"] #route-nav { display: none; }
[data-customer-scope="other"] #office-nav > [data-page="server-maintenance"] { order: 1; }
[data-customer-scope="all-scheduled"] #office-nav > :not([data-page="customer-portals"]) { display: none; }
#all-scheduled-routes-link { color: #23334d; font-weight: 650; }
#all-scheduled-routes-link[aria-current="page"] { color: var(--red-text); }
#customer-route-detail:not(:empty) { display: grid; gap: .65rem; }

.dashboard-entry-logo { display: none; }
#workspace[data-customer-entry="true"] { grid-template-columns: minmax(0,1fr); }
#workspace[data-customer-entry="true"] > aside,
#workspace[data-customer-entry="true"] #page-description,
#workspace[data-customer-entry="true"] #portal-email-status { display: none; }
#workspace[data-customer-entry="true"] > main { max-width: 780px; margin: 0 auto; padding-top: clamp(1.5rem, 7vh, 5rem); }
#workspace[data-customer-entry="true"] .dashboard-entry-logo { display: block; margin-bottom: .9rem; }
#workspace[data-customer-entry="true"] #portal-company { min-width: min(320px, 65vw); }
#customer-overview-stats { display: flex; flex-wrap: wrap; gap: .8rem; margin: 0; }
#customer-overview-stats > div { min-width: 9rem; padding: .8rem; border: 1px solid var(--border); border-radius: .4rem; }
#customer-overview-stats dd { margin: .2rem 0 0; font-size: 1.45rem; font-weight: 700; }

#workspace[data-customer-scope="other"]:not([data-customer-entry="true"]) [aria-labelledby="portal-select-title"],
#workspace[data-customer-scope="other"] #portal-detail > .panel:has(> #portal-name) { display: none; }

.cushman-portal-link { display: inline-block; margin-block: .45rem; }
.cushman-portal-link[hidden] { display: none; }

.office-nav-section {
  margin: .7rem .8rem .15rem;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 700;
}
[data-screen="overview"] .handoff article:not(:has(button:not([hidden]))) { display: none; }
[data-screen="overview"] .handoff article .row { align-items: start; margin-top: .55rem; }
.office-route-search { display: flex; flex-wrap: wrap; align-items: end; gap: .6rem 1rem; margin-block: .8rem; }
.office-route-search input { width: min(24rem, 76vw); max-width: 100%; }
.office-route-search-miss { display: none !important; }
.office-tool-links { padding: .2rem 0; }
.cushman-portal-link {
  width: fit-content;
  padding: .45rem .7rem;
  border: 1px solid #d6a5a7;
  border-radius: .4rem;
  font-weight: 650;
  color: var(--red-text);
  background: var(--red-light);
}
@media (min-width: 751px) {
  .shell > aside { position: sticky; top: 0; align-self: start; max-height: 100dvh; overflow-y: auto; }
}
@media (max-width: 750px) {
  .office-nav-section { flex-basis: 100%; margin: .5rem 0 .1rem; }
}


.office-back-button {
  min-width: 44px;
  min-height: 44px;
  margin-bottom: .35rem;
  padding: .15rem .65rem;
  font-size: 1.25rem;
  line-height: 1;
}

.manager-preview-banner {
  margin-bottom: .85rem;
  padding: .65rem .8rem;
  border: 1px solid #d6a5a7;
  border-radius: .4rem;
  background: var(--red-light);
  color: var(--red-text);
  font-weight: 650;
}
