.customer-layout {
  display: grid;
  grid-template-columns: minmax(340px, var(--customer-list-pane, 45%)) 14px minmax(420px, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  height: 100%;
  min-height: 0;
}

.vendor-layout {
  grid-template-columns: minmax(340px, 45%) minmax(420px, 1fr);
  gap: 14px;
}

.customer-layout > .panel {
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 0;
  min-width: 0;
}

.customer-layout > .panel > .panel-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.customer-search-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.customer-results {
  flex: 1;
  min-height: 0;
  max-height: none;
}

.customer-pane-resizer {
  position: relative;
  align-self: stretch;
  width: 14px;
  min-width: 14px;
  border: 0;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
}

.customer-pane-resizer::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 50%;
  width: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 78%, var(--accent) 22%);
  transform: translateX(-50%);
  transition: background 0.15s ease, width 0.15s ease;
}

.customer-pane-resizer:hover::before,
.customer-pane-resizer:focus-visible::before,
.customer-layout.is-resizing .customer-pane-resizer::before {
  width: 6px;
  background: var(--accent);
}

.customer-pane-resizer:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 2px;
}

.customer-layout.is-resizing {
  cursor: col-resize;
  user-select: none;
}

.customer-profile-panel {
  overflow: hidden;
}

.customer-profile-panel .panel-body {
  gap: 0;
}

.customer-profile-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

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

.tabs {
  display: flex;
  gap: 6px;
  margin: 12px 0;
  border-bottom: 1px solid var(--line);
}

.tab-btn {
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 9px 11px;
  font-weight: 700;
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.customer-detail-scroll,
.customer-history-results {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

#customerProfileContent,
#vendorProfileContent {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.customer-menu-grid {
  margin-top: 14px;
}

.phone-orders-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.phone-orders-panel > .panel-body {
  min-height: 0;
}

.phone-order-entry {
  height: 100%;
  min-height: 0;
}

.phone-order-layout-form {
  display: grid;
  grid-template-columns: var(--phone-order-columns, minmax(520px, 1.35fr) minmax(360px, .75fr));
  gap: 14px;
  height: 100%;
  min-height: 0;
  font-family: var(--phone-order-font-family, inherit);
  font-size: var(--phone-order-font-size, 13px);
}

.phone-order-layout-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  min-height: 0;
}

.phone-order-layout-group {
  position: relative;
  align-self: flex-start;
  width: 100%;
  background: var(--phone-order-group-bg, #fff);
}

.phone-order-layout-group-drag-handle {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 3;
  color: var(--accent);
  cursor: move;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.phone-order-layout-group-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.phone-order-layout-field {
  min-width: 120px;
}

.phone-order-field-groupTitle {
  min-width: 96px;
}

.phone-order-group-title-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
}

.phone-order-group-title-field h3 {
  margin: 0;
  font-size: 1.15em;
  line-height: 1.1;
  white-space: nowrap;
}

.phone-order-layout-field > label,
.phone-order-layout-field input,
.phone-order-layout-field select,
.phone-order-layout-field textarea {
  width: 100%;
}

.phone-order-add-button {
  align-self: end;
  width: 100%;
  min-height: 40px;
}

.phone-order-saved-header {
  display: flex;
  justify-content: flex-end;
}

.phone-order-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

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

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

.phone-order-customer-search-row .primary {
  min-width: 150px;
  min-height: 40px;
}

.phone-order-customer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #b8d8d3;
  border-radius: 8px;
  background: #eefaf7;
}

.phone-order-customer-card.is-empty {
  border-color: var(--line);
  background: var(--panel-soft);
}

.phone-order-customer-card span,
.phone-order-customer-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.phone-order-customer-card strong {
  display: block;
  margin: 3px 0;
  font-size: 18px;
}

.phone-order-results {
  display: grid;
  gap: 7px;
  max-height: 190px;
  overflow: auto;
}

.phone-order-results:not(:empty) {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.phone-order-result,
.phone-order-item-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  text-align: left;
}

.phone-order-result:hover,
.phone-order-item-result:hover {
  border-color: var(--accent);
}

.phone-order-result strong,
.phone-order-result span,
.phone-order-item-result strong,
.phone-order-item-result span {
  display: block;
}

.phone-order-result span,
.phone-order-item-result span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.phone-order-result-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.phone-order-result-action {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-weight: 900;
}

.phone-order-result .phone-order-result-action {
  color: #fff;
  font-size: 13px;
}

.phone-order-result-empty {
  color: var(--muted);
  font-weight: 800;
}

.phone-order-item-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px auto;
  gap: 10px;
  align-items: end;
}

