:root {
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --line: #dce3e0;
  --line-strong: #c4cfcb;
  --text: #17201e;
  --muted: #66736f;
  --brand: #0f685e;
  --brand-dark: #0c4f48;
  --brand-soft: #e7f3f0;
  --blue: #1d6685;
  --blue-soft: #eaf3f7;
  --amber: #96610a;
  --amber-soft: #fff4df;
  --danger: #a43b32;
  --danger-soft: #fff0ee;
  --sidebar: #12231f;
  --shadow: 0 8px 22px rgba(27, 45, 40, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--brand);
  border-radius: 6px;
  padding: 0 14px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

button:not(:disabled):hover {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

button.secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

button.secondary:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

button,
a,
.nav-link,
.icon-button,
.text-button,
.auth-tab,
.team-mode-tabs button,
.field-message-card,
.checklist-template-main,
.help-index-grid button,
.geocode-result,
.customer-table-wrap tr[data-customer-id],
.point-table tbody tr {
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease,
    opacity 140ms ease;
}

button:disabled:hover,
.team-mode-tabs button.is-unavailable:hover {
  border-color: inherit;
  background: inherit;
  color: inherit;
  box-shadow: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(15, 104, 94, 0.18);
  outline-offset: 2px;
}

button svg,
a svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  stroke-width: 2;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: 0;
  background: #fff;
  color: var(--text);
  padding: 10px 11px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 104, 94, 0.12);
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.combo-field {
  min-width: 220px;
}

.combo-box {
  display: block;
  min-width: 0;
  position: relative;
}

.combo-box input {
  padding-right: 42px;
}

.combo-clear-button {
  position: absolute;
  right: 6px;
  top: 50%;
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  transform: translateY(-50%);
}

.combo-clear-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  color: var(--text);
}

.combo-clear-button svg {
  width: 14px;
  height: 14px;
}

.compact-combo {
  width: min(260px, 100%);
}

.compact-combo input {
  min-height: 32px;
  padding-block: 5px;
  font-size: 11px;
}

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

h1,
h2,
h3 {
  margin-bottom: 0;
}

.hidden {
  display: none !important;
}

.icon-button.spinning svg {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-screen {
  display: grid;
  grid-template-columns: minmax(340px, 1.05fr) minmax(420px, 0.95fr);
  min-height: 100vh;
  background: var(--surface);
}

.auth-brand {
  display: grid;
  align-content: center;
  gap: 36px;
  padding: clamp(40px, 7vw, 96px);
  background: var(--sidebar);
  color: #f3f8f6;
}

.auth-brand .eyebrow {
  color: #79bdb2;
}

.auth-brand h1 {
  max-width: 620px;
  margin-top: 8px;
  font-size: 52px;
  line-height: 1.06;
}

.auth-brand p:not(.eyebrow) {
  max-width: 560px;
  margin: 18px 0 0;
  color: #b8cac5;
  font-size: 17px;
  line-height: 1.6;
}

.brand-sign {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid #55726b;
  border-radius: 8px;
  background: #1a3932;
  font-size: 18px;
  font-weight: 850;
}

.auth-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.auth-proof span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #d3e0dd;
  font-size: 13px;
  font-weight: 650;
}

.auth-proof svg {
  width: 18px;
  color: #79bdb2;
}

