/* CRM-WEB extension, separated to preserve the deployed header and styles. */
.crm-task-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:16px;margin:18px 0}
.crm-task-grid .panel{margin:0}.crm-task-grid h3{font-size:1.05rem;margin:0 0 14px}.crm-task-grid ul{padding-left:20px}.crm-task-grid li{margin:8px 0}
.crm-task-count{font-size:2rem}.crm-card h2{font-size:1.2rem}.crm-card p,.crm-editor p,.crm-clock span{overflow-wrap:anywhere}
.crm-clock{display:grid;gap:7px;border-left:3px solid #887667;padding:12px 16px;margin:14px 0;background:#f7f4ef}
.crm-chips{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.crm-chips:empty{display:none}.crm-chips button{font-size:.85rem;padding:5px 10px;border-radius:20px}
.crm-editor{max-width:780px}.crm-editor textarea{min-height:85px}.crm-editor input,.crm-editor select,.crm-editor textarea{width:100%;min-width:0;box-sizing:border-box}.crm-editor .check input{width:auto}
.crm-permissions{grid-column:1/-1;padding:12px 0;border-bottom:1px solid #ddd}.crm-permissions summary{font-weight:700;cursor:pointer;margin-bottom:12px}.crm-permissions .check{margin:8px 0;align-items:flex-start}.crm-permissions .check input{flex:0 0 auto}
.crm-map{height:430px;width:100%;max-width:100%;z-index:0;border:1px solid #ded9d0;border-radius:12px;background:#e8e5dd}
.crm-marker-shell{background:transparent;border:0}.crm-marker{display:block;text-align:center;font-size:30px;line-height:32px;text-shadow:0 0 2px white,0 0 4px white}
.crm-map-soft .leaflet-tile-pane{filter:saturate(.25) contrast(.78) brightness(1.12)}
.crm-map-symbol{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;flex:0 0 34px;border:2px solid white;border-radius:50%;background:var(--channel-color,#6B7280);color:var(--symbol-ink,white);box-shadow:0 0 0 1px #1e293b99,0 2px 4px #0f172a55;font-family:"Segoe UI Symbol","Arial",sans-serif;font-size:22px;font-weight:400;line-height:1;text-shadow:none}
.crm-map-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:12px 0}
.crm-map-toolbar p{margin:0}.crm-map-toolbar label{white-space:nowrap}
.crm-map-zoom .leaflet-control-zoom{display:flex;float:none;margin:0}
.crm-map-zoom .leaflet-bar a{border:0;border-radius:3px;width:36px;height:34px;line-height:34px}
.crm-map-zoom .leaflet-bar a+a{border-left:1px solid #cbd5e1}
.crm-map-identity{display:flex;align-items:center;gap:10px;overflow-wrap:anywhere}
.crm-map-identity span:last-child{min-width:0}
.crm-map-popup{font-size:14px;line-height:1.45;overflow-wrap:anywhere}
.crm-map-popup>a{font-weight:700}
.crm-map .leaflet-popup-content{max-width:calc(100vw - 96px)}
.crm-location-detail{font-size:13px;margin:10px 0;color:#475569}
.crm-location-detail summary{cursor:pointer;text-decoration:underline;text-underline-offset:3px}
.crm-map-legend ul{display:flex;flex-wrap:wrap;gap:10px 24px;list-style:none;padding:0}
.crm-map-legend li{display:flex;align-items:center;gap:8px;max-width:100%;overflow-wrap:anywhere}
.crm-channel-dot{display:inline-block;width:16px;height:16px;flex:0 0 16px;border:2px solid white;border-radius:50%;background:var(--channel-color,#6B7280);box-shadow:0 0 0 1px #475569}
.crm-map-legend small{color:#475569}
.crm-map-customers h3{font-size:16px;margin:0}
.crm-map-customers article{overflow-wrap:anywhere}
.crm-map .leaflet-popup-content{overflow-wrap:anywhere}.crm-map .leaflet-control-attribution{font-size:10px}.crm-map a{color:#234b69}
#customer-sections summary{font-weight:700;cursor:pointer}#customer-sections details{margin:16px 0}
.crm-card .section-head{gap:12px;flex-wrap:wrap}.crm-card h2{overflow-wrap:anywhere}.connection a{text-decoration:underline;color:inherit}
@media(max-width:600px){.crm-map{height:330px}.crm-task-grid{grid-template-columns:1fr}.crm-editor .actions{flex-wrap:wrap}.crm-editor label{min-width:0}.crm-clock{font-size:.9rem}.crm-card .section-head{align-items:flex-start}.crm-permissions .check{font-size:.9rem}.filter-row label{max-width:100%;min-width:0}.filter-row input,.filter-row select{max-width:100%;box-sizing:border-box}}

/* CRM-SEARCH-001: stable field order, explicit application and portfolio search. */
.crm-search-panel{display:flex;flex-wrap:wrap;gap:16px;align-items:flex-end}
.crm-search-panel>label{flex:1 1 210px;min-width:0}
.crm-search-panel>.filter-row,.crm-search-panel>details,.crm-search-panel>.crm-filter-heading,.crm-search-panel>.crm-filter-groups{flex:0 0 100%;min-width:0}
.crm-search-panel input,.crm-search-panel select{width:100%;min-width:0;box-sizing:border-box}
.crm-search-panel .crm-filter-actions{display:flex;align-items:center;flex-wrap:wrap;gap:10px;flex:0 0 100%;border-top:1px solid #e6dfda;padding-top:16px}
.crm-filter-hint{margin-right:auto}.crm-filter-hint:empty{display:none}
.crm-filters-dirty .crm-filter-hint{color:#77550b}
.crm-search-panel .crm-chips{flex:0 0 100%;margin:0;gap:8px}
.crm-search-panel .crm-chips button{white-space:normal;overflow-wrap:anywhere;text-align:left;max-width:100%}
.crm-filter-heading h2{margin:0;font-size:1.12rem}.crm-filter-heading p{margin:5px 0 0}
.crm-filter-groups{display:grid;grid-template-columns:minmax(220px,.85fr) minmax(340px,1.5fr);gap:24px}
.crm-filter-groups fieldset{border:0;padding:0;margin:0;min-width:0}
.crm-filter-groups fieldset+fieldset{border-left:1px solid #e6dfda;padding-left:24px}
.crm-filter-groups legend{font-size:.9rem;font-weight:700;margin:0 0 12px;padding:0}
.crm-period-fields{display:grid;grid-template-columns:minmax(85px,.65fr) minmax(140px,1fr);gap:12px}
.crm-filter-groups [data-filter-fields]{display:grid;grid-template-columns:minmax(190px,1.3fr) minmax(150px,1fr);gap:12px}
.crm-filter-groups label{display:flex;flex-direction:column;gap:7px;min-width:0}
.crm-filter-groups .help{margin:10px 0 0;font-weight:400}
.crm-seller-picker{position:relative}.crm-seller-search{font-weight:400}
.crm-seller-options{position:absolute;left:0;top:100%;width:max(100%,280px);max-width:min(440px,calc(100vw - 64px));background:white;border:1px solid #c8bdb6;border-radius:8px;box-shadow:0 8px 22px #362a221c;z-index:20;padding:6px;font-weight:400}
.crm-seller-options[hidden]{display:none}.crm-seller-options [role=listbox]{max-height:240px;overflow-y:auto}
.crm-seller-options [role=option]{padding:11px 10px;cursor:pointer;overflow-wrap:anywhere;font-size:.92rem;border-radius:4px}
.crm-seller-options [role=option]:hover,.crm-seller-options [aria-selected=true]{background:#f5e8e8;color:#95132b}
.crm-seller-options .help{padding:8px;margin:0;font-size:.8rem}
.crm-results-heading{margin:26px 0 18px}.crm-results-heading h2{margin:4px 0;font-size:1.4rem}.crm-results-heading p{margin:4px 0}
#metrics .metric strong{font-size:clamp(1.35rem,2.05vw,1.9rem);overflow-wrap:anywhere}
@media(max-width:850px){.crm-filter-groups{grid-template-columns:1fr;gap:18px}.crm-filter-groups fieldset+fieldset{border-left:0;border-top:1px solid #e6dfda;padding:16px 0 0}.crm-search-panel .filter-row{flex-wrap:wrap}.crm-search-panel .filter-row>label{flex:1 1 200px}}
@media(max-width:480px){.crm-filter-groups [data-filter-fields]{grid-template-columns:1fr}.crm-search-panel .crm-filter-actions>button{flex:1 1 100%}.crm-filter-hint{flex-basis:100%}.crm-search-panel .filter-row>label{flex-basis:100%}.crm-seller-options{width:100%;max-width:100%;box-sizing:border-box}.crm-period-fields{grid-template-columns:85px minmax(0,1fr)}#metrics .metric strong{font-size:1.55rem}}
@media(max-width:600px){#metrics .metrics{grid-template-columns:1fr}#metrics .metric strong{overflow-wrap:normal;font-size:clamp(1.2rem,5.5vw,1.55rem)}}

/* UI-REVIEW-001: shared hierarchy; existing brand header is preserved. */
#content h1{line-height:1.2;letter-spacing:-.025em}#content h2{line-height:1.3}
#content .intro{gap:20px;align-items:flex-start}#content .intro .muted{max-width:68ch}
#content a:not(.button):not(.leaflet-control-zoom-in):not(.leaflet-control-zoom-out),#content button.link{color:#344b5b}
#content a:not(.button):hover,#content button.link:hover{text-decoration:underline;color:#172d3d}
#content .primary{background:#35434d;border-color:#35434d;color:white}#content .primary:hover{background:#20313c;border-color:#20313c}
#content .danger{color:#a21631;border-color:#a21631}#content .help{line-height:1.5}
#content :is(a,button,input,select,textarea,summary):focus-visible,#connection button:focus-visible{outline:3px solid #406b90;outline-offset:3px}
#content .panel{border-radius:10px}#content .section-head{gap:12px;flex-wrap:wrap}
#content .stack{gap:18px}#content .stack>button.primary{justify-self:start;min-width:150px}
#content input,#content select,#content textarea{scroll-margin-block:100px;max-width:100%;box-sizing:border-box}
#content .stack label{min-width:0}#content summary{cursor:pointer;line-height:1.5}
#content details>summary{padding-block:7px}#content .pager{gap:12px;flex-wrap:wrap}
.connection{align-items:center;gap:12px}.connection>span:last-child{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap}.connection button{font-size:.85rem;padding:7px 12px;background:white;color:#34424b;border:1px solid #b7b9b8}
.crm-task-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr));align-items:start;gap:12px;margin-top:8px}
.crm-task-grid .ui-task-summary{padding:18px;min-width:0}.ui-task-summary>a{display:flex;flex-direction:column;gap:8px;text-decoration:none;line-height:1.3}
.ui-task-summary>a>span:first-child{font-size:.9rem;min-height:2.6em;color:#4d5357}.ui-task-summary .crm-task-count{line-height:1.15;color:#29343c;font-size:2rem;font-variant-numeric:tabular-nums}
.ui-task-summary .ui-unknown{font-size:1.2rem;line-height:1.9}.ui-task-action{font-size:.78rem;color:#52626e}.ui-task-reason{margin:12px 0 0;padding-top:10px;border-top:1px solid #e5dfda;font-size:.8rem}
.ui-task-lists{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start;margin:24px 0}.ui-task-lists:empty{display:none}.ui-task-lists .panel{margin:0;min-width:0;padding:20px}
.ui-task-lists>.panel:last-child:nth-child(odd){grid-column:1/-1}
.ui-task-lists h2{font-size:1.05rem;margin:0}.ui-task-lists .section-head>a{font-size:.8rem;white-space:nowrap}
.ui-task-lists ul{list-style:none;padding:0;margin:14px 0 0}.ui-task-lists li+li{border-top:1px solid #e8e3df}.ui-task-lists li a{display:block;padding:12px 0;overflow-wrap:anywhere;text-decoration:none;font-size:.9rem}
.ui-section-title{font-size:1.05rem;margin:30px 0 12px}.office-cards.ui-shortcuts{margin:0 0 24px;gap:12px}.ui-shortcuts .office-card{padding:16px;gap:5px}.ui-shortcuts .office-card>span{font-size:.95rem;color:#29343c;font-weight:700}.ui-shortcuts .office-card small{color:#53616b;font-weight:400}
.ui-collection-summary{padding:20px}.ui-collection-summary h2{font-size:1.1rem;margin:0}.ui-collection-summary p{font-size:.85rem}.ui-collection-summary .section-head>strong{font-variant-numeric:tabular-nums}.ui-collection-summary .button{font-size:.85rem;padding:8px 12px}
.ui-field-requirement{display:inline-block;font-size:.7rem!important;font-weight:400;color:#62666a;margin-left:8px}.ui-field-error{display:block;color:#a21631;font-size:.8rem;line-height:1.4;margin-top:6px}.ui-form-error{margin:0 0 12px;max-width:65ch}[aria-invalid=true]{border-color:#a21631!important}
#content label:has(>.ui-field-requirement){display:block}#content label:has(>.ui-field-requirement)>:is(input,select,textarea){display:block;margin-top:6px}
@media(max-width:700px){.ui-task-lists{grid-template-columns:1fr}.crm-task-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.crm-task-grid .ui-task-summary{padding:14px}.ui-task-summary>a>span:first-child{font-size:.82rem;min-height:3.9em}.ui-task-reason{font-size:.75rem}.ui-task-action{font-size:.72rem}.ui-task-summary .crm-task-count{font-size:1.65rem}.ui-task-summary .ui-unknown{font-size:1.05rem}.connection>span:last-child{justify-content:flex-start}.ui-task-lists .panel{padding:16px}#content .stack>button.primary{width:100%}.office-cards.ui-shortcuts{grid-template-columns:1fr 1fr}.ui-shortcuts .office-card{padding:12px}.ui-shortcuts .office-card small{font-size:.75rem}}

/* HEADER-002: consistent area navigation and a measured sticky header. */
:root{--app-header-height:156px}
html{scroll-padding-top:calc(var(--app-header-height) + 16px)}
.app-header{position:sticky;top:0;z-index:30;background:white;box-shadow:0 3px 12px #342a2b12}
.skip{z-index:40}
.app-header .navigation-sections{flex-wrap:nowrap;justify-content:flex-start;gap:24px}
.app-header .navigation-main{flex-wrap:nowrap;gap:4px;flex-shrink:0}
.navigation-location{display:flex;align-items:baseline;gap:8px;margin:0 0 0 auto;padding-left:20px;border-left:1px solid #e7dfe0;font-size:13px;min-width:0;color:var(--muted)}
.navigation-location>span{white-space:nowrap}
.navigation-location strong{font-size:14px;font-weight:600;color:var(--dark);overflow-wrap:anywhere}
.app-header .navigation-dropdown-panel{left:0;right:auto;max-height:calc(100vh - var(--app-header-height) - 16px);max-height:calc(100dvh - var(--app-header-height) - 16px);overflow-y:auto;overscroll-behavior:contain}
.app-header .navigation-dropdown:last-child .navigation-dropdown-panel{left:auto;right:0}
@media(min-width:701px) and (max-width:1100px){
  .app-header .navigation-sections{gap:12px}
  .app-header .navigation-main{gap:0}
  .navigation-location{padding-left:12px;gap:4px;flex-direction:column;line-height:1.3}
}
@media(max-width:700px){
  .app-header .top{padding:12px 16px;gap:8px}
  .app-header .navigation-location{display:none}
  .app-header .navigation.navigation-open .navigation-sections{position:absolute;top:100%;left:0;right:0;margin:0;padding:8px 12px 12px;background:white;border-bottom:1px solid #e7dfe0;box-shadow:0 8px 18px #342a2b1a;max-height:calc(100vh - var(--app-header-height) - 12px);max-height:calc(100dvh - var(--app-header-height) - 12px);overflow-y:auto;overscroll-behavior:contain}
  .app-header .navigation .navigation-main{display:flex;flex-direction:column;align-items:stretch;gap:3px}
  .app-header .navigation-dropdown-panel{position:static;max-height:none;overflow:visible}
}

/* SETTINGS-001: one settings workspace with capability-filtered categories. */
.settings-layout{display:grid;grid-template-columns:235px minmax(0,1fr);gap:28px;align-items:start}
.settings-categories{position:sticky;top:calc(var(--app-header-height) + 20px);max-height:calc(100vh - var(--app-header-height) - 40px);overflow-y:auto;padding:8px;background:white;border:1px solid var(--border);border-radius:10px}
.settings-category-group+ .settings-category-group{border-top:1px solid #e7dfe0;margin-top:8px;padding-top:8px}
.settings-category-group>p{margin:8px 12px 6px;font-size:12px;font-weight:700;color:var(--muted)}
.settings-categories button{display:flex;justify-content:flex-start;text-align:left;width:100%;min-height:46px;padding:11px 12px;border:0;border-radius:6px;font-size:15px;font-weight:500;background:transparent;white-space:normal}
.settings-categories button[aria-current=page]{color:#b6002b;background:#fae9ee;font-weight:700}
.settings-category-picker{display:none}
.settings-content{min-width:0}
#content .settings-content [data-settings-heading]{font-size:25px;line-height:1.25;margin-bottom:10px}
.settings-content>.intro{margin-bottom:18px}
.settings-content .login{max-width:720px;margin:0;padding:24px}
.settings-content .admin-grid{gap:20px;align-items:start}
.settings-content .detail-summary{grid-template-columns:minmax(0,1fr);gap:16px;margin:18px 0 0}
.settings-content .detail-summary>div{display:grid;grid-template-columns:minmax(90px,.6fr) minmax(0,1fr);gap:12px;align-items:baseline}
.settings-content .detail-summary dd{margin:0}
@media(max-width:1100px){.settings-content .admin-grid{grid-template-columns:minmax(0,1fr)}}
@media(max-width:900px){
  .settings-layout{grid-template-columns:minmax(0,1fr);gap:22px}
  .settings-categories{display:none}
  .settings-category-picker{display:flex;padding:16px;background:white;border:1px solid var(--border);border-radius:10px}
  .settings-content .login{padding:20px}
}
@media(max-width:700px){.settings-content .detail-summary>div{display:block}.settings-content .detail-summary dd{margin-top:4px}}

/* TANGO-LIGHT-001: replace the sync strip with an accessible header light. */
.header-identity{display:flex;align-items:center;gap:16px;min-width:0}
.connection-indicator{position:relative;z-index:8;display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;flex:0 0 44px;border-radius:8px;color:white;text-decoration:none}
.connection-indicator:hover{background:#ffffff0d}
.connection-light{width:13px;height:13px;border-radius:50%;background:#f4c64e;border:1px solid #fff6;box-shadow:0 0 0 4px #f4c64e14}
.connection-indicator.is-connected .connection-light{background:#58da89;box-shadow:0 0 0 4px #58da8914}
.connection-tooltip{position:absolute;top:calc(100% + 6px);left:0;z-index:1;width:max-content;max-width:260px;padding:10px 13px;border:1px solid #685658;border-radius:8px;background:#342a2b;color:white;font-size:14px;font-weight:400;line-height:1.5;text-align:left;white-space:normal;box-shadow:0 6px 18px #0003;visibility:hidden;opacity:0}
.connection-tooltip::before{content:'';position:absolute;left:0;right:0;top:-8px;height:8px}
.connection-indicator:is(:hover,:focus-visible) .connection-tooltip{visibility:visible;opacity:1}
.connection-indicator.tooltip-dismissed .connection-tooltip{visibility:hidden;opacity:0}
@media(max-width:700px){.header-identity{justify-content:space-between;gap:8px}.connection-tooltip{left:auto;right:0}}
/* CRM-REV2: compact quote review, including small screens. */
.quote-detail-nav{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.quote-detail-intro{gap:16px;margin-bottom:12px}
.quote-detail-intro .detail-title{font-size:clamp(1.2rem,2vw,1.8rem);line-height:1.3;margin-bottom:10px}
.quote-commercial .quote-totals{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0 0 16px}
.quote-commercial .quote-totals .amount{grid-column:auto;min-width:0}
.quote-totals .amount-large{font-size:clamp(.8rem,1.7vw,1.35rem)!important;overflow-wrap:anywhere}
.quote-commercial .line-product{min-width:160px;white-space:normal}
.channel-color-row,.seller-symbol-row{padding:12px 0;border-bottom:1px solid #dbe3e7}
.channel-color-row>strong,.seller-symbol-row>strong{flex:1 1 220px}
#customer-search{align-items:end}
@media(min-width:701px) and (max-width:1100px){.app-header .navigation-main{flex-wrap:wrap;flex-shrink:1;min-width:0}.navigation-location{flex:0 0 130px}}
@media(max-width:600px){.quote-commercial{padding:12px}.quote-commercial .quote-totals{gap:8px}.quote-totals dt{font-size:.75rem}.quote-detail-intro>.actions{width:100%}.quote-detail-intro>.actions>*{flex:1 1 180px}}

/* HEADER-003: each business area owns its documents, follow-ups and alerts. */
.app-header .navigation-dropdown-panel{width:340px;max-width:calc(100vw - 64px);padding:12px}
.navigation-category+ .navigation-category{border-top:1px solid #e7dfe0;margin-top:10px;padding-top:10px}
.navigation-category h2{margin:4px 12px 6px;color:var(--muted);font-size:12px;font-weight:700;line-height:1.5;letter-spacing:.05em;text-transform:uppercase}
.navigation-category button{flex-direction:column;align-items:flex-start;gap:3px}
.navigation-category button small{font-size:12px;font-weight:400;color:var(--muted);line-height:1.4}
.navigation-dropdown summary.is-current{box-shadow:inset 0 -2px #b6002b}
@media(min-width:701px){
  .app-header [data-area=quotes] .navigation-dropdown-panel{width:550px;max-width:calc(100vw - 130px);display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
  [data-area=quotes] .navigation-category+ .navigation-category{border:0;margin:0;padding:0}
  .app-header [data-area=billing] .navigation-dropdown-panel{left:auto;right:0}
  .navigation-location{flex-direction:column;align-items:flex-start;gap:2px;line-height:1.3}
}
@media(max-width:700px){
  .app-header .navigation-dropdown-panel{width:100%;max-width:none;padding:4px 0 4px 8px}
  .navigation-current{white-space:normal;overflow-wrap:anywhere;min-width:0}
}

/* TOUR-MAP-001: map and form are kept in one session, including mobile tabs. */
.tour-planner{display:grid;grid-template-columns:minmax(0,3fr) minmax(330px,2fr);gap:22px;align-items:start}
.tour-planner .panel{margin:0;min-width:0;padding:20px}
.tour-map-panel{position:sticky;top:calc(var(--app-header-height) + 16px)}
.tour-map{height:clamp(320px,55vh,650px);border:1px solid var(--border);border-radius:8px;z-index:0}
.tour-map-panel [data-tour-route-status]{margin:14px 0;line-height:1.5;font-weight:600}
.tour-map-panel [data-tour-route-status][aria-busy=true]{color:var(--muted)}
.tour-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.tour-planner .crm-editor{max-width:none}
.tour-search{padding-top:16px;border-top:1px solid var(--border);display:grid;gap:10px}
.tour-search-result{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 10px;padding:12px 0;border-bottom:1px solid var(--border)}
.tour-search-result small{grid-column:1;color:var(--muted);overflow-wrap:anywhere}
.tour-search-result button{grid-column:2;grid-row:1/3;align-self:center;min-height:44px;padding:8px 12px}
.tour-stop{padding:14px;margin:12px 0;border:1px solid var(--border);border-radius:8px;background:#fcfafb}
.tour-stop.is-selected{border-color:#b6002b;box-shadow:0 0 0 1px #b6002b}
.tour-stop-heading{display:flex;align-items:flex-start;gap:8px}
.tour-stop-heading [data-stop-select]{display:grid;grid-template-columns:30px minmax(0,1fr);align-items:start;gap:10px;text-align:left;flex:1;border:0;padding:8px 0;background:transparent;min-width:0;overflow-wrap:anywhere;line-height:1.5}
.tour-stop-heading .tour-stop-number{font-size:15px;line-height:30px}
.tour-stop-name{min-width:0;padding-top:3px}
.tour-stop-number,.tour-pin{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;background:#b6002b;color:white;font-weight:700;width:30px;height:30px;flex-shrink:0}
.tour-pin{border:2px solid white;box-shadow:0 1px 6px #0006}
.tour-pin-shell.is-selected .tour-pin{background:#342a2b;box-shadow:0 0 0 4px #b6002b55}
.tour-drag{border:0;background:transparent;cursor:grab;padding:8px;min-width:32px;flex-shrink:0}
.tour-stop textarea{min-height:65px}
.tour-stop-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.tour-stop-actions button{padding:8px 12px;min-height:44px}
.tour-view-tabs{display:none}
@media(max-width:900px){
  .tour-view-tabs{display:flex;gap:8px;margin-bottom:16px}
  .tour-view-tabs button{flex:1}
  .tour-view-tabs button[aria-pressed=true]{background:#342a2b;color:white}
  .tour-planner{display:block}
  .tour-map-panel{position:static}
  .tour-planner[data-tour-view-active=companies] .tour-map-panel,.tour-planner[data-tour-view-active=map] .tour-form-panel{display:none}
  .tour-map{height:clamp(260px,55dvh,600px)}
  .tour-drag{display:none}
}
@media(max-width:420px){.tour-planner .panel{padding:14px}.tour-fields{grid-template-columns:minmax(0,1fr)}.tour-stop{padding:10px}.tour-search-result{grid-template-columns:minmax(0,1fr)}.tour-search-result button{grid-column:1;grid-row:auto;justify-self:start}}

/* CRM-COMMENTS-001: compact customer cards; preserve the installed base stylesheet. */
.customer-cards{gap:12px}.customer-card{padding:14px 16px}.customer-card-heading{display:flex;align-items:baseline;gap:12px;justify-content:space-between}.customer-card .customer-card-seller{flex:0 1 35%;margin:0;font-size:12px;line-height:1.4;overflow-wrap:anywhere}.customer-card-heading h2{flex:1;min-width:0;margin:0;text-align:right}.customer-card-heading h2 button{font-size:17px;min-height:36px;padding:2px 0}.customer-card .customer-card-date{font-size:12px;margin:4px 0 10px}.customer-card-metrics{display:grid;grid-template-columns:minmax(0,.75fr) minmax(0,.75fr) minmax(0,1.8fr);gap:10px;align-items:start}.customer-card-metrics>span{font-size:12px;color:var(--muted)}.customer-card-metrics>span>strong{display:block;font-size:17px;color:var(--dark)}.customer-card-metrics .customer-amount{margin:0;display:flex;flex-direction:column-reverse;min-width:0}.customer-card-metrics .customer-amount>span{font-size:12px}.customer-card-metrics .customer-amount>strong{font-size:17px;margin:0;overflow-wrap:anywhere}.customer-intro{display:flex;align-items:baseline;justify-content:flex-start;gap:8px 18px;flex-wrap:wrap;margin:12px 0}.customer-intro h1{font-size:20px;margin:0;overflow-wrap:anywhere}.customer-intro p{font-size:13px;margin:0;overflow-wrap:anywhere}
@media(max-width:480px){.customer-card{padding:12px}.customer-card-heading{gap:8px}.customer-card-heading h2 button{font-size:16px}.customer-card-metrics{gap:7px}.customer-card-metrics .customer-amount>strong{font-size:15px}.customer-intro{gap:6px 12px}.customer-intro h1{font-size:19px}}

@media(max-width:480px){.customer-card-metrics{grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1.65fr)}.customer-card-metrics>span,.customer-card-metrics .customer-amount>span{font-size:11px;overflow-wrap:anywhere}}

/* V401: per-request freight decisions, desktop and mobile. */
.freight-card{display:grid;grid-template-columns:minmax(0,1fr) minmax(250px,1fr);gap:24px}.freight-card h2{overflow-wrap:anywhere}.freight-amounts{display:flex;flex-wrap:wrap;gap:24px}.freight-amounts dd{margin:4px 0;font-weight:700}.freight-card textarea{width:100%;box-sizing:border-box}.freight-card [data-feedback]{margin:0}.freight-card [data-feedback]:empty{display:none}@media(max-width:680px){.freight-card{grid-template-columns:minmax(0,1fr);gap:16px}.freight-card .actions{flex-wrap:wrap}}

/* CRM20-02..06: one compact, accessible grid for receivables and invoices. */
.receivable-scroll{max-width:100%;overflow:auto;border:1px solid #d8d2c9;border-radius:10px;background:#fff}
.receivable-grid{width:100%;border-collapse:collapse;font-size:13px;line-height:1.45}
.receivable-grid caption{text-align:left;padding:12px 14px;font-weight:600;color:#514a43}
.receivable-grid th,.receivable-grid td{padding:11px 12px;text-align:left;vertical-align:top;border-bottom:1px solid #e8e3dc}
.receivable-grid thead th{background:#f3f0eb;font-size:12px;white-space:normal;min-width:90px}
.receivable-grid th[scope=row]{min-width:145px;font-weight:600}
.receivable-grid td:nth-child(4){min-width:150px;max-width:240px}
.receivable-grid td:nth-child(5){min-width:115px}
.receivable-grid .amount{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.receivable-grid td:first-child,.receivable-grid td:nth-child(2){white-space:nowrap}
.receivable-grid a{display:inline-block;padding:5px 0;min-height:34px}
.receivable-grid small{display:block;font-weight:400;color:#655c53;margin-top:3px}
.receivable-grid tbody tr:hover{background:#faf8f4}
.followup-flag{display:inline-block;border:1px solid #c48c82;border-radius:5px;padding:3px 6px;color:#842d26;background:#fff3f0;font-size:12px;line-height:1.4}
.receivable-amounts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.receivable-amounts dt{font-size:13px;color:#655c53}
.receivable-amounts dd{margin:5px 0;font-size:20px;font-weight:700;overflow-wrap:anywhere}
.receivable-filters.filter-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));align-items:start;gap:14px}
.receivable-filters>label{width:auto;min-width:0}
.receivable-filters input,.receivable-filters select{width:100%;min-width:0;box-sizing:border-box}
.receivable-dates{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;grid-column:span 2}
.receivable-dates label{min-width:0}
.receivable-filters .crm-filter-actions,.receivable-filters .crm-chips{grid-column:1/-1}
@media(max-width:800px){.receivable-filters.filter-row{grid-template-columns:repeat(2,minmax(0,1fr))}.receivable-amounts{grid-template-columns:minmax(0,1fr)}.receivable-grid th,.receivable-grid td{padding:9px}.receivable-grid a{min-height:44px}.receivable-dates{gap:10px}}

/* INVOICE-DETAIL-001: one subtotal and a readable invoice record. */
.invoice-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:24px}
.invoice-heading h2{margin:0 0 10px;overflow-wrap:anywhere}
.invoice-heading>div{min-width:0}.invoice-heading>.button{flex-shrink:0}
.invoice-overview{display:grid;grid-template-columns:minmax(220px,.8fr) minmax(0,2fr);gap:28px;align-items:start}
.invoice-subtotal{margin:0;padding:20px;border:1px solid var(--border);border-radius:10px;background:#f7f4f1}
.invoice-subtotal dt{font-size:14px;color:var(--muted)}
.invoice-subtotal dd{margin:8px 0 0;font-size:clamp(23px,2.4vw,32px);font-weight:700;line-height:1.25;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.invoice-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 24px;margin:0}
.invoice-facts>div{min-width:0}.invoice-facts dt{font-size:13px;color:var(--muted)}
.invoice-facts dd{margin:4px 0 0;font-size:16px;font-weight:600;overflow-wrap:anywhere}
.invoice-facts a{display:inline-block;min-height:32px}
.invoice-collection{margin-top:24px;padding-top:22px;border-top:1px solid var(--border)}
.invoice-collection h3{margin-bottom:18px}.invoice-followup{margin:14px 0 0}.invoice-followup a{display:inline-block;padding:8px 0}
.invoice-file-note{margin:20px 0 0;padding:12px 14px;background:#f7f4f1;border-radius:8px;font-size:14px}
.invoice-freshness{margin-top:22px;border-top:1px solid var(--border);padding-top:14px}
.invoice-freshness summary{cursor:pointer;min-height:40px;font-size:14px;font-weight:600}
.invoice-freshness .invoice-facts{margin:12px 0}
@media(max-width:800px){.invoice-overview{grid-template-columns:minmax(0,1fr);gap:20px}.invoice-heading{flex-wrap:wrap}.invoice-subtotal{padding:16px}.invoice-facts{gap:16px}}
@media(max-width:480px){.invoice-detail{padding:18px}.invoice-facts{grid-template-columns:minmax(0,1fr)}.invoice-heading>.button{width:100%}}
