:root {
  --shell: #f4f1e9;
  --bg: #fbfaf6;
  --surface: #ffffff;
  --surface-soft: #f7f8f3;
  --line: #e1e4db;
  --line-strong: #ccd5c5;
  --text: #123235;
  --muted: #6f7f79;
  --faint: #9aa49e;
  --green: #2f8a2f;
  --green-dark: #247226;
  --green-soft: #e7f2e3;
  --blue: #2d6e8f;
  --blue-soft: #e7f1f6;
  --amber: #a85f12;
  --amber-soft: #fbefd9;
  --red: #b5443e;
  --red-soft: #f7e5e2;
  --shadow: 0 1px 2px rgba(18, 50, 53, .045), 0 10px 24px rgba(18, 50, 53, .032);
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  overflow-y: scroll;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.42;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 166px minmax(0, 1fr);
  transition: grid-template-columns 180ms ease;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 60px minmax(0, 1fr);
}

.sidebar {
  height: 100vh;
  position: sticky;
  top: 0;
  overflow: auto;
  background: var(--shell);
  border-right: 1px solid var(--line);
  padding: 12px 9px;
}

.brand {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font-weight: 780;
  padding: 0 6px;
  width: 100%;
  text-align: left;
}

.brand-mark {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 2px solid #697a72;
  border-radius: 7px;
  background: #dce4db;
  box-shadow: inset 0 0 0 2px var(--shell);
  font-size: 12px;
}

.brand-name {
  letter-spacing: .01em;
  white-space: nowrap;
}

.nav-create,
.nav-item {
  width: 100%;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: #304946;
  padding: 0 10px;
  text-align: left;
  font-weight: 720;
}

.nav-create {
  margin-bottom: 9px;
}

.nav-item {
  margin-top: 4px;
}

.nav-item.is-divided {
  margin-top: 13px;
  padding-top: 0;
  position: relative;
}

.nav-item.is-divided::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -8px;
  height: 1px;
  background: var(--line);
}

.nav-list {
  border-top: 1px solid var(--line);
  padding-top: 9px;
}

.nav-item.active,
.nav-item:hover,
.nav-create:hover,
.brand:hover {
  background: var(--surface);
  box-shadow: var(--shadow);
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  color: currentColor;
}

.icon-svg {
  width: 19px;
  height: 19px;
  display: block;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.brand-mark .icon-svg {
  width: 16px;
  height: 16px;
}

.icon-button .icon-svg {
  width: 18px;
  height: 18px;
}

.app-shell.sidebar-collapsed .sidebar {
  padding-inline: 8px;
}

.app-shell.sidebar-collapsed .brand,
.app-shell.sidebar-collapsed .nav-create,
.app-shell.sidebar-collapsed .nav-item {
  justify-content: center;
  padding-inline: 0;
}

.app-shell.sidebar-collapsed .brand-name,
.app-shell.sidebar-collapsed .nav-label {
  display: none;
}

.app-shell.sidebar-collapsed .nav-item.active,
.app-shell.sidebar-collapsed .nav-item:hover,
.app-shell.sidebar-collapsed .nav-create:hover,
.app-shell.sidebar-collapsed .brand:hover {
  box-shadow: 0 1px 2px rgba(18, 50, 53, .08);
}

.main-shell {
  min-width: 0;
}

.topbar {
  height: 54px;
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  background: rgba(251, 250, 246, .92);
  backdrop-filter: blur(10px);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 680;
}

.breadcrumbs strong {
  color: var(--text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.search-box {
  width: 258px;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  padding: 0 8px 0 10px;
  font-weight: 680;
}

.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-weight: 620;
}

.search-box span {
  font-size: 0;
}

.search-box span::before {
  content: "Search";
  font-size: 12.5px;
}

kbd {
  min-width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--faint);
  font: 720 11.5px var(--font);
}

.icon-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: #2b4845;
  font-weight: 760;
}

.icon-button:hover {
  background: var(--surface-soft);
  color: var(--green-dark);
}