.auth-entry {
  display: grid;
  align-content: center;
  width: min(100%, 560px);
  margin: auto;
  padding: 36px clamp(24px, 6vw, 72px);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.auth-tab {
  min-height: 42px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
}

.auth-tab:hover,
.auth-tab.active {
  border-color: var(--brand);
  background: transparent;
  color: var(--brand-dark);
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form h2 {
  font-size: 25px;
}

.auth-form > button {
  margin-top: 6px;
}

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

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

.menu-toggle {
  position: fixed;
  top: 23px;
  left: 242px;
  z-index: 45;
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.app-shell.menu-collapsed .menu-toggle {
  left: 18px;
}

.menu-toggle:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: none;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: rgba(14, 25, 22, 0.34);
  padding: 0;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100vh;
  border-right: 1px solid #294039;
  background: var(--sidebar);
  color: #edf5f3;
  padding: 18px 14px;
  overflow: hidden;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.app-shell.menu-collapsed .sidebar {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 2px 8px 20px;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  height: 38px;
  border: 1px solid #4b665f;
  border-radius: 7px;
  background: #1b3a33;
  font-weight: 850;
}

.brand-block strong,
.brand-block span {
  display: block;
}

.brand-block strong {
  font-size: 16px;
}

.brand-block span {
  margin-top: 1px;
  color: #9fb5af;
  font-size: 11px;
}

.nav-list {
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}

.nav-link {
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 0;
  background: transparent;
  color: #b8cac5;
  padding: 0 11px;
  font-weight: 650;
}

.nav-link span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  border: 0;
  background: #233d37;
  color: #fff;
}

.nav-link.active {
  box-shadow: inset 3px 0 var(--brand);
}

.nav-link svg {
  width: 18px;
  color: #7fb3aa;
}

.sidebar-footer {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.session-box {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 9px;
  min-width: 0;
  border-top: 1px solid #344b45;
  padding: 14px 4px 0;
}

.session-box strong,
.session-box small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-box strong {
  color: #e9f1ef;
  font-size: 12px;
}

.session-box small {
  margin-top: 2px;
  color: #8fa69f;
  font-size: 10px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #2b5148;
  color: #fff;
  font-weight: 800;
}

.main-area {
  min-width: 0;
  padding-top: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 88px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  padding: 15px 24px 15px 72px;
  backdrop-filter: blur(10px);
}

.topbar h1 {
  font-size: 24px;
}

.topbar p:not(.eyebrow) {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.topbar-actions,
.section-actions,
.view-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.icon-button {
  width: 38px;
  min-width: 38px;
  padding: 0;
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

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

.icon-button.inverse {
  border-color: #3b554e;
  background: transparent;
  color: #c9d8d4;
}

.date-control {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 156px;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  padding: 0 10px;
}

.date-control svg {
  width: 16px;
  flex: 0 0 auto;
  color: var(--muted);
}

.date-control input {
  min-height: 34px;
  border: 0;
  box-shadow: none;
  padding: 0;
  font-size: 12px;
}

.workspace {
  display: grid;
  min-width: 0;
  padding: 22px 24px 40px;
}

.view {
  display: none;
  min-width: 0;
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
}

.view.active {
  display: grid;
  gap: 16px;
}

.view-toolbar {
  justify-content: flex-end;
  min-width: 0;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.content-panel,
.onboarding-band,
.map-panel,
.resource-strip {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.content-panel {
  padding: 17px;
}

.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  margin-bottom: 14px;
}

.section-title h2 {
  font-size: 18px;
}

.section-title h3 {
  font-size: 15px;
}

.section-title span {
  color: var(--muted);
  font-size: 11px;
}

.section-title.compact {
  align-items: center;
  margin-top: 18px;
  margin-bottom: 9px;
}

.text-button {
  min-height: 32px;
  border: 0;
  background: transparent;
  color: var(--brand);
  padding: 0;
  font-size: 12px;
}

.text-button:hover {
  border: 0;
  background: transparent;
  color: var(--brand-dark);
}

.onboarding-band {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(420px, 1.4fr) auto;
  align-items: center;
  gap: 22px;
  border-color: #b9d8d1;
  border-left: 4px solid var(--brand);
  background: #f5fbf9;
  padding: 18px 20px;
}

.onboarding-band h2 {
  font-size: 18px;
}

.onboarding-band p:not(.eyebrow) {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.onboarding-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 8px;
}

.onboarding-step {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.onboarding-step i {
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
  font-style: normal;
}

.onboarding-step.complete {
  color: var(--brand-dark);
}

.onboarding-step.complete i {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.metric-grid {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.overview-metrics,
.finance-metrics,
.report-metrics,
.inventory-metrics,
.sync-metrics,
.audit-metrics,
.system-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.inventory-setup-panel {
  display: grid;
  gap: 4px;
}

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

.inventory-action-card {
  justify-content: flex-start;
  min-height: 72px;
  width: 100%;
  text-align: left;
}

.inventory-action-card span {
  display: grid;
  gap: 3px;
}

.inventory-action-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.report-toolbar {
  justify-content: flex-start;
  align-items: flex-end;
}

.report-toolbar label:not(.date-control):not(.search-field) {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.report-toolbar select {
  min-width: 145px;
}

.report-search {
  flex: 1 1 260px;
  max-width: 420px;
}

.report-panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.7fr);
  gap: 12px;
}

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

.report-list-panel .activity-list {
  min-height: 210px;
  max-height: 430px;
  overflow: auto;
}

.report-pagination {
  margin: 0 -17px -17px;
}

.stock-item-table {
  min-width: 760px;
}

.stock-item-table code {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 5px;
  padding: 0 7px;
  background: #f4f6f5;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.system-toolbar > label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.health-banner {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid #a9d5cc;
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  background: #f5fbf9;
  padding: 15px 18px;
}

.health-banner.warning {
  border-color: #ead1a6;
  border-left-color: #ad721c;
  background: var(--amber-soft);
}

.health-banner.critical {
  border-color: #efb9b9;
  border-left-color: var(--danger);
  background: #fff7f7;
}

.health-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 7px;
  background: var(--brand);
  color: #fff;
}

.health-banner.warning .health-icon { background: #ad721c; }
.health-banner.critical .health-icon { background: var(--danger); }
.health-banner h2 { margin-top: 2px; font-size: 18px; }
.health-banner small,
.health-banner > span:last-child { color: var(--muted); font-size: 11px; }

.health-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
}

.component-list { display: grid; }

.component-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 11px 0;
}

.component-row:first-child { border-top: 0; }
.component-row strong,
.component-row small { display: block; }
.component-row small { margin-top: 3px; color: var(--muted); }
.system-error-table th,
.system-error-table td { white-space: nowrap; }
.system-error-table td:nth-child(3) { min-width: 280px; white-space: normal; }

.audit-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(150px, 1fr));
  align-items: end;
  justify-content: stretch;
  width: 100%;
}

.audit-toolbar .search-field {
  min-width: 0;
}

.audit-toolbar > label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.audit-table th,
.audit-table td {
  white-space: nowrap;
}

.audit-table td:nth-child(2),
.audit-table td:nth-child(3) {
  min-width: 180px;
  white-space: normal;
}

.audit-table strong,
.audit-table small {
  display: block;
}

.audit-table small {
  margin-top: 3px;
  color: var(--muted);
}

.metric-time {
  font-size: 16px !important;
  line-height: 1.25 !important;
}

.metric {
  min-width: 0;
  min-height: 108px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 15px;
  box-shadow: var(--shadow);
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin: 11px 0 7px;
  font-size: 25px;
  line-height: 1;
  overflow-wrap: anywhere;
}

.metric.accent {
  border-color: #a9d5cc;
  background: var(--brand-soft);
}

.warning-metric {
  border-color: #ead1a6;
  background: var(--amber-soft);
}

.content-panel .metric {
  min-height: 82px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 9px 15px;
  box-shadow: none;
}

.content-panel .metric:first-child {
  border-left: 0;
}

.overview-grid,
.customer-workspace,
.route-workspace,
.checklist-layout,
.integration-grid,
.report-grid {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.overview-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
}

.operation-list,
.action-list,
.activity-list {
  display: grid;
  gap: 8px;
}

.operation-item,
.action-item,
.activity-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-width: 0;
  border-top: 1px solid var(--line);
  padding: 11px 0;
}

.operation-item:first-child,
.action-item:first-child,
.activity-item:first-child {
  border-top: 0;
}

.operation-icon,
.action-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 7px;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.operation-icon svg,
.action-icon svg {
  width: 17px;
}

.operation-item strong,
.operation-item span,
.action-item strong,
.action-item span,
.activity-item strong,
.activity-item span {
  display: block;
}

.operation-item span,
.action-item span,
.activity-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.activity-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.activity-item small.warning-text {
  color: var(--amber);
  font-weight: 700;
}

.route-job-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.route-job-detail {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.route-job-facts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 10px;
}

.route-job-facts span {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
}

.route-job-facts strong,
.route-job-facts small {
  display: block;
}

.route-job-facts small {
  color: var(--muted);
  font-size: 11px;
}

.progress-track {
  width: 90px;
  height: 6px;
  border-radius: 3px;
  background: #e5ebe9;
  overflow: hidden;
}

.progress-track i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--brand);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 230px;
  padding: 30px;
  text-align: center;
  color: var(--muted);
}

.empty-state svg {
  width: 32px;
  height: 32px;
  margin-bottom: 12px;
  color: #8ca29c;
}

.empty-state h3 {
  color: var(--text);
  font-size: 16px;
}

.empty-state p {
  max-width: 320px;
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.5;
}

.planner-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
  gap: 9px;
  min-width: 0;
  width: 100%;
}

