/* Shared header wrappers retain the original layout on all other portal views. */
.customer-primary-actions,.customer-toolbar,.customer-toolbar-tools { display:contents; }
.customer-document-link { display:inline-flex;align-items:center;justify-content:center;gap:9px; }
.customer-document-link svg { width:19px;height:19px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round; }

/* Two clear rows: create/request actions, then search and display controls. */
body:not(.locked):not(.password-change-required):has(#customersView.active) .topbar {
  display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"heading primary" "toolbar toolbar";
  gap:22px 24px;padding:24px;background:#fff;border:1px solid #dce6ec;border-radius:18px;
  box-shadow:0 4px 18px #14344905;align-items:center;min-width:0;
}
body:has(#customersView.active) .topbar-heading { grid-area:heading;min-width:0; }
body:has(#customersView.active) .topbar .top-actions { display:contents; }
body:has(#customersView.active) .topbar .kicker { display:block;font-size:10px;letter-spacing:.12em;color:#667d8b; }
body:has(#customersView.active) .topbar h1 { font-size:27px;line-height:1.2;margin:5px 0 7px;letter-spacing:-.025em; }
body:has(#customersView.active) .topbar h1 { display:inline-flex;align-items:center;gap:10px;padding:10px 16px;border:1px solid #c6dfe4;border-radius:11px;background:#f1faf8;color:#075d68;font-size:20px; }
body:has(#customersView.active) .topbar h1::before { content:"";width:22px;height:22px;background:currentColor;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='1.8' d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2M16 3a4 4 0 0 1 0 8m6 10v-2a4 4 0 0 0-3-3.87'/%3E%3Ccircle fill='none' stroke='black' stroke-width='1.8' cx='9' cy='7' r='4'/%3E%3C/svg%3E") center/contain no-repeat; }
body:has(#customersView.active) .topbar p { font-size:13px;line-height:1.55;margin:0;color:#637b8b; }
body:has(#customersView.active) .customer-primary-actions { grid-area:primary;display:flex;gap:10px;align-items:center; }
body:has(#customersView.active) .customer-primary-actions button { min-height:46px;border-radius:11px;font-size:13px;white-space:nowrap; }
body:has(#customersView.active) #addCustomerButton { color:#fff;background:#007f8d;border-color:#007f8d;box-shadow:0 3px 8px #007f8d20; }
body:has(#customersView.active) #addCustomerButton:hover { background:#006b77;border-color:#006b77; }
body:has(#customersView.active) #customerScanInvitationsButton { background:#f4fafb;border-color:#c6dfe4;color:#076577;box-shadow:none; }
body:has(#customersView.active) .customer-toolbar { grid-area:toolbar;display:flex;flex-wrap:wrap;gap:12px;align-items:center;border-top:1px solid #e9eff3;padding-top:18px;min-width:0; }
body:has(#customersView.active) .topbar .search { order:0;flex:1 1 260px;width:auto;min-width:200px;max-width:none;border-radius:11px;min-height:46px;background:#f8fafc;border-color:#d6e2e9;box-shadow:none; }
body:has(#customersView.active) .topbar .search:focus-within { background:#fff;border-color:#008596;box-shadow:0 0 0 3px #00859616; }
body:has(#customersView.active) .topbar .search input { min-width:0;min-height:44px;font-size:14px;background:transparent; }
body:has(#customersView.active) .topbar .customer-filter-summary--topbar { order:0;min-height:30px;padding:0 11px;border-radius:8px;font-size:12px;box-shadow:none; }
body:has(#customersView.active) .topbar-heading #customerFilterSummary {display:block;min-height:0;margin-top:6px;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;color:#637b8b;font-size:12px;font-weight:500;}
body:has(#customersView.active) .topbar-heading #customerFilterSummary[hidden]{display:none;}
body:has(#customersView.active) .customer-toolbar-tools { display:flex;gap:8px;align-items:center;min-width:0; }
body:has(#customersView.active) .customer-toolbar-tools button { min-height:44px;border-radius:9px;padding:0 12px;box-shadow:none;font-size:12px;white-space:nowrap; }
body:has(#customersView.active) #customerViewMode { min-height:44px;margin:0;border-radius:10px;padding:3px; }
body:has(#customersView.active) #customerViewMode button { min-height:36px;padding:0 12px;border-radius:7px; }
body:has(#customersView.active) #newTicketButton { display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid #b8d2e4;background:#fff;color:#006b80; }
body:has(#customersView.active) #newTicketButton:hover { background:#eef4f7; }
body:has(#customersView.active) .topbar button:focus-visible { outline:3px solid #008596;outline-offset:3px; }
body:has(#customersView.active) .topbar .admin-approval-alert:not([hidden]) { grid-column:1/-1; }

@media(max-width:1100px) {
  body:not(.locked):not(.password-change-required):has(#customersView.active) .topbar { grid-template-columns:minmax(0,1fr);grid-template-areas:"heading" "primary" "toolbar";gap:16px;padding:20px; }
  body:has(#customersView.active) .customer-primary-actions { justify-content:flex-start; }
  body:has(#customersView.active) .customer-toolbar-tools { flex-wrap:wrap; }
}
@media(max-width:600px) {
  body:not(.locked):not(.password-change-required):has(#customersView.active) .topbar { padding:16px;border-radius:14px;gap:16px; }
  body:has(#customersView.active) .topbar-heading { min-width:0; }
  body:has(#customersView.active) .topbar h1 { font-size:24px; }
  body:has(#customersView.active) .customer-primary-actions { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;align-items:stretch; }
  body:has(#customersView.active) .customer-primary-actions button { min-width:0;min-height:56px;padding:9px;font-size:12px;white-space:normal;line-height:1.4; }
  body:has(#customersView.active) .customer-toolbar { display:grid;grid-template-columns:minmax(0,1fr);gap:12px;padding-top:16px; }
  body:has(#customersView.active) .topbar .search { grid-row:1;min-width:0;width:100%;max-width:none; }
  body:has(#customersView.active) .topbar .customer-filter-summary--topbar { justify-self:start;min-height:26px; }
  body:has(#customersView.active) .customer-toolbar-tools { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px; }
  body:has(#customersView.active) #customerViewMode { grid-column:1/-1;justify-self:start; }
  body:has(#customersView.active) #customerViewMode button { min-height:44px; }
  body:has(#customersView.active) #newTicketButton { grid-column:1/-1; }
  body:has(#customersView.active) .customer-toolbar-tools>button { min-width:0;padding:6px;white-space:normal;line-height:1.4; }
}
#customersView #customerFilterPanel {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 8px 10px;
}
#customersView #customerFilterPanel > label { grid-column: span 2; min-width: 0; }
#customersView #customerFilterPanel > .customer-filter-search { grid-column: span 8; }
#customersView #customerFilterPanel > button { grid-column: span 2; min-height: 38px; }
#customersView #customerFilterPanel > .customer-filter-reset { grid-row: 1; grid-column: 11 / span 2; }
#customersView #customerFilterPanel > #customerFilterSearchSubmit { grid-row: 1; grid-column: 9 / span 2; }
#customersView #customerFilterPanel input { width: 100%; height: 38px; box-sizing: border-box; padding: 8px 10px; border: 1px solid #d5e4df; border-radius: 9px; font: inherit; }
.customer-toolbar .search[hidden] { display: none !important; }
@media (max-width: 900px) {
  #customersView #customerFilterPanel { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #customersView #customerFilterPanel > .customer-filter-search { grid-column: 1 / -1; }
  #customersView #customerFilterPanel > button,
  #customersView #customerFilterPanel > .customer-filter-reset,
  #customersView #customerFilterPanel > #customerFilterSearchSubmit { grid-row: auto; grid-column: span 2; }
}
@media (max-width: 480px) {
  #customersView #customerFilterPanel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Single-row customer heading; count replaces the descriptive second line. */
body.amv-professional-ui:not(.locked):has(#customersView.active) .topbar {grid-template-areas:"heading primary"!important;grid-template-columns:minmax(0,1fr) auto!important;padding:10px 14px!important;min-height:0!important;gap:10px!important;margin-bottom:10px!important;align-items:center!important;}
body.amv-professional-ui:has(#customersView.active) .topbar-heading {display:flex!important;align-items:center;flex-wrap:wrap;gap:8px 12px;flex:1 1 auto!important;min-width:0!important;}
body.amv-professional-ui:has(#customersView.active) .topbar :is(#pageKicker,#pageSubtitle) {display:none!important;}
body.amv-professional-ui:has(#customersView.active) .topbar #pageTitle {margin:0!important;padding:6px 10px!important;font-size:18px!important;line-height:1.2!important;min-height:34px;box-shadow:none!important;}
body.amv-professional-ui:has(#customersView.active) #customerFilterSummary {margin:0!important;padding:0!important;border:0!important;background:none!important;min-height:0!important;font-size:12px!important;color:#617784;white-space:nowrap;}
body.amv-professional-ui:has(#customersView.active) .topbar .top-actions {flex:0 1 auto!important;gap:8px!important;min-height:0!important;}
body.amv-professional-ui:has(#customersView.active) .customer-primary-actions {gap:8px!important;}
body.amv-professional-ui:has(#customersView.active) .customer-primary-actions :is(button,.customer-view-mode) {min-height:36px!important;}
body.amv-professional-ui:has(#customersView.active) .customer-primary-actions>button {padding:7px 12px!important;border-radius:9px;box-shadow:none!important;font-size:12px;}
@media(max-width:700px){body.amv-professional-ui:has(#customersView.active) .topbar .top-actions {flex-basis:100%!important;justify-content:flex-start!important;}body.amv-professional-ui:has(#customersView.active) .customer-primary-actions {width:100%;justify-content:flex-start;}body.amv-professional-ui:has(#customersView.active) .topbar {padding:10px!important;}}

body.amv-professional-ui:has(#customersView.active) #customerViewMode {padding:2px!important;min-height:36px!important;}
body.amv-professional-ui:has(#customersView.active) #customerViewMode button {min-height:30px!important;}
@media(max-width:900px){body.amv-professional-ui:not(.locked):has(#customersView.active) .topbar {grid-template-columns:minmax(0,1fr)!important;grid-template-areas:"heading" "primary"!important;}body.amv-professional-ui:has(#customersView.active) .customer-primary-actions {display:flex!important;flex-wrap:wrap!important;}}
