.tracking-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, .7fr);
  gap: 16px;
}

.tracking-layout .fleet-card { min-height: 660px; }

.summary-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.summary-strip span { padding-right: 12px; border-right: 1px solid var(--line); }
.summary-strip span:last-child { border: 0; }
.summary-strip strong { color: var(--ink); font-size: 15px; }
.setup-banner { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; padding: 15px 17px; border: 1px solid #f0c49f; border-radius: 14px; background: #fff4e9; }
.setup-banner[hidden] { display: none; }
.setup-banner div { display: grid; gap: 3px; }
.setup-banner b { color: #843d16; font-size: 13px; }
.setup-banner span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.person-cell { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.person-cell .avatar { width: 34px; height: 34px; font-size: 11px; }
.cell-note { display: block; color: var(--muted); margin-top: 4px; max-width: 360px; }
.row-actions { display: flex; gap: 7px; white-space: nowrap; }
.compact { min-height: 34px; padding: 0 10px; border-radius: 9px; font-size: 12px; }
.danger { color: #a33831; border-color: #efcbc7; background: #fff9f8; }
.empty-cell { text-align: center !important; color: var(--muted); padding: 34px !important; }
.field-help { color: var(--muted); font-size: 11px; line-height: 1.45; }
.assignment-summary { display: grid; gap: 4px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fffaf6; }
.assignment-summary b { font-size: 13px; }
.assignment-summary span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.data-table td .tag { white-space: nowrap; }
.courier-table { min-width: 900px; }
button:disabled { cursor: not-allowed; opacity: .5; }

@media (max-width: 1100px) {
  .tracking-layout { grid-template-columns: 1fr; }
  .tracking-layout .fleet-card { min-height: 0; }
}

@media (max-width: 650px) {
  .summary-strip { overflow: auto; }
  .setup-banner { align-items: flex-start; flex-direction: column; }
  .topbar { align-items: flex-start; }
  .top-actions { flex-wrap: wrap; justify-content: flex-end; }
}

/* Customer Hub */
.crm-root { min-height: 620px; }
.crm-state { display: grid; min-height: 220px; align-content: center; justify-items: center; gap: 10px; padding: 26px; color: var(--muted); text-align: center; }
.crm-state b { color: var(--ink); }
.crm-state.error b { color: #9c3c31; }
.crm-welcome { display: grid; max-width: 760px; min-height: 430px; margin: 48px auto; padding: 54px; align-content: center; justify-items: start; gap: 12px; }
.crm-welcome h2 { margin: 3px 0; font: 700 28px Manrope,sans-serif; }
.crm-welcome p { max-width: 620px; margin: 0; color: var(--muted); line-height: 1.65; }
.crm-welcome-points { display: flex; flex-wrap: wrap; gap: 9px 18px; margin: 10px 0; color: #7b4a2e; font-size: 12px; font-weight: 700; }
.crm-welcome-points span { display: inline-flex; align-items: center; gap: 5px; }
.crm-welcome-points .icon { width: 15px; color: var(--forest); }
.crm-workspace { display: grid; grid-template-columns: minmax(270px, .43fr) minmax(0, 1.57fr); gap: 18px; min-height: calc(100vh - 145px); }
.crm-customer-list, .crm-detail { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.crm-customer-list { display: flex; flex-direction: column; }
.crm-search-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; padding: 15px 14px 10px; }
.crm-search { display: grid; grid-template-columns: 18px minmax(0,1fr); align-items: center; gap: 8px; min-height: 42px; padding: 0 11px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--muted); }
.crm-search:focus-within { border-color: #dc8b58; box-shadow: 0 0 0 3px rgba(216,100,31,.08); }
.crm-search .icon { width: 15px; }
.crm-search input { min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 11px; }
.crm-search-row select { max-width: 92px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); font: inherit; font-size: 10px; }
.crm-advanced-filters { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; padding: 0 14px 10px; }
.crm-advanced-filters select, .crm-advanced-filters input { min-width: 0; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font: inherit; font-size: 9px; }
.crm-usage { display: grid; grid-template-columns: 1fr auto; gap: 7px; padding: 0 15px 12px; color: var(--muted); font-size: 9px; }
.crm-usage button { padding: 0; border: 0; background: transparent; color: var(--forest); font: inherit; font-weight: 700; }
.crm-usage i { height: 3px; overflow: hidden; border-radius: 99px; background: #eee8e3; }
.crm-usage i { grid-column: 1 / -1; }
.crm-usage b { display: block; height: 100%; border-radius: inherit; background: var(--forest); }
.crm-list-body { min-height: 0; overflow-y: auto; flex: 1; }
.crm-customer-row { display: grid; grid-template-columns: 38px minmax(0,1fr) 8px; align-items: center; gap: 10px; width: calc(100% - 12px); min-height: 70px; margin: 0 6px; padding: 10px 9px; border: 0; border-bottom: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); text-align: left; }
.crm-customer-row:hover, .crm-customer-row.selected { background: #fff5eb; }
.crm-customer-row.selected { box-shadow: inset 3px 0 var(--forest); }
.crm-customer-row .avatar { width: 34px; height: 34px; background: #ffe5c9; font-size: 10px; }
.crm-customer-row > span:nth-child(2) { display: grid; gap: 4px; min-width: 0; }
.crm-customer-row b { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.crm-customer-row b em { margin-left: 5px; color: var(--forest); font-size: 7px; font-style: normal; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.crm-customer-row small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.crm-customer-row > i { width: 6px; height: 6px; border-radius: 50%; background: #55a96b; }
.crm-customer-row > i.archived { background: #a7a19d; }
.crm-customer-row > i.risk { background: #d44f42; }
.crm-list-empty, .crm-detail-empty { display: grid; min-height: 360px; align-content: center; justify-items: center; gap: 9px; padding: 26px; color: var(--muted); text-align: center; }
.crm-list-empty b, .crm-detail-empty b { color: var(--ink); }
.crm-list-empty small, .crm-detail-empty small { max-width: 260px; line-height: 1.5; }
.crm-list-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; color: var(--muted); font-size: 9px; }
.crm-list-foot div { display: flex; gap: 5px; }
.crm-list-foot .icon-btn { width: 30px; min-height: 30px; }
.crm-detail { overflow-y: auto; }
.crm-detail-head { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 14px; min-height: 102px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.crm-detail-head > .avatar { width: 48px; height: 48px; background: #ffe5c9; }
.crm-detail-head > div:nth-child(3) { min-width: 0; }
.crm-detail-head > div:nth-child(3) > div { display: flex; align-items: center; gap: 9px; }
.crm-detail-head h2 { margin: 0; font: 700 18px Manrope,sans-serif; }
.crm-detail-head small { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; }
.crm-detail-actions { display: flex; gap: 7px; }
.crm-mobile-back { display: none; }
.crm-facts { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1px; padding: 13px 20px; border-bottom: 1px solid var(--line); background: #f4efeb; }
.crm-facts > div { display: grid; grid-template-columns: 18px minmax(0,1fr); align-items: center; gap: 8px; padding: 4px 10px; border-right: 1px solid #dfd5cd; background: #fff; }
.crm-facts > div:first-child { border-radius: 10px 0 0 10px; }
.crm-facts > div:last-child { border: 0; border-radius: 0 10px 10px 0; }
.crm-facts .icon { width: 15px; color: var(--muted); }
.crm-facts span { display: grid; min-width: 0; gap: 2px; }
.crm-facts small { color: var(--muted); font-size: 8px; }
.crm-facts b { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.crm-tabs { display: flex; gap: 28px; min-height: 49px; align-items: end; padding: 0 22px; border-bottom: 1px solid var(--line); }
.crm-tabs a { height: 49px; padding-top: 18px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 10px; font-weight: 700; text-decoration: none; }
.crm-tabs a:first-child, .crm-tabs a:hover { border-bottom-color: var(--forest); color: var(--ink); }
.crm-detail-grid { display: grid; grid-template-columns: minmax(0,1fr) 190px; gap: 13px; padding: 14px; background: #faf8f6; }
.crm-detail-grid > main { display: grid; align-content: start; gap: 13px; }
.crm-detail-grid > aside { display: grid; align-content: start; gap: 13px; }
.crm-panel, .crm-side-card { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.crm-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.crm-panel-head > div { display: grid; gap: 3px; }
.crm-panel-head h3, .crm-side-card h3 { margin: 0; font: 700 12px Manrope,sans-serif; }
.crm-panel-head span { color: var(--muted); font-size: 9px; }
.crm-count { display: inline-grid; min-width: 18px; height: 18px; margin-left: 4px; place-items: center; border-radius: 99px; background: #fff0e4; color: var(--forest)!important; }
.crm-timeline { padding: 8px 14px 12px; }
.crm-timeline article { position: relative; display: grid; grid-template-columns: 31px minmax(0,1fr) auto; gap: 10px; min-height: 78px; padding: 12px 0; }
.crm-timeline article:not(:last-child) { border-bottom: 1px solid var(--line); }
.crm-event-icon { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: #fff0e4; color: var(--forest); }
.crm-event-icon .icon { width: 14px; }
.crm-timeline article > div { display: grid; align-content: start; gap: 4px; }
.crm-timeline b { font-size: 10px; }
.crm-timeline small, .crm-timeline article > div > span { color: var(--muted); font-size: 8px; line-height: 1.45; }
.crm-note { display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 10px; margin: 10px; padding: 13px; border-radius: 11px; background: #fff5eb; }
.crm-note > span { color: var(--forest); }
.crm-note .icon { width: 15px; }
.crm-note p { display: grid; gap: 8px; margin: 0; font-size: 10px; line-height: 1.5; }
.crm-note small { color: var(--muted); font-size: 8px; }
.crm-address-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; padding: 10px; }
.crm-address-card { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 11px; }
.crm-address-card > div { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.crm-address-card .icon-btn { width: 26px; min-height: 26px; border: 0; }
.crm-address-card b { font-size: 10px; }
.crm-address-card p { margin: 6px 0 0; color: var(--muted); font-size: 8px; line-height: 1.55; }
.crm-contact-list { display: grid; }
.crm-contact-list article { display: grid; grid-template-columns: 35px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.crm-contact-list article:last-child { border: 0; }
.crm-contact-list .avatar { width: 32px; height: 32px; font-size: 9px; }
.crm-contact-list article > div { display: grid; gap: 3px; }
.crm-contact-list b { font-size: 10px; }
.crm-contact-list small { color: var(--muted); font-size: 8px; }
.crm-panel-empty, .crm-panel-locked { padding: 28px; color: var(--muted); font-size: 10px; text-align: center; }
.crm-panel-locked { background: #faf8f6; }
.crm-side-card { display: grid; gap: 10px; padding: 14px; }
.crm-side-card > b { font-size: 10px; }
.crm-side-card p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.crm-side-card > small { color: var(--muted); font-size: 8px; }
.crm-side-card .text-button { padding-top: 4px; font-size: 9px; text-align: left; }
.crm-side-metric { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 9px; }
.crm-side-metric b { color: var(--ink); font-size: 9px; }
.crm-health-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.crm-health-card > strong { font: 700 25px Manrope,sans-serif; }
.crm-health { padding: 4px 7px; border-radius: 99px; background: #eef0ed; color: #68716c; font-size: 8px; font-weight: 800; }
.crm-health.healthy { background: #e7f5e9; color: #28723d; }
.crm-health.watch { background: #fff0da; color: #9a651e; }
.crm-health.at_risk { background: #fff0ee; color: #a33831; }
.crm-health-metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; }
.crm-health-metrics span { display: grid; gap: 2px; padding: 7px 4px; border-radius: 8px; background: #faf7f4; color: var(--muted); font-size: 7px; text-align: center; }
.crm-health-metrics b { color: var(--ink); font-size: 10px; }
.crm-focus-card { border-color: #efd9c8; background: #fffaf6; }
.crm-focus-card .report-spinner { width: 16px; height: 16px; }
.crm-focus-reasons { display: flex; flex-wrap: wrap; gap: 5px; }
.crm-focus-reasons span { padding: 4px 7px; border-radius: 999px; background: #fff0e4; color: var(--orange-dark); font-size: 7px; font-weight: 750; }
.crm-stage-select { width: 100%; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font: inherit; font-size: 10px; }
.crm-custom-field-rows { display: grid; gap: 7px; margin: 14px 0; }
.crm-custom-field-rows > div { display: grid; grid-template-columns: minmax(0,.75fr) minmax(0,1.25fr); gap: 7px; }
.crm-custom-field-rows input { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 9px; font: inherit; font-size: 10px; }
.crm-form-modal { width: min(620px,100%); }
.crm-form > p { margin: 4px 0 18px; color: var(--muted); font-size: 12px; }
.crm-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 12px; }
.crm-form-grid .field { min-width: 0; }
.crm-span { grid-column: 1 / -1; }
.crm-form-section { margin: 12px 0 2px; padding-top: 12px; border-top: 1px solid var(--line); }
.crm-check { display: flex; align-items: flex-start; gap: 9px; margin: 13px 0; color: var(--ink); font-size: 11px; font-weight: 700; line-height: 1.45; }
.crm-check input { width: 17px; height: 17px; accent-color: var(--forest); }
.dispatch-save-toggle { display:flex; align-items:center; gap:12px; margin:14px 0; padding:13px 14px; border:1px solid var(--line); border-radius:13px; background:#fffaf6; cursor:pointer; }
.dispatch-save-toggle>span { display:grid; gap:2px; flex:1; }
.dispatch-save-toggle b { font-size:12px; }
.dispatch-save-toggle small { color:var(--muted); font-size:10px; line-height:1.4; }
.dispatch-save-toggle input { position:absolute; opacity:0; pointer-events:none; }
.dispatch-save-toggle i { width:42px; height:24px; padding:3px; border-radius:99px; background:#c9c2bd; transition:.18s ease; }
.dispatch-save-toggle i:after { content:''; display:block; width:18px; height:18px; border-radius:50%; background:#fff; box-shadow:0 1px 4px #5e3b2738; transition:.18s ease; }
.dispatch-save-toggle input:checked+i { background:var(--forest); }
.dispatch-save-toggle input:checked+i:after { transform:translateX(18px); }
.dispatch-save-toggle input:focus-visible+i { outline:3px solid #f6b98f; outline-offset:2px; }
.dispatch-save-toggle input:disabled+i { opacity:.62; }
.address-location-feedback { display: grid; gap: 8px; }
.address-normalization { display:flex; align-items:flex-start; gap:7px; min-height:20px; color:var(--muted); font-size:12px; line-height:1.45; }
.address-normalization:before { content:''; width:7px; height:7px; flex:none; border-radius:50%; background:#c4bbb5; }
.address-normalization.loading:before { border:2px solid #ead8ca; border-top-color:var(--forest); background:transparent; animation:report-spin .8s linear infinite; }
.address-normalization.success { color:#3a7a4c; }
.address-normalization.success:before { content:'✓'; width:15px; height:15px; display:grid; place-items:center; color:#fff; background:#4f9b62; font-size:9px; }
.address-normalization.error { color:#a94135; }
.address-normalization.error:before { background:#d45b4d; }
.address-normalization.warning { color:#843d16; }
.address-normalization.warning:before { margin-top:4px; background:#d8641f; }
.address-location-actions { display:flex; align-items:center; flex-wrap:wrap; gap:8px; padding:10px 11px; border:1px solid #efcfb6; border-radius:11px; background:#fff8f1; }
.address-location-actions[hidden] { display:none; }
.address-location-actions .text-button, .address-location-actions .ghost { min-height:40px; }
.crm-form textarea { width: 100%; resize: vertical; padding: 12px; border: 1px solid var(--line); border-radius: 11px; outline: 0; font: inherit; }
.crm-form textarea:focus { border-color: var(--forest); }
#modal:has(.dispatch-create-modal) { justify-items: end; padding: 0; animation: dispatch-backdrop-in 180ms ease-out both; }
.dispatch-create-modal { width: min(540px,100%); height: 100vh; max-height: 100vh; padding: 25px 28px; border-radius: 20px 0 0 20px; will-change: transform; animation: dispatch-sheet-in 320ms cubic-bezier(.22,1,.36,1) both; }
#modal.is-closing:has(.dispatch-create-modal) { pointer-events: none; animation: dispatch-backdrop-out 220ms ease-in both; }
#modal.is-closing .dispatch-create-modal { animation: dispatch-sheet-out 240ms cubic-bezier(.4,0,1,1) both; }
@keyframes dispatch-sheet-in { from { transform: translate3d(104%,0,0); } to { transform: translate3d(0,0,0); } }
@keyframes dispatch-sheet-out { from { transform: translate3d(0,0,0); } to { transform: translate3d(104%,0,0); } }
@keyframes dispatch-backdrop-in { from { background-color: rgba(33,17,11,0); } to { background-color: rgba(33,17,11,.67); } }
@keyframes dispatch-backdrop-out { from { background-color: rgba(33,17,11,.67); } to { background-color: rgba(33,17,11,0); } }
@media (prefers-reduced-motion: reduce) {
  #modal:has(.dispatch-create-modal), #modal.is-closing:has(.dispatch-create-modal), .dispatch-create-modal, #modal.is-closing .dispatch-create-modal, .page-transition-fallback { animation: none; }
}

/* Country-aware phone entry */
.phone-composite { display: grid; grid-template-columns: minmax(104px,auto) minmax(0,1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: border-color .16s ease, box-shadow .16s ease; }
.phone-composite:focus-within { border-color: var(--orange-dark); box-shadow: 0 0 0 3px rgba(216,100,31,.11); }
.phone-composite select, .phone-composite input { min-height: 44px; border: 0 !important; border-radius: 0 !important; background: transparent; box-shadow: none !important; }
.phone-composite select { width: auto; padding-right: 28px; border-right: 1px solid var(--line) !important; color: var(--ink); font-weight: 750; }
.phone-composite input { min-width: 0; }
.field-help.field-error { color: #a33831; }
.phone-composite input[aria-invalid="true"] { color: #a33831; }
.crm-history-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fbf8f5; }
.crm-history-toolbar select { width: auto; min-height: 36px; padding: 6px 30px 6px 10px; }
.crm-history-toolbar span { color: var(--muted); font-size: 11px; }
.crm-history-row { cursor: pointer; grid-template-columns: auto minmax(0,1fr) auto auto !important; transition: background .16s ease, transform .16s ease; }
.crm-history-row:hover, .crm-history-row:focus-visible { background: #fff8f1; }
.crm-history-row .text-button { align-self: center; }
.crm-history-more { display: block; width: calc(100% - 24px); margin: 12px; }
.customer-message-intro { margin-top: 24px; }
.customer-message-settings { display: grid; gap: 0; padding: 22px; }
.customer-message-setting-row { display: grid; grid-template-columns: minmax(220px,.7fr) minmax(420px,1.3fr); gap: 24px; padding: 0 0 22px; }
.customer-message-setting-row + .customer-message-setting-row { padding-top: 22px; border-top: 1px solid var(--line); }
.customer-message-setting-row > div:first-child h3 { margin: 0 0 6px; font: 750 18px Manrope,sans-serif; }
.customer-message-setting-row > div:first-child p { margin: 0; color: var(--muted); line-height: 1.55; }
.setting-title-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.setting-title-line h3 { margin-bottom: 0 !important; }
.recommended-chip { padding: 4px 7px; border-radius: 999px; background: #eaf5ec; color: #28643a; font: 750 9px Manrope,sans-serif; letter-spacing: .02em; }
.customer-message-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.customer-message-options button { display: grid; grid-template-columns: 36px 1fr; gap: 2px 10px; min-height: 112px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; }
.customer-message-options button > span { display: grid; grid-row: 1 / span 2; width: 36px; height: 36px; place-items: center; border-radius: 11px; background: #fff0e4; color: var(--orange-dark); }
.customer-message-options button b { align-self: end; font: 750 13px Manrope,sans-serif; }
.customer-message-options button small { color: var(--muted); line-height: 1.4; }
.customer-message-options button.selected { border-color: var(--orange-dark); background: #fff8f1; box-shadow: 0 0 0 2px rgba(216,100,31,.09); }
.customer-message-options button:focus-visible { outline: 3px solid rgba(216,100,31,.25); outline-offset: 2px; }
.customer-message-options button:disabled { cursor: not-allowed; opacity: .68; }
.proof-delivery-privacy { display: flex; align-items: flex-start; grid-column: 2; gap: 8px; margin: -8px 0 0; padding: 10px 12px; border-radius: 11px; background: #f8f5f2; color: var(--muted); font-size: 11px; line-height: 1.5; }
.proof-delivery-privacy .icon { flex: none; width: 16px; color: var(--orange-dark); }
.proof-delivery-privacy b { color: var(--ink); }
.customer-message-settings > footer { display: flex; justify-content: space-between; grid-column: 1 / -1; gap: 14px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); }
.customer-settings-state { grid-column: 1 / -1; margin-top: 12px; padding: 9px 11px; border-radius: 9px; color: var(--muted); background: #f8f5f2; font-size: 11px; }
.customer-settings-state.saved { color: #28643a; background: #eaf5ec; }
.customer-settings-state.error { color: #933b32; background: #fff0ee; }
.customer-send-note { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: #fff8f1; color: var(--muted); font-size: 12px; }
.customer-send-note .icon { color: var(--orange-dark); }
.dispatch-proof-card-wrap { display: grid; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.dispatch-proof-card-wrap .dispatch-proof-card { border: 0; border-radius: 0; }
.proof-send-action { justify-content: center; margin: 0 12px 12px; }
@media (max-width: 420px) { .phone-composite { grid-template-columns: 102px minmax(0,1fr); } }
@media (max-width: 820px) { .customer-message-setting-row { grid-template-columns: 1fr; } .proof-delivery-privacy { grid-column: auto; margin-top: -4px; } .customer-message-settings > footer { grid-column: auto; } }
@media (max-width: 650px) { .crm-history-toolbar { align-items: stretch; flex-direction: column; } .crm-history-toolbar select { width: 100%; } .crm-history-row { grid-template-columns: auto minmax(0,1fr) auto !important; } .crm-history-row .text-button { grid-column: 2 / -1; justify-self: start; } .customer-message-options { grid-template-columns: 1fr; } .customer-message-settings > footer { align-items: flex-start; flex-direction: column; } }
.dispatch-customer-picker { position: relative; display: grid; gap: 8px; margin: 14px 0; }
.dispatch-customer-picker > label { font-size: 12px; font-weight: 700; }
.dispatch-customer-picker > small { color: var(--muted); font-size: 10px; }
.dispatch-customer-matches { position: absolute; top: 68px; right: 0; left: 0; z-index: 20; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 16px 36px rgba(54,30,17,.16); }
.dispatch-customer-matches[hidden], .dispatch-customer-selected[hidden], .dispatch-save-customer[hidden] { display: none; }
.dispatch-customer-matches button { display: grid; grid-template-columns: 34px minmax(0,1fr) 18px; align-items: center; gap: 10px; width: 100%; min-height: 58px; padding: 9px 11px; border: 0; border-bottom: 1px solid var(--line); background: #fff; color: var(--ink); text-align: left; }
.dispatch-customer-matches button:hover { background: #fff6ed; }
.dispatch-customer-matches .avatar { width: 32px; height: 32px; font-size: 9px; }
.dispatch-customer-matches button > span:nth-child(2) { display: grid; gap: 3px; }
.dispatch-customer-matches b { font-size: 10px; }
.dispatch-customer-matches small { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.dispatch-customer-matches .icon { width: 14px; color: var(--forest); }
.dispatch-match-state { padding: 15px; color: var(--muted); font-size: 10px; text-align: center; }
.dispatch-match-state.error { color: #9c3c31; }
.dispatch-customer-selected { display: grid; gap: 9px; padding: 11px; border: 1px solid #efc9a9; border-radius: 12px; background: #fff8f1; }
.dispatch-customer-selected > div { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 9px; }
.dispatch-customer-selected .avatar { width: 32px; height: 32px; font-size: 9px; }
.dispatch-customer-selected > div > span:nth-child(2) { display: grid; gap: 3px; }
.dispatch-customer-selected b { font-size: 10px; }
.dispatch-customer-selected small { color: var(--muted); font-size: 8px; }
.dispatch-customer-selected label { display: grid; gap: 5px; color: var(--muted); font-size: 9px; }
.dispatch-customer-selected select { padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font: inherit; font-size: 10px; }

@media (max-width: 1180px) {
  .crm-detail-grid { grid-template-columns: 1fr; }
  .crm-detail-grid > aside { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .crm-address-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .crm-facts { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .crm-facts > div, .crm-facts > div:first-child, .crm-facts > div:last-child { border: 0; border-radius: 8px; }
}

@media (max-width: 760px) {
  .customers-page .main { padding-bottom: 12px; }
  .customers-page .topbar { align-items: stretch; flex-direction: column; }
  .customers-page .top-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .customers-page .top-actions .primary { grid-column: 1 / -1; }
  .customers-page .hub-current, .customers-page .app-download { display: none; }
  .crm-root { min-height: calc(100vh - 220px); }
  .crm-advanced-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .crm-advanced-filters input { grid-column: 1 / -1; }
  .crm-workspace { display: block; min-height: 0; }
  .crm-customer-list { min-height: calc(100vh - 230px); }
  .crm-detail { position: fixed; inset: 64px 0 0; z-index: 44; display: none; overflow-y: auto; border: 0; border-radius: 0; background: #faf8f6; }
  .crm-detail.mobile-open { display: block; }
  .crm-mobile-back { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
  .crm-detail-head { position: sticky; top: 0; z-index: 3; grid-template-columns: 40px 38px minmax(0,1fr); min-height: 76px; padding: 10px 12px; background: #fff; }
  .crm-detail-head > .avatar { width: 36px; height: 36px; font-size: 10px; }
  .crm-detail-head h2 { font-size: 15px; }
  .crm-detail-head small { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
  .crm-detail-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 42px; }
  .crm-facts { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 10px; }
  .crm-tabs { position: sticky; top: 124px; z-index: 2; overflow-x: auto; gap: 22px; padding: 0 14px; background: #fff; }
  .crm-tabs a { white-space: nowrap; }
  .crm-detail-grid { display: block; padding: 10px; }
  .crm-detail-grid > main, .crm-detail-grid > aside { display: grid; gap: 10px; }
  .crm-detail-grid > aside { margin-top: 10px; }
  .crm-address-grid { grid-template-columns: 1fr; }
  .crm-form-grid { grid-template-columns: 1fr; }
  .crm-custom-field-rows > div { grid-template-columns: 1fr; }
  .crm-span { grid-column: auto; }
  #modal:has(.dispatch-create-modal) { align-items: end; }
  .dispatch-create-modal { height: calc(100vh - 18px); border-radius: 18px 18px 0 0; padding: 21px 16px; }
  .crm-welcome { margin: 18px auto; padding: 27px 20px; }
  .crm-welcome h2 { font-size: 23px; }
}

@media (prefers-reduced-motion: reduce) {
  .crm-detail { scroll-behavior: auto; }
}

.settings-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 20px; padding: 22px 24px; border: 1px solid #f2d4bb; border-radius: 18px; background: linear-gradient(135deg, #fffaf6 0%, #fff 72%); }
.settings-intro h2 { margin: 5px 0 7px; font-size: clamp(20px, 3vw, 28px); }
.settings-intro p { max-width: 700px; margin: 0; color: var(--muted); line-height: 1.6; }
.beta-chip { flex: 0 0 auto; padding: 7px 10px; border: 1px solid #efc49f; border-radius: 999px; background: #fff0e4; color: #9b481d; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.channel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.channel-card { display: flex; min-height: 330px; flex-direction: column; gap: 20px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 10px 30px rgba(44, 29, 20, .04); }
.channel-card.ready { border-color: #b9dfc8; }
.channel-card.qr_pending, .channel-card.connecting { border-color: #efc49f; }
.channel-card.degraded, .channel-card.disconnected { border-color: #efc9c5; }
.channel-card-head { display: grid; grid-template-columns: 46px 1fr auto; align-items: start; gap: 12px; }
.channel-card-head h3 { margin: 2px 0 5px; font-size: 17px; }
.channel-card-head p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.channel-logo { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 14px; color: #fff; font-size: 13px; font-weight: 900; }
.pathway-channel { background: var(--forest); }
.whatsapp-channel { background: #24a867; }
.channel-state { padding: 6px 8px; border-radius: 999px; background: #f5f3f1; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.channel-state.ready { background: #e9f8ef; color: #187a44; }
.channel-state.qr_pending, .channel-state.connecting { background: #fff1e5; color: #9b481d; }
.channel-state.degraded, .channel-state.disconnected { background: #fff0ee; color: #a33831; }
.channel-card ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 12px; }
.channel-card li::before { content: '✓'; margin-right: 8px; color: var(--forest); font-weight: 900; }
.channel-explainer, .channel-locked, .connected-identity { display: grid; gap: 5px; padding: 14px; border-radius: 12px; background: #faf8f6; }
.channel-explainer span, .channel-locked span, .connected-identity small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.channel-locked { border: 1px dashed #e2d9d2; }
.channel-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.channel-footnote { margin-top: auto; color: var(--muted); font-size: 10px; line-height: 1.5; }
.qr-stage { display: grid; min-height: 340px; place-items: center; padding: 18px; text-align: center; }
.qr-stage img { width: min(100%, 320px); height: auto; border: 10px solid #fff; border-radius: 16px; box-shadow: 0 16px 40px rgba(44, 29, 20, .12); }
.qr-waiting, .qr-loading, .qr-success, .qr-error { display: grid; justify-items: center; gap: 10px; max-width: 390px; }
.qr-waiting span, .qr-loading span, .qr-success span, .qr-error span { color: var(--muted); line-height: 1.5; }
.qr-loading::before { content: ''; width: 38px; height: 38px; border: 3px solid #f0d6c1; border-top-color: var(--forest); border-radius: 50%; animation: qrPulse .8s linear infinite; }
.qr-success::before { content: '✓'; display: grid; width: 50px; height: 50px; place-items: center; border-radius: 50%; background: #e9f8ef; color: #187a44; font-size: 24px; font-weight: 900; }
.qr-error { color: #a33831; }
@keyframes qrPulse { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .channel-grid { grid-template-columns: 1fr; }
  .channel-card { min-height: 0; }
}

@media (max-width: 520px) {
  .settings-intro { flex-direction: column; padding: 18px; }
  .channel-card { padding: 17px; }
  .channel-card-head { grid-template-columns: 42px 1fr; }
  .channel-state { grid-column: 2; justify-self: start; }
  .channel-logo { width: 42px; height: 42px; }
  .channel-actions { align-items: stretch; flex-direction: column; }
  .channel-actions button { width: 100%; }
}

.developer-platform-card, .developer-locked { margin-top: 20px; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 10px 30px rgba(44, 29, 20, .04); }
.developer-locked { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.developer-locked h2, .developer-platform-head h2 { margin: 5px 0 7px; font-size: 22px; }
.developer-locked p, .developer-platform-head p { max-width: 680px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.developer-platform-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; }
.developer-usage { display: grid; gap: 8px; margin: 22px 0 8px; padding: 16px; border-radius: 14px; background: #faf7f4; }
.developer-usage > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 12px; }
.developer-usage > div:first-child span, .developer-usage small { color: var(--muted); }
.developer-usage b { font-size: 14px; }
.developer-usage small { font-size: 10px; }
.usage-track { height: 7px; overflow: hidden; border-radius: 999px; background: #e9e1db; }
.usage-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #d8641f, #f29b56); }
.api-key-list { display: grid; margin-top: 18px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.api-key-row { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 12px; min-height: 78px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.api-key-row:last-child { border-bottom: 0; }
.api-key-row.revoked { opacity: .63; background: #faf9f8; }
.api-key-glyph { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; background: #fff0e4; color: #a84d1e; font: 800 10px monospace; }
.api-key-row > div { display: grid; gap: 4px; min-width: 0; }
.api-key-row b { font-size: 12px; }
.api-key-row code { color: #744730; font-size: 10px; word-break: break-all; }
.api-key-row small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.developer-empty { display: flex; align-items: center; justify-content: center; gap: 13px; min-height: 120px; padding: 22px; color: var(--muted); }
.developer-empty > div { display: grid; gap: 4px; }
.developer-empty b { color: var(--ink); font-size: 12px; }
.developer-empty small { font-size: 10px; }
.developer-endpoints { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 18px; color: var(--muted); font-size: 10px; }
.developer-endpoints code { padding: 7px 9px; border-radius: 8px; background: #f7f4f1; color: #674333; }
.webhook-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 22px; margin: 22px 0 8px; padding: 14px 16px; border-radius: 14px; background: #faf7f4; color: var(--muted); font-size: 11px; }
.webhook-summary b { margin-right: 3px; color: var(--ink); font-size: 14px; }
.webhook-row code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scope-picker { display: grid; gap: 8px; margin: 15px 0; padding: 0; border: 0; }
.scope-picker legend { margin-bottom: 8px; font-size: 12px; font-weight: 800; }
.scope-picker label { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }
.scope-picker label:has(input:checked) { border-color: #d8641f; background: #fff7f0; }
.scope-picker span { display: grid; gap: 3px; }
.scope-picker b { font-size: 12px; }
.scope-picker small { color: var(--muted); font-size: 10px; }
.api-key-secret { text-align: left; }
.api-key-secret > .signal { margin-bottom: 12px; }
.secret-value { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; margin: 18px 0; padding: 12px; border: 1px solid #edc7a8; border-radius: 12px; background: #fff8f1; }
.secret-value code { overflow-wrap: anywhere; color: #63351f; font-size: 11px; user-select: all; }
.secret-warning { display: grid; gap: 4px; padding: 13px; border-radius: 10px; background: #fff0ee; color: #913e34; }
.secret-warning span { font-size: 10px; line-height: 1.5; }

@media (max-width: 650px) {
  .developer-platform-card, .developer-locked { padding: 17px; }
  .developer-platform-head, .developer-locked { align-items: stretch; flex-direction: column; }
  .developer-platform-head .primary { width: 100%; }
  .api-key-row { grid-template-columns: 36px minmax(0,1fr); }
  .api-key-row > button, .api-key-row > .channel-state { grid-column: 2; justify-self: start; }
  .developer-endpoints { align-items: stretch; flex-direction: column; }
  .webhook-summary { align-items: flex-start; flex-direction: column; }
  .developer-endpoints code { overflow-x: auto; }
  .secret-value { grid-template-columns: 1fr; }
  .secret-value button { width: 100%; }
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.messages-workspace { position: relative; display: grid; grid-template-columns: minmax(260px, .92fr) minmax(430px, 1.7fr) minmax(260px, .9fr); gap: 14px; height: calc(100vh - 154px); min-height: 620px; margin-top: 18px; }
.admin-data-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #efc6a9;
  border-radius: 14px;
  background: #fff2e8;
  color: #7d3f1d;
}
.admin-data-error[hidden] { display: none; }
.admin-data-error div { display: grid; gap: 3px; }
.admin-data-error span { color: #8e6650; font-size: 12px; line-height: 1.45; }
.conversation-rail, .conversation-pane, .courier-context { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.conversation-pane { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; box-shadow: 0 12px 30px rgba(58, 33, 20, .055); }
.conversation-rail-head { position: relative; padding: 16px 15px 0; border-bottom: 1px solid var(--line); }
.conversation-rail-head > div:first-child { display: none; }
.chat-admin-menu { display: none; }
.conversation-search { display: grid; grid-template-columns: 20px 1fr; align-items: center; gap: 8px; min-height: 40px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); }
.conversation-search .icon { width: 16px; }
.conversation-search input { min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 12px; }
.conversation-tabs { display: flex; align-items: center; gap: 22px; min-height: 48px; }
.conversation-tabs button { align-self: stretch; padding: 0 2px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-weight: 700; }
.conversation-tabs button.active { border-bottom-color: var(--forest); color: var(--ink); }
.conversation-tabs span { margin-left: auto; color: var(--muted); font-size: 10px; }
.conversation-list { display: grid; align-content: start; }
.conversation-row { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 70px; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: #fff; color: var(--ink); text-align: left; transition: background .16s ease; }
.conversation-row:last-child { border-bottom: 0; }
.conversation-row:hover, .conversation-row.selected { background: #fff7f0; }
.conversation-row.selected { box-shadow: inset 3px 0 var(--forest); }
.conversation-row .avatar { width: 36px; height: 36px; background: #ffead7; color: #3a2115; font-size: 11px; }
.conversation-row > span:nth-child(2) { display: grid; gap: 4px; min-width: 0; }
.conversation-row b { font-size: 12px; }
.conversation-row small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.conversation-meta { display: grid; justify-items: end; align-self: stretch; align-content: center; gap: 6px; }
.conversation-meta strong { display: grid; min-width: 20px; height: 20px; padding: 0 5px; place-items: center; border-radius: 999px; background: var(--forest); color: #fff; font-size: 9px; }
.conversation-empty { display: grid; min-height: 300px; align-content: center; justify-items: center; gap: 8px; padding: 24px; color: var(--muted); text-align: center; }
.conversation-empty .signal { color: var(--forest); }
.conversation-empty b { color: var(--ink); }
.conversation-empty small { max-width: 220px; line-height: 1.5; }
.active-chat-head { display: grid; grid-template-columns: 42px minmax(0,1fr) auto auto; align-items: center; gap: 10px; min-height: 76px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.active-chat-head > .avatar { width: 38px; height: 38px; background: #ffead7; color: #3a2115; }
.active-chat-identity { display: grid; gap: 4px; min-width: 0; }
.active-chat-identity b { overflow: hidden; font: 700 15px Manrope, sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.active-chat-identity small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.presence-dot { width: 7px; height: 7px; border-radius: 50%; background: #55a96b; }
.presence-dot.offline { background: #a8aaa8; }
.chat-mobile-inbox, .chat-mobile-close { display: none; }
.chat-context-toggle { display: grid; }
.chat-timeline { min-height: 0; overflow-y: auto; padding: 12px 16px 18px; overscroll-behavior: contain; }
.chat-history-control { display: grid; justify-items: center; gap: 6px; margin: 0 0 12px; }
.chat-history-control small { color: #a4442d; font-size: 9px; }
.chat-date { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; color: var(--muted); font-size: 9px; }
.chat-date::before, .chat-date::after { height: 1px; flex: 1; background: var(--line); content: ''; }
.chat-date span { padding: 4px 9px; border-radius: 999px; background: #faf8f6; white-space: nowrap; }
.chat-event { display: grid; grid-template-columns: 28px minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 44px; margin: 6px 0; padding: 7px 10px; border: 1px solid #e8dfd8; border-radius: 9px; background: #fcfaf8; }
.chat-event-icon { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; background: #fff0e4; color: var(--forest); }
.chat-event-icon .icon { width: 14px; }
.chat-event > div { display: grid; gap: 2px; }
.chat-event b { font-size: 10px; }
.chat-event small, .chat-event time { color: var(--muted); font-size: 9px; }
.chat-event time { white-space: nowrap; }
.workspace-message { display: grid; grid-template-columns: 30px minmax(0, 76%); align-items: end; gap: 7px; margin: 8px 0; }
.workspace-message.outgoing { grid-template-columns: minmax(0, 76%); justify-content: end; }
.workspace-message.outgoing .message-avatar { display: none; }
.workspace-message > div { min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 12px 12px 12px 4px; background: #fff; }
.workspace-message.outgoing > div { border-color: #f0dccb; border-radius: 12px 12px 4px; background: #fff0e4; }
.message-avatar { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: #ffead7; color: #3a2115; font-size: 9px; font-weight: 800; }
.workspace-message p { margin: 0; font-size: 11px; line-height: 1.5; }
.workspace-message time { display: block; margin-top: 5px; color: var(--muted); font-size: 8px; text-align: right; }
.workspace-composer { margin: 0 14px 14px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.workspace-composer:focus-within { border-color: #d99a6d; box-shadow: 0 0 0 3px rgba(216,100,31,.08); }
.workspace-composer textarea { width: 100%; min-height: 44px; resize: none; border: 0; outline: 0; color: var(--ink); font: inherit; font-size: 11px; line-height: 1.5; }
.composer-feedback { display: flex; min-height: 16px; align-items: center; justify-content: space-between; gap: 10px; }
.composer-feedback small { color: #a4442d; font-size: 9px; }
.composer-feedback small[hidden] { display: block; visibility: hidden; }
.composer-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.composer-actions small { margin-right: auto; color: var(--muted); font-size: 9px; }
.composer-feedback span { color: var(--muted); font-size: 9px; }
.composer-actions .primary { min-height: 36px; padding: 0 13px; }
.chat-state { display: grid; align-content: center; justify-items: center; gap: 9px; min-height: 360px; padding: 28px; color: var(--muted); text-align: center; }
.chat-state.compact { min-height: 200px; }
.chat-state b { color: var(--ink); }
.chat-state small { max-width: 320px; line-height: 1.5; }
.chat-loader { width: 30px; height: 30px; border: 3px solid #f0d6c1; border-top-color: var(--forest); border-radius: 50%; animation: qrPulse .8s linear infinite; }
.courier-context { overflow-y: auto; }
.context-head { display: flex; align-items: center; justify-content: space-between; min-height: 53px; padding: 0 15px; border-bottom: 1px solid var(--line); }
.context-head b { font-size: 12px; }
.context-section { display: grid; gap: 10px; padding: 17px 15px; border-bottom: 1px solid var(--line); }
.context-section:last-child { border-bottom: 0; }
.context-section > span { font-size: 10px; font-weight: 800; }
.context-section > small { color: var(--muted); font-size: 9px; }
.context-status { justify-self: start; padding: 6px 10px; border-radius: 999px; background: #f0f0ed; color: #68716c; font-size: 10px; }
.context-status.online { background: #e8f5e9; color: #246b39; }
.context-link { cursor: pointer; }
.context-link:hover { background: #fffaf6; }
.context-object { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 9px; }
.context-object i { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 8px; background: #f7f3ef; }
.context-object .icon { width: 16px; }
.context-object div { display: grid; gap: 3px; }
.context-object small { color: var(--muted); font-size: 9px; }
.context-address { display: grid; grid-template-columns: 18px 1fr; align-items: start; gap: 8px; }
.context-address .icon { width: 15px; }
.context-address b { font-size: 10px; font-weight: 500; line-height: 1.55; }
.dispatch-progress { display: grid; grid-template-columns: repeat(4,1fr); gap: 0; padding-top: 4px; }
.dispatch-progress span { position: relative; display: grid; justify-items: center; gap: 6px; color: var(--muted); text-align: center; }
.dispatch-progress span::before { position: absolute; top: 8px; left: -50%; z-index: 0; width: 100%; height: 1px; background: #ddd5cf; content: ''; }
.dispatch-progress span:first-child::before { display: none; }
.dispatch-progress i { position: relative; z-index: 1; display: grid; width: 17px; height: 17px; place-items: center; border: 1px solid #d9d1ca; border-radius: 50%; background: #fff; }
.dispatch-progress .done i, .dispatch-progress .current i { border-color: var(--forest); }
.dispatch-progress .done i { background: var(--forest); color: #fff; }
.dispatch-progress .done::before, .dispatch-progress .current::before { background: var(--forest); }
.dispatch-progress .current i::after { width: 5px; height: 5px; border-radius: 50%; background: var(--forest); content: ''; }
.dispatch-progress .icon { width: 10px; }
.dispatch-progress small { max-width: 62px; font-size: 8px; line-height: 1.3; }
.chat-drawer-scrim { display: none; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.chat-head h2 { margin-top: 4px; }
.chat-messages { display: flex; max-height: 420px; min-height: 220px; flex-direction: column; gap: 9px; overflow: auto; margin: 18px -4px; padding: 4px; }
.chat-message { display: grid; align-self: flex-start; gap: 4px; max-width: 82%; padding: 11px 13px; border-radius: 14px 14px 14px 4px; background: #f2eeea; }
.chat-message.outgoing { align-self: flex-end; border-radius: 14px 14px 4px; background: #fff0e4; }
.chat-message b, .chat-message small { font-size: 10px; }
.chat-message span { line-height: 1.45; }
.chat-message small { color: var(--muted); }
.chat-compose { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 9px; }
.chat-compose textarea { min-height: 76px; resize: vertical; border: 1px solid var(--line); border-radius: 12px; padding: 11px; font: inherit; }
.chat-compose textarea:focus { border-color: var(--forest); outline: none; }
@media (max-width: 520px) { .chat-head { align-items: flex-start; flex-direction: column; } .chat-compose { grid-template-columns: 1fr; } }

@media (max-width: 1180px) {
  .messages-workspace { grid-template-columns: minmax(250px, .8fr) minmax(460px, 1.6fr); }
  .courier-context { position: fixed; inset: 0 0 0 auto; z-index: 46; width: min(88vw, 360px); border-radius: 14px 0 0 14px; transform: translateX(105%); transition: transform .22s ease; box-shadow: -18px 0 50px rgba(33,17,11,.22); }
  .courier-context.drawer-open { transform: translateX(0); }
  .courier-context .chat-mobile-close { display: grid; width: 38px; height: 38px; place-items: center; border: 0; background: transparent; }
  .chat-drawer-scrim { position: fixed; inset: 0; z-index: 45; display: block; border: 0; background: rgba(33,17,11,.48); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .chat-drawer-scrim.open { opacity: 1; pointer-events: auto; }
}

@media (max-width: 760px) {
  .admin-data-error { align-items: flex-start; }
  body.chat-panel-open { overflow: hidden; }
  .messages-page .mobile-admin-bar { display: none; }
  .messages-page .main { padding-top: 0; }
  .messages-workspace { display: block; height: 100vh; min-height: 0; margin: 0 -13px; }
  .conversation-pane { min-height: calc(100vh - 64px); border: 0; border-radius: 0; box-shadow: none; }
  .conversation-rail { position: fixed; inset: 0 auto 0 0; z-index: 46; width: min(88vw, 370px); border-radius: 0 14px 14px 0; transform: translateX(-105%); transition: transform .22s ease; box-shadow: 18px 0 50px rgba(33,17,11,.22); }
  .conversation-rail.drawer-open { transform: translateX(0); }
  .conversation-rail-head { padding-top: 14px; }
  .conversation-rail-head > div:first-child { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
  .conversation-rail-head > div:first-child span { display: none; }
  .conversation-rail-head > div:first-child b { font: 700 18px Manrope,sans-serif; }
  .chat-admin-menu { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid #65402e; border-radius: 11px; background: #3d2115; color: #fff; }
  .chat-mobile-close { display: grid; width: 38px; height: 38px; place-items: center; border: 0; border-radius: 10px; background: #faf7f4; }
  .conversation-rail > .conversation-rail-head > .chat-mobile-close { position: absolute; top: 15px; right: 15px; }
  .active-chat-head { position: sticky; top: 0; z-index: 5; grid-template-columns: 40px 36px minmax(0,1fr) 42px 42px; min-height: 68px; padding: 9px 10px; background: #27160e; color: #fff; }
  .active-chat-head > .avatar { width: 35px; height: 35px; }
  .active-chat-identity b { font-size: 13px; }
  .active-chat-identity small { color: #d1b6a7; font-size: 9px; }
  .chat-mobile-inbox { position: relative; display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid #65402e; border-radius: 11px; background: #3d2115; color: #fff; }
  .chat-mobile-inbox span { position: absolute; top: -5px; right: -5px; display: grid; min-width: 18px; height: 18px; padding: 0 4px; place-items: center; border-radius: 999px; background: var(--forest); color: #fff; font-size: 8px; }
  .chat-call { width: 42px; height: 42px; padding: 0; border-color: #65402e; background: #3d2115; color: #fff; }
  .chat-call span { display: none; }
  .chat-context-toggle { border-color: #65402e; background: #3d2115; color: #fff; }
  .chat-timeline { padding: 12px 12px 118px; }
  .workspace-message { grid-template-columns: 28px minmax(0, 82%); }
  .workspace-message.outgoing { grid-template-columns: minmax(0, 82%); }
  .workspace-composer { position: fixed; right: 8px; bottom: max(8px, env(safe-area-inset-bottom)); left: 8px; z-index: 8; margin: 0; box-shadow: 0 10px 35px rgba(40,22,14,.16); }
  .workspace-composer textarea { min-height: 36px; max-height: 84px; }
  .composer-actions .primary { min-height: 40px; }
  .composer-actions small { display: none; }
  .courier-context { width: min(88vw, 370px); }
  .messages-page .mobile-nav-scrim { z-index: 54; }
  .messages-page .sidebar { z-index: 55; }
  .mobile-admin-bar + .mobile-nav-scrim + .sidebar + .main .topbar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .conversation-rail, .courier-context, .chat-drawer-scrim { transition: none; }
}

.proof-picker { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.dispatch-form-error { margin: 14px 0; padding: 12px 14px; border: 1px solid #efb6ad; border-radius: 12px; background: #fff1ee; color: #8d2d20; font-size: 13px; line-height: 1.45; outline: none; }
.dispatch-form-error[hidden] { display: none; }
.modal { max-height: calc(100vh - 32px); overflow: auto; overscroll-behavior: contain; }
.end-work-code > p { margin-bottom: 16px; }
.end-work-code-value { padding: 18px; border: 1px solid #f0c9a8; border-radius: 16px; background: #fff8f1; color: var(--orange-dark, #b94f13); font: 800 clamp(30px, 8vw, 42px)/1 Manrope, sans-serif; letter-spacing: .24em; text-align: center; user-select: all; }
.end-work-code-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.end-work-code-meta span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 9px; border-radius: 999px; background: #f7f4f1; color: var(--muted); font-size: 11px; font-weight: 700; }
.end-work-code-meta .icon { width: 14px; height: 14px; }
.end-work-code > small { display: block; color: var(--muted); font-size: 11px; line-height: 1.5; }
.proof-picker legend { margin-bottom: 7px; font-weight: 700; }
.proof-choice { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.proof-choice:has(input:checked) { border-color: var(--forest); background: #fff8f1; }
.proof-choice input { width: 18px; height: 18px; accent-color: var(--forest); }
.proof-choice span { display: grid; gap: 2px; }
.proof-choice small { color: var(--muted); font-size: 10px; }
.signature-label { display: flex; align-items: center; justify-content: space-between; }
.signature-label .text-button { padding: 4px 0; }
.signature-pad { display: block; width: 100%; height: 160px; border: 1px dashed #c9b8ac; border-radius: 12px; background: #fff; touch-action: none; }
.dispatch-geofence { display: grid; gap: 9px; }
.dispatch-geofence[hidden] { display: none; }
.dispatch-geofence select { width: auto; min-width: 130px; padding: 8px 10px; }
#dispatch-geofence-map { height: 230px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #f3efeb; }
.address-normalized-suggestion { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-top:8px; padding:9px 10px; border:1px solid #ead8ca; border-radius:10px; background:#fffaf6; color:var(--ink); }
.address-normalized-suggestion > span { min-width:0; display:grid; gap:2px; }
.address-normalized-suggestion small { color:var(--muted); font-size:10px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; }
.address-normalized-suggestion b { overflow:hidden; color:#654a3a; font-size:11px; line-height:1.4; text-overflow:ellipsis; white-space:nowrap; }
.address-normalized-suggestion .text-button { flex:0 0 auto; min-height:30px; padding:0 5px; font-size:11px; }
.pathway-geofence-marker { width:32px !important; height:42px !important; margin:0 !important; border:0 !important; background:transparent !important; }
.pathway-geofence-marker > span { position:absolute; top:0; left:1px; width:30px; height:30px; display:grid; place-items:center; border:3px solid #fff; border-radius:50% 50% 50% 4px; background:#d8641f; box-shadow:0 5px 14px rgba(86,41,16,.36); transform:rotate(-45deg); }
.pathway-geofence-marker > span:after { content:''; width:8px; height:8px; border-radius:50%; background:#fff; transform:rotate(45deg); }
.geofence-check { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 11px 12px; border: 1px solid #f0c9a8; border-radius: 12px; background: #fff8f1; color: var(--orange-dark); }
.geofence-check .icon { flex: 0 0 auto; }
.geofence-check div { display: grid; gap: 2px; }
.geofence-check small { color: var(--muted); line-height: 1.4; }

.hub-switcher select { min-width: 150px; height: 40px; padding: 0 34px 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-weight: 650; }
.hub-current { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 700; }
.hub-current .icon { width: 15px; height: 15px; color: var(--orange-dark); }
.hub-settings-head { margin-bottom: 12px; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(230px,1fr)); gap: 12px; margin-bottom: 24px; }
.hub-card { display: grid; gap: 14px; padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 8px 24px rgba(45,27,16,.035); }
.hub-card h3 { margin: 4px 0; font-size: 16px; }
.hub-card p { margin: 0; color: var(--muted); font-size: 11px; }
.hub-code { color: var(--orange-dark); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.hub-card-stats { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 10px; }
.hub-card-stats b { color: var(--ink); font-size: 13px; }
@media (max-width: 720px) { .hub-switcher { width: 100%; } .hub-switcher select { width: 100%; } .hub-current { display: none; } .hub-grid { grid-template-columns: 1fr; } }

/* Dispatch record */
body.dispatch-detail-open { overflow: hidden; }
.dispatch-row { cursor: pointer; transition: background .16s ease, box-shadow .16s ease; }
.dispatch-row:hover { background: #fffaf6; }
.dispatch-row:focus-visible { outline: 0; box-shadow: inset 3px 0 var(--forest), inset 0 0 0 2px rgba(216,100,31,.22); }
.dispatch-reference { display: grid; justify-items: start; gap: 3px; min-width: 92px; padding: 4px 0; border: 0; background: transparent; color: var(--ink); text-align: left; }
.dispatch-reference span { color: var(--orange-dark, #a84d1e); font-size: 9px; font-weight: 750; }
.dispatch-view-action { color: var(--orange-dark, #a84d1e); }
.dispatch-detail-layer { position: fixed; inset: 0; z-index: 48; }
.dispatch-detail-scrim { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(35,19,12,.48); cursor: default; animation: dispatch-fade-in .18s ease both; }
.dispatch-detail-panel { position: absolute; inset: 0 0 0 auto; display: flex; width: min(560px, calc(100vw - 52px)); flex-direction: column; overflow: hidden; border-left: 1px solid #eadfd6; background: #fcfaf8; box-shadow: -22px 0 70px rgba(42,23,14,.2); outline: none; animation: dispatch-drawer-in .22s cubic-bezier(.2,.7,.2,1) both; }
.dispatch-detail-content { display: contents; }
.dispatch-detail-layer.is-closing { pointer-events: none; }
.dispatch-detail-layer.is-closing .dispatch-detail-scrim { animation: dispatch-fade-out .18s ease both; }
.dispatch-detail-layer.is-closing .dispatch-detail-panel { animation: dispatch-drawer-out .22s cubic-bezier(.4,0,.8,.3) both; }
.dispatch-detail-head { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 13px; min-height: 102px; padding: 18px 22px; border-bottom: 1px solid var(--line); background: #fff; }
.dispatch-detail-head h2 { margin: 3px 0 2px; font: 750 22px Manrope,sans-serif; letter-spacing: -.02em; }
.dispatch-detail-head p { margin: 0; color: var(--muted); font-size: 10px; }
.dispatch-detail-back { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
.dispatch-detail-back:hover { background: #fff7f0; }
.dispatch-detail-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 20px 30px; }
.dispatch-detail-summary { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.dispatch-detail-summary article { display: grid; align-content: start; gap: 4px; min-width: 0; padding: 15px 16px; border-bottom: 1px solid var(--line); }
.dispatch-detail-summary article:first-child { border-right: 1px solid var(--line); }
.dispatch-detail-summary .dispatch-address { grid-column: 1 / -1; border-bottom: 0; }
.dispatch-detail-summary span, .dispatch-detail-section-head p { color: var(--muted); font-size: 10px; }
.dispatch-detail-summary b { font-size: 12px; line-height: 1.45; }
.dispatch-detail-summary small { color: var(--muted); font-size: 9px; }
.dispatch-detail-section { margin-top: 14px; padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.dispatch-detail-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.dispatch-detail-section-head h3 { margin: 0 0 3px; font: 750 14px Manrope,sans-serif; }
.dispatch-detail-section-head p { margin: 0; line-height: 1.45; }
.dispatch-detail-section-head > span { padding: 5px 8px; border-radius: 99px; background: #fff0e4; color: #a84d1e; font-size: 9px; font-weight: 750; white-space: nowrap; }
.dispatch-requirements { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 0; list-style: none; }
.dispatch-requirement { display: grid; grid-template-columns: 32px minmax(0,1fr) 18px; align-items: center; gap: 9px; min-height: 58px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.dispatch-requirement > span { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 9px; background: #f6f2ee; color: var(--muted); }
.dispatch-requirement > span .icon { width: 15px; }
.dispatch-requirement > div { display: grid; gap: 2px; min-width: 0; }
.dispatch-requirement b { font-size: 10px; }
.dispatch-requirement small { color: var(--muted); font-size: 9px; }
.dispatch-requirement > .icon { width: 15px; color: #39804d; }
.dispatch-requirement.verified { border-color: #d8e9d2; background: #fbfef9; }
.dispatch-requirement.verified > span { background: #eaf5e5; color: #39804d; }
.dispatch-requirement.waiting { border-color: #efd7c3; background: #fffaf6; }
.dispatch-requirement.waiting > span { background: #fff0e4; color: var(--forest); }
.dispatch-requirement.optional { opacity: .68; }
.dispatch-proof-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.dispatch-proof-card { display: grid; grid-template-columns: 72px minmax(0,1fr); align-items: center; gap: 11px; min-height: 86px; overflow: hidden; padding: 7px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); text-align: left; }
.dispatch-proof-card:not(:disabled):hover { border-color: #d99a6d; background: #fffaf6; }
.dispatch-proof-card:disabled { cursor: default; opacity: .72; }
.dispatch-proof-card img, .dispatch-proof-icon { width: 72px; height: 70px; object-fit: cover; border-radius: 9px; background: #f4efeb; }
.dispatch-proof-icon { display: grid; place-items: center; color: var(--forest); }
.dispatch-proof-card > span:last-child { display: grid; gap: 3px; min-width: 0; }
.dispatch-proof-card b { font-size: 10px; }
.dispatch-proof-card small { color: var(--muted); font-size: 8px; line-height: 1.4; }
.dispatch-proof-card em { color: #a84d1e; font-size: 8px; font-style: normal; font-weight: 750; }
.dispatch-proof-empty { display: flex; align-items: center; gap: 12px; min-height: 78px; padding: 13px; border: 1px dashed #d9cbc0; border-radius: 12px; background: #fcfaf8; }
.dispatch-proof-empty > div { display: grid; gap: 3px; }
.dispatch-proof-empty b { font-size: 11px; }
.dispatch-proof-empty small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.work-journal-section { overflow: hidden; padding: 0; }
.work-journal-section > .dispatch-detail-section-head { margin: 0; padding: 17px; border-bottom: 1px solid var(--line); background: #fffdfb; }
.work-journal-section > [data-work-journal] { display: grid; min-height: 120px; }
.work-journal-more { justify-self: center; margin: 13px 0 0; }
.work-journal-inline-error { margin: 12px 15px 0; padding: 10px 12px; border: 1px solid #efb6ad; border-radius: 10px; background: #fff1ee; color: #8d2d20; font-size: 10px; }
.work-journal-inline-error button { margin-left: 6px; }
.work-journal-timeline { position: relative; display: grid; padding: 15px 17px 4px; }
.work-journal-timeline::before { position: absolute; top: 30px; bottom: 24px; left: 33px; width: 1px; background: #eadfd6; content: ''; }
.work-journal-entry { position: relative; display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 11px; padding: 0 0 16px; }
.work-journal-marker { z-index: 1; display: grid; width: 33px; height: 33px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--orange-dark); }
.work-journal-marker .icon { width: 14px; height: 14px; }
.work-journal-entry-body { min-width: 0; padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.work-journal-entry-body > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.work-journal-entry-body > header > div { display: grid; gap: 2px; }
.work-journal-entry-body > header span { color: var(--orange-dark); font-size: 8px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.work-journal-entry-body > header b { font-size: 10px; }
.work-journal-entry-body time { color: var(--muted); font-size: 8px; white-space: nowrap; }
.work-journal-entry-body p { margin: 10px 0 0; color: var(--ink); font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.work-journal-entry.initial-note .work-journal-marker { border-color: #e5a675; background: #fff0e4; }
.work-journal-entry.initial-note .work-journal-entry-body { border-color: #efd2bc; background: #fff9f4; box-shadow: inset 3px 0 var(--orange-dark); }
.work-journal-entry.assignment-note .work-journal-marker { color: #4b699c; background: #f0f5fc; }
.work-journal-assignment { display: block; margin-top: 9px; color: var(--muted); font-size: 9px; }
.work-journal-photos { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; margin-top: 10px; }
.work-journal-photos button { position: relative; overflow: hidden; min-height: 82px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: #f5f0eb; color: var(--orange-dark); }
.work-journal-photos button:not(:disabled):hover { border-color: #d99a6d; }
.work-journal-photos button:focus-visible { outline: 3px solid rgba(216,100,31,.24); outline-offset: 2px; }
.work-journal-photos img { display: block; width: 100%; height: 82px; object-fit: cover; }
.work-journal-photos button > span { display: grid; height: 82px; place-items: center; }
.work-journal-photos button > span .icon { width: 22px; }
.work-journal-photos em { position: absolute; right: 5px; bottom: 5px; padding: 3px 5px; border-radius: 5px; background: rgba(45,27,16,.78); color: #fff; font-size: 7px; font-style: normal; }
.work-journal-empty { display: flex; align-items: center; gap: 11px; margin: 15px 17px; padding: 14px; border: 1px dashed #d9cbc0; border-radius: 12px; background: #fcfaf8; }
.work-journal-empty > div { display: grid; gap: 3px; }
.work-journal-empty b { font-size: 11px; }
.work-journal-empty small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.work-journal-state { display: grid; min-height: 132px; place-content: center; justify-items: center; gap: 8px; padding: 22px; color: var(--muted); text-align: center; }
.work-journal-state b { color: var(--ink); font-size: 11px; }
.work-journal-state small { max-width: 300px; font-size: 9px; line-height: 1.5; }
.work-journal-state.error button { margin-top: 4px; }
.work-journal-composer { display: grid; gap: 8px; margin-top: 7px; padding: 15px 17px 17px; border-top: 1px solid var(--line); background: #fcfaf8; }
.work-journal-composer > label { font-size: 10px; font-weight: 800; }
.work-journal-composer textarea { width: 100%; min-height: 78px; resize: vertical; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); font: 500 11px/1.5 'DM Sans',sans-serif; outline: none; }
.work-journal-composer textarea:focus { border-color: var(--orange-dark); box-shadow: 0 0 0 3px rgba(216,100,31,.11); }
.work-journal-composer-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 8px; }
.work-journal-composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.work-journal-photo-pick { cursor: pointer; }
.work-journal-photo-pick .icon { width: 15px; }
.work-journal-file-list { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.work-journal-progress { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; }
.work-journal-progress .report-spinner { width: 14px; height: 14px; }
.work-journal-readonly { margin: 15px 17px 17px; padding: 12px; border-radius: 10px; background: #f7f4f1; color: var(--muted); font-size: 9px; line-height: 1.5; }
.completion-evidence-section { border-color: #ded8d2; background: #fff; }
.completion-evidence-section > .dispatch-detail-section-head { padding-bottom: 12px; border-bottom: 1px solid #eee8e3; }
.dispatch-timeline { position: relative; display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.dispatch-timeline::before { position: absolute; top: 17px; bottom: 17px; left: 16px; width: 1px; background: var(--line); content: ''; }
.dispatch-timeline li { position: relative; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 55px; }
.dispatch-event-dot { z-index: 1; display: grid; width: 33px; height: 33px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--forest); }
.dispatch-event-dot.complete { border-color: #d6e8cf; background: #eaf5e5; color: #39804d; }
.dispatch-event-dot .icon { width: 14px; }
.dispatch-timeline div { display: grid; gap: 3px; min-width: 0; }
.dispatch-timeline b { font-size: 10px; }
.dispatch-timeline small, .dispatch-timeline time { color: var(--muted); font-size: 8px; line-height: 1.4; }
.dispatch-timeline time { text-align: right; white-space: nowrap; }
.dispatch-section-empty { padding: 15px; border-radius: 10px; background: #faf8f6; color: var(--muted); font-size: 10px; text-align: center; }
.dispatch-tracking-state { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.dispatch-tracking-state > div { display: grid; gap: 3px; }
.dispatch-tracking-state b { font-size: 11px; }
.dispatch-tracking-state small { color: var(--muted); font-size: 9px; }
.dispatch-detail-state { display: grid; min-height: 100%; align-content: center; justify-items: center; gap: 9px; padding: 34px; color: var(--muted); text-align: center; }
.dispatch-detail-state b { color: var(--ink); font: 750 16px Manrope,sans-serif; }
.dispatch-detail-state small { max-width: 300px; line-height: 1.5; }
.dispatch-detail-state button { min-width: 120px; margin-top: 8px; }
.dispatch-detail-state.error .signal { color: var(--forest); }
.dispatch-proof-viewer > img { display: block; width: 100%; max-height: 58vh; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; background: #f7f3ef; }
.dispatch-proof-viewer .primary { text-decoration: none; }
@keyframes dispatch-drawer-in { from { transform: translateX(24px); opacity: .4; } to { transform: translateX(0); opacity: 1; } }
@keyframes dispatch-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes dispatch-drawer-out { from { transform: translateX(0); opacity: 1; } to { transform: translateX(24px); opacity: .4; } }
@keyframes dispatch-fade-out { from { opacity: 1; } to { opacity: 0; } }

@media (max-width: 650px) {
  .dispatch-table { min-width: 760px; }
  .dispatch-detail-panel { inset: 0; width: 100%; border: 0; box-shadow: none; }
  .dispatch-detail-scrim { display: none; }
  .dispatch-detail-head { position: sticky; top: 0; z-index: 2; grid-template-columns: 44px minmax(0,1fr) auto; min-height: 78px; padding: max(10px, env(safe-area-inset-top)) 13px 10px; }
  .dispatch-detail-head .tag { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dispatch-detail-head h2 { font-size: 18px; }
  .dispatch-detail-head .eyebrow { font-size: 9px; }
  .dispatch-detail-back { width: 44px; height: 44px; }
  .dispatch-detail-body { padding: 12px 12px max(26px, env(safe-area-inset-bottom)); }
  .dispatch-detail-summary { grid-template-columns: 1fr; }
  .dispatch-detail-summary article:first-child { border-right: 0; }
  .dispatch-detail-summary article { min-height: 70px; }
  .dispatch-detail-summary .dispatch-address { grid-column: auto; }
  .dispatch-requirements, .dispatch-proof-grid { grid-template-columns: 1fr; }
  .dispatch-requirement { min-height: 62px; }
  .dispatch-proof-card { min-height: 94px; }
  .work-journal-timeline { padding-inline: 13px; }
  .work-journal-timeline::before { left: 29px; }
  .work-journal-entry-body > header { align-items: flex-start; flex-direction: column; gap: 4px; }
  .work-journal-entry-body time { white-space: normal; }
  .work-journal-photos { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .work-journal-composer { padding-inline: 13px; }
  .work-journal-composer-actions { align-items: stretch; flex-direction: column; }
  .work-journal-composer-actions > * { width: 100%; }
  .work-journal-composer-meta { align-items: flex-start; flex-direction: column; gap: 3px; }
  .dispatch-timeline li { grid-template-columns: 36px minmax(0,1fr); min-height: 64px; }
  .dispatch-timeline time { grid-column: 2; text-align: left; }
  .dispatch-detail-section { padding: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .dispatch-row, .dispatch-detail-panel, .dispatch-detail-scrim, .work-journal-photos button { animation: none; transition: none; }
}

/* Workforce reports */
.report-workspace { display: grid; gap: 18px; }
.report-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(135deg,#fff 0%,#fffaf5 100%); box-shadow: 0 10px 30px rgba(45,27,16,.035); }
.report-toolbar h2 { margin: 4px 0 5px; font: 750 20px Manrope,sans-serif; }
.report-toolbar p { margin: 0; color: var(--muted); font-size: 10px; }
.report-filter-controls { display: flex; align-items: flex-end; gap: 9px; }
.report-filter-controls label { display: grid; gap: 5px; color: var(--muted); font-size: 8px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.report-filter-controls input { width: 132px; height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font: 650 10px Manrope,sans-serif; }
.report-presets { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #f7f3ef; }
.report-presets button { min-height: 29px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font: 700 9px Manrope,sans-serif; cursor: pointer; }
.report-presets button.active { background: #fff; color: var(--orange-dark); box-shadow: 0 2px 8px rgba(45,27,16,.08); }
.report-metrics, .report-loading-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.report-metric { display: grid; grid-template-columns: 36px minmax(0,1fr); gap: 12px; min-height: 112px; align-items: start; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 8px 24px rgba(45,27,16,.035); }
.report-metric-icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; background: #fff1e5; color: var(--orange-dark); }
.report-metric-icon .icon { width: 17px; height: 17px; }
.report-metric > div { display: grid; gap: 3px; }
.report-metric small { color: var(--muted); font-size: 8px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.report-metric strong { font: 760 25px Manrope,sans-serif; letter-spacing: -.04em; }
.report-metric span:last-child { color: var(--muted); font-size: 9px; line-height: 1.4; }
.report-table-card { overflow: hidden; padding-bottom: 0; }
.report-table-card .card-head { padding: 17px 19px; }
.report-table { min-width: 880px; }
.report-table th { padding-top: 12px; padding-bottom: 12px; }
.report-table td { vertical-align: middle; }
.report-table td > b, .report-table td > small { display: block; }
.report-table td > small, .report-table .person-cell small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.report-courier-row { cursor: pointer; transition: background .15s ease, box-shadow .15s ease; }
.report-courier-row:hover { background: #fffaf6; }
.report-courier-row:focus-visible { outline: 0; box-shadow: inset 3px 0 var(--forest), inset 0 0 0 2px rgba(216,100,31,.18); }
.report-open { color: var(--orange-dark); }
.report-refreshing { color: var(--orange-dark); font-size: 9px; font-weight: 750; }
.report-retention-note { margin: -6px 3px 0; color: var(--muted); font-size: 9px; }
.report-state, .report-empty { display: grid; min-height: 280px; place-content: center; justify-items: center; gap: 9px; padding: 36px; text-align: center; }
.report-state b, .report-empty b { font: 750 16px Manrope,sans-serif; }
.report-state small, .report-empty small { max-width: 430px; color: var(--muted); line-height: 1.55; }
.report-state button { margin-top: 8px; }
.report-state .signal, .report-empty .signal { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 15px; background: #fff1e5; color: var(--orange-dark); }
.report-state .signal .icon, .report-empty .signal .icon { width: 20px; height: 20px; }
.report-locked { min-height: 390px; background: radial-gradient(circle at 50% 0,#fff7ef,#fff 58%); }
.report-error .signal { background: #fff0ed; color: #a33b30; }
.report-loading { display: grid; gap: 18px; }
.report-loading-metrics i { height: 112px; border: 1px solid #eee5dd; border-radius: 15px; background: linear-gradient(90deg,#f7f3ef 25%,#fff 50%,#f7f3ef 75%); background-size: 200% 100%; animation: report-shimmer 1.4s linear infinite; }
.report-spinner { width: 22px; height: 22px; border: 2px solid #f0d3bc; border-top-color: var(--forest); border-radius: 50%; animation: report-spin .8s linear infinite; }
.report-detail { display: grid; gap: 18px; }
.report-detail-head { display: flex; align-items: center; gap: 12px; }
.report-detail-head .avatar { width: 46px; height: 46px; font-size: 12px; }
.report-detail-head h2 { margin: 0 0 3px; }
.report-detail-head p { margin: 0; color: var(--muted); font-size: 10px; }
.report-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.report-detail-grid article { display: grid; gap: 4px; min-height: 94px; align-content: center; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fcfaf8; }
.report-detail-grid small { color: var(--muted); font-size: 8px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.report-detail-grid b { font-size: 14px; }
.report-detail-grid span { color: var(--muted); font-size: 9px; line-height: 1.4; }
.report-session-window { display: flex; align-items: center; gap: 11px; padding: 13px 14px; border-radius: 12px; background: #fff5eb; color: var(--orange-dark); }
.report-session-window > span { display: grid; }
.report-session-window .icon { width: 17px; }
.report-session-window div { display: grid; gap: 2px; }
.report-session-window b { color: var(--ink); font-size: 10px; }
.report-session-window small { color: var(--muted); font-size: 9px; }
@keyframes report-shimmer { to { background-position: -200% 0; } }
@keyframes report-spin { to { transform: rotate(360deg); } }

@media (max-width: 920px) {
  .report-toolbar { align-items: stretch; flex-direction: column; }
  .report-filter-controls { flex-wrap: wrap; }
  .report-metrics, .report-loading-metrics { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 650px) {
  .report-workspace { gap: 12px; }
  .report-toolbar { gap: 15px; padding: 16px; }
  .report-toolbar h2 { font-size: 18px; }
  .report-filter-controls { display: grid; grid-template-columns: 1fr 1fr; }
  .report-presets { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3,1fr); }
  .report-filter-controls input { width: 100%; min-width: 0; }
  .report-metrics, .report-loading-metrics { gap: 8px; }
  .report-metric { grid-template-columns: 30px minmax(0,1fr); min-height: 108px; gap: 9px; padding: 13px; }
  .report-metric-icon { width: 30px; height: 30px; }
  .report-metric strong { font-size: 21px; }
  .report-table-card { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .report-table-card .card-head { padding: 8px 2px 12px; }
  .report-table-card .table-wrap { overflow: visible; }
  .report-table { display: block; min-width: 0; }
  .report-table thead { display: none; }
  .report-table tbody { display: grid; gap: 9px; }
  .report-table tr { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 13px 8px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 7px 20px rgba(45,27,16,.035); }
  .report-table td { display: block; padding: 0; border: 0; }
  .report-table td:first-child { grid-column: 1 / -1; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
  .report-table td:nth-child(2)::before { content: 'Work'; }
  .report-table td:nth-child(3)::before { content: 'Completed'; }
  .report-table td:nth-child(4)::before { content: 'Exceptions'; }
  .report-table td:nth-child(5)::before { content: 'Proof'; }
  .report-table td:nth-child(6)::before { content: 'Route'; }
  .report-table td:nth-child(n+2):nth-child(-n+6)::before { display: block; margin-bottom: 4px; color: var(--muted); font-size: 7px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
  .report-table td:last-child { display: flex; align-items: end; justify-content: end; }
  .report-detail-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .report-courier-row { transition: none; }
  .report-loading-metrics i, .report-spinner { animation: none; }
}

/* CRM Professional · Customer Growth */
.crm-growth-subnav { display: flex; align-items: stretch; gap: 10px; min-height: 48px; margin: 0 0 14px; padding: 0 14px; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.82); scrollbar-width: none; }
.crm-growth-subnav::-webkit-scrollbar { display: none; }
.crm-growth-subnav button { position: relative; flex: 0 0 auto; padding: 0 14px; border: 0; background: transparent; color: var(--muted); font: 700 10px Manrope,sans-serif; cursor: pointer; }
.crm-growth-subnav button::after { content: ''; position: absolute; right: 12px; bottom: -1px; left: 12px; height: 2px; border-radius: 2px; background: transparent; }
.crm-growth-subnav button.active { color: var(--orange-dark); }
.crm-growth-subnav button.active::after { background: var(--orange); }
.growth-root { min-height: 320px; }
.growth-page-intro { max-width: 650px; margin: -14px 0 17px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.growth-overview, .growth-workspace { display: grid; gap: 14px; }
.growth-overview .card, .growth-workspace .card { box-shadow: 0 8px 28px rgba(45,27,16,.035); }
.growth-section-head, .growth-workspace-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.growth-section-head .text-button, .growth-priority footer .text-button { width: auto; padding: 0; white-space: nowrap; }
.growth-section-head h2, .growth-workspace-head h2 { margin: 0; font: 750 13px Manrope,sans-serif; }
.growth-section-head span, .growth-workspace-head p { display: block; margin: 3px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.growth-health { padding: 18px; }
.growth-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)) 1.1fr; margin-top: 13px; }
.growth-metric, .growth-score { display: grid; min-width: 0; min-height: 75px; align-content: center; gap: 5px; padding: 0 20px; border-left: 1px solid var(--line); }
.growth-metric:first-child { padding-left: 0; border-left: 0; }
.growth-metric small, .growth-score small { color: var(--muted); font-size: 8px; font-weight: 650; }
.growth-metric strong, .growth-score strong { color: var(--ink); font: 760 22px Manrope,sans-serif; letter-spacing: -.04em; }
.growth-metric strong.danger-text { color: #c23c31; }
.growth-metric span, .growth-score span { overflow: hidden; color: #3c8d4a; font-size: 8px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.growth-metric span .icon { width: 10px; height: 10px; vertical-align: -2px; }
.growth-score { grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 9px; }
.growth-score small { grid-column: 1 / -1; }
.growth-score strong { display: grid; width: 45px; height: 45px; place-items: center; border: 2px solid #efcdb4; border-radius: 50%; color: var(--orange-dark); font-size: 15px; }
.growth-score span { align-self: center; color: var(--orange-dark); font-weight: 700; }
.growth-priority-grid { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(360px,1fr); gap: 14px; }
.growth-priority, .growth-focus, .growth-campaigns { padding: 18px; }
.growth-priority-title { display: flex; align-items: flex-start; gap: 14px; }
.growth-priority-title > .signal { display: grid; flex: 0 0 48px; width: 48px; height: 48px; place-items: center; border-radius: 50%; background: #fff0ed; color: #c23c31; }
.growth-priority-title > .signal .icon { width: 20px; height: 20px; }
.growth-priority-title small { color: #c23c31; font-size: 8px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.growth-priority-title h2 { margin: 4px 0 5px; font: 760 17px Manrope,sans-serif; }
.growth-priority-title p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.growth-priority-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin: 18px 0; }
.growth-priority-metrics .growth-metric { min-height: 60px; padding: 0 14px; }
.growth-priority-metrics .growth-metric:first-child { padding-left: 0; }
.growth-priority-metrics .growth-metric strong { font-size: 17px; }
.growth-priority footer { display: grid; grid-template-columns: minmax(180px,1fr) auto auto; align-items: center; gap: 11px; padding: 12px; border: 1px solid #f3e4d6; border-radius: 12px; background: #fff9f4; }
.growth-campaigns > footer { display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid #f3e4d6; border-radius: 12px; background: #fff9f4; }
.growth-priority footer > div, .growth-campaigns > footer > div { display: flex; min-width: 0; flex: 1; align-items: center; gap: 10px; }
.growth-priority footer > div > .icon, .growth-campaigns > footer > div > .icon { flex: 0 0 auto; color: var(--orange-dark); }
.growth-priority footer span, .growth-campaigns > footer span { display: grid; gap: 2px; }
.growth-priority footer b, .growth-campaigns > footer b { font-size: 9px; }
.growth-priority footer small, .growth-campaigns > footer small { color: var(--muted); font-size: 8px; line-height: 1.45; }
.growth-focus { overflow: hidden; }
.growth-focus-list { display: grid; margin: 10px -18px -18px; }
.growth-focus-list > button { display: grid; grid-template-columns: 32px minmax(0,1.3fr) minmax(92px,1fr) 34px 72px; align-items: center; gap: 8px; min-height: 48px; padding: 6px 18px; border: 0; border-top: 1px solid #f3ede8; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.growth-focus-list > button:hover { background: #fffaf6; }
.growth-focus-list .avatar { width: 28px; height: 28px; font-size: 8px; }
.growth-focus-list span:nth-child(2) { display: grid; min-width: 0; gap: 2px; }
.growth-focus-list b { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.growth-focus-list small { overflow: hidden; color: var(--muted); font-size: 7px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.growth-focus-list em { overflow: hidden; padding: 4px 6px; border-radius: 5px; background: #fff0ed; color: #b53e35; font-size: 7px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.growth-focus-list i { display: grid; width: 26px; height: 26px; place-items: center; border: 1px solid #e99c8f; border-radius: 50%; color: #b53e35; font-size: 8px; font-style: normal; font-weight: 800; }
.growth-campaigns { display: grid; gap: 12px; }
.growth-campaign-row { display: grid; grid-template-columns: 36px minmax(190px,1.4fr) repeat(3,minmax(90px,.7fr)); align-items: center; gap: 12px; min-height: 60px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; }
.growth-campaign-row > .signal { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid #d8ecd9; border-radius: 50%; color: #269640; }
.growth-campaign-row > div { display: grid; gap: 3px; min-width: 0; }
.growth-campaign-row > div:first-of-type { grid-template-columns: auto 1fr; align-items: center; column-gap: 8px; }
.growth-campaign-row > div:first-of-type small { grid-column: 1 / -1; }
.growth-campaign-row b { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.growth-campaign-row small { color: var(--muted); font-size: 8px; }
.growth-campaign-row .tag { width: max-content; font-size: 7px; }
.growth-value-strip { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)) .9fr; padding: 13px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.growth-value-strip > div { display: flex; min-width: 0; align-items: center; gap: 10px; padding: 0 18px; border-left: 1px solid var(--line); }
.growth-value-strip > div:first-child { border-left: 0; }
.growth-value-strip .signal { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: #fff0e4; color: var(--orange-dark); }
.growth-value-strip p { display: grid; min-width: 0; gap: 2px; margin: 0; }
.growth-value-strip b, .growth-value-strip > div > small { font-size: 8px; }
.growth-value-strip p small { color: var(--muted); font-size: 7px; line-height: 1.4; }
.growth-value-strip > div:last-child { display: grid; gap: 3px; }
.growth-value-strip strong { font: 760 20px Manrope,sans-serif; }
.growth-value-strip strong i { color: var(--muted); font-size: 8px; font-style: normal; font-weight: 600; }
.growth-workspace { padding-top: 6px; }
.growth-workspace-head { align-items: end; padding: 4px 2px 2px; }
.growth-workspace-head h2 { margin-top: 4px; font-size: 23px; }
.growth-workspace-head p { max-width: 580px; font-size: 10px; }
.growth-segment-grid, .growth-automation-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.growth-segment-card, .growth-automation-card { display: grid; gap: 12px; padding: 18px; }
.growth-segment-card > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.growth-segment-card h3, .growth-automation-card h3 { margin: 0; font: 750 15px Manrope,sans-serif; }
.growth-segment-card p, .growth-automation-card p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.growth-segment-card > div:nth-of-type(2) { padding: 11px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.growth-segment-card > div:nth-of-type(2) span { display: grid; gap: 3px; color: var(--muted); font-size: 8px; }
.growth-segment-card > div:nth-of-type(2) b { color: var(--ink); font-size: 11px; }
.growth-segment-card footer { display: flex; justify-content: flex-end; }
.growth-campaign-table { display: grid; gap: 8px; padding: 12px; }
.growth-automation-card { grid-template-columns: 40px minmax(0,1fr); align-items: start; }
.growth-automation-card > .signal { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; background: #fff0e4; color: var(--orange-dark); }
.growth-automation-card > div { display: grid; gap: 4px; }
.growth-automation-card > div small { color: var(--orange-dark); font-size: 7px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.growth-automation-card > button { grid-column: 1 / -1; }
.growth-empty, .growth-page-state { display: grid; min-height: 210px; place-content: center; justify-items: center; gap: 8px; padding: 28px; text-align: center; }
.growth-empty > .signal { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: #fff0e4; color: var(--orange-dark); }
.growth-empty > b { font: 750 13px Manrope,sans-serif; }
.growth-empty > small { max-width: 420px; color: var(--muted); font-size: 9px; line-height: 1.55; }
.growth-campaign-form textarea { width: 100%; resize: vertical; }

@media (max-width: 1080px) {
  .growth-priority-grid { grid-template-columns: 1fr; }
  .growth-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); row-gap: 12px; }
  .growth-metrics > :nth-child(4) { padding-left: 0; border-left: 0; }
  .growth-score { grid-column: span 2; }
  .growth-segment-grid, .growth-automation-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .growth-value-strip { grid-template-columns: 1fr 1fr; row-gap: 14px; }
  .growth-value-strip > div:nth-child(3) { border-left: 0; }
}

@media (max-width: 650px) {
  .growth-page-intro { margin-top: -9px; font-size: 11px; }
  .crm-growth-subnav { margin: -2px -2px 12px; padding: 0 4px; border-right: 0; border-left: 0; border-radius: 0; }
  .crm-growth-subnav button { min-height: 45px; padding: 0 12px; }
  .growth-overview, .growth-workspace { gap: 10px; }
  .growth-health, .growth-priority, .growth-focus, .growth-campaigns { padding: 14px; }
  .growth-section-head { align-items: center; }
  .growth-metrics { grid-template-columns: 1fr 1fr; gap: 0; margin-top: 10px; }
  .growth-metric, .growth-score { min-height: 78px; padding: 12px; border-top: 1px solid var(--line); border-left: 0; }
  .growth-metric:nth-child(even), .growth-score { border-left: 1px solid var(--line); }
  .growth-metric:first-child { padding: 12px; }
  .growth-score { grid-column: auto; }
  .growth-priority-title > .signal { flex-basis: 40px; width: 40px; height: 40px; }
  .growth-priority-metrics { grid-template-columns: 1fr 1fr; margin: 14px 0; }
  .growth-priority-metrics .growth-metric { padding: 10px; border-top: 1px solid var(--line); border-left: 0; }
  .growth-priority-metrics .growth-metric:nth-child(even) { border-left: 1px solid var(--line); }
  .growth-priority footer, .growth-campaigns > footer { display: flex; align-items: stretch; flex-wrap: wrap; }
  .growth-priority footer > div, .growth-campaigns > footer > div { flex-basis: 100%; }
  .growth-priority footer .primary, .growth-campaigns > footer .primary { flex: 1; }
  .growth-focus-list { margin-right: -14px; margin-left: -14px; }
  .growth-focus-list > button { grid-template-columns: 30px minmax(0,1fr) 30px; padding: 8px 14px; }
  .growth-focus-list em { grid-column: 2; width: max-content; max-width: 100%; }
  .growth-focus-list i { grid-column: 3; grid-row: 1 / span 2; }
  .growth-focus-list > button > small:last-child { display: none; }
  .growth-campaign-row { grid-template-columns: 34px minmax(0,1fr) 1fr 1fr; gap: 9px; padding: 12px; }
  .growth-campaign-row > div:first-of-type { grid-column: 2 / -1; }
  .growth-campaign-row > div:nth-of-type(n+2) { padding-top: 9px; border-top: 1px solid var(--line); }
  .growth-campaign-row > div:nth-of-type(2) { grid-column: 2; }
  .growth-value-strip { grid-template-columns: 1fr; padding: 0; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
  .growth-value-strip > div { min-height: 70px; padding: 13px 15px; border-top: 1px solid var(--line); border-left: 0; }
  .growth-value-strip > div:first-child { border-top: 0; }
  .growth-workspace-head { align-items: stretch; flex-direction: column; }
  .growth-workspace-head > button { width: 100%; }
  .growth-segment-grid, .growth-automation-grid { grid-template-columns: 1fr; }
  .growth-campaign-table { padding: 0; border: 0; background: transparent; box-shadow: none; }
  .growth-campaign-form .crm-form-grid { grid-template-columns: 1fr; }
}
#app { view-transition-name: pathway-app; }
.sidebar { view-transition-name: pathway-sidebar; }
.main { view-transition-name: pathway-page; }
.mobile-admin-bar { view-transition-name: pathway-mobile-bar; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-group(pathway-app), ::view-transition-group(pathway-page) { animation-duration: 260ms; animation-timing-function: cubic-bezier(.22,1,.36,1); }
::view-transition-old(pathway-app), ::view-transition-old(pathway-page) { animation: pathway-page-out 180ms cubic-bezier(.4,0,1,1) both; mix-blend-mode: normal; }
::view-transition-new(pathway-app), ::view-transition-new(pathway-page) { animation: pathway-page-in 260ms cubic-bezier(.22,1,.36,1) both; mix-blend-mode: normal; }
html[data-page-direction="back"]::view-transition-old(pathway-app), html[data-page-direction="back"]::view-transition-old(pathway-page) { animation-name: pathway-page-out-back; }
html[data-page-direction="back"]::view-transition-new(pathway-app), html[data-page-direction="back"]::view-transition-new(pathway-page) { animation-name: pathway-page-in-back; }
html[data-transition-scope="admin"]::view-transition-old(pathway-app), html[data-transition-scope="admin"]::view-transition-new(pathway-app) { animation: none; }
html[data-transition-scope="admin"]::view-transition-group(pathway-sidebar), html[data-transition-scope="admin"]::view-transition-group(pathway-mobile-bar), html[data-transition-scope="admin"]::view-transition-old(pathway-sidebar), html[data-transition-scope="admin"]::view-transition-new(pathway-sidebar), html[data-transition-scope="admin"]::view-transition-old(pathway-mobile-bar), html[data-transition-scope="admin"]::view-transition-new(pathway-mobile-bar) { animation: none; mix-blend-mode: normal; }
@keyframes pathway-page-out { to { opacity: 0; transform: translate3d(-10px,0,0); } }
@keyframes pathway-page-in { from { opacity: 0; transform: translate3d(14px,0,0); } }
@keyframes pathway-page-out-back { to { opacity: 0; transform: translate3d(10px,0,0); } }
@keyframes pathway-page-in-back { from { opacity: 0; transform: translate3d(-14px,0,0); } }
.page-transition-fallback { animation: pathway-page-in 260ms cubic-bezier(.22,1,.36,1) both; }
html[data-page-direction="back"] .page-transition-fallback { animation-name: pathway-page-in-back; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(pathway-app), ::view-transition-group(pathway-page), ::view-transition-old(pathway-app), ::view-transition-new(pathway-app), ::view-transition-old(pathway-page), ::view-transition-new(pathway-page) { animation: none; }
}

/* Typed work items: delivery remains the default; service details stay quietly contextual. */
.work-type-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 18px 0; padding: 0; border: 0; }
.work-type-picker legend { grid-column: 1 / -1; margin-bottom: 1px; color: var(--ink); font-size: 11px; font-weight: 800; }
.work-type-picker label { position: relative; min-width: 0; cursor: pointer; }
.work-type-picker input { position: absolute; opacity: 0; pointer-events: none; }
.work-type-picker span { display: grid; min-height: 74px; align-content: center; gap: 4px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; background: #fff; transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease; }
.work-type-picker b { font: 750 13px Manrope,sans-serif; }
.work-type-picker small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.work-type-picker input:checked + span { border-color: var(--orange); background: #fff7f1; box-shadow: inset 0 0 0 1px rgba(216,100,31,.18); }
.work-type-picker input:focus-visible + span { outline: 3px solid rgba(216,100,31,.2); outline-offset: 2px; }
.dispatch-service-fields { display: grid; min-width: 0; max-width: 100%; gap: 17px; margin: 6px 0 19px; padding: 18px; border: 1px solid #eadfd6; border-radius: 16px; background: linear-gradient(180deg,#fffaf6 0,#fff 150px); box-shadow: 0 8px 26px rgba(61,35,21,.045); }
.dispatch-service-heading { display: flex; align-items: center; gap: 11px; padding-bottom: 14px; border-bottom: 1px solid #f0e5dd; }
.dispatch-service-heading > span { display: grid; flex: 0 0 38px; width: 38px; height: 38px; place-items: center; border-radius: 11px; background: #fff0e4; color: var(--orange-dark); }
.dispatch-service-heading > div { display: grid; gap: 2px; }
.dispatch-service-heading b { font: 750 14px Manrope,sans-serif; }
.dispatch-service-heading small { max-width: 390px; color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.dispatch-appointment-grid, .dispatch-asset-grid { display: grid; min-width: 0; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.dispatch-service-fields .field { min-width: 0; gap: 8px; margin: 0; }
.dispatch-service-fields .field label { font-size: 11.5px; }
.dispatch-service-fields input, .dispatch-service-fields select, .dispatch-service-fields textarea { width: 100%; min-width: 0; max-width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font: 500 12px/1.45 'DM Sans',sans-serif; outline: none; transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease; }
.dispatch-service-fields input, .dispatch-service-fields select { min-height: 46px; padding: 11px 12px; }
.dispatch-service-fields textarea { min-height: 94px; padding: 12px 13px; resize: vertical; }
.dispatch-service-fields input::placeholder, .dispatch-service-fields textarea::placeholder { color: #9a8b82; opacity: 1; }
.dispatch-service-fields input:focus-visible, .dispatch-service-fields select:focus-visible, .dispatch-service-fields textarea:focus-visible { border-color: var(--orange-dark); box-shadow: 0 0 0 3px rgba(216,100,31,.12); }
.dispatch-service-fields .field-help { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.dispatch-service-help { margin-top: -10px !important; }
.service-appointment-note { color: var(--orange-dark) !important; font-weight: 750; }
.service-brief-note { overflow: hidden; max-width: 290px; text-overflow: ellipsis; white-space: nowrap; }
.dispatch-service-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; overflow: hidden; border: 1px solid #efd8c8; border-radius: 15px; background: #efd8c8; }
.dispatch-service-summary > div { display: grid; align-content: start; gap: 5px; min-height: 86px; padding: 15px 16px; background: #fffaf6; }
.dispatch-service-summary span { color: var(--orange-dark); font-size: 9px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.dispatch-service-summary b { font-size: 11px; line-height: 1.5; }
.dispatch-service-summary small { color: var(--muted); font-size: 9px; }

@media (max-width: 650px) {
  .work-type-picker, .dispatch-appointment-grid, .dispatch-asset-grid { grid-template-columns: 1fr; }
  .work-type-picker legend { grid-column: auto; }
  .work-type-picker span { min-height: 64px; }
  .dispatch-service-fields { gap: 15px; padding: 15px; border-radius: 14px; }
  .dispatch-service-heading { align-items: flex-start; padding-bottom: 12px; }
  .dispatch-service-heading small { font-size: 10px; }
  .dispatch-service-summary { grid-template-columns: 1fr; }
  .dispatch-service-summary > div { min-height: 70px; }
}

@media (prefers-reduced-motion: reduce) {
  .work-type-picker span, .dispatch-service-fields input, .dispatch-service-fields select, .dispatch-service-fields textarea { transition: none; }
}