.page {
  width: 100%;
  max-width: 1540px;
  padding: 30px 20px 42px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 16px;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.avatar {
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #edece5;
  color: #314541;
  font-weight: 760;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 27px;
  line-height: 1.12;
  letter-spacing: 0;
}

h2 {
  font-size: 19px;
  line-height: 1.18;
  letter-spacing: 0;
}

h3 {
  font-size: 15px;
  line-height: 1.22;
  letter-spacing: 0;
}

.muted {
  color: var(--muted);
  font-weight: 560;
}

.eyebrow {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.page-actions,
.button-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: #31514b;
  padding: 0 13px;
  font-weight: 740;
  text-decoration: none;
  white-space: nowrap;
}

.button:hover {
  border-color: var(--line-strong);
}

.button.primary {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.button.primary:hover {
  background: var(--green-dark);
}

.button.ghost {
  background: transparent;
}

.button.small {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12.5px;
}

.chip {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 11.5px;
  font-weight: 720;
}

.chip.info {
  color: var(--blue);
  background: var(--blue-soft);
}

.chip.warning {
  color: var(--amber);
  background: var(--amber-soft);
}

.chip.danger {
  color: var(--red);
  background: var(--red-soft);
}

.chip.muted {
  color: var(--muted);
  background: var(--surface-soft);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.grid-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}

.stack {
  display: grid;
  gap: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}

.panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(18, 50, 53, .015);
}

.panel.pad {
  padding: 16px;
}

.panel-head {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
}

.panel-body {
  padding: 14px;
}

.empty {
  min-height: 80px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.empty-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #eeeee8;
  color: #445955;
  font-weight: 740;
}

.metric {
  min-height: 88px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.metric-value {
  margin-top: 8px;
  color: var(--text);
  font-size: 23px;
  font-weight: 780;
}

.avatar.small {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

.metric .chip {
  margin-top: 7px;
}

.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfbf8;
}

.inputish,
.selectish {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: #4b625f;
  padding: 0 10px;
  font-weight: 680;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

th {
  padding: 10px 13px;
  border-bottom: 1px solid var(--line);
  background: #fbfbf8;
  color: var(--muted);
  text-align: left;
  font-weight: 740;
}

td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-weight: 610;
}

tr:last-child td {
  border-bottom: 0;
}

.side-section {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.side-section:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}

.side-section h2 {
  margin-bottom: 12px;
  font-size: 17px;
}

.field-row {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}

.field-row:last-child {
  border-bottom: 0;
}

.field-row span:first-child {
  color: var(--muted);
  font-weight: 680;
}

.linkish {
  color: var(--green);
  font-weight: 760;
}

.tabs {
  display: flex;
  gap: 20px;
  overflow: auto;
  border-bottom: 1px solid var(--line);
  padding: 0 14px;
}

.tab {
  height: 38px;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-weight: 700;
  padding: 0;
}

.tab.active {
  color: var(--text);
  border-color: var(--green);
}

.property-card,
.work-card,
.team-card,
.job-card,
.visit-card,
.mobile-card {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
}

.property-card.selected {
  border-color: var(--line-strong);
  background: #fbfdf9;
}

.property-button {
  width: 100%;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.property-button:hover {
  border-color: var(--line-strong);
}

.property-workspace {
  border: 1px solid var(--line-strong);
  background: #fbfdf9;
}

.client-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 680;
}

.client-breadcrumb button,
.request-breadcrumb button {
  border: 0;
  background: transparent;
  color: var(--green);
  padding: 0;
  font-weight: 760;
}

.client-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}

.client-cell > div:last-child {
  display: grid;
  gap: 3px;
}

.client-row {
  cursor: pointer;
}

.client-row:hover td {
  background: #fbfbf8;
}

.clients-list-layout,
.requests-list-layout {
  grid-template-columns: minmax(0, 1fr) 310px;
}

.request-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 680;
}

.request-row {
  cursor: pointer;
}

.request-row:hover td {
  background: #fbfbf8;
}

.request-title-chips {
  margin-top: 10px;
}

.request-summary-counts {
  display: grid;
  gap: 2px;
}

.request-summary-grid,
.request-note-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.request-summary-grid .wide,
.request-note-grid .wide {
  grid-column: 1 / -1;
}

.request-note-block {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 12px;
}

.request-checklist {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  font-weight: 640;
}

.request-checklist li::marker {
  color: var(--green);
}

.quote-assist .side-section h2 {
  margin-bottom: 8px;
}