.route-editor-pane {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.route-editor-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.route-editor-grid {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.route-editor-card {
  box-shadow: none;
}

.route-editor-fields {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.route-note-field {
  grid-column: 1 / -1;
}

.route-preference-fields {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) repeat(3, minmax(150px, auto));
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.route-add-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) auto minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.route-publish-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 1.2fr) auto;
  gap: 12px;
  align-items: end;
}

.route-publish-card .section-title {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.route-start-panel {
  display: grid;
  gap: 8px;
}

.route-start-panel.hidden {
  display: none;
}

.route-start-fields {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(105px, 0.7fr) minmax(105px, 0.7fr);
  gap: 8px;
}

.route-preview-layout {
  margin-top: 0;
}

.route-pool-card .route-assignment-list {
  grid-template-columns: 1fr;
  max-height: 420px;
  overflow: auto;
  padding-right: 2px;
}

.status-line {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}

.route-assignment-panel {
  margin-bottom: 16px;
}

.route-assignment-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.route-assignment-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}

.route-assignment-list .activity-item {
  grid-template-columns: 36px minmax(0, 1fr) auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
}

.region-management-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.region-tree-panel,
.region-form-panel {
  min-width: 0;
}

.region-tree {
  min-height: 360px;
}

.region-tree ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.region-tree li ul {
  margin-top: 8px;
  padding-left: 18px;
}

.region-node {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  padding: 10px;
}

.region-node-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.region-node-icon svg {
  width: 17px;
}

.region-node-main {
  min-width: 0;
}

.region-node-main strong,
.region-node-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.region-node-main strong {
  color: var(--text);
  font-size: 13px;
}

.region-node-main small,
.region-node-count {
  color: var(--muted);
  font-size: 11px;
}

.region-node-count {
  white-space: nowrap;
}

.region-node-actions {
  justify-content: flex-end;
}

.customer-editor-form {
  width: 100%;
  max-width: none;
  margin: 0 auto;
}

.customer-editor-form textarea {
  min-height: 96px;
}

.customer-form-header .section-title,
.customer-form-actions .button-row {
  margin-bottom: 0;
}

.customer-form-grid {
  display: grid;
  grid-template-columns: minmax(520px, 1.08fr) minmax(420px, 0.92fr);
  gap: 16px;
  align-items: start;
}

.customer-form-column {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.customer-form-column .section-title.compact {
  margin-top: 0;
  margin-bottom: 0;
}

.customer-form-actions {
  display: flex;
  justify-content: flex-end;
}

.customer-form-actions .button-row {
  width: min(100%, 520px);
}

.assignment-cancel-button {
  white-space: nowrap;
}

.route-region-group {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  overflow: hidden;
}

.route-region-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

.route-region-heading strong,
.route-region-heading small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-region-actions {
  display: flex;
  gap: 6px;
}

.route-region-points {
  display: grid;
  gap: 8px;
  padding: 10px;
  max-height: 360px;
  overflow: auto;
}

.route-workspace {
  grid-template-columns: minmax(0, 1.4fr) minmax(330px, 0.6fr);
  min-height: 560px;
}

.map-panel {
  position: relative;
  overflow: hidden;
  min-height: 560px;
  padding: 0;
}

.route-map {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 560px;
  background: #e8efed;
}

.route-map[data-route-map-note]::after {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 520;
  max-width: min(360px, calc(100% - 24px));
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.96);
  padding: 8px 10px;
  color: var(--muted);
  content: attr(data-route-map-note);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  box-shadow: var(--shadow);
}

.map-legend {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 500;
  display: flex;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  padding: 8px 10px;
  color: var(--muted);
  font-size: 10px;
  box-shadow: var(--shadow);
}

.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--blue);
}

.legend-dot.route {
  background: var(--brand);
}

.route-number-marker,
.route-start-marker,
.route-draft-marker {
  display: grid;
  place-items: center;
}

.route-number-marker.leaflet-div-icon,
.route-start-marker.leaflet-div-icon,
.route-draft-marker.leaflet-div-icon {
  border: 0;
  background: transparent;
}

.route-number-marker span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 18px rgba(12, 39, 37, 0.24);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.route-start-marker span {
  display: grid;
  place-items: center;
  min-width: 82px;
  height: 28px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #143c5a;
  color: #fff;
  box-shadow: 0 8px 18px rgba(12, 39, 37, 0.24);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.stop-panel {
  max-height: 560px;
  overflow: hidden;
}

.route-stop-list {
  display: grid;
  gap: 7px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 3px;
}

.route-stop-card {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: var(--surface-soft);
}

.route-stop-card.editing {
  grid-template-columns: 30px minmax(0, 1fr) auto 68px;
  border-color: #8dbdb5;
  background: #f1f8f6;
}

.route-order-actions,
.route-move-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.route-order-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 10px;
}

.route-draft-marker span {
  display: block;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #1d6685;
  box-shadow: 0 6px 14px rgba(12, 39, 37, 0.22);
}

.route-move-actions .icon-button {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
}

.stop-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.route-stop-card strong,
.route-stop-card small {
  display: block;
}

.route-plan-note,
.route-plan-note-line {
  color: #5a4737;
  background: #fff7e8;
  border: 1px solid #f0d39d;
  border-radius: 7px;
}

.route-plan-note {
  margin-bottom: 10px;
  padding: 9px 11px;
  font-size: 12px;
}

.route-plan-note-line {
  display: inline-block;
  margin-top: 6px;
  padding: 5px 7px;
  font-size: 11px;
}

.route-stop-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.customer-note-list {
  display: grid;
  gap: 7px;
}

.customer-note-list.route-notes {
  margin-top: 8px;
}

.customer-note-list.detail-notes {
  margin: 10px 0;
}

.customer-note {
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 7px;
  background: #f7fbfd;
  padding: 8px 9px;
  color: var(--body);
}