.phone-order-line-table {
  flex: 1;
  min-height: 160px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.phone-order-line-table table {
  min-width: 680px;
}

.phone-order-line-qty {
  max-width: 96px;
}

.phone-order-summary {
  display: grid;
  grid-template-columns: minmax(120px, .4fr) minmax(150px, .5fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid #b8d8d3;
  border-radius: 8px;
  background: #eefaf7;
}

.phone-order-summary div {
  display: grid;
  gap: 3px;
}

.phone-order-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.phone-order-summary strong {
  font-size: 22px;
}

.phone-order-saved-list {
  flex: 1;
  min-height: 0;
  max-height: none;
}

.phone-order-recent-card {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.phone-order-recent-card h3 {
  margin: 0;
}

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

.vendor-layout.concession-active {
  grid-template-columns: minmax(260px, .55fr) minmax(0, 2fr);
}

.vendor-history-results {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

.vendor-history-results table {
  min-width: 620px;
}

.vendor-history-toolbar .secondary.active {
  border-color: var(--accent);
  background: #edf4fd;
  color: var(--accent-dark);
}

.vendor-overview {
  align-items: start;
}

.concession-workspace {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 12px;
  padding-right: 3px;
}

.concession-settings-card,
.concession-assignment-card,
.concession-settlement-card,
.concession-history-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.concession-step-label {
  display: block;
  margin-bottom: 3px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.concession-settings-card {
  background: #edf4fd;
}

.concession-settings-card h4,
.concession-assignment-card h4,
.concession-settlement-card h4,
.concession-history-card h4,
.concession-settings-card p,
.concession-assignment-card p,
.concession-settlement-card p {
  margin: 0;
}

.concession-settings-grid {
  display: grid;
  grid-template-columns: minmax(150px, .8fr) repeat(2, minmax(130px, .65fr)) minmax(220px, 1.2fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

.concession-type-toggle .checkbox-box {
  min-height: 40px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  display: grid;
  place-items: center;
}

.concession-type-toggle input {
  width: 22px;
  height: 22px;
}

.concession-save-button {
  min-height: 40px;
  white-space: nowrap;
}

.concession-assignment-card.is-disabled {
  opacity: .55;
  pointer-events: none;
}

.concession-assignment-list {
  display: grid;
  gap: 6px;
  max-height: 190px;
  overflow: auto;
  margin: 10px 0;
}

.concession-assignment-row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 6px 2px;
}

.concession-assignment-row strong {
  display: grid;
  gap: 2px;
}

.concession-assignment-row strong small {
  color: var(--muted);
  font-weight: 650;
}

.concession-assignment-add {
  display: grid;
  grid-template-columns: 120px minmax(170px, 1fr) minmax(170px, 1fr) minmax(170px, 1fr) 145px 145px auto;
  gap: 8px;
  align-items: end;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.concession-assignment-add [hidden] {
  display: none;
}

.concession-period-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 180px)) auto;
  gap: 10px;
  align-items: end;
  margin: 10px 0;
}

.concession-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.concession-summary-grid > div {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  border-radius: 6px;
  padding: 9px;
  display: grid;
  gap: 3px;
}

.concession-summary-grid span,
.concession-summary-grid small {
  color: var(--muted);
}

.concession-summary-grid strong {
  font-size: 18px;
}

.concession-summary-grid .concession-payable {
  border-color: var(--accent);
  background: #e3f6f2;
}

.concession-preview-lines {
  max-height: 260px;
  overflow: auto;
}

.concession-preview-lines table,
.concession-history-list table {
  min-width: 720px;
}

.concession-preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
}

.concession-settlement-complete {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border-color: #7fc5b9;
  background: #edf9f6;
  padding: 16px;
}

.concession-complete-mark {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #007a70;
  color: #fff;
  font-size: 30px;
  font-weight: 900;
}

.concession-complete-copy {
  min-width: 0;
}

.concession-complete-copy h4,
.concession-complete-copy p {
  margin: 0;
}

.concession-complete-copy p {
  margin-top: 4px;
}

.concession-complete-total {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 8px;
}

.concession-complete-total span {
  color: var(--muted);
  font-weight: 700;
}

.concession-complete-total strong {
  font-size: 24px;
}

.concession-complete-actions {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 8px;
  justify-items: stretch;
}

.concession-complete-actions .ghost {
  grid-column: 1 / -1;
}

.concession-preview-empty {
  padding: 18px 4px;
}

.concession-history-list {
  max-height: 260px;
  overflow: auto;
}

#concessions.view.active {
  min-height: 0;
  overflow: hidden;
}

.concession-management-workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  height: 100%;
  min-height: 0;
}

.concession-management-workspace .panel {
  border-radius: 6px;
  box-shadow: none;
}

.concession-management-workspace .primary {
  border-color: var(--mc-blue-700, #1559b7);
  background: var(--mc-blue-700, #1559b7);
}

.concession-management-workspace .primary:hover {
  border-color: #124fa4;
  background: #124fa4;
}

.concession-management-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 66px;
  padding: 9px 12px;
}

.concession-management-header-primary,
.concession-management-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.concession-management-back {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 11px;
  white-space: nowrap;
}

.concession-management-back span {
  margin-right: 3px;
  color: var(--mc-blue-700, #1559b7);
  font-size: 16px;
}

.concession-management-identity {
  display: grid;
  min-width: 0;
}

.concession-management-identity h3,
.concession-management-identity .eyebrow {
  margin: 0;
}

.concession-management-identity h3 {
  overflow: hidden;
  margin-top: 1px;
  font-size: 17px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.concession-management-identity .eyebrow,
.concession-management-identity > span:last-child {
  color: var(--mc-muted, var(--muted));
  font-size: 10px;
  line-height: 1.25;
}

.concession-management-header-status {
  margin-right: 4px;
  font-size: 11px;
}

.concession-management-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 10px;
  height: 100%;
  min-height: 0;
}

.concession-vendor-rail,
.concession-management-main {
  min-height: 0;
}

.concession-vendor-rail {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.concession-vendor-rail-header {
  min-height: 52px;
  padding: 9px 11px;
}

.concession-vendor-rail-header > div {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.concession-vendor-rail-header h3 {
  margin: 0;
  font-size: 14px;
}

.concession-vendor-rail-header > div > span {
  overflow: hidden;
  color: var(--mc-muted, var(--muted));
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.concession-vendor-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 3px 0;
  scrollbar-width: thin;
}

.concession-vendor-row {
  width: 100%;
  display: grid;
  gap: 5px;
  padding: 9px 10px 9px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.concession-vendor-row:hover {
  background: #f7faff;
}

.concession-vendor-row.active {
  background: var(--mc-blue-100, #eaf2ff);
  box-shadow: inset 3px 0 var(--mc-blue-600, #1f6bd3);
}

.concession-vendor-row > strong {
  overflow: hidden;
  font-size: 12px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.concession-vendor-row-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  color: var(--mc-muted, var(--muted));
  font-size: 9px;
}

.concession-vendor-row-meta small {
  overflow: hidden;
  color: inherit;
  font-size: inherit;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.concession-vendor-list-empty {
  display: grid;
  gap: 4px;
  padding: 18px 14px;
  text-align: center;
}

.concession-vendor-list-empty strong {
  font-size: 12px;
}

.concession-vendor-list-empty span {
  color: var(--mc-muted, var(--muted));
  font-size: 10px;
  line-height: 1.4;
}

.concession-management-main {
  display: grid;
  grid-auto-rows: max-content;
  gap: 10px;
  align-content: start;
  overflow: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}

.concession-management-empty {
  min-height: 220px;
  display: grid;
  align-content: center;
  gap: 4px;
  place-items: center;
  padding: 24px;
  text-align: center;
}

.concession-management-stats {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.concession-management-stats > div {
  display: grid;
  align-content: center;
  gap: 1px;
  min-width: 92px;
  padding: 3px 13px;
  border-left: 1px solid var(--line);
}

.concession-management-stats span {
  color: var(--mc-muted, var(--muted));
  font-size: 9px;
  font-weight: 720;
  text-transform: uppercase;
}

.concession-management-stats strong {
  font-size: 15px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.concession-management-stats .has-conflict {
  color: #9a5b05;
}

.concession-conflict-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid #d99b3f;
  border-left-width: 4px;
  border-radius: 6px;
  background: #ffffff;
}

.concession-conflict-panel > div {
  display: grid;
  gap: 2px;
}

.concession-conflict-panel span {
  color: var(--mc-muted, var(--muted));
  font-size: 10px;
}

.concession-management-section-header {
  min-height: 48px;
  padding: 9px 12px;
}

.concession-management-section-header > div:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.concession-management-section-header h3 {
  margin: 0;
  font-size: 14px;
}

.concession-management-section-header > div:first-child > span {
  color: var(--mc-muted, var(--muted));
  font-size: 10px;
}

.concession-management-setup .panel-body,
.concession-management-settlement .panel-body {
  padding: 10px 12px;
}

.concession-management-setup-grid {
  display: grid;
  grid-template-columns: minmax(130px, .45fr) minmax(130px, .45fr) minmax(280px, 1.4fr);
  gap: 10px;
}

.concession-management-setup-grid label,
.concession-managed-add-rule label,
.concession-bulk-grid label,
.concession-managed-period label,
.concession-managed-assignment-row label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 720;
}

.concession-management-setup-grid input,
.concession-management-setup-grid select,
.concession-managed-add-rule input,
.concession-managed-add-rule select,
.concession-managed-period input,
.concession-bulk-grid input,
.concession-bulk-grid textarea,
.concession-managed-assignment-row input {
  min-height: 34px;
  padding: 6px 8px;
  border-color: var(--line-strong);
  border-radius: 5px;
  background: #ffffff;
}

.concession-management-assignments {
  border-color: #b8c9df;
}

.concession-assignment-management-list {
  max-height: 260px;
  overflow: auto;
  padding: 4px 12px;
  scrollbar-width: thin;
}

.concession-managed-assignment-row {
  display: grid;
  grid-template-columns: 82px minmax(170px, 1fr) minmax(135px, 160px) minmax(135px, 160px) auto;
  align-items: end;
  gap: 8px;
  min-height: 48px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.concession-managed-assignment-row > strong {
  align-self: center;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.concession-assignment-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-height: 92px;
  padding: 14px;
  text-align: left;
}

.concession-assignment-empty > div {
  display: grid;
  gap: 3px;
}

.concession-assignment-empty strong {
  font-size: 12px;
}

.concession-assignment-empty span {
  color: var(--mc-muted, var(--muted));
  font-size: 10px;
}

.concession-assignment-empty-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  color: var(--mc-blue-700, #1559b7);
  border: 1px solid #cfdae6;
  border-radius: 50%;
  background: #f8fbff;
}

.concession-assignment-empty-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.concession-managed-add-rule {
  display: grid;
  grid-template-columns: 120px minmax(180px, 1fr) minmax(180px, 1fr) minmax(180px, 1fr) 145px 145px auto;
  gap: 8px;
  align-items: end;
  padding: 9px 12px 10px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.concession-managed-add-rule-title {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.concession-managed-add-rule-title strong {
  font-size: 11px;
}

.concession-managed-add-rule-title span {
  color: var(--mc-muted, var(--muted));
  font-size: 9px;
}

.concession-managed-add-rule [hidden] {
  display: none;
}

.concession-bulk-import {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0 0 6px 6px;
  background: #fff;
}

.concession-bulk-import summary {
  cursor: pointer;
  padding: 8px 12px;
  color: var(--mc-blue-700, #1559b7);
  font-size: 10px;
  font-weight: 760;
}

.concession-bulk-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(190px, .7fr) 150px 150px auto;
  gap: 10px;
  align-items: end;
  padding: 2px 12px 10px;
}

.concession-bulk-text {
  grid-row: span 2;
}

.concession-bulk-text textarea {
  resize: vertical;
  min-height: 112px;
}

.concession-management-settlement .segmented-control {
  display: inline-grid;
  grid-template-columns: repeat(2, auto);
}

.concession-management-settlement .segmented-control button {
  min-height: 32px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--ink);
  padding: 5px 10px;
  font-size: 10px;
  font-weight: 720;
}

.concession-management-settlement .segmented-control button.active {
  border-color: var(--mc-blue-700, #1559b7);
  background: var(--mc-blue-700, #1559b7);
  color: #ffffff;
}

.concession-managed-period {
  display: grid;
  grid-template-columns: 160px 160px minmax(240px, 1fr) max-content;
  gap: 10px;
  align-items: end;
  margin-bottom: 5px;
}

.concession-adjustment-reason {
  grid-column: 3;
}

.concession-managed-complete {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border-left: 4px solid var(--mc-success, #138a55);
  background: #ffffff;
}

.concession-managed-complete h4,
.concession-managed-complete p {
  margin: 0;
}

.concession-managed-complete > div:nth-child(2) > strong {
  display: block;
  margin-top: 6px;
  font-size: 23px;
}

.concession-management-history-list {
  max-height: 290px;
  overflow: auto;
  scrollbar-width: thin;
}

.concession-management-history-list table {
  width: 100%;
  min-width: 760px;
  font-size: 10px;
}

.concession-management-history-list th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 7px 8px;
  background: #eef3f7;
  box-shadow: inset 0 -1px var(--line);
  white-space: nowrap;
}

.concession-management-history-list td {
  padding: 7px 8px;
}

.concession-management-history-list td:first-child {
  display: grid;
  gap: 3px;
}

.concession-management-history-list td:nth-child(3),
.concession-history-list td:nth-child(2) {
  min-width: 105px;
}

.concession-management-history-list td small,
.concession-history-list td small {
  display: block;
  max-width: 210px;
  margin-top: 4px;
  color: var(--muted);
  white-space: normal;
}

.void-concession-settlement.compact {
  min-height: 34px;
  padding: 6px 9px;
  white-space: nowrap;
}

.tag.warning {
  background: #fff0ce;
  color: #704a00;
}

.concession-management-workspace .tag.warning {
  color: #805005;
  background: #ffffff;
  border-color: #d8a14a;
}

@media (max-width: 1450px) {
  .concession-management-shell {
    grid-template-columns: 235px minmax(0, 1fr);
  }

  .concession-management-stats > div {
    min-width: 82px;
    padding-inline: 10px;
  }

  .concession-managed-add-rule,
  .concession-bulk-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .concession-managed-add-rule-title {
    grid-column: 1 / -1;
  }

  .concession-managed-period {
    grid-template-columns: 150px 150px minmax(220px, 1fr) max-content;
  }
}

.item-concession-ownership-banner {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid #85bdb5;
  border-left: 5px solid #007a70;
  border-radius: 7px;
  background: #edf9f6;
}

.item-concession-ownership-banner > div:first-child {
  display: grid;
  gap: 2px;
  min-width: 180px;
}

.item-concession-label,
.item-concession-unassigned {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.item-concession-ownership-rules {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

@media (max-width: 1250px) {
  .concession-managed-add-rule,
  .concession-bulk-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .concession-managed-period {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .concession-adjustment-reason {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .concession-management-shell {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .concession-vendor-rail {
    max-height: 240px;
  }

  .concession-managed-assignment-row,
  .concession-management-setup-grid,
  .concession-management-header,
  .concession-managed-complete {
    grid-template-columns: 1fr;
  }

  .concession-management-header {
    display: grid;
  }
}

@media (max-width: 1200px) {
  .concession-settings-grid,
  .concession-assignment-add {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .concession-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .concession-settlement-complete {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .concession-complete-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .concession-complete-actions .ghost {
    grid-column: auto;
  }
}

.history-toolbar {
  flex: 0 0 auto;
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.history-criteria {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 160px)) auto;
  gap: 10px;
  align-items: end;
}

.history-quick-ranges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-range-btn {
  min-height: 36px;
  padding: 7px 12px;
}

.history-range-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.history-note {
  margin: 0;
}

.customer-edit-form {
  max-height: calc(100vh - 360px);
  overflow: auto;
  padding-right: 4px;
}

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

.customer-overview-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.profile-section {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.profile-section h4,
.statement-section h4,
.card-on-file-section h4 {
  margin: 0;
}

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

.profile-kv-grid .kv {
  grid-template-columns: 118px minmax(0, 1fr);
}

.profile-kv-grid .kv strong {
  overflow-wrap: break-word;
}

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

.demographics-grid .kv {
  grid-template-columns: 104px minmax(0, 1fr);
}

.demographics-grid .kv-wide {
  grid-column: 1 / -1;
}

.demographics-grid .kv-wide strong {
  white-space: normal;
  overflow-wrap: break-word;
}

.demographics-grid .kv strong {
  word-break: normal;
}

.customer-layout-profile {
  display: grid;
  grid-template-columns: repeat(var(--customer-profile-column-count, 2), minmax(0, 1fr));
  gap: 12px;
  font-family: var(--customer-profile-font-family, var(--font-main));
  font-size: var(--customer-profile-font-size, 13px);
}

.customer-layout-column-settings {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(260px, 1.6fr) auto;
  align-items: end;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.customer-layout-column-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.customer-layout-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  align-items: stretch;
}

.customer-layout-group {
  width: 100%;
  max-width: 100%;
  background: var(--customer-group-bg, var(--panel-soft));
}

.customer-layout-field-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 9px 10px;
  align-items: start;
}

.customer-profile-value {
  display: grid;
  align-content: start;
  min-width: 0;
  min-height: 58px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  overflow: hidden;
}

.customer-profile-value > span {
  display: block;
  color: var(--muted);
  font-size: max(11px, calc(var(--customer-profile-font-size, 13px) - 2px));
  font-weight: 850;
  line-height: 1.15;
}

.customer-profile-value strong {
  display: block;
  min-width: 0;
  color: var(--ink);
  font-size: var(--customer-profile-font-size, 13px);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.customer-profile-value-badge strong {
  display: flex;
  align-items: center;
}

.customer-profile-note-value {
  white-space: normal;
}

.customer-layout-designer-modal {
  width: min(1180px, 96vw);
}

.customer-layout-designer-modal .modal-body {
  padding-top: 0;
}

.customer-layout-designer-form {
  user-select: none;
}

.customer-layout-designer-form .customer-profile-value {
  pointer-events: none;
}

.customer-layout-designer-group {
  min-height: 90px;
}

.customer-layout-designer-field > .customer-profile-value {
  pointer-events: none;
}

.profile-note {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.profile-checks,
.checkbox-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.checkbox-line,
.radio-line {
  display: inline-flex;
  grid-template-columns: none;
  grid-auto-flow: column;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
}

.checkbox-line input,
.radio-line input {
  width: auto;
}

.sales-total-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 12px;
}

.sales-total-controls {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.sales-total-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

#salesTotalSummary {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.sales-total-results {
  flex: 1;
  min-height: 0;
  max-height: none;
}

.upload-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.sale-detail-panel {
  margin-top: 12px;
  margin-bottom: 12px;
}

.nested-panel {
  box-shadow: none;
}

.sale-lines {
  margin: 12px 0;
  max-height: 230px;
}

.compact-list {
  max-height: 180px;
}

.card-on-file-section {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.statement-section {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-title-row h4 {
  margin: 0;
  font-size: 15px;
}

.add-card-form {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.kv {
  display: grid;
  grid-template-columns: 135px minmax(0, 1fr);
  gap: 8px;
  font-size: 13px;
}

.kv span:first-child {
  color: var(--muted);
}

.security-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 30000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(9, 25, 34, .86);
}

.security-auth-card {
  width: min(440px, 100%);
  padding: 28px;
  border: 1px solid #35515e;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .36);
}

.security-auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.security-auth-brand > span { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 8px; background: #0b948e; color: #fff; font-weight: 800; }
.security-auth-brand strong, .security-auth-brand small { display: block; }
.security-auth-card h2 { margin: 0 0 18px; }
.security-auth-card label { display: grid; gap: 6px; margin-top: 13px; color: #536672; font-weight: 700; }
.security-auth-card input { min-height: 42px; }
.security-auth-actions { display: flex; justify-content: flex-end; margin-top: 22px; }
.security-auth-error { margin-bottom: 12px; padding: 10px 12px; border-left: 4px solid #b72030; background: #fff0f1; color: #8f1724; }

.security-admin-shell {
  --security-blue: #1d63bd;
  --security-blue-dark: #174f96;
  --security-blue-soft: #eaf2fd;
  --security-ink: #17253a;
  --security-muted: #64748b;
  --security-border: #d5dde7;
  --security-surface: #fff;
  --security-workspace: #f4f6f9;
  min-height: 560px;
  color: var(--security-ink);
  background: var(--security-workspace);
}

.security-admin-shell .primary {
  border-color: var(--security-blue);
  background: var(--security-blue);
}

.security-admin-shell [hidden] { display: none !important; }
.security-admin-shell .primary:hover { border-color: var(--security-blue-dark); background: var(--security-blue-dark); }
.security-admin-shell button:focus-visible,
.security-admin-shell input:focus-visible,
.security-admin-shell select:focus-visible {
  outline: 2px solid var(--security-blue);
  outline-offset: 1px;
}
.security-admin-shell .settings-panel-header { min-height: 58px; padding: 8px 14px; background: #fff; }
.security-admin-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.security-admin-heading > div { display: grid; gap: 2px; }
.security-admin-heading strong { font-size: 17px; line-height: 1.15; }
.security-admin-heading span { color: var(--security-muted); font-size: 12px; font-weight: 500; }
.security-tabs { display: flex; align-self: stretch; gap: 18px; }
.security-tabs button {
  min-height: 42px;
  padding: 0 2px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #53657a;
  font-size: 13px;
  font-weight: 750;
}
.security-tabs button:hover { color: var(--security-blue-dark); }
.security-tabs button.active { border-bottom-color: var(--security-blue); color: var(--security-blue-dark); }
#securityAdminBody { min-width: 0; }

.security-admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 31%) minmax(0, 1fr);
  gap: 10px;
  height: max(590px, calc(100vh - 205px));
  padding: 10px;
  overflow: hidden;
}

.security-list-pane,
.security-detail-pane,
.security-section,
.security-role-header,
.security-module-navigator,
.security-permission-editor,
.security-my-account-header {
  min-width: 0;
  border: 1px solid var(--security-border);
  border-radius: 6px;
  background: var(--security-surface);
}

.security-list-pane { display: flex; flex-direction: column; min-height: 0; padding: 10px; }
.security-detail-pane { min-height: 0; padding: 10px; overflow-y: auto; overscroll-behavior: contain; }
.security-pane-heading,
.security-section-heading,
.security-role-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.security-pane-heading { min-height: 38px; margin-bottom: 8px; }
.security-pane-heading > div { display: grid; gap: 1px; }
.security-pane-heading h3,
.security-section-heading h4 { margin: 0; color: var(--security-ink); }
.security-pane-heading h3 { font-size: 14px; }
.security-pane-heading span,
.security-section-heading > span { color: var(--security-muted); font-size: 11px; font-weight: 650; }
.security-pane-heading .primary { min-height: 32px; padding: 5px 10px; font-size: 12px; }

.security-search-field { position: relative; display: block; }
.security-search-field::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 11px;
  width: 11px;
  height: 11px;
  border: 1.6px solid #708197;
  border-radius: 50%;
  transform: translateY(-60%);
  pointer-events: none;
}
.security-search-field::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: calc(50% + 5px);
  left: 21px;
  width: 6px;
  height: 1.6px;
  background: #708197;
  transform: rotate(45deg);
  pointer-events: none;
}
.security-search-field input { width: 100%; min-height: 34px; padding-left: 32px; border-color: #c8d3df; font-size: 12px; }
.security-search-field input:focus { border-color: var(--security-blue); box-shadow: 0 0 0 2px rgba(29, 99, 189, .12); }

.security-employee-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1px;
  min-height: 0;
  margin-top: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-top: 1px solid var(--security-border);
  border-bottom: 1px solid var(--security-border);
}
.security-employee-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 10px;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 6px 8px;
  border: 0;
  border-bottom: 1px solid #e5eaf0;
  border-radius: 0;
  background: #fff;
  color: var(--security-ink);
  text-align: left;
}
.security-employee-row:hover { background: #f4f7fb; }
.security-employee-row:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--security-blue); outline-offset: -2px; }
.security-employee-row.is-selected {
  box-shadow: inset 3px 0 0 var(--security-blue);
  background: var(--security-blue-soft);
}
.security-employee-avatar,
.security-identity-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #e6edf7;
  color: #214b80;
  font-weight: 800;
}
.security-employee-avatar { width: 28px; height: 28px; font-size: 11px; }
.security-identity-avatar { width: 42px; height: 42px; font-size: 16px; }
.security-employee-copy { display: grid; gap: 2px; min-width: 0; }
.security-employee-copy strong,
.security-employee-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.security-employee-copy strong { font-size: 12px; }
.security-employee-copy small { color: var(--security-muted); font-size: 10.5px; }
.security-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; }
.security-status-dot.is-active { background: #16a05d; }
.security-status-dot.is-warning { background: #d99400; }
.security-status-dot.is-danger { background: #c43b48; }

.security-employee-identity {
  display: grid;
  grid-template-columns: auto minmax(180px, .8fr) minmax(420px, 1.5fr);
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 10px 12px;
  border: 1px solid var(--security-border);
  border-radius: 6px;
  background: #fff;
}
.security-identity-copy { min-width: 0; }
.security-identity-copy > div { display: flex; align-items: center; gap: 8px; }
.security-identity-copy h3 { margin: 0; font-size: 18px; line-height: 1.15; }
.security-identity-copy p { margin: 5px 0 0; overflow: hidden; color: var(--security-muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.security-identity-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border-left: 1px solid var(--security-border);
}
.security-identity-facts > div { min-width: 0; padding: 2px 10px; border-right: 1px solid var(--security-border); }
.security-identity-facts > div:last-child { border-right: 0; }
.security-identity-facts dt,
.security-account-facts dt { color: var(--security-muted); font-size: 9.5px; font-weight: 750; letter-spacing: .025em; text-transform: uppercase; }
.security-identity-facts dd,
.security-account-facts dd { margin: 4px 0 0; overflow: hidden; color: var(--security-ink); font-size: 11.5px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }

.security-status-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 21px;
  padding: 2px 7px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #53657a;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}
.security-status-badge.is-active { border-color: #b8dfc9; background: #edf8f1; color: #137344; }
.security-status-badge.is-warning { border-color: #ead6a3; background: #fff9e9; color: #8a5a00; }
.security-status-badge.is-danger { border-color: #ebc0c5; background: #fff3f4; color: #a22835; }
.security-muted { color: var(--security-muted); }

.security-section { padding: 10px 12px; }
.security-assignments-section { margin-top: 10px; }
.security-section-heading { min-height: 34px; margin-bottom: 8px; }
.security-section-heading > div { display: grid; gap: 2px; }
.security-section-heading h4 { font-size: 13px; }
.security-section-heading p { margin: 0; color: var(--security-muted); font-size: 10.5px; }
.security-assignment-table { overflow: hidden; border: 1px solid var(--security-border); border-radius: 5px; }
.security-assignment-header,
.security-assignment-row {
  display: grid;
  grid-template-columns: minmax(105px, 1.2fr) minmax(105px, 1fr) minmax(92px, .9fr) minmax(92px, .9fr) minmax(85px, .8fr) 76px 58px;
  align-items: center;
  min-width: 0;
}
.security-assignment-header {
  min-height: 31px;
  background: #eef2f6;
  color: #43546a;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .025em;
  text-transform: uppercase;
}
.security-assignment-header > span,
.security-assignment-row > div { min-width: 0; padding: 6px 7px; }
.security-assignment-row { min-height: 45px; border-top: 1px solid var(--security-border); color: #26374d; font-size: 10.5px; }
.security-assignment-row:hover { background: #f8fafc; }
.security-assignment-row > div { overflow: hidden; text-overflow: ellipsis; }
.security-assignment-row strong,
.security-assignment-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.security-assignment-row small { margin-top: 2px; color: var(--security-muted); font-size: 9.5px; }
.security-row-action { min-height: 27px; padding: 3px 6px; border: 0; background: transparent; color: #ad2d3a; font-size: 10px; font-weight: 750; }
.security-row-action:hover { background: #fff1f2; }

.security-empty-state,
.security-empty-compact { display: grid; place-items: center; gap: 4px; color: var(--security-muted); text-align: center; }
.security-empty-state { min-height: 80px; padding: 14px; border: 1px dashed #cbd5e1; border-radius: 5px; background: #fafbfc; }
.security-empty-compact { min-height: 120px; padding: 16px; }
.security-empty-state strong,
.security-empty-compact strong { color: #43546a; font-size: 12px; }
.security-empty-state span,
.security-empty-compact span { font-size: 10.5px; }

.security-employee-action-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(240px, .75fr); gap: 10px; margin-top: 10px; }
.security-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
.security-form-grid label,
.security-role-fields label { display: grid; gap: 4px; min-width: 0; color: #526277; font-size: 10.5px; font-weight: 750; }
.security-form-grid input,
.security-form-grid select,
.security-role-fields input { min-height: 33px; font-size: 11px; }
.security-form-grid .wide { grid-column: 1 / -1; }
.security-check { display: flex !important; align-items: center; gap: 7px !important; color: #43546a !important; }
.security-check input { min-height: 0 !important; }
.security-form-action { display: flex; align-items: center; justify-content: flex-end; }
.security-form-action .primary { min-height: 33px; }
.security-credential-summary { display: grid; gap: 0; border: 1px solid var(--security-border); border-radius: 5px; }
.security-credential-summary > div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 9px; border-bottom: 1px solid var(--security-border); font-size: 10.5px; }
.security-credential-summary > div:last-child { border-bottom: 0; }
.security-credential-summary span { color: var(--security-muted); }
.security-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; margin-top: 10px; }
.security-actions button { min-height: 32px; font-size: 11px; }
.security-actions .danger,
.security-admin-shell .danger { border-color: #c53b49; background: #fff; color: #ad2d3a; }
.security-actions .danger:hover,
.security-admin-shell .danger:hover { background: #fff1f2; }

.security-role-workspace { display: flex; flex-direction: column; gap: 8px; height: max(590px, calc(100vh - 205px)); padding: 10px; overflow: hidden; }
.security-role-toolbar { flex: 0 0 auto; min-height: 38px; }
.security-role-toolbar label { display: flex; align-items: center; gap: 8px; color: #526277; font-size: 11px; font-weight: 750; }
.security-role-toolbar select { min-width: 260px; min-height: 34px; }
.security-role-toolbar .primary { min-height: 34px; }
.security-role-form { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 8px; min-height: 0; }
.security-role-header {
  display: grid;
  grid-template-columns: minmax(440px, 1.5fr) minmax(310px, 1fr) auto;
  align-items: end;
  gap: 12px;
  padding: 10px 12px;
}
.security-role-fields { display: grid; grid-template-columns: minmax(125px, .55fr) minmax(160px, .8fr) minmax(220px, 1.4fr); gap: 8px; }
.security-role-fields input[readonly] { background: #f4f6f8; color: #64748b; }
.security-role-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); min-height: 42px; border: 1px solid var(--security-border); border-radius: 5px; }
.security-role-summary > div { display: grid; align-content: center; gap: 2px; min-width: 0; padding: 5px 8px; border-right: 1px solid var(--security-border); }
.security-role-summary > div:last-child { border-right: 0; }
.security-role-summary span { overflow: hidden; color: var(--security-muted); font-size: 8.5px; font-weight: 750; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.security-role-summary strong { font-size: 14px; }
.security-role-header-actions { display: grid; grid-template-columns: repeat(2, auto); align-items: center; justify-content: end; gap: 6px 8px; }
.security-role-header-actions .security-check { white-space: nowrap; }
.security-role-header-actions button { min-height: 32px; padding: 5px 10px; font-size: 11px; }

.security-permission-workspace { display: grid; grid-template-columns: minmax(210px, 245px) minmax(0, 1fr); gap: 8px; min-height: 0; }
.security-module-navigator,
.security-permission-editor { min-height: 0; overflow: hidden; }
.security-module-navigator { display: flex; flex-direction: column; padding: 9px; }
.security-module-list { flex: 1; min-height: 0; margin-top: 7px; overflow-y: auto; border-top: 1px solid var(--security-border); }
.security-module-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 0;
  border-bottom: 1px solid #e5eaf0;
  border-radius: 0;
  background: #fff;
  color: #405168;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
}
.security-module-row small { color: var(--security-muted); font-size: 9.5px; font-variant-numeric: tabular-nums; }
.security-module-row:hover { background: #f4f7fb; }
.security-module-row.is-selected { box-shadow: inset 3px 0 0 var(--security-blue); background: var(--security-blue-soft); color: var(--security-blue-dark); }
.security-permission-editor { padding: 10px 12px; overflow-y: auto; overscroll-behavior: contain; }
.security-permission-module-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--security-border); }
.security-permission-module-heading span { color: var(--security-muted); font-size: 9px; font-weight: 750; text-transform: uppercase; }
.security-permission-module-heading h4 { margin: 2px 0 0; font-size: 16px; }
.security-permission-module-heading small { color: var(--security-muted); font-size: 10px; }
.security-permission-purpose { margin-top: 10px; }
.security-permission-purpose-heading { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.security-permission-purpose-heading h5 { margin: 0; font-size: 11px; text-transform: uppercase; letter-spacing: .035em; }
.security-permission-purpose-heading span { color: var(--security-muted); font-size: 9px; }
.security-permission-rows { border: 1px solid var(--security-border); border-radius: 5px; overflow: hidden; }
.security-permission-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 43px; padding: 6px 9px; border-bottom: 1px solid var(--security-border); }
.security-permission-row:last-child { border-bottom: 0; }
.security-permission-row:hover { background: #f8fafc; }
.security-permission-row > label { display: flex; align-items: center; gap: 9px; min-width: 0; margin: 0; cursor: pointer; }
.security-permission-row > label > span { display: grid; gap: 2px; min-width: 0; }
.security-permission-row strong { color: #26374d; font-size: 11px; }
.security-permission-row small { color: var(--security-muted); font-size: 9.5px; }
.security-permission-row em { flex: 0 0 auto; padding: 2px 6px; border: 1px solid #ead6a3; border-radius: 999px; background: #fff9e9; color: #8a5a00; font-size: 9px; font-style: normal; font-weight: 750; }

.security-my-account { padding: 10px; }
.security-my-account-header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px; }
.security-my-account-header > div > span { color: var(--security-muted); font-size: 9px; font-weight: 750; text-transform: uppercase; }
.security-my-account-header h3 { margin: 2px 0; font-size: 18px; }
.security-my-account-header p { margin: 0; color: var(--security-muted); font-size: 11px; }
.security-my-account-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .8fr); gap: 10px; margin-top: 10px; }
.security-account-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 10px; border: 1px solid var(--security-border); border-radius: 5px; }
.security-account-facts > div { padding: 8px 9px; border-right: 1px solid var(--security-border); }
.security-account-facts > div:last-child { border-right: 0; }
.security-role-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.security-role-tags span { padding: 3px 7px; border: 1px solid #c9d8ea; border-radius: 999px; background: #f5f8fc; color: #315578; font-size: 10px; font-weight: 700; }
.security-role-tags span.is-empty { border-style: dashed; color: var(--security-muted); }
.security-account-actions { display: grid; gap: 7px; }
.security-account-actions button { display: grid; justify-items: start; gap: 2px; min-height: 48px; padding: 8px 10px; text-align: left; }
.security-account-actions button strong { font-size: 11px; }
.security-account-actions button span { font-size: 9.5px; font-weight: 500; opacity: .82; }

@media (max-width: 1450px) {
  .security-admin-grid { grid-template-columns: 275px minmax(0, 1fr); }
  .security-employee-identity { grid-template-columns: auto minmax(180px, .8fr) minmax(330px, 1.25fr); }
  .security-identity-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .security-identity-facts > div:nth-child(2) { border-right: 0; }
  .security-identity-facts > div:nth-child(-n+2) { padding-bottom: 6px; }
  .security-identity-facts > div:nth-child(n+3) { padding-top: 6px; border-top: 1px solid var(--security-border); }
  .security-assignment-header,
  .security-assignment-row {
    grid-template-columns: minmax(92px, 1.15fr) minmax(92px, 1fr) minmax(82px, .9fr) minmax(82px, .9fr) 78px 69px 53px;
  }
  .security-role-header { grid-template-columns: minmax(380px, 1.25fr) minmax(280px, .9fr); }
  .security-role-header-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
}

@media (max-width: 1180px) {
  .security-admin-grid { grid-template-columns: 250px minmax(0, 1fr); }
  .security-employee-action-grid { grid-template-columns: 1fr; }
  .security-role-fields { grid-template-columns: 115px minmax(145px, .8fr) minmax(190px, 1.2fr); }
  .security-permission-workspace { grid-template-columns: 205px minmax(0, 1fr); }
}

/* Customer Lookup: Corporate Minimal high-volume search workspace. */
.customer-lookup-page {
  --customer-lookup-blue: var(--accent);
  --customer-lookup-blue-dark: var(--accent-dark);
  --customer-lookup-blue-soft: #edf4fd;
  --customer-lookup-border: #d5dde7;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  min-width: 0;
  min-height: 0;
  color: #14243a;
}

.customer-lookup-command {
  display: grid;
  gap: 11px;
  flex: 0 0 auto;
  padding: 12px 14px;
  border: 1px solid var(--customer-lookup-border);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(20, 36, 58, 0.04);
}

.customer-lookup-primary-row,
.customer-filter-footer,
.customer-results-header,
.customer-results-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.customer-primary-search {
  position: relative;
  flex: 1 1 680px;
  min-width: 320px;
}

.customer-primary-search input {
  height: 46px;
  padding: 10px 42px 10px 45px;
  border-color: #c7d2df;
  border-radius: 5px;
  color: #17263a;
  font-size: 15px;
  font-weight: 550;
}

.customer-primary-search input::placeholder {
  color: #718097;
  opacity: 1;
}

.customer-search-icon {
  position: absolute;
  top: 50%;
  left: 17px;
  z-index: 1;
  width: 16px;
  height: 16px;
  border: 2px solid #65788f;
  border-radius: 50%;
  transform: translateY(-58%);
  pointer-events: none;
}

.customer-search-icon::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: -4px;
  width: 7px;
  height: 2px;
  border-radius: 2px;
  background: #65788f;
  transform: rotate(45deg);
  transform-origin: left center;
}

.customer-search-clear {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #66778d;
  font-size: 24px;
  line-height: 1;
  transform: translateY(-50%);
}

.customer-search-clear:hover {
  background: #edf2f7;
  color: #20354e;
}

.customer-lookup-top-actions,
.customer-filter-actions,
.customer-selection-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.customer-show-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  color: #20354e;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.customer-show-all input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--customer-lookup-blue);
}

.customer-lookup-page .primary {
  border-color: var(--customer-lookup-blue);
  background: var(--customer-lookup-blue);
  color: #ffffff;
}

.customer-lookup-page .primary:hover {
  border-color: var(--customer-lookup-blue-dark);
  background: var(--customer-lookup-blue-dark);
}

.customer-lookup-page .secondary,
.customer-lookup-page .ghost {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #23364d;
}

.customer-lookup-page .secondary:hover,
.customer-lookup-page .ghost:hover {
  border-color: #9fb0c3;
  background: #f4f7fa;
}

.customer-lookup-page button:focus-visible,
.customer-lookup-page input:focus-visible,
.customer-lookup-page select:focus-visible,
.customer-lookup-page tr:focus-visible {
  outline: 2px solid var(--customer-lookup-blue);
  outline-offset: 2px;
}

.customer-lookup-page input:focus,
.customer-lookup-page select:focus {
  border-color: var(--customer-lookup-blue);
  box-shadow: 0 0 0 3px rgba(24, 95, 187, 0.12);
}

.customer-lookup-page .customer-search-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
  margin: 0;
}

.customer-lookup-page .customer-search-grid label {
  gap: 4px;
  min-width: 0;
  color: #40536b;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.customer-lookup-page .customer-search-grid input,
.customer-lookup-page .customer-search-grid select {
  min-width: 0;
  min-height: 38px;
  padding: 7px 9px;
  border-color: #cbd5e1;
  border-radius: 5px;
  color: #1c2f47;
  font-size: 13px;
}

.customer-filter-footer {
  min-height: 34px;
}

.customer-active-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  color: #56677d;
  font-size: 11px;
  white-space: nowrap;
}

.customer-active-filters strong {
  color: #33475f;
  font-variant-numeric: tabular-nums;
}

.customer-filter-chip {
  max-width: 220px;
  min-height: 26px;
  overflow: hidden;
  padding: 4px 8px;
  border: 1px solid #bfd2e9;
  border-radius: 999px;
  background: #f2f7fd;
  color: #214a79;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-filter-chip:hover {
  border-color: #91b2d7;
  background: #e6f0fb;
}

.customer-lookup-results-panel {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-color: var(--customer-lookup-border);
  border-radius: 6px;
  box-shadow: none;
}

.customer-results-header {
  flex: 0 0 auto;
  min-height: 50px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--customer-lookup-border);
  background: #ffffff;
}

.customer-results-header > div {
  min-width: 0;
}

.customer-results-header h3 {
  color: #17283e;
  font-size: 15px;
  line-height: 1.2;
}

.customer-results-header h3 span {
  margin-left: 4px;
  color: #3d526b;
  font-variant-numeric: tabular-nums;
}

.customer-results-header .muted {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-keyboard-hint {
  color: #5d6f85;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.customer-selection-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  min-width: 0;
  min-height: 56px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--customer-lookup-border);
  background: #f7f9fc;
}

.customer-selection-identity,
.customer-selection-balance {
  min-width: 0;
}

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

.customer-selection-identity strong {
  overflow: hidden;
  color: #152840;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-selection-identity span {
  margin-top: 2px;
  overflow: hidden;
  color: #617188;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-selection-balance {
  min-width: 82px;
  text-align: right;
}

.customer-selection-balance span {
  color: #64748a;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.customer-selection-balance strong {
  margin-top: 2px;
  color: #17283e;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.customer-selection-bar .status {
  min-height: 24px;
  border-radius: 999px;
  font-size: 11px;
}

.customer-selection-actions button {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 11.5px;
}

.customer-lookup-page .customer-results {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  max-height: none;
  overflow: auto;
  border: 0;
  border-radius: 0;
  scrollbar-gutter: stable;
}

.customer-results table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  color: #1e3148;
  font-size: 12.5px;
}

.customer-results th,
.customer-results td {
  height: 43px;
  padding: 7px 11px;
  border-right: 1px solid #edf1f5;
  border-bottom: 1px solid #dde4ec;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-results th:last-child,
.customer-results td:last-child {
  border-right: 0;
}

.customer-results th {
  top: 0;
  z-index: 3;
  height: 40px;
  background: #f3f6f9;
  color: #3c5068;
  font-size: 11px;
  font-weight: 800;
}

.customer-results .table-sort {
  color: inherit;
  font-weight: 800;
}

.customer-results .table-sort:hover {
  color: var(--customer-lookup-blue);
}

.customer-results tbody tr {
  cursor: default;
}

.customer-results tbody tr:hover td {
  background: #f5f8fc;
}

.customer-results tbody tr.selected-row td {
  background: var(--customer-lookup-blue-soft);
}

.customer-results tbody tr.selected-row td:first-child {
  box-shadow: inset 3px 0 0 var(--customer-lookup-blue);
}

.customer-results tbody tr:focus {
  outline-offset: -3px;
}

.customer-number-column { width: 12%; }
.customer-name-column { width: 19%; }
.customer-phone-column { width: 19%; }
.customer-address-column { width: 28%; }
.customer-status-column { width: 12%; }
.customer-balance-column { width: 10%; }

.customer-number-cell strong,
.customer-name-cell strong,
.customer-balance-cell strong {
  color: #19334f;
  font-weight: 750;
}

.customer-name-cell strong,
.customer-number-cell strong {
  color: #174f91;
}

.customer-phone-cell strong,
.customer-phone-cell span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-phone-cell span {
  margin-top: 1px;
  color: #6a7a8d;
  font-size: 10.5px;
}

.customer-grid-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-grid-status i {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8795a6;
}

.customer-grid-status.good i { background: #159447; }
.customer-grid-status.warn i { background: #e7a117; }
.customer-grid-status.bad i { background: #bf3b48; }

.customer-empty-row td {
  height: 150px;
  text-align: center;
}

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

.customer-empty-row span {
  margin-top: 5px;
  color: #66768a;
  font-size: 12px;
}

.customer-results-footer {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 14px;
  border-top: 1px solid var(--customer-lookup-border);
  background: #fbfcfd;
  color: #586a80;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.customer-profile-drawer[hidden] {
  display: none;
}

.customer-profile-drawer {
  position: fixed;
  inset: 0 0 0 260px;
  z-index: 1200;
}

/* A sale opened from a customer profile must sit above that workspace. */
body:has(#customerProfileDrawer:not([hidden])) #transactionModal.show {
  z-index: 1300;
}

.customer-profile-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(16, 30, 45, 0.42);
}

.customer-profile-drawer .customer-profile-panel {
  position: absolute;
  top: 14px;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  width: clamp(640px, calc(100% - var(--customer-list-pane, 45%)), 900px);
  max-width: calc(100% - 28px);
  max-height: none;
  border-color: #c9d4e0;
  border-radius: 7px;
  box-shadow: 0 18px 48px rgba(15, 30, 48, 0.22);
}

.customer-drawer-resizer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -8px;
  z-index: 2;
  width: 16px;
  min-width: 16px;
}

.customer-drawer-resizer::before {
  top: 10px;
  bottom: 10px;
  width: 3px;
  background: #9cacbe;
}

.customer-profile-drawer.is-resizing,
.customer-profile-drawer.is-resizing .customer-profile-panel {
  cursor: col-resize;
  user-select: none;
}

.customer-profile-drawer.is-resizing .customer-drawer-resizer::before,
.customer-drawer-resizer:hover::before,
.customer-drawer-resizer:focus-visible::before {
  width: 5px;
  background: var(--customer-lookup-blue);
}

.customer-profile-drawer .customer-profile-panel > .panel-header {
  flex: 0 0 auto;
  min-height: 54px;
  padding: 9px 12px;
  background: #ffffff;
}

.customer-profile-drawer .customer-profile-panel > .panel-header .inline-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.customer-profile-drawer .customer-profile-panel > .panel-header button {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 11.5px;
}

.customer-profile-drawer .customer-profile-panel > .panel-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 13px;
  overflow: auto;
  background: #ffffff;
}

@media (max-width: 1450px) {
  .customer-lookup-page .customer-search-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .customer-lookup-command {
    gap: 8px;
    padding: 10px 12px;
  }

  .customer-primary-search {
    min-width: 260px;
  }

  .customer-lookup-top-actions button {
    padding-inline: 9px;
    font-size: 11.5px;
  }

  .customer-selection-bar {
    gap: 8px;
    padding-inline: 11px;
  }
}

@media (max-width: 1180px) {
  .customer-lookup-primary-row {
    align-items: stretch;
    flex-direction: column;
  }

  .customer-primary-search {
    flex-basis: auto;
    width: 100%;
  }

  .customer-lookup-top-actions {
    justify-content: flex-end;
  }

  .customer-lookup-page .customer-search-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-selection-bar {
    grid-template-columns: minmax(150px, 1fr) auto auto;
  }

  .customer-selection-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

@media (max-height: 820px) {
  .customer-lookup-page {
    gap: 8px;
  }

  .customer-lookup-command {
    gap: 7px;
    padding-block: 8px;
  }

  .customer-primary-search input {
    height: 41px;
  }

  .customer-lookup-page .customer-search-grid input,
  .customer-lookup-page .customer-search-grid select {
    min-height: 34px;
  }

  .customer-filter-footer {
    min-height: 30px;
  }

  .customer-results-header {
    min-height: 45px;
  }

  .customer-selection-bar {
    min-height: 50px;
  }

  .customer-results th,
  .customer-results td {
    height: 38px;
    padding-block: 5px;
  }

  .customer-results th {
    height: 36px;
  }
}

@media (max-width: 980px) {
  .customer-profile-drawer {
    left: 0;
  }
}

/* Corporate Minimal customer record workspace */
.customer-profile-drawer {
  --accent: #2468b5;
  --accent-soft: #edf4fd;
  --customer-profile-blue: var(--accent);
  --customer-profile-border: #d5dee9;
  --customer-profile-surface: #f5f7fa;
  background: var(--customer-profile-surface);
}

.customer-profile-backdrop {
  background: var(--customer-profile-surface);
}

.customer-profile-drawer .customer-profile-panel {
  inset: 0;
  width: 100%;
  max-width: none;
  max-height: none;
  border: 0;
  border-radius: 0;
  background: var(--customer-profile-surface);
  box-shadow: none;
}

.customer-profile-drawer .customer-profile-panel > .panel-header.customer-profile-workspace-bar {
  min-height: 58px;
  padding: 8px 24px;
  border-bottom: 1px solid var(--customer-profile-border);
  background: #ffffff;
}

.customer-profile-title-block {
  display: grid;
  gap: 1px;
}

.customer-profile-title-block h3 {
  margin: 0;
  color: #102443;
  font-size: 20px;
  line-height: 1.2;
}

.customer-profile-drawer .customer-profile-panel > .panel-header .customer-profile-actions {
  flex-wrap: nowrap;
  gap: 9px;
}

.customer-profile-drawer .customer-profile-panel > .panel-header .customer-profile-actions button {
  min-height: 38px;
  padding: 7px 14px;
  border-radius: 5px;
  font-size: 12px;
  white-space: nowrap;
}

.customer-profile-actions [hidden] {
  display: none;
}

.customer-profile-drawer .customer-profile-panel > .panel-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 22px 14px;
  overflow: hidden;
  background: var(--customer-profile-surface);
}

#customerProfile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
}

.customer-profile-identity {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(390px, 1.35fr) minmax(470px, 1fr);
  min-width: 0;
  width: min(100%, 1500px);
  margin: 12px auto 0;
  border: 1px solid var(--customer-profile-border);
  border-radius: 6px;
  background: #ffffff;
  overflow: hidden;
}

.customer-profile-person {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 15px;
  padding: 13px 18px;
}

.customer-profile-avatar {
  flex: 0 0 56px;
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border-radius: 50%;
  background: #eaf2fd;
  color: #123d76;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.customer-profile-person-copy {
  min-width: 0;
}

.customer-profile-name-row {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.customer-profile-name-row h2 {
  min-width: 0;
  margin: 0;
  color: #102443;
  font-size: 22px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-profile-name-row .status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
}

.customer-profile-name-row .status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.customer-profile-meta {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 0;
  margin-top: 6px;
  color: #53657a;
  font-size: 11.5px;
}

.customer-profile-meta > span {
  min-width: 0;
  padding: 0 13px;
  border-left: 1px solid #dce3eb;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-profile-meta > span:first-child {
  padding-left: 0;
  border-left: 0;
}

.customer-profile-meta strong {
  color: #17375f;
  font-weight: 700;
}

.customer-profile-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-width: 0;
  border-left: 1px solid var(--customer-profile-border);
}

.customer-profile-metric {
  display: grid;
  align-content: center;
  min-width: 0;
  gap: 6px;
  padding: 13px 15px;
  border-left: 1px solid #e2e7ed;
}

.customer-profile-metric:first-child {
  border-left: 0;
}

.customer-profile-metric span {
  color: #5b6d82;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.015em;
  line-height: 1.2;
}

.customer-profile-metric strong {
  min-width: 0;
  color: #102443;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-profile-tabs.tabs {
  flex: 0 0 auto;
  width: min(100%, 1500px);
  min-height: 43px;
  gap: 22px;
  margin: 0 auto 10px;
  padding: 0 3px;
  border-bottom-color: #cfd9e5;
}

.customer-profile-tabs .tab-btn {
  min-height: 42px;
  padding: 8px 2px 7px;
  border-bottom-width: 2px;
  border-radius: 0;
  color: #41536a;
  font-size: 12px;
  font-weight: 750;
}

.customer-profile-tabs .tab-btn.active {
  color: var(--customer-profile-blue);
  border-bottom-color: var(--customer-profile-blue);
}

.customer-profile-tabs .tab-btn:disabled {
  color: #9aa7b7;
  cursor: not-allowed;
  opacity: 0.75;
}

#customerProfileContent.customer-profile-content {
  flex: 1 1 auto;
  width: min(100%, 1500px);
  min-width: 0;
  min-height: 0;
  margin: 0 auto;
  padding: 0 2px 4px;
  overflow: auto;
  outline: none;
  scrollbar-gutter: stable;
}

#customerProfileContent.customer-profile-content:focus-visible {
  border-radius: 4px;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--customer-profile-blue) 45%, transparent);
}

.customer-profile-overview,
.customer-edit-form {
  min-width: 0;
}

.customer-profile-overview-layout.customer-layout-profile {
  align-items: start;
  gap: 12px;
}

.customer-profile-overview-layout.customer-layout-profile.is-two-column-workspace {
  grid-template-columns: minmax(0, 1.36fr) minmax(0, 1fr);
}

.customer-profile-overview-layout .customer-layout-column {
  gap: 9px;
}

.customer-profile-panel .customer-profile-overview-layout .profile-section,
.customer-profile-panel .customer-financial-workspace .profile-section,
.customer-profile-panel .customer-profile-supplemental .profile-section {
  gap: 0;
  padding: 0 14px 1px;
  border: 1px solid var(--customer-profile-border);
  border-radius: 6px;
  background: var(--customer-group-bg, #ffffff);
  box-shadow: none;
}

.customer-profile-panel .customer-profile-overview-layout .section-title-row,
.customer-profile-panel .customer-financial-workspace .section-title-row,
.customer-profile-panel .customer-profile-supplemental .section-title-row {
  min-height: 36px;
  padding: 5px 0;
  border-bottom: 1px solid #dce3eb;
}

.customer-profile-panel .customer-profile-overview-layout .section-title-row h4,
.customer-profile-panel .customer-financial-workspace .section-title-row h4,
.customer-profile-panel .customer-profile-supplemental .section-title-row h4 {
  color: #152b49;
  font-size: 13.5px;
  font-weight: 800;
}

.customer-profile-overview-layout .customer-layout-field-grid,
.customer-profile-supplemental .customer-layout-field-grid {
  gap: 0 16px;
}

.customer-profile-panel .customer-profile-value {
  display: grid;
  grid-template-columns: minmax(135px, 42%) minmax(0, 1fr);
  align-items: center;
  align-content: center;
  min-width: 0;
  min-height: 34px;
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid #e2e7ed;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.customer-profile-panel .customer-profile-value > span {
  color: #53677f;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
}

.customer-profile-panel .customer-profile-value > strong {
  min-width: 0;
  color: #142947;
  font-size: 12.25px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.customer-profile-overview-layout.is-editing .customer-profile-value {
  min-height: 34px;
  padding-block: 2px;
}

.customer-profile-address-field {
  display: grid;
  min-width: 0;
}

.customer-profile-indicator {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
}

.customer-profile-indicator i {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ba9b9;
}

.customer-profile-indicator.good i { background: #14964c; }
.customer-profile-indicator.warn i { background: #e5a21a; }
.customer-profile-indicator.bad i { background: #bd3f4b; }

.customer-profile-panel .customer-profile-value input:not([type="checkbox"]):not([type="file"]),
.customer-profile-panel .customer-profile-value select {
  width: 100%;
  min-height: 28px;
  height: 28px;
  padding: 4px 8px;
  border-color: #bdcad8;
  border-radius: 4px;
  background: #ffffff;
  color: #142947;
  font-size: 12px;
}

.customer-profile-inline-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  min-width: 0;
}

.customer-profile-checkbox {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  color: #142947;
  font-size: 12px;
  font-weight: 700;
}

.customer-profile-checkbox input {
  width: 16px;
  height: 16px;
}

.customer-profile-file-editor {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
}

.customer-profile-file-editor > span {
  flex: 0 1 120px;
  min-width: 0;
  color: #53677f;
  font-size: 10.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-profile-file-editor input[type="file"] {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  min-height: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  color: #243d5d;
  font-size: 10.5px;
}

.customer-edit-form {
  max-height: none;
  padding: 0;
  overflow: visible;
}

.customer-profile-supplemental {
  max-width: calc(50% - 7px);
  margin-top: 12px;
}

.customer-financial-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(440px, 1.28fr);
  align-items: start;
  gap: 14px;
}

.customer-statement-card,
.customer-card-workspace {
  min-width: 0;
}

.customer-statement-card > p {
  margin: 12px 0 5px;
  font-size: 11.5px;
}

.customer-statement-summary {
  display: grid;
  gap: 5px;
  padding: 14px 0 11px;
  border-bottom: 1px solid #e2e7ed;
}

.customer-statement-summary span {
  color: #5b6d82;
  font-size: 11px;
}

.customer-statement-summary strong {
  color: #142947;
  font-size: 13px;
}

.customer-statement-card .checkbox-row {
  padding: 9px 0 10px;
}

.customer-card-list.compact-list {
  max-height: none;
}

.customer-card-workspace .list-item {
  min-height: 48px;
  padding: 8px 0;
  border-bottom: 1px solid #e2e7ed;
}

.customer-card-workspace .add-card-form {
  margin-top: 12px;
  padding: 11px;
  border-radius: 5px;
  background: #f8fafc;
}

.customer-card-workspace .add-card-form input {
  min-height: 34px;
}

.customer-profile-content .history-toolbar,
.customer-profile-content .sales-total-controls {
  padding: 13px;
  border: 1px solid var(--customer-profile-border);
  border-radius: 6px;
  background: #ffffff;
}

.customer-profile-content .history-criteria input {
  min-height: 34px;
}

.customer-profile-content .customer-history-results,
.customer-profile-content .sales-total-results {
  border: 1px solid var(--customer-profile-border);
  border-radius: 6px;
  background: #ffffff;
}

.customer-profile-content .customer-history-results th,
.customer-profile-content .sales-total-results th {
  position: sticky;
  top: 0;
  z-index: 1;
}

@media (max-width: 1450px) {
  .customer-profile-drawer .customer-profile-panel > .panel-header.customer-profile-workspace-bar {
    padding-inline: 18px;
  }

  .customer-profile-drawer .customer-profile-panel > .panel-header .customer-profile-actions {
    gap: 7px;
  }

  .customer-profile-drawer .customer-profile-panel > .panel-header .customer-profile-actions button {
    padding-inline: 10px;
  }

  .customer-profile-drawer .customer-profile-panel > .panel-body {
    padding-inline: 18px;
  }

  .customer-profile-identity {
    grid-template-columns: minmax(360px, 1.2fr) minmax(440px, 1fr);
  }

  .customer-profile-person {
    gap: 12px;
    padding-inline: 14px;
  }

  .customer-profile-meta > span {
    padding-inline: 9px;
  }

  .customer-profile-metric {
    padding-inline: 11px;
  }
}

@media (max-width: 1180px) {
  .customer-profile-identity {
    grid-template-columns: 1fr;
  }

  .customer-profile-metrics {
    border-top: 1px solid var(--customer-profile-border);
    border-left: 0;
  }

  .customer-profile-overview-layout.customer-layout-profile,
  .customer-financial-workspace {
    grid-template-columns: 1fr;
  }

  .customer-profile-supplemental {
    max-width: none;
  }
}

@media (max-height: 820px) {
  .customer-profile-drawer .customer-profile-panel > .panel-header.customer-profile-workspace-bar {
    min-height: 56px;
    padding-block: 7px;
  }

  .customer-profile-title-block h3 {
    font-size: 18px;
  }

  .customer-profile-drawer .customer-profile-panel > .panel-header .customer-profile-actions button {
    min-height: 34px;
    padding-block: 5px;
  }

  .customer-profile-identity {
    margin-top: 10px;
  }

  .customer-profile-person {
    padding-block: 10px;
  }

  .customer-profile-avatar {
    flex-basis: 46px;
    width: 46px;
    height: 46px;
    font-size: 15px;
  }

  .customer-profile-name-row h2 {
    font-size: 19px;
  }

  .customer-profile-metric {
    gap: 4px;
    padding-block: 9px;
  }

  .customer-profile-metric strong {
    font-size: 15px;
  }

  .customer-profile-tabs.tabs {
    min-height: 37px;
    margin-bottom: 8px;
  }

  .customer-profile-tabs .tab-btn {
    min-height: 36px;
    padding-block: 5px;
  }

  .customer-profile-panel .customer-profile-overview-layout .section-title-row,
  .customer-profile-panel .customer-financial-workspace .section-title-row,
  .customer-profile-panel .customer-profile-supplemental .section-title-row {
    min-height: 32px;
    padding-block: 4px;
  }

  .customer-profile-panel .customer-profile-value,
  .customer-profile-overview-layout.is-editing .customer-profile-value {
    min-height: 30px;
    padding-block: 2px;
  }

  .customer-profile-panel .customer-profile-value input:not([type="checkbox"]):not([type="file"]),
  .customer-profile-panel .customer-profile-value select,
  .customer-profile-panel .customer-profile-file-editor input[type="file"] {
    min-height: 26px;
    height: 26px;
  }

  .customer-profile-overview-layout .customer-layout-column {
    gap: 7px;
  }
}

@media (max-width: 760px) {
  .customer-profile-drawer .customer-profile-panel > .panel-header.customer-profile-workspace-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .customer-profile-drawer .customer-profile-panel > .panel-header .customer-profile-actions {
    width: 100%;
    overflow-x: auto;
  }

  .customer-profile-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-profile-metric:nth-child(3) {
    border-left: 0;
    border-top: 1px solid #e2e7ed;
  }

  .customer-profile-metric:nth-child(4) {
    border-top: 1px solid #e2e7ed;
  }

  .customer-profile-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .customer-profile-meta > span {
    padding: 0;
    border-left: 0;
  }
}

/* Customer and older operations pages use the shared blue/navy workspace language. */
.customer-dashboard-panel,
.phone-orders-panel,
.operations-workspace {
  border-color: var(--line);
}

.customer-dashboard-panel > .panel-header,
.phone-orders-panel > .panel-header,
.operations-workspace > .panel-header {
  min-height: 58px;
  border-bottom-color: var(--line);
}

.customer-dashboard-panel .settings-tile,
.phone-orders-panel .phone-order-layout-form,
.operations-workspace .split-detail > .panel {
  border-color: var(--line);
}

.customer-dashboard-panel .settings-tile:hover,
.operations-workspace .list-item:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  background: var(--accent-soft);
}

.pricing-workspace-content,
.returns-workspace {
  width: min(100%, 1320px);
}