.quotes-list-layout {
  grid-template-columns: minmax(0, 1fr) 310px;
}

.quote-row {
  cursor: pointer;
}

.quote-row:hover td {
  background: #fbfbf8;
}

.quote-builder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.panel-head.flush {
  min-height: auto;
  margin: -16px -16px 0;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--green);
  padding: 0;
  font: inherit;
  font-weight: 760;
  cursor: pointer;
}

.quote-source-grid .request-note-block strong {
  line-height: 1.45;
}

.quote-assist-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.quote-assist-grid .wide {
  grid-column: 1 / -1;
}

.notice {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 10px 12px;
  color: var(--text);
  font-weight: 680;
  line-height: 1.45;
}

.notice.warning {
  border-color: #e5d3aa;
  background: #fff9ea;
}

.quote-items-panel {
  overflow: hidden;
}

.quote-table-scroll {
  overflow-x: auto;
}

.quote-items-table {
  min-width: 980px;
}

.quote-items-table th:first-child,
.quote-items-table td:first-child {
  width: 48px;
  text-align: center;
}

.quote-input {
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  padding: 7px 8px;
  font: inherit;
  font-weight: 650;
}

.quote-input.mini {
  width: 76px;
}

.quote-textarea {
  min-height: 54px;
  resize: vertical;
}

.schedule-check.compact {
  min-height: auto;
  justify-content: center;
  gap: 6px;
}

.quote-totals-footer,
.quote-side-totals {
  display: grid;
  gap: 8px;
}

.quote-totals-footer {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  background: #fbfbf8;
  padding: 12px 14px;
}

.quote-totals-footer div,
.quote-side-totals div {
  display: grid;
  gap: 3px;
}

.quote-totals-footer span,
.quote-side-totals span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.quote-totals-footer strong,
.quote-side-totals strong {
  color: var(--text);
  font-weight: 780;
}

.quote-summary-panel {
  position: sticky;
  top: 18px;
}

.quote-side-totals {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 12px;
}

.quote-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 42;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: auto;
  background: rgba(18, 50, 53, .18);
  padding: 46px 18px;
}

.quote-modal {
  width: min(760px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 20px 70px rgba(18, 50, 53, .18);
  padding: 16px;
}

.quote-preview {
  width: min(720px, 100%);
}

.quote-preview-body {
  display: grid;
  gap: 14px;
  padding-top: 16px;
  line-height: 1.55;
}

.quote-preview-body h1 {
  font-size: 24px;
}

.quote-preview-body h3 {
  font-size: 15px;
}

.request-side-actions {
  margin-top: 12px;
}

.client-model-list {
  display: grid;
  gap: 7px;
}

.client-model-list span {
  min-height: 28px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 0 9px;
  font-weight: 680;
}

.client-more-wrap {
  position: relative;
}

.client-more-menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 24;
  width: 224px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 9px;
}

.client-more-menu button {
  width: 100%;
  min-height: 31px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0 9px;
  font-weight: 680;
}

.client-more-menu button:hover {
  background: var(--surface-soft);
}

.menu-context {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.client-modal-backdrop,
.request-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 38;
  display: grid;
  place-items: start center;
  overflow: auto;
  background: rgba(18, 50, 53, .18);
  padding: 46px 18px;
}