.customer-note.important {
  border-color: #f2b8b5;
  border-left-color: #c62828;
  background: #fff1f1;
  color: #9f1c1c;
}

.customer-note strong,
.customer-note span {
  display: block;
}

.customer-note strong {
  margin-bottom: 4px;
  font-size: 10px;
}

.customer-note span {
  font-size: 11px;
  line-height: 1.45;
  white-space: normal;
}

.point-form-layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(420px, 1.1fr);
  gap: 14px;
  align-items: stretch;
  min-width: 0;
}

.point-editor-form,
.point-location-panel {
  min-width: 0;
}

.address-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  align-items: end;
}

.geocode-results {
  display: grid;
  gap: 7px;
}

.geocode-result {
  display: grid;
  justify-items: start;
  min-height: auto;
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--text);
  padding: 8px 10px;
  text-align: left;
  white-space: normal;
}

.geocode-result:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.geocode-result strong,
.geocode-result span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.geocode-result span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.geocode-empty {
  border: 1px dashed var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
}

.point-location-panel {
  display: grid;
  grid-template-rows: auto minmax(340px, 1fr) 260px auto;
  gap: 10px;
}

.point-location-map {
  min-height: 340px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e8efed;
}

.point-reference-map {
  width: 100%;
  height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f5f3;
}

.map-helper {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.detail-field-grid .empty strong {
  color: var(--muted);
}

.profile-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
  min-width: 0;
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 240px;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 3px 7px;
  font-size: 11px;
  line-height: 1.3;
}

.profile-chip strong {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

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

.resource-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.resource-strip > div {
  min-width: 130px;
  border-right: 1px solid var(--line);
  padding-right: 14px;
}

.resource-strip strong,
.resource-strip span {
  display: block;
}

.resource-strip span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.resource-strip button:first-of-type {
  margin-left: auto;
}

.search-field {
  display: flex;
  align-items: center;
  min-width: 260px;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  padding: 0 10px;
}

.search-field svg {
  width: 16px;
  color: var(--muted);
}

.search-field input {
  min-height: 34px;
  border: 0;
  box-shadow: none;
}

.customer-workspace {
  grid-template-columns: minmax(0, 1.45fr) minmax(310px, 0.55fr);
}

.customer-list-panel,
.customer-detail {
  min-height: 470px;
}

.customer-list-panel {
  overflow: hidden;
  padding: 0;
}

.customer-list-panel-wide {
  min-height: 430px;
}

.customer-list-panel > .section-title {
  min-height: 58px;
  padding: 12px 14px;
}

.customer-table-wrap {
  max-height: 430px;
  border-inline: 0;
  border-radius: 0;
}

.customer-table-wrap thead {
  position: sticky;
  z-index: 2;
  top: 0;
}

.customer-table-wrap td strong,
.customer-table-wrap td small {
  display: block;
}

.customer-table-wrap td small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.customer-pagination {
  min-height: 46px;
}

.customer-pagination > :nth-child(2) {
  margin-left: auto;
}

.customer-table-wrap tr[data-customer-id] {
  cursor: pointer;
}

.customer-table-wrap tr[data-customer-id]:hover,
.customer-table-wrap tr.selected {
  background: var(--brand-soft);
}

.customer-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.customer-detail-header h2 {
  font-size: 18px;
}

.customer-detail-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.customer-detail-page {
  display: grid;
  gap: 14px;
}

.customer-visit-journal {
  display: grid;
  gap: 12px;
}

.visit-journal-controls {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 12px;
}

.visit-journal-filters,
.visit-journal-column-box {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  background: var(--surface-soft);
}

.dynamic-filter-grid,
.column-toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.column-toggle-grid .checkbox-label {
  min-height: 30px;
  font-size: 11px;
}

.customer-visit-table-wrap {
  max-height: 460px;
}

.customer-visit-table-wrap thead {
  position: sticky;
  z-index: 2;
  top: 0;
}

.customer-visit-table-wrap td {
  vertical-align: top;
}

.customer-visit-pagination {
  margin: 0 -14px -14px;
}

.balance-display {
  text-align: right;
}

.balance-display span,
.balance-display strong {
  display: block;
}

.balance-display span {
  color: var(--muted);
  font-size: 10px;
}

.balance-display strong {
  margin-top: 4px;
  font-size: 20px;
}

.detail-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 14px;
}

.detail-facts div {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.detail-facts div:nth-child(odd) {
  padding-right: 12px;
}

.detail-facts span,
.detail-facts strong {
  display: block;
}

.detail-facts span {
  color: var(--muted);
  font-size: 10px;
}

.detail-facts strong {
  margin-top: 4px;
  font-size: 12px;
}

.detail-custom-fields {
  margin-top: 14px;
}

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

.detail-field-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 9px 10px;
}

.detail-field-grid span,
.detail-field-grid strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.detail-field-grid span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.detail-field-grid strong {
  margin-top: 3px;
  font-size: 12px;
}

.collection-history {
  margin-top: 0;
}

.team-summary {
  margin-top: -2px;
}

.team-toolbar {
  align-items: center;
}

.team-toolbar .search-field {
  flex: 1 1 360px;
}

.team-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.team-mode-tabs button {
  justify-content: center;
  min-height: 44px;
  border-color: var(--line);
  background: #fff;
  color: var(--muted);
}

.team-mode-tabs button:not(:disabled):hover,
.team-mode-tabs button.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.team-mode-tabs button.is-unavailable {
  cursor: not-allowed;
  opacity: 0.48;
}

.team-mode-tabs button.is-unavailable:hover {
  border-color: var(--line);
  background: #fff;
  color: var(--muted);
}

.team-admin-layout {
  display: grid;
  gap: 14px;
}

.team-roster-panel {
  display: grid;
  gap: 12px;
}

.location-policy-panel .section-title {
  align-items: center;
}

.location-policy-panel .section-title > svg {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: var(--surface-soft);
  color: var(--brand-dark);
}