.client-modal,
.request-modal {
  width: min(760px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 20px 70px rgba(18, 50, 53, .18);
  padding: 16px;
}

.request-modal {
  width: min(860px, 100%);
}

.client-form-grid,
.request-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.client-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.client-field.wide,
.schedule-check.wide {
  grid-column: 1 / -1;
}

.client-field input,
.client-field select,
.client-field textarea {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 8px 10px;
}

.client-field textarea {
  resize: vertical;
}

.client-form-section {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.request-form-section {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.request-form-section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.property-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.route-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
}

.schedule-grid {
  display: grid;
  grid-template-columns: 66px repeat(5, minmax(145px, 1fr));
  overflow: auto;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: var(--surface);
}

.slot,
.day-head {
  min-height: 70px;
  padding: 9px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.day-head {
  min-height: 42px;
  background: #fbfbf8;
  color: var(--muted);
  font-weight: 740;
}

.time-cell {
  background: #fbfbf8;
  color: var(--muted);
  font-weight: 700;
}

.visit-card {
  min-width: 126px;
  background: #f8fcf6;
  box-shadow: 0 1px 0 rgba(18, 50, 53, .02);
}

.visit-card.info {
  background: #f1f8fb;
}

.visit-card.warning {
  background: #fff8ed;
}

.visit-card.danger {
  background: #fff3f2;
}

.schedule-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 16px;
  align-items: start;
}

.schedule-main {
  min-width: 0;
}

.schedule-toolbar {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.schedule-toolbar-group {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.schedule-date-button {
  min-width: 172px;
}

.icon-only-button {
  min-width: 30px;
  padding-inline: 0;
  font-size: 18px;
}

.schedule-menu-wrap {
  position: relative;
}

.schedule-dropdown {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 18;
  width: 280px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 9px;
}

.schedule-dropdown.compact {
  width: 138px;
}

.schedule-dropdown button {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0 9px;
  font-weight: 680;
}

.schedule-dropdown button:hover,
.schedule-dropdown button.selected {
  background: var(--surface-soft);
}

.filters-menu {
  width: 318px;
  max-height: 520px;
  overflow: auto;
}

.filters-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.filters-menu-head button {
  width: auto;
  min-height: 30px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.filter-section {
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.schedule-check {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 620;
}

.schedule-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.filter-all-button,
.team-all-button {
  width: auto;
  min-height: 28px;
  margin: 7px 0 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--text);
  padding: 0 9px;
  font-weight: 680;
}

.filter-option-row,
.team-filter-row {
  min-height: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.filter-option-row button,
.team-filter-row button {
  width: auto;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--green);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 720;
}

.type-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.schedule-type-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-soft);
}

.type-pill {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 8px;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 720;
}

.type-cell {
  display: grid;
  gap: 5px;
}

.week-calendar {
  display: grid;
  grid-template-columns: 66px repeat(var(--day-count), minmax(130px, 1fr));
  overflow: auto;
  background: var(--surface);
}

.week-head {
  min-height: 47px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fbfbf8;
}

.week-head strong {
  font-size: 12px;
  text-transform: uppercase;
}

.week-head span {
  color: var(--muted);
  font-size: 12px;
}

.week-head.today,
.schedule-day-column.today {
  background: rgba(251, 239, 217, .58);
}

.time-spacer {
  border-left: 0;
}

.time-rail {
  border-right: 1px solid var(--line);
  background: #fbfbf8;
}

.time-label {
  height: 31.5px;
  padding: 8px 8px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.time-label.half-hour {
  border-bottom-color: rgba(225, 228, 219, .36);
  padding-top: 0;
}

.schedule-day-column {
  position: relative;
  min-height: 819px;
  border-right: 1px solid var(--line);
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 62px,
      var(--line) 63px
    );
}

.schedule-drop-slot {
  height: 31.5px;
  border-bottom: 1px solid rgba(225, 228, 219, .52);
}

.schedule-drop-slot.half-hour {
  border-bottom-color: rgba(225, 228, 219, .28);
}

.schedule-drop-slot:hover {
  background: rgba(231, 242, 227, .44);
}

.schedule-visit-card {
  position: absolute;
  left: 8px;
  right: 8px;
  z-index: 2;
  display: grid;
  align-content: start;
  gap: 2px;
  min-height: 34px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--green);
  border-radius: 7px;
  background: #f8fcf6;
  color: var(--text);
  padding: 7px 8px 12px;
  box-shadow: 0 1px 2px rgba(18, 50, 53, .055);
  font-size: 12px;
}

.schedule-visit-card[data-overlap-count="2"],
.schedule-visit-card[data-overlap-count="3"],
.schedule-visit-card[data-overlap-count="4"] {
  gap: 1px;
  padding-inline: 6px;
  font-size: 11px;
}

.schedule-visit-card[data-overlap-count="2"] .muted,
.schedule-visit-card[data-overlap-count="3"] .muted,
.schedule-visit-card[data-overlap-count="4"] .muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-visit-card.warning {
  border-left-color: var(--amber);
  background: var(--amber-soft);
}

.schedule-visit-card.info {
  border-left-color: var(--blue);
  background: var(--blue-soft);
}

.schedule-visit-card.danger {
  border-left-color: var(--red);
  background: var(--red-soft);
}

.schedule-visit-card.type-cleaning-visit,
.unscheduled-card.type-cleaning-visit {
  border-left-color: var(--green);
  background: var(--green-soft);
}

.schedule-visit-card.type-quote-assessment,
.unscheduled-card.type-quote-assessment {
  border-left-color: var(--blue);
  background: var(--blue-soft);
}

.schedule-visit-card.type-request-enquiry,
.unscheduled-card.type-request-enquiry {
  border-left-color: var(--amber);
  background: var(--amber-soft);
}

.schedule-visit-card.type-task-reminder,
.unscheduled-card.type-task-reminder {
  border-left-color: var(--line-strong);
  background: var(--surface-soft);
}

.schedule-visit-card.type-issue-revisit,
.unscheduled-card.type-issue-revisit {
  border-left-color: var(--red);
  background: var(--red-soft);
}

.schedule-visit-card.type-commercial-special,
.unscheduled-card.type-commercial-special {
  border-left-color: #60777c;
  background: #edf2f2;
}

.schedule-visit-card.status-completed,
.unscheduled-card.status-completed {
  border-color: var(--line);
  border-left-color: var(--line-strong);
  background: var(--surface-soft);
  color: var(--muted);
}

.schedule-visit-card.status-risk,
.unscheduled-card.status-risk {
  outline: 1px solid var(--red);
  outline-offset: -1px;
}

tr.status-completed .type-pill {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--muted);
}

tr.status-completed .chip,
.map-list button.status-completed .chip {
  color: var(--muted);
  background: var(--surface-soft);
}

tr.status-risk td:first-child {
  box-shadow: inset 3px 0 0 var(--red);
}

.schedule-visit-card.type-issue-revisit .schedule-warning {
  color: var(--red);
}

.schedule-type-dot.type-cleaning-visit,
.type-pill.type-cleaning-visit,
.month-summary.type-cleaning-visit {
  border-color: var(--green);
  background: var(--green-soft);
}

.schedule-type-dot.type-quote-assessment,
.type-pill.type-quote-assessment,
.month-summary.type-quote-assessment {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.schedule-type-dot.type-request-enquiry,
.type-pill.type-request-enquiry,
.month-summary.type-request-enquiry {
  border-color: var(--amber);
  background: var(--amber-soft);
}

.schedule-type-dot.type-task-reminder,
.type-pill.type-task-reminder,
.month-summary.type-task-reminder {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.schedule-type-dot.type-issue-revisit,
.type-pill.type-issue-revisit,
.month-summary.type-issue-revisit {
  border-color: var(--red);
  background: var(--red-soft);
}

.schedule-type-dot.type-commercial-special,
.type-pill.type-commercial-special,
.month-summary.type-commercial-special {
  border-color: #60777c;
  background: #edf2f2;
}

.month-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 7px;
}

.schedule-visit-card strong {
  font-size: 11.5px;
}

.schedule-warning {
  color: var(--amber);
  font-size: 11px;
  font-weight: 720;
}

.resize-handle {
  position: absolute;
  left: 16px;
  right: 16px;
  height: 7px;
  border-radius: 999px;
  cursor: ns-resize;
}

.resize-handle.top {
  top: 3px;
}

.resize-handle.bottom {
  bottom: 3px;
}

.resize-handle::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 22px;
  height: 2px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(18, 50, 53, .22);
}

.resize-handle.top::after {
  top: 2px;
}

.resize-handle.bottom::after {
  bottom: 2px;
}

.resize-handle:hover::after {
  background: rgba(18, 50, 53, .38);
}

.schedule-resizing {
  cursor: ns-resize;
}

.unscheduled-panel {
  position: sticky;
  top: 70px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 11px;
  max-height: calc(100vh - 86px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

.unscheduled-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.unscheduled-list {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow-y: auto;
  padding-right: 3px;
}

.unscheduled-card {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 11px;
}

.unscheduled-card:hover {
  border-color: var(--line-strong);
}

.empty.mini {
  min-height: 70px;
}

.empty.mini .empty-icon {
  width: 38px;
  height: 38px;
}

.day-calendar {
  display: grid;
}

.day-title {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfbf8;
}

.day-grid {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  overflow: auto;
}

.day-grid .schedule-day-column {
  min-width: 420px;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(var(--month-cols, 7), minmax(100px, 1fr));
  overflow: auto;
}

.month-weekday,
.month-cell {
  min-height: 92px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px;
}

.month-weekday {
  min-height: 38px;
  background: #fbfbf8;
  color: var(--muted);
  font-weight: 740;
}

.month-cell {
  display: grid;
  align-content: start;
  gap: 7px;
}

.month-cell.today {
  background: rgba(251, 239, 217, .58);
}

.month-cell span {
  color: var(--muted);
  font-size: 12px;
}

.schedule-list {
  display: grid;
  gap: 18px;
  padding: 16px;
}

.list-group {
  display: grid;
  gap: 10px;
}

.map-shell {
  display: grid;
  grid-template-columns: 250px minmax(360px, 1fr) 230px;
  min-height: 620px;
}

.map-list,
.map-legend {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  border-right: 1px solid var(--line);
  background: #fbfbf8;
}

.map-legend {
  border-right: 0;
  border-left: 1px solid var(--line);
}

.map-list button {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  padding: 10px;
}

.map-list button.type-cleaning-visit {
  border-left: 4px solid var(--green);
  background: var(--green-soft);
}

.map-list button.type-quote-assessment {
  border-left: 4px solid var(--blue);
  background: var(--blue-soft);
}

.map-list button.type-request-enquiry {
  border-left: 4px solid var(--amber);
  background: var(--amber-soft);
}

.map-list button.type-task-reminder {
  border-left: 4px solid var(--line-strong);
  background: var(--surface-soft);
}

.map-list button.type-issue-revisit {
  border-left: 4px solid var(--red);
  background: var(--red-soft);
}

.map-list button.type-commercial-special {
  border-left: 4px solid #60777c;
  background: #edf2f2;
}

.map-list button.status-completed {
  border-left-color: var(--line-strong);
  background: var(--surface-soft);
  color: var(--muted);
}

.map-list button.status-risk {
  outline: 1px solid var(--red);
  outline-offset: -1px;
}

.mock-map {
  position: relative;
  overflow: hidden;
  background: var(--surface-soft);
}

.mock-map-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: .6;
}

.map-pin {
  position: absolute;
  z-index: 2;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--green);
  color: white;
  font-size: 12px;
  font-weight: 740;
  box-shadow: var(--shadow);
}

.map-pin.warning {
  background: var(--amber);
}

.map-pin.info {
  background: var(--blue);
}

.map-pin.danger {
  background: var(--red);
}

.map-pin.type-cleaning-visit {
  background: var(--green);
}

.map-pin.type-quote-assessment {
  background: var(--blue);
}

.map-pin.type-request-enquiry {
  background: var(--amber);
}

.map-pin.type-task-reminder {
  background: var(--muted);
}

.map-pin.type-issue-revisit {
  background: var(--red);
}

.map-pin.type-commercial-special {
  background: #60777c;
}

.map-pin.status-completed {
  background: var(--faint);
}

.map-pin.status-risk {
  outline: 2px solid var(--red);
}

.map-note {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 2;
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px 12px;
  box-shadow: var(--shadow);
}

.map-note span {
  color: var(--muted);
  font-size: 12px;
}

.visit-popover {
  position: absolute;
  z-index: 36;
  width: 296px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 16px 46px rgba(18, 50, 53, .15);
}

.visit-popover-bar {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 5px 8px 5px 11px;
  cursor: move;
}

.visit-popover-bar strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visit-popover-bar button {
  width: 26px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 760;
}

.visit-popover-bar button:hover {
  background: var(--red-soft);
  color: var(--red);
}

.visit-popover-body {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.visit-popover .field-row strong {
  min-width: 0;
  text-align: right;
}

.visit-popover .type-pill {
  justify-self: end;
}

.popover-chip-row {
  justify-content: flex-start;
  gap: 6px;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}

.lane {
  min-height: 370px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8f8f2;
}

.lane h2 {
  margin-bottom: 11px;
  font-size: 16px;
}

.job-card {
  margin-bottom: 9px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.mobile-wrap {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.phone {
  width: 318px;
  min-height: 650px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 9px solid #1f2f2d;
  border-radius: 30px;
  background: var(--bg);
  box-shadow: 0 16px 44px rgba(18, 50, 53, .14);
}

.phone-head {
  min-height: 64px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  padding: 0 16px 13px;
  border-bottom: 1px solid var(--line);
  background: var(--shell);
  font-weight: 740;
}

.phone-body {
  flex: 1;
  display: grid;
  align-content: start;
  gap: 11px;
  padding: 14px;
}

.phone-nav {
  height: 58px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.phone-nav span {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}

.portal-frame {
  max-width: 980px;
  overflow: hidden;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.portal-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 23px;
  background: var(--shell);
}

.portal-body {
  padding: 20px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  max-width: 360px;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 18px 44px rgba(18, 50, 53, .12);
  padding: 11px 13px;
  font-weight: 680;
  transition: opacity .18s ease, transform .18s ease;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.action-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 30;
  width: min(420px, 100vw);
  height: 100vh;
  transform: translateX(100%);
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: -20px 0 52px rgba(18, 50, 53, .10);
  padding: 16px;
  transition: transform .2s ease;
}

.action-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.drawer-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

@media (max-width: 1120px) {
  .app-shell,
  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }

  .app-shell.sidebar-collapsed .brand-name,
  .app-shell.sidebar-collapsed .nav-label {
    display: inline;
  }

  .app-shell.sidebar-collapsed .brand,
  .app-shell.sidebar-collapsed .nav-create,
  .app-shell.sidebar-collapsed .nav-item {
    justify-content: flex-start;
    padding-inline: 10px;
  }

  .nav-create,
  .brand {
    width: fit-content;
  }

  .topbar {
    position: static;
  }

  .grid-detail,
  .grid-4,
  .grid-3,
  .grid-2,
  .kanban,
  .settings-grid,
  .property-grid,
  .route-strip,
  .schedule-layout,
  .map-shell,
  .quote-builder-grid,
  .quote-assist-grid,
  .quote-totals-footer {
    grid-template-columns: 1fr;
  }

  .unscheduled-panel {
    position: static;
    max-height: none;
  }

  .schedule-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .map-list,
  .map-legend {
    border: 0;
    border-bottom: 1px solid var(--line);
  }

  .page-head {
    flex-direction: column;
  }

  .page-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .page {
    padding: 20px 14px 36px;
  }

  .topbar {
    align-items: flex-start;
    height: auto;
    padding: 12px 14px;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
  }

  .search-box {
    width: 100%;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  h1 {
    font-size: 25px;
  }

  .phone {
    width: 100%;
    max-width: 330px;
  }

  .schedule-date-button {
    min-width: 0;
    width: 100%;
  }

  .schedule-toolbar-group {
    width: 100%;
  }

  .schedule-dropdown,
  .filters-menu {
    left: 0;
    right: auto;
    width: min(318px, calc(100vw - 28px));
  }

  .week-calendar {
    grid-template-columns: 60px repeat(var(--day-count), minmax(128px, 1fr));
  }

  .month-grid {
    grid-template-columns: repeat(var(--month-cols, 7), minmax(92px, 1fr));
  }

  .client-form-grid,
  .request-form-grid,
  .request-summary-grid,
  .request-note-grid,
  .quote-source-grid {
    grid-template-columns: 1fr;
  }

  .quote-modal-backdrop {
    padding: 18px 12px;
  }
}

/* --- A4 Document View --- */
.a4-document-backdrop {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  justify-content: center;
  padding: 40px 18px;
  overflow-y: auto;
}

.a4-document {
  background: #fff;
  width: min(800px, 100%);
  min-height: 1056px;
  padding: 60px 48px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  margin: 0 auto;
  position: relative;
}

.a4-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid var(--border);
  padding-bottom: 24px;
  margin-bottom: 32px;
}

.a4-client-block {
  margin-bottom: 32px;
}

@media print {
  body * {
    visibility: hidden;
  }
  .a4-document, .a4-document * {
    visibility: visible;
  }
  .a4-document {
    position: absolute;
    left: 0;
    top: 0;
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: auto;
    box-shadow: none;
    border: none;
  }
  .no-print {
    display: none !important;
  }
}