.location-policy-form {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(140px, 0.6fr) minmax(130px, 0.5fr) minmax(130px, 0.5fr) auto;
  gap: 10px;
  align-items: end;
  min-width: 0;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.location-policy-form .checkbox-label {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 10px;
}

.location-policy-form button {
  width: 100%;
}

.location-policy-form small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

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

.user-table td:first-child strong,
.user-table td:first-child small {
  display: block;
}

.user-table td:first-child small {
  margin-top: 3px;
  color: var(--muted);
}

.user-table th,
.user-table td {
  white-space: nowrap;
}

.user-table td:first-child {
  min-width: 190px;
  white-space: normal;
}

@media (max-width: 1180px) {
  .team-admin-layout {
    grid-template-columns: 1fr;
  }

  .audit-toolbar {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .audit-toolbar .search-field {
    grid-column: span 2;
  }
}

.team-member {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #fff;
}

.team-member-main {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.team-member .avatar {
  width: 42px;
  height: 42px;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.team-member-info {
  min-width: 0;
}

.team-member-info strong,
.team-member-info small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-member-info small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.team-location-card .team-location {
  color: #b45309;
}

.team-location-card .team-location.fresh {
  color: #047857;
}

.team-member-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.team-member-meta {
  display: grid;
  gap: 7px;
  min-width: 0;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.team-member-meta span {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.team-member-meta svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.team-member-meta .team-location {
  color: #b45309;
}

.team-member-meta .team-location.fresh {
  color: #047857;
}

.team-member-meta .employee-access-summary.ready {
  color: #047857;
}

.team-member-meta .employee-access-summary.missing {
  color: #b45309;
}

.subtle-action {
  justify-self: start;
}

.employee-location-schedule {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(110px, 1fr) auto;
  gap: 8px;
  align-items: end;
  min-width: 0;
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 10px;
}

.employee-location-schedule label {
  font-size: 10px;
}

.team-location-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 12px;
}

.team-location-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 13px;
}

.field-message-form {
  display: grid;
  gap: 12px;
}

.message-toolbar {
  justify-content: space-between;
  align-items: end;
}

.message-filter-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) repeat(2, minmax(150px, 0.75fr)) minmax(130px, 0.6fr) auto;
  gap: 10px;
  align-items: end;
  flex: 1;
}

.message-filter-grid label {
  min-width: 0;
}

.checkbox-stack {
  display: grid;
  gap: 8px;
  align-content: end;
}

.field-message-stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.field-message-stat-strip article {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(59, 130, 246, 0.07), rgba(16, 185, 129, 0.06)),
    #fff;
  padding: 12px;
}

.field-message-stat-strip span {
  color: var(--muted);
  font-size: 12px;
}

.field-message-stat-strip strong {
  font-size: 24px;
}

.field-message-list {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.field-message-card {
  display: grid;
  gap: 7px;
  width: 100%;
  min-width: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  background: #fff;
  padding: 13px 14px;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.16s ease, border-left-color 0.16s ease;
}

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

.field-message-card:hover,
.field-message-card.active {
  background: #f8fafc;
}

.field-message-card.important {
  border-left-color: var(--amber);
}

.field-message-card.critical {
  border-left-color: var(--danger);
}

.field-message-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.field-message-head span:first-child {
  display: grid;
  gap: 3px;
}

.field-message-card p {
  margin: 0;
  color: var(--text);
  max-width: 920px;
}

.message-pagination {
  margin-top: 14px;
}

.field-message-detail {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(59, 130, 246, 0.06), rgba(16, 185, 129, 0.06)),
    #fff;
  padding: 14px;
  position: sticky;
  top: 18px;
}

.field-message-detail-page {
  display: grid;
  gap: 16px;
  max-width: 980px;
}

.field-message-detail-header,
.field-message-recipient {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.field-message-detail-header span:first-child,
.field-message-recipient span:nth-child(2),
.recipient-read-state {
  display: grid;
  gap: 3px;
}

.recipient-read-state {
  min-width: 118px;
  text-align: right;
}

.field-message-detail-body {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
}

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

.field-message-stat-grid article {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 10px;
}

.field-message-stat-grid span,
.field-message-recipient small {
  color: var(--muted);
  font-size: 12px;
}

.field-message-stat-grid strong {
  font-size: 20px;
}

.field-message-recipient-list {
  display: grid;
  gap: 8px;
}

.field-message-recipient {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

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

.user-access-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 10px;
}

.user-access-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.user-access-card strong,
.user-access-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-access-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.user-access-meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.user-access-meta span,
.user-access-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.user-access-meta svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.user-access-actions {
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.checklist-layout {
  grid-template-columns: minmax(260px, 0.58fr) minmax(0, 1.42fr);
  align-items: start;
}

.checklist-overview-panel .mini-metrics {
  max-width: 760px;
}

.checklist-template-list,
.checklist-workbench,
.checklist-item-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.checklist-template-card {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  padding: 11px;
}

.checklist-template-card.selected {
  border-color: #9acdc3;
  background: var(--brand-soft);
}

.checklist-template-main {
  display: flex;
  min-height: auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  text-align: left;
  white-space: normal;
}

.checklist-template-main:hover {
  border: 0;
  background: transparent;
  color: var(--text);
}

.checklist-template-main strong,
.checklist-template-main small,
.checklist-card-meta span {
  display: block;
}

.checklist-template-main small,
.checklist-card-meta {
  color: var(--muted);
  font-size: 11px;
}

.checklist-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.selected-checklist-panel {
  min-height: 260px;
}

.muted-copy {
  color: var(--muted);
  line-height: 1.5;
}

.checklist-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.checklist-facts span,
.checklist-item-row {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdfc;
  padding: 10px;
}

.checklist-facts strong,
.checklist-facts small,
.checklist-item-row strong,
.checklist-item-row small {
  display: block;
}

.checklist-facts small,
.checklist-item-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.checklist-item-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.checklist-item-order {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 800;
}

.checklist-publish-panel > button {
  justify-self: start;
}

.empty-state.compact {
  min-height: 150px;
  padding: 22px;
}

.settings-stack,
.form-stack,
.dialog-form {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.field-definition-list,
.custom-fields-form {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.custom-field-form-title {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.field-definition-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 9px 10px;
}

.field-definition-item strong,
.field-definition-item small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.field-definition-item small,
.field-flags {
  color: var(--muted);
  font-size: 10px;
}

.field-flags {
  grid-column: 1 / 3;
}

.import-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.import-preview-item {
  display: grid;
  gap: 2px;
  min-width: 120px;
  max-width: 220px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 8px;
  background: var(--surface-soft);
}

.import-preview-item.core_field {
  border-color: #9cc9c0;
  background: #f0f8f6;
}

.import-preview-item.custom_field {
  border-color: #b8c9ed;
  background: #f2f6ff;
}

.import-preview-item.unknown {
  border-color: #e8c886;
  background: #fff8e6;
}

.import-preview-item strong,
.import-preview-item small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.import-preview-item strong {
  font-size: 11px;
}

.import-preview-item small {
  color: var(--muted);
  font-size: 10px;
}

.import-preview-item select {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 7px;
  background: #fff;
  font: inherit;
  font-size: 11px;
}

.report-grid {
  grid-template-columns: 1fr 1fr;
}

.integration-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.integration-provider-panel {
  padding: 12px 14px;
}

.integration-provider-list {
  display: grid;
  gap: 7px;
}

.integration-provider {
  display: grid;
  grid-template-columns: 36px minmax(150px, 0.7fr) minmax(260px, 1.3fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  background: var(--surface-soft);
}

.integration-provider.ready {
  border-color: #8dbdb5;
  background: #f1f8f6;
}

.provider-monogram {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--text);
  color: #fff;
  font-size: 13px;
  font-weight: 850;
}

.integration-provider strong,
.integration-provider small {
  display: block;
}

.integration-provider small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.provider-capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.provider-capabilities span {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  padding: 3px 6px;
  color: var(--muted);
  font-size: 9px;
}

.integration-brand,
.integration-health {
  display: flex;
  align-items: center;
  gap: 14px;
}

.integration-logo {
  display: grid;
  place-items: center;
  flex: 0 0 52px;
  height: 52px;
  border-radius: 8px;
  background: #e84f34;
  color: #fff;
  font-size: 20px;
  font-weight: 850;
}

.integration-brand p:not(.eyebrow) {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.integration-health > span {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
}

.integration-health strong {
  color: var(--text);
  font-size: 12px;
}

.integration-grid {
  grid-template-columns: minmax(320px, 0.65fr) minmax(0, 1.35fr);
}

.mini-metrics {
  grid-template-columns: repeat(3, 1fr);
}

.sync-metrics {
  max-width: 700px;
  margin-bottom: 10px;
}

.inline-status {
  border-left: 3px solid var(--blue);
  background: var(--blue-soft);
  color: #275467;
  padding: 9px 11px;
  font-size: 11px;
}

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

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
}

.checkbox-label input {
  width: 18px;
  height: 18px;
  margin: 0;
}

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

.notice {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 2000;
  max-width: min(420px, calc(100vw - 36px));
  border: 1px solid #b9d6df;
  border-left: 4px solid var(--blue);
  border-radius: 7px;
  background: #f3fafc;
  color: #214c5d;
  padding: 12px 14px;
  box-shadow: 0 14px 34px rgba(25, 45, 50, 0.18);
}

.notice.error {
  border-color: #e0aaa5;
  border-left-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  border-radius: 999px;
  padding: 0 8px;
  background: #edf1f0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.pill.receivable,
.pill.active,
.pill.return,
.pill.synced,
.pill.succeeded,
.pill.visited {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.pill.payable,
.pill.pending,
.pill.queued,
.pill.count,
.pill.not_visited {
  background: var(--amber-soft);
  color: var(--amber);
}

.pill.running,
.pill.load,
.pill.in_progress {
  background: var(--blue-soft);
  color: var(--blue);
}

.pill.failed,
.pill.consume,
.pill.error {
  background: var(--danger-soft);
  color: var(--danger);
}

.billing-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.78fr) minmax(0, 1.22fr);
  gap: 16px;
}

.billing-settings-panel {
  align-self: start;
}

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

.feature-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 10px 12px;
}

.feature-toggle input {
  width: 18px;
  height: 18px;
}

.feature-toggle span,
.feature-toggle strong,
.feature-toggle small {
  display: block;
}

.feature-toggle small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 650;
}

.invoice-line-row td {
  background: var(--surface-soft);
  padding-top: 8px;
  padding-bottom: 8px;
}

.invoice-line-row span {
  display: inline-flex;
  margin: 3px 8px 3px 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 5px 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.invoice-line-breakdown {
  display: grid;
  gap: 8px;
}

.invoice-line-row .invoice-line-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  border-radius: 8px;
  padding: 8px 10px;
}

.invoice-line-item strong {
  color: var(--ink);
}

.invoice-line-item small {
  color: var(--muted);
  font-weight: 750;
  white-space: nowrap;
}

.table-wrap {
  min-width: 0;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: middle;
}

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

th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

td {
  font-size: 12px;
}

td:last-child,
th:last-child {
  text-align: right;
}

.entity-dialog {
  width: min(520px, calc(100vw - 28px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 0;
  box-shadow: 0 24px 70px rgba(15, 31, 27, 0.28);
}

.entity-dialog::backdrop {
  background: rgba(12, 29, 25, 0.52);
  backdrop-filter: blur(2px);
}

.dialog-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 17px;
}

.dialog-bar h2 {
  font-size: 18px;
}

.dialog-form {
  padding: 17px;
}

.danger-button {
  border-color: #dfaaa4;
  background: #fff;
  color: var(--danger);
}

.danger-button:hover {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.scale-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.scale-summary > div {
  min-width: 0;
  border-right: 1px solid var(--line);
  padding: 14px 16px;
}

.scale-summary > div:last-child { border-right: 0; }
.scale-summary span, .scale-summary strong, .scale-summary small { display: block; }
.scale-summary span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.scale-summary strong { margin-top: 3px; font-size: 25px; }
.scale-summary small { margin-top: 2px; color: var(--muted); font-size: 10px; }

.data-toolbar {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.data-toolbar .search-field {
  flex: 1 1 340px;
}

.data-toolbar select {
  width: auto;
  min-width: 145px;
}

.dense-panel { padding: 0; overflow: hidden; }

.bulk-toolbar,
.pagination-bar,
.detail-command-row,
.row-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.bulk-toolbar {
  min-height: 48px;
  border-bottom: 1px solid var(--line);
  padding: 8px 12px;
  color: var(--muted);
  font-size: 11px;
}

.selection-control { display: flex; align-items: center; gap: 7px; color: var(--text); }
.selection-control input, .point-row-check { width: 17px; height: 17px; margin: 0; }
.bulk-select { width: auto; min-width: 150px; min-height: 32px; padding-block: 5px; font-size: 11px; }
.bulk-spacer { flex: 1; }
.compact-command { min-height: 32px; padding: 0 10px; font-size: 11px; }
.compact-command.warning-command {
  margin-top: 6px;
  border-color: var(--amber);
  background: var(--amber-soft);
  color: var(--amber);
}

.point-table-wrap {
  max-height: calc(100vh - 365px);
  min-height: 390px;
  border: 0;
  border-radius: 0;
}

.point-table { min-width: 1050px; }
.point-table thead { position: sticky; z-index: 2; top: 0; }
.point-table th, .point-table td { padding: 8px 10px; }
.point-table tbody tr:hover, .point-table tbody tr.selected { background: #f1f8f6; }
.point-table td strong, .point-table td small { display: block; }
.point-table td small { max-width: 210px; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.check-column { width: 42px; text-align: center !important; }
.actions-column { width: 126px; }
.truncate-cell { display: block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.row-actions { justify-content: flex-end; }
.row-actions .icon-button { width: 30px; min-width: 30px; min-height: 30px; }
.row-actions .icon-button svg { width: 14px; height: 14px; }
.danger-icon { color: var(--danger); }
.danger-icon:hover { border-color: #dfaaa4; background: var(--danger-soft); color: var(--danger); }

.pagination-bar {
  justify-content: space-between;
  min-height: 50px;
  border-top: 1px solid var(--line);
  padding: 8px 12px;
  color: var(--muted);
  font-size: 11px;
}

.pagination-bar > div { display: flex; gap: 6px; }
.detail-command-row { flex-wrap: wrap; margin-top: 14px; }
.detail-command-row button { flex: 1 1 auto; min-height: 36px; padding: 0 10px; font-size: 11px; }
.import-format { display: grid; gap: 5px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); padding: 10px; }
.import-format code { overflow-wrap: anywhere; color: var(--muted); font-size: 10px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.help-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  align-items: center;
  gap: 28px;
  min-height: 190px;
  overflow: hidden;
  border: 1px solid #21483f;
  border-radius: 10px;
  background:
    radial-gradient(circle at 88% 10%, rgba(72, 187, 163, 0.28), transparent 34%),
    linear-gradient(135deg, #102c26 0%, #19483d 100%);
  color: #fff;
  padding: 28px 30px;
  box-shadow: var(--shadow);
}

.help-hero .eyebrow { color: #8ed8c8; }
.help-hero h2 { margin-top: 5px; font-size: clamp(24px, 3vw, 36px); line-height: 1.12; }
.help-hero p:not(.eyebrow) { max-width: 720px; margin: 10px 0 0; color: #c8ddd7; line-height: 1.65; }

.help-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.11);
  padding: 0 14px;
  backdrop-filter: blur(8px);
}

.help-search svg { flex: 0 0 auto; color: #8ed8c8; }
.help-search input { min-width: 0; border: 0; background: transparent; color: #fff; box-shadow: none; }
.help-search input::placeholder { color: #c8ddd7; }

.help-start-panel { border-left: 4px solid var(--brand); }
.help-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  counter-reset: help-step;
  list-style: none;
}

.help-flow li {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 7px;
  min-height: 175px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px;
  counter-increment: help-step;
}

.help-flow li::before {
  content: counter(help-step);
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 850;
}

.help-flow strong { font-size: 13px; }
.help-flow span { color: var(--muted); font-size: 11px; line-height: 1.55; }
.help-flow button { justify-self: start; min-height: 30px; border: 0; background: transparent; color: var(--brand-dark); padding: 0; font-size: 11px; }

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

.help-concepts article {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  padding: 15px;
}

.help-concepts svg { width: 20px; flex: 0 0 auto; color: var(--brand); }
.help-concepts strong { font-size: 12px; }
.help-concepts p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }

.help-index { padding-bottom: 15px; }
.help-index .section-title { margin-top: 0; }
.help-index-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.help-index-grid button { min-height: 32px; border-color: var(--line-strong); background: #fff; color: var(--text); padding: 0 11px; font-size: 11px; }
.help-index-grid button:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }

.help-empty { border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--surface); padding: 40px 20px; }
.help-guide { display: grid; gap: 14px; }
.help-topic { scroll-margin-top: 110px; padding: 0; overflow: hidden; }
.help-topic > header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  border-bottom: 1px solid var(--line);
  padding: 17px 18px;
}

.help-topic > header h2 { margin-top: 2px; font-size: 20px; }
.help-topic > header p:not(.eyebrow) { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.help-topic > header > button { min-height: 34px; border-color: var(--line-strong); background: #fff; color: var(--brand-dark); padding: 0 12px; font-size: 11px; }
.help-topic-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-dark); }
.help-topic-icon svg { width: 21px; }

.help-topic-body {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(270px, 0.75fr);
  gap: 18px;
  padding: 18px;
}

.help-topic-body h3 { margin-bottom: 10px; font-size: 13px; }
.help-topic-body ul,
.help-topic-body ol { display: grid; gap: 8px; margin: 0; padding-left: 20px; }
.help-topic-body li,
.help-topic-body p { color: #425650; font-size: 12px; line-height: 1.65; }
.help-topic-body aside { border-left: 3px solid #b9d8d1; border-radius: 6px; background: #f5faf8; padding: 14px 15px; }
.help-topic-body aside p { margin: 0; }
.help-topic-body aside p + p { margin-top: 10px; }
.help-topic-featured { border-color: #9bcbbf; }
.help-topic-featured > header { background: #f3faf8; }

.help-faq { display: grid; gap: 8px; padding: 18px; }
.help-faq details { border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); padding: 0 13px; }
.help-faq summary { cursor: pointer; padding: 13px 0; font-size: 12px; font-weight: 750; }
.help-faq p { margin: 0; border-top: 1px solid var(--line); padding: 12px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.65; }

@media (max-width: 1180px) {
  .scale-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scale-summary > div:nth-child(2) { border-right: 0; }
  .scale-summary > div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .help-concepts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1180px) {
  .onboarding-band {
    grid-template-columns: 1fr;
  }

  .onboarding-steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .planner-controls {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

  .planner-controls button {
    align-self: end;
  }

  .route-workspace,
  .customer-workspace,
  .visit-journal-controls,
  .customer-form-grid,
	  .point-form-layout,
	  .region-management-layout,
	  .integration-grid,
	  .billing-layout,
	  .report-panel-grid {
	    grid-template-columns: 1fr;
	  }

  .map-panel,
  .route-map,
  .point-location-map {
    min-height: 460px;
  }

  .stop-panel {
    max-height: none;
  }
}

@media (max-width: 940px) {
  .auth-brand h1 {
    font-size: 38px;
  }

  .menu-toggle,
  .app-shell.menu-collapsed .menu-toggle {
    top: 14px;
    left: 14px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 40;
    width: min(86vw, 300px);
    max-width: 300px;
    height: 100vh;
    padding: 18px 14px;
    box-shadow: 18px 0 38px rgba(14, 25, 22, 0.22);
    transform: translateX(-100%);
    opacity: 1;
    pointer-events: none;
  }

  .app-shell.menu-open .sidebar {
    transform: translateX(0);
    pointer-events: auto;
  }

  .app-shell.menu-open .menu-backdrop {
    display: block;
  }

  .brand-block {
    padding-left: 50px;
  }

  .nav-list {
    display: grid;
    grid-template-columns: 1fr;
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: 0;
  }

  .nav-link {
    justify-content: flex-start;
  }

  .sidebar-footer {
    display: block;
  }

  .topbar {
    position: static;
    padding-left: 68px;
  }

  .overview-grid,
  .checklist-layout,
  .checklist-facts,
  .help-hero,
  .help-topic-body {
    grid-template-columns: 1fr;
  }

  .overview-metrics,
  .finance-metrics,
  .report-metrics,
  .sync-metrics,
  .audit-metrics,
  .system-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .health-grid {
    grid-template-columns: 1fr;
  }

  .team-grid,
  .team-location-grid,
  .user-access-list {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 760px) {
  .auth-screen {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    gap: 18px;
    min-height: 280px;
    padding: 28px 22px;
  }

  .auth-brand h1 {
    font-size: 34px;
  }

  .auth-proof {
    display: none;
  }

  .auth-entry {
    padding: 28px 20px;
  }

  .topbar {
    align-items: flex-start;
    padding: 14px 16px;
  }

  .topbar p:not(.eyebrow) {
    display: none;
  }

  .workspace {
    padding: 16px;
  }

  .nav-list {
    display: grid;
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: 0;
  }

  .nav-link {
    flex: initial;
    width: auto;
    min-width: 0;
  }

  .view-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

	  .view-toolbar > * {
	    flex: 1 1 180px;
	  }

	  .report-toolbar .report-search {
	    flex-basis: 100%;
	    max-width: none;
	  }

  .planner-controls {
    grid-template-columns: 1fr 1fr;
  }

  .route-editor-fields,
  .route-preference-fields,
  .route-add-grid,
  .route-publish-card,
  .route-start-fields {
    grid-template-columns: 1fr 1fr;
  }

  .route-add-grid button,
  .route-publish-card button {
    width: 100%;
  }

  .resource-strip,
  .integration-hero,
  .integration-health {
    align-items: stretch;
    flex-direction: column;
  }

  .resource-strip > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 9px;
  }

  .resource-strip button:first-of-type {
    margin-left: 0;
  }

	  .team-grid,
	  .team-location-grid,
	  .user-access-list,
	  .report-grid,
	  .report-panel-grid {
	    grid-template-columns: 1fr;
	  }

  .location-policy-form {
    grid-template-columns: 1fr 1fr;
  }

  .audit-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .audit-toolbar .search-field {
    grid-column: 1 / -1;
  }

  .health-banner {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .health-banner > span:last-child {
    grid-column: 2;
  }
}

@media (max-width: 560px) {
  .route-editor-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .route-editor-fields,
  .route-preference-fields,
  .route-add-grid,
  .route-publish-card,
  .route-start-fields {
    grid-template-columns: 1fr;
  }

  .scale-summary {
    grid-template-columns: 1fr;
  }

  .scale-summary > div,
  .scale-summary > div:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .scale-summary > div:last-child {
    border-bottom: 0;
  }

  .team-toolbar {
    align-items: stretch;
  }

  .team-mode-tabs {
    grid-template-columns: 1fr;
  }

  .location-policy-form {
    grid-template-columns: 1fr;
  }

  .team-member-main {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .team-member-actions {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .employee-location-schedule {
    grid-template-columns: 1fr;
  }

  .bulk-toolbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .bulk-spacer {
    display: none;
  }

  .bulk-select,
  .compact-combo {
    width: 100%;
  }

  .integration-provider {
    grid-template-columns: 36px minmax(0, 1fr) auto;
  }

  .provider-capabilities {
    grid-column: 1 / -1;
  }

  .route-stop-card.editing {
    grid-template-columns: 30px minmax(0, 1fr) 68px;
  }

  .region-node {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .region-node .pill,
  .region-node-count,
  .region-node-actions {
    grid-column: 2;
    justify-self: start;
  }

  .route-stop-card.editing > .pill {
    display: none;
  }

  .point-table-wrap {
    max-height: 520px;
  }

  .topbar {
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions .date-control {
    flex: 1;
  }

  .overview-metrics,
  .finance-metrics,
  .report-metrics,
  .sync-metrics,
  .system-metrics,
  .mini-metrics,
  .detail-field-grid,
  .message-filter-grid,
  .field-message-stat-strip,
  .field-message-stat-grid,
  .inventory-action-grid,
  .onboarding-steps,
  .field-row,
  .button-row,
  .planner-controls {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 92px;
  }

  .content-panel .metric {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .content-panel .metric:first-child {
    border-top: 0;
  }

  .map-panel,
  .route-map,
  .point-location-map {
    min-height: 380px;
  }

  .search-field {
    min-width: 0;
  }

  .section-title {
    align-items: stretch;
    flex-direction: column;
  }

  .field-message-detail {
    position: static;
  }

  .field-message-recipient {
    flex-wrap: wrap;
  }

  .help-concepts {
    grid-template-columns: 1fr;
  }

  .help-topic > header {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .help-topic > header > button {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .help-topic-body aside {
    border-top: 3px solid #b9d8d1;
    border-left: 0;
  }

  .recipient-read-state {
    width: 100%;
    text-align: left;
  }

  .address-search-row {
    grid-template-columns: 1fr;
  }

}
