﻿html {
  height: 100%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  font-family: "Noto Sans", "Segoe UI", "Segoe UI Variable Text", "Segoe UI Symbol", "Helvetica Neue", Arial, "Arial Unicode MS", "DejaVu Sans", "Liberation Sans", sans-serif;
  background: #f5f7fb;
  color: #111827;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

input,
select,
button,
textarea {
  font: inherit;
}

.layout {
  width: min(1400px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(10px, 2vw, 24px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 16px;
  overflow: visible;
}

.header-meta-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}


.header-panel,
.tab-row,
.controls-panel,
.panel-title-row,
.table-wrap,
.results-panel,
.cart-panel,
.saved-quotes-panel,
.header-fields-panel,
.pricing-rules-panel {
  min-width: 0;
}

.header-panel {
  position: relative;
  z-index: 12;
  backdrop-filter: blur(12px);
}

.header-panel > div,
.controls-panel > div,
.controls-panel > .actions,
.header-meta-group {
  min-width: 0;
}

.tab-row {
  position: relative;
  z-index: 11;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.results-panel .table-wrap,
.cart-panel .table-wrap,
.saved-quotes-panel .table-wrap,
.inventory-table-wrap,
.review-panel .table-wrap {
  overflow: auto;
  overflow-y: auto;
  overflow-x: auto;
}

.language-picker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #334155;
}

.language-picker select {
  min-width: 84px;
}

.tab-row {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  align-items: center;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #d7dce5;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.tab-button {
  background: #cbd5e1;
  color: #0f172a;
}

.tab-button.active {
  background: #1d4ed8;
  color: #fff;
}


.tab-row {
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.tab-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.table-wrap {
  border-radius: 10px;
  -webkit-overflow-scrolling: touch;
}

.tab-panel {
  display: none;
  gap: 20px;
  min-width: 0;
}

.tab-panel.active {
  display: grid;
  align-content: start;
  min-height: 0;
  overflow: visible;
  padding-right: 0;
  scrollbar-gutter: auto;
}

.panel {
  min-width: 0;
  background: #fff;
  border: 1px solid #d7dce5;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.05);
}

.header-panel,
.controls-panel,
.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.controls-panel {
  align-items: end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 200px;
}

.field.compact {
  min-width: 240px;
}

.field.grow {
  flex: 1;
}

.stock-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.stock-pill.in-stock {
  background: #dcfce7;
  color: #166534;
}

.stock-pill.out-stock {
  background: #fee2e2;
  color: #991b1b;
}

.row-in-stock td {
  background: rgba(34, 197, 94, 0.06);
}

.model-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.compact-gap {
  gap: 4px;
}

.model-note {
  font-size: 12px;
  color: #475569;
}

.header-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  padding: 10px 12px;
  border: 1px solid #c7ced9;
  border-radius: 8px;
  background: #fff;
}

button {
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: #1d4ed8;
  color: #fff;
  cursor: pointer;
}

button.secondary {
  background: #475569;
}

.actions,
.cart-actions {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  max-height: 420px;
  position: relative;
  z-index: 1;
}

.inventory-table-wrap {
  max-height: 520px;
}

.depo-table {
  min-width: 1480px;
}

.cart-table {
  min-width: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 10px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
  line-height: 1.35;
}

thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
}

.meta,
.totals {
  font-size: 14px;
  color: #334155;
}


.pricing-rules-panel {
  border: 1px solid #d7dce5;
  border-radius: 12px;
  background: #f8fafc;
  padding: 14px;
  margin-bottom: 16px;
}

.pricing-rule-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}

.compact-actions {
  justify-content: flex-start;
}

.brand-discount-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.brand-discount-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 600;
}

.brand-discount-pill button {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
}

.inline-number {
  width: 88px;
  padding: 8px 10px;
}

.qty-input {
  width: 54px;
  min-width: 54px;
}

.discount-input {
  width: 62px;
  min-width: 62px;
}

.compact-select {
  min-width: 118px;
  max-width: 128px;
  padding: 8px 28px 8px 10px;
}

.cart-source-select {
  min-width: 0;
  width: 100%;
  max-width: 132px;
}

.cart-brand-cell,
.cart-model-cell {
  min-width: 0;
}

.cart-description-cell {
  display: table-cell;
  min-width: 0;
}

.desc-note {
  display: block;
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
}

.cart-table {
  table-layout: fixed;
  width: max(100%, 1516px);
}

.cart-table th[data-col-key] {
  position: sticky;
  top: 0;
}

.cart-table th.is-resizable {
  position: sticky;
  user-select: none;
}

.cart-table th.is-resizable .col-header-label {
  display: inline-block;
  padding-right: 10px;
}

.col-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
  z-index: 4;
}

.col-resizer::after {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: transparent;
  transition: background 0.15s ease;
}

.cart-table th.is-resizable:hover .col-resizer::after,
body.is-col-resizing .col-resizer::after {
  background: #cbd5e1;
}

body.is-col-resizing {
  cursor: col-resize;
  user-select: none;
}

.cart-table td {
  height: 84px;
  vertical-align: middle;
}

.cart-main-stack {
  display: grid;
  gap: 4px;
  min-width: 0;
  align-content: center;
}

.cart-model-meta {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-description-preview {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.35;
  color: #64748b;
  white-space: normal;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  max-height: calc(1.35em * 3);
  word-break: break-word;
}

.cart-description-preview.is-empty {
  color: #94a3b8;
}

.selected-price-cell {
  min-width: 168px;
  white-space: nowrap;
}

.price-edit-button {
  width: 100%;
  text-align: left;
  background: #eff6ff;
  color: #1e3a8a;
  padding: 8px 10px;
  font-weight: 700;
  border: 1px solid #bfdbfe;
}

.price-edit-button.custom-price-active {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.price-edit-note {
  display: none;
}

.line-adjustment-note {
  margin-top: 4px;
  font-size: 11px;
  color: #475569;
  line-height: 1.4;
  display: none;
}

.cart-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  min-width: 88px;
}

.cart-row-actions .secondary {
  min-width: 54px;
}

.compact-icon-actions {
  min-width: 78px;
}

.icon-action-button {
  width: 38px;
  min-width: 38px;
  height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

.icon-action-button.danger {
  background: #475569;
}

.saved-quotes-panel .table-wrap {
  max-height: 320px;
}

.cart-panel .proforma-lines-table-wrap {
  min-height: 420px;
  max-height: 560px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.metric-card {
  border: 1px solid #d7dce5;
  border-radius: 12px;
  padding: 10px 12px;
  background: #f8fafc;
  min-width: 0;
}

.metric-card-label {
  font-size: 11px;
  color: #475569;
}

.metric-card-value {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.metric-card-rich {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.preaccount-metric-section {
  display: grid;
  gap: 4px;
}

.preaccount-metric-section-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
}

.preaccount-usd-total-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
  padding-top: 6px;
  border-top: 1px dashed rgba(148, 163, 184, 0.28);
}

.preaccount-usd-total-label {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.preaccount-usd-total-value .preaccount-money {
  gap: 6px;
}

.preaccount-usd-total-value .preaccount-currency-icon,
.preaccount-usd-total-value .preaccount-money span:last-child {
  font-size: 0.78rem;
  font-weight: 700;
}

.metric-plain-value {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
}

.metric-money-stack {
  display: grid;
  gap: 6px;
}

.metric-money-line,
.metric-converted-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.metric-converted-line {
  padding-top: 8px;
  border-top: 1px solid #dbe3ef;
}

.metric-currency-code,
.metric-converted-label {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e8eef8;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.metric-money-amount {
  min-width: 0;
  text-align: right;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  color: #0f172a;
}

.metric-empty {
  color: #94a3b8;
  font-size: 16px;
  font-weight: 600;
}

.cost-dialog {
  width: min(760px, calc(100vw - 32px));
  border: none;
  border-radius: 14px;
  padding: 0;
}

.cost-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.cost-dialog-body {
  padding: 20px;
}

.cost-dialog pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Noto Sans Mono", Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
}

.release-notes-dialog {
  width: min(860px, calc(100vw - 32px));
}

.release-notes-dialog-body {
  display: grid;
  gap: 16px;
}

.release-notes-body {
  display: grid;
  gap: 12px;
  max-height: min(68vh, 620px);
  overflow: auto;
  padding-right: 4px;
}

.release-notes-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 2px;
}

.release-note-card {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

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

.release-note-title {
  color: #0f172a;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
}

.release-note-meta {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.release-note-summary {
  margin: 0;
  color: #334155;
  line-height: 1.55;
}

.release-note-list {
  margin: 0;
  padding-left: 18px;
  color: #1f2937;
  line-height: 1.5;
}

.release-note-list li + li {
  margin-top: 6px;
}

.manual-item-dialog-body {
  display: grid;
  gap: 16px;
}

.manual-item-grid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.manual-item-grid .grow {
  grid-column: span 2;
}

.header-fields-panel .panel-title-row {
  margin-bottom: 14px;
}

.money-cell {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.hidden {
  display: none !important;
}

.user-badge {
  align-self: stretch;
  padding: 8px 12px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e3a8a;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.login-card {
  position: relative;
  width: min(420px, 100%);
  padding: 24px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #d7dce5;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
  display: grid;
  gap: 14px;
}

.login-busy-popup {
  position: absolute;
  inset: 16px;
  z-index: 2;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(191, 219, 254, 0.9);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(4px);
}

.login-busy-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #dbeafe;
  border-top-color: #1d4ed8;
  border-radius: 999px;
  animation: login-spin 0.8s linear infinite;
}

.login-busy-text {
  font-size: 14px;
  font-weight: 700;
  color: #1d4ed8;
  text-align: center;
}

@keyframes login-spin {
  to { transform: rotate(360deg); }
}

.error-text {
  min-height: 20px;
  color: #b91c1c;
  font-size: 13px;
}

#loginHint,
#loginAuthStatus {
  min-height: 18px;
}

#loginAuthStatus {
  color: #1d4ed8;
  font-size: 13px;
}

.list-loading-row td {
  padding: 14px 12px;
  text-align: center;
  font-size: 13px;
  color: #475569;
  background: #f8fafc;
}





.admin-heading-group {
  display: grid;
  gap: 6px;
}

.admin-helper {
  margin: 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.5;
}



.admin-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid #d6e0ef;
  border-radius: 18px;
  padding: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f9ff 100%);
  box-shadow:
    0 12px 30px rgba(15, 23, 42, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.admin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(207, 220, 236, 0.7);
}

.admin-card-head h3 {
  margin: 0;
  font-size: 18px;
  color: #0b1b34;
}

.admin-card-head .meta {
  display: inline-block;
  margin-top: 6px;
}





.admin-create-card,
.admin-users-card,
.admin-audit-card,
.admin-roles-card {
  min-height: 100%;
}

.admin-create-head {
  align-items: flex-start;
}

.admin-form-grid {
  grid-template-columns: 1fr;
  align-items: end;
  gap: 14px 16px;
}

.admin-form-grid .field.grow {
  grid-column: 1 / -1;
}

.admin-create-actions {
  display: flex;
  align-items: end;
  justify-content: center;
  grid-column: 1 / -1;
}

.admin-create-actions button {
  min-width: 200px;
}

.admin-role-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

.admin-role-card {
  height: 100%;
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid #d8e3f3;
  background: linear-gradient(180deg, #ffffff 0%, #f2f7ff 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}

.admin-role-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.admin-role-name {
  font-weight: 700;
  color: #0f172a;
}

.admin-role-code {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-role-counts {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.admin-role-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.admin-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 600;
}

.admin-pill-muted {
  background: #f1f5f9;
  color: #475569;
}

.admin-users-card {
  padding-bottom: 16px;
  gap: 16px;
}

.admin-users-head {
  margin-bottom: 4px;
}

.admin-table-wrap {
  flex: 1;
  min-height: 0;
  border: 1px solid #dbe3ef;
  border-radius: 18px;
  background: #ffffff;
  overflow: hidden;
}

.admin-users-table {
  min-width: 1120px;
}

.admin-users-table td {
  vertical-align: top;
}

.admin-user-row td {
  background: #ffffff;
}

.admin-user-row-inactive td {
  background: #f8fafc;
}

.admin-user-identity-cell {
  min-width: 200px;
}

.admin-user-name {
  font-weight: 700;
  color: #0f172a;
}

.admin-user-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.admin-role-badge,
.admin-scope-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.admin-role-badge {
  background: #dbeafe;
  color: #1d4ed8;
}

.admin-scope-badge.is-open {
  background: #dcfce7;
  color: #166534;
}

.admin-scope-badge.is-limited {
  background: #fef3c7;
  color: #92400e;
}

.admin-input,
.admin-select {
  width: 100%;
  min-width: 140px;
}

.admin-tab-input {
  min-width: 220px;
}

.admin-active-cell {
  min-width: 126px;
}

.admin-active-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #334155;
  white-space: nowrap;
}

.admin-date-cell {
  white-space: nowrap;
  color: #475569;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 190px;
  justify-content: flex-start;
}

.admin-empty-row,
.admin-empty-state {
  padding: 18px;
  color: #64748b;
  text-align: center;
}


.compact-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.review-panel {
  margin-top: 16px;
  border-top: 1px solid #e2e8f0;
  padding-top: 16px;
}

.review-panel table {
  min-width: 880px;
}

.review-panel th {
  position: static;
  background: #f8fafc;
}

@media (max-width: 1024px) {
  .header-panel,
  .controls-panel,
  .panel-title-row {
    flex-direction: column;
    align-items: stretch;
  }

  .header-meta-group {
    align-items: stretch;
  }

  .header-grid {
    grid-template-columns: 1fr;
  }

  .admin-grid,
  

  .admin-search-grid {
    grid-template-columns: 1fr;
  }

  

  .metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .admin-form-grid,
  .compact-grid,
  .admin-search-form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .admin-audit-filter-grid {
    grid-template-columns: 1fr 1fr;
  }

  .admin-audit-search-field {
    grid-column: 1 / -1;
  }

  .admin-form-grid .field.grow,
  .admin-create-actions {
    grid-column: 1 / -1;
  }

  .pricing-rule-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .layout {
    padding: 14px;
  }

  .actions,
  .cart-actions,
  .tab-row {
    flex-wrap: wrap;
  }

  .field,
  .field.compact {
    min-width: 100%;
  }

  .admin-form-grid,
  .admin-audit-filter-grid,
  .admin-search-form-grid {
    grid-template-columns: 1fr;
  }

  .language-picker {
    justify-content: space-between;
  }

  th,
  td {
    padding: 8px 10px;
    font-size: 13px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .pricing-rule-grid {
    grid-template-columns: 1fr;
  }

  .inline-number,
  .compact-select,
  .qty-input,
  .discount-input {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .admin-form-grid,
  .compact-grid,
  .admin-audit-filter-grid {
    grid-template-columns: 1fr;
  }

  .admin-create-actions button {
    width: min(100%, 320px);
  }

  .admin-role-top {
    grid-template-columns: 1fr;
  }

  .admin-role-counts {
    justify-items: start;
  }

  .admin-actions {
    min-width: 140px;
  }

  .price-edit-button {
    width: 100%;
  }

  .selected-price-cell {
    min-width: 120px;
  }
}


@media (max-width: 640px) {
  .layout {
    padding: 10px;
    gap: 12px;
  }

  .panel {
    padding: 14px;
    border-radius: 12px;
  }

  .tab-row {
    flex-wrap: nowrap;
    gap: 8px;
    padding-bottom: 4px;
    margin: 0 -2px;
  }

  .tab-button {
    min-width: max-content;
    padding: 9px 12px;
  }

  .header-panel h1,
  .panel-title-row h2 {
    margin: 0;
  }

  .header-panel h1 {
    font-size: 24px;
    line-height: 1.2;
  }

  .panel-title-row h2 {
    font-size: 18px;
  }

  .header-meta-group,
  .actions,
  .cart-actions {
    width: 100%;
  }

  .cart-actions > label,
  .cart-actions > button,
  .actions > button {
    width: 100%;
  }

  .table-wrap {
    max-height: none;
  }

  .cost-dialog {
    width: min(760px, calc(100vw - 12px));
  }

  .cost-dialog-body {
    padding: 14px;
  }
}

/* Header layout stabilization (web hotfix) */
.header-panel .header-meta-group {
  display: grid !important;
  grid-template-columns: auto auto minmax(220px, 1fr) auto auto auto;
  grid-template-areas:
    "version language user security feedback logout"
    "meta meta meta meta meta meta";
  align-items: center;
  gap: 10px 12px;
}

.header-panel .header-version-stack {
  grid-area: version;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.header-panel .language-picker {
  grid-area: language;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.header-panel #currentUserBadge {
  grid-area: user;
  justify-self: stretch;
  min-height: 42px;
}

.header-panel #securityButton {
  grid-area: security;
}

.header-panel #feedbackButton {
  grid-area: feedback;
}

.header-panel #logoutButton {
  grid-area: logout;
}

.header-panel #securityButton,
.header-panel #feedbackButton,
.header-panel #logoutButton {
  justify-self: end;
  min-height: 42px;
  white-space: nowrap;
}

.header-panel #meta-summary {
  grid-area: meta;
  justify-self: end;
  margin-top: 2px;
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 1220px) {
  .header-panel .header-meta-group {
    grid-template-columns: auto minmax(220px, 1fr) auto auto auto;
    grid-template-areas:
      "version user user security logout"
      "language language language feedback feedback"
      "meta meta meta meta meta";
  }

  .header-panel .language-picker {
    justify-self: start;
  }

  .header-panel #feedbackButton {
    justify-self: start;
  }
}

@media (max-width: 860px) {
  .header-panel .header-meta-group {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "version version"
      "language language"
      "user user"
      "security logout"
      "feedback feedback"
      "meta meta";
  }

  .header-panel .language-picker,
  .header-panel #securityButton,
  .header-panel #feedbackButton,
  .header-panel #logoutButton,
  .header-panel #meta-summary {
    justify-self: stretch;
    text-align: left;
  }

  .header-panel .language-picker select {
    width: 100%;
    min-width: 0;
  }

  .header-panel #meta-summary {
    white-space: normal;
    word-break: break-word;
  }
}



@media (max-width: 1024px) {
  .cart-table td {
    height: 76px;
  }

  .cart-col-brand { width: 16%; }
  .cart-col-model { width: 20%; }
  .cart-col-description { width: 24%; }
  .cart-col-selected { width: 18%; }
}

@media (max-width: 768px) {
  .cart-table td {
    height: auto;
  }

  .cart-col-brand { width: 18%; }
  .cart-col-model { width: 24%; }
  .cart-col-description { width: 22%; }
  .cart-col-selected { width: 18%; }

  .col-resizer {
    display: none;
  }

  .cart-description-preview.has-tooltip:hover::after {
    width: min(300px, 78vw);
  }
}


.cart-col-brand { width: 14%; }
.cart-col-model { width: 19%; }
.cart-col-description { width: 20%; }
.cart-col-line-type { width: 12%; }
.cart-col-qty { width: 8%; }
.cart-col-discount { width: 10%; }
.cart-col-selected { width: 18%; }
.cart-col-stock { width: 5%; }
.cart-col-actions { width: 3%; }

.cart-table th:nth-child(n+4),
.cart-table td:nth-child(n+4) {
  text-align: center;
}

.cart-table td:not(:first-child) {
  padding-left: 8px;
  padding-right: 8px;
}

.qty-input,
.discount-input,
.price-edit-button,
.compact-icon-actions,
.selected-price-cell,
.cart-table td .stock-pill {
  margin-left: auto;
  margin-right: auto;
}

.selected-price-cell {
  min-width: 0;
}

.price-edit-button {
  max-width: 160px;
}

.compact-icon-actions {
  justify-content: center;
}

.cart-table .stock-pill {
  justify-content: center;
}

@media (max-width: 1200px) {
  .cart-col-brand { width: 16%; }
  .cart-col-model { width: 22%; }
  .cart-col-description { width: 21%; }
  .cart-col-line-type { width: 15%; }
  .cart-col-selected { width: 18%; }
  .cart-col-stock { width: 8%; }
  .cart-col-actions { width: 6%; }
}





.security-dialog-body {
  display: grid;
  gap: 14px;
}

.security-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.security-setup-box {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #f8fbff;
}

.security-secret-label {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.security-secret,
.security-uri {
  padding: 10px 12px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #dbe3ef;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-all;
}

.security-qr-wrap,
.security-recovery-wrap {
  display: grid;
  gap: 10px;
}

.security-qr-image {
  width: 220px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #dbe3ef;
  background: #ffffff;
}

.security-recovery-codes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.security-recovery-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #dbe3ef;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.admin-totp-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.admin-totp-badge.is-on {
  background: #dcfce7;
  color: #166534;
}

.admin-totp-badge.is-pending {
  background: #fef3c7;
  color: #92400e;
}

.admin-totp-badge.is-off {
  background: #e2e8f0;
  color: #334155;
}

.admin-audit-table {
  min-width: 880px;
}

.admin-log-action {
  font-weight: 700;
  color: #0f172a;
}

.admin-log-meta {
  margin-top: 4px;
  font-size: 12px;
  color: #64748b;
}

@media (max-width: 560px) {
  .metric-grid {
    grid-template-columns: 1fr;
  }
}

.toolbar-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #334155;
  font-size: 12px;
  position: relative;
  z-index: 3;
}

.toolbar-field span {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.toolbar-field-primary {
  min-width: 320px;
}

.toolbar-field-wide {
  min-width: 320px;
}

.toolbar-field-currency {
  min-width: 148px;
}

.toolbar-select {
  width: 100%;
  max-width: 100%;
  white-space: nowrap;
  min-height: 44px;
}

.toolbar-select-price {
  min-width: 300px;
  font-weight: 700;
}

.price-source-select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.price-source-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.price-source-pill {
  appearance: none;
  border: 1px solid #c7ced9;
  background: #ffffff;
  color: #334155;
  border-radius: 999px;
  padding: 10px 14px;
  min-height: 42px;
  font-weight: 700;
}

.price-source-pill.is-active {
  border-color: #1d4ed8;
  background: #dbeafe;
  color: #1e3a8a;
}

.price-source-pill:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.toolbar-select-currency {
  min-width: 124px;
}

.toolbar-help {
  color: #64748b;
  font-size: 11px;
  line-height: 1.35;
}

.panel-title-row-proforma {
  align-items: flex-start;
}

.proforma-toolbar {
  flex: 1;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.proforma-toolbar-group {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.proforma-toolbar-priority {
  flex: 1 1 500px;
  justify-content: flex-end;
}

.proforma-toolbar-actions {
  flex: 0 0 auto;
}

.cart-actions {
  align-items: flex-end;
}

.cart-actions > .toolbar-field {
  align-self: stretch;
}

.proforma-toolbar-actions > button {
  min-height: 44px;
  white-space: nowrap;
}

@media (max-width: 1200px) {
  .panel-title-row-proforma {
    flex-direction: column;
    align-items: stretch;
  }

  .proforma-toolbar {
    justify-content: stretch;
  }

  .proforma-toolbar-priority {
    justify-content: stretch;
    flex-basis: auto;
  }
}

@media (max-width: 900px) {
  .toolbar-field-primary,
  .toolbar-field-wide {
    min-width: min(100%, 260px);
  }

  .toolbar-select-price {
    min-width: 0;
  }

  .price-source-switch {
    gap: 6px;
  }

  .price-source-pill {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
  }
}



.led-panel {
  display: grid;
  gap: 16px;
  align-content: start;
}

.led-form-grid,
.led-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}

.led-layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.led-selected-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.led-strategy-grid,
.led-recommendation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.led-strategy-card,
.led-recommendation-card,
.led-warning-card {
  border: 1px solid #d7dce5;
  border-radius: 12px;
  padding: 14px;
  background: #f8fafc;
  display: grid;
  gap: 8px;
}

.led-recommendation-card.is-active,
.led-strategy-card.is-active {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 1px rgba(29, 78, 216, 0.16);
  background: #eff6ff;
}

.led-card-title-row,
.led-bom-row-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.led-card-title {
  font-weight: 700;
  color: #0f172a;
}

.led-card-subtitle,
.led-card-meta,
.led-card-note {
  font-size: 13px;
  color: #475569;
}

.led-status-badge,
.led-group-badge,
.led-warning-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.led-status-badge.ok,
.led-warning-badge.info {
  background: #dbeafe;
  color: #1d4ed8;
}

.led-status-badge.warn,
.led-warning-badge.warning {
  background: #fef3c7;
  color: #92400e;
}

.led-status-badge.critical,
.led-warning-badge.critical {
  background: #fee2e2;
  color: #b91c1c;
}

.led-group-badge {
  background: #e2e8f0;
  color: #334155;
}

.led-summary-card {
  border: 1px solid #d7dce5;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  display: grid;
  gap: 6px;
}

.led-summary-label {
  font-size: 13px;
  color: #475569;
}

.led-summary-value {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.led-warning-stack {
  display: grid;
  gap: 10px;
}

.led-warning-card p,
.led-recommendation-card p,
.led-strategy-card p {
  margin: 0;
}

.led-add-button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 980px) {
  .led-layout-grid {
    grid-template-columns: 1fr;
  }
}
.warning-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #f5d08a;
  background: #fff7e6;
  color: #7c2d12;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}
.warning-bar-info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}
.warning-bar-message {
  min-width: 0;
  font-size: 14px;
  line-height: 1.5;
}
.warning-bar-close {
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: inherit;
  cursor: pointer;
}
.saved-quote-revision-badge,
.cart-line-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}
.manual-badge {
  margin-left: 8px;
  background: #fef3c7;
  color: #92400e;
}
.cart-line-type-cell {
  min-width: 0;
}
.cart-line-type-stack {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.cart-line-type-button,
.cart-line-group-button {
  min-height: 2rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  line-height: 1.1;
}
.cart-line-type-button.is-standard {
  background: #e2e8f0;
  color: #334155;
}
.cart-line-type-button.is-optional {
  background: #fef3c7;
  color: #92400e;
}
.cart-line-type-button.is-alternative {
  background: #dbeafe;
  color: #1d4ed8;
}
.saved-quote-actions {
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.cart-reset-price {
  margin-top: 6px;
}
.icon-action-button.subtle {
  background: #e2e8f0;
  color: #334155;
}
.export-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.export-summary-row {
  display: grid;
  gap: 6px;
  align-content: start;
  min-height: 88px;
  padding: 14px 16px;
  border: 1px solid #dbe3ef;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}
.export-summary-label {
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.export-summary-value {
  color: #0f172a;
  font-weight: 700;
  font-size: 20px;
  line-height: 1.2;
}
.export-summary-note {
  margin: 4px 2px 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.5;
}
.export-summary-dialog {
  width: min(1220px, calc(100vw - 32px));
  max-height: min(92vh, 1040px);
}
.export-summary-body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-content: stretch;
  gap: 18px;
  max-height: min(88vh, 980px);
  overflow: hidden;
  padding: 22px;
}
.export-summary-content {
  display: grid;
  gap: 18px;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
}
.export-summary-content::-webkit-scrollbar {
  width: 12px;
}
.export-summary-content::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  background: rgba(86, 104, 136, 0.38);
}
.export-summary-content::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.46);
}
.export-summary-dialog .panel-title-row {
  align-items: flex-start;
}
.export-summary-dialog .cart-actions {
  justify-content: flex-end;
  margin-top: 2px;
  padding-top: 4px;
}
.export-summary-dialog .cart-actions button {
  min-width: 220px;
}
.proforma-template-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 320px) auto minmax(240px, 1fr);
  gap: 14px;
  align-items: end;
  margin-top: 16px;
}
.proforma-template-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.proforma-template-meta {
  align-self: center;
}
.proforma-qc-panel {
  margin-top: 18px;
}
.proforma-qc-grid,
.export-summary-qc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 16px;
}
.proforma-preview-card,
.proforma-checklist-card {
  border: 1px solid #dbe3ef;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 18px;
}
.proforma-preview-shell,
.proforma-qc-shell {
  display: grid;
  gap: 14px;
}
.proforma-preview-heading,
.proforma-qc-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.proforma-preview-title {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
}
.proforma-preview-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.proforma-preview-badge,
.proforma-qc-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e8eefc;
  color: #1e40af;
  font-size: 12px;
  font-weight: 700;
}
.proforma-preview-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.proforma-preview-meta-grid > div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.proforma-preview-meta-grid span {
  color: #64748b;
  font-size: 12px;
}
.proforma-preview-table {
  display: grid;
  gap: 8px;
}
.proforma-preview-row {
  display: grid;
  grid-template-columns: 1fr 1fr 88px 140px;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
}
.proforma-preview-row-head {
  background: #e8eefc;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}
.proforma-preview-empty {
  padding: 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  color: #64748b;
  text-align: center;
}
.proforma-preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #eaf7ef;
  border: 1px solid #bbf7d0;
  color: #166534;
  font-weight: 700;
}
.proforma-qc-list {
  display: grid;
  gap: 10px;
}
.proforma-qc-item {
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid #dbe3ef;
  background: #ffffff;
}
.proforma-qc-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.proforma-qc-item.is-pass {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.proforma-qc-item.is-pass strong {
  color: #15803d;
}
.proforma-qc-item.is-warn {
  border-color: #fed7aa;
  background: #fff7ed;
}
.proforma-qc-item.is-warn strong {
  color: #c2410c;
}
.admin-audit-filter-grid {
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: end;
}

.admin-audit-search-field {
  grid-column: 1 / -1;
}

.admin-audit-filter-grid .field,
.admin-audit-filter-grid .field.compact,
.admin-audit-filter-grid .field.grow {
  min-width: 0;
}

.admin-audit-filter-grid input,
.admin-audit-filter-grid select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.admin-audit-search-field {
  grid-column: 1 / -1;
}
.cart-table.is-compact .cart-model-meta {
  display: none;
}
.cart-table.is-compact .cart-description-preview {
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.cart-table.is-compact th,
.cart-table.is-compact td {
  padding-top: 10px;
  padding-bottom: 10px;
}
#proformaTab.is-presentation .pricing-rules-panel,
#proformaTab.is-presentation #quoteMetricCards {
  display: none;
}
#proformaTab.is-presentation .cart-table th:nth-child(5),
#proformaTab.is-presentation .cart-table td:nth-child(5),
#proformaTab.is-presentation .cart-table th:nth-child(7),
#proformaTab.is-presentation .cart-table td:nth-child(7),
#proformaTab.is-presentation .cart-table th:nth-child(8),
#proformaTab.is-presentation .cart-table td:nth-child(8) {
  display: none;
}
#proformaTab.is-presentation .cart-table {
  width: max(100%, 1200px);
}
#proformaTab.is-presentation .cart-table .selected-price-cell {
  justify-items: end;
}

/* Header compact layout override */
.header-panel {
  padding: 16px 18px;
  align-items: center;
}

.header-panel > div:first-child {
  flex: 1 1 420px;
  display: grid;
  gap: 8px;
  align-content: center;
}

.header-panel > div:first-child p {
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
  color: #334155;
}

.header-meta-group {
  flex: 1 1 760px;
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto auto;
  align-items: center;
  gap: 10px 12px;
}

.header-meta-group > * {
  min-width: 0;
}

.language-picker {
  justify-self: end;
  font-size: 13px;
}

.language-picker select {
  min-width: 72px;
  padding: 8px 36px 8px 12px;
  border-radius: 14px;
}

.user-badge {
  align-self: center;
  min-height: 44px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#securityButton,
#logoutButton {
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 14px;
  white-space: nowrap;
}

#meta-summary {
  grid-column: 1 / -1;
  justify-self: end;
  margin-top: 2px;
  text-align: right;
  font-size: 13px;
  line-height: 1.35;
  color: #475569;
}

@media (max-width: 1280px) {
  .header-meta-group {
    grid-template-columns: auto minmax(220px, 1fr) auto auto;
  }
}

@media (max-width: 1024px) {
  .header-panel {
    align-items: stretch;
  }

  .header-meta-group {
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .language-picker {
    justify-self: stretch;
  }

  .user-badge,
  #meta-summary {
    grid-column: 1 / -1;
  }

  #meta-summary {
    justify-self: stretch;
    text-align: left;
  }
}


/* LED tab cleanup */
.led-panel {
  gap: 12px;
}

.led-panel .panel-title-row {
  align-items: center;
}

.led-panel .panel-title-row h2 {
  margin: 0;
}

.led-panel .cart-actions {
  gap: 10px;
}

.led-panel .cart-actions button {
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 12px;
}

.led-form-grid {
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 10px 12px;
}

.led-form-grid .field,
.led-form-grid .field.compact {
  min-width: 0;
}

.led-form-grid label,
.led-config-grid label,
.led-selected-row label {
  font-size: 13px;
  color: #475569;
}

.led-form-grid input,
.led-form-grid select,
.led-config-grid input,
.led-config-grid select,
.led-selected-row select {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
}

.led-form-grid .checkbox-inline {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
}

.led-layout-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.led-selected-row {
  grid-template-columns: minmax(0, 1fr);
}

.led-layout-grid > .led-panel {
  min-width: 0;
}

.led-summary-card {
  padding: 10px 12px;
}

.led-summary-value {
  font-size: 18px;
}

.led-recommendation-card,
.led-strategy-card,
.led-warning-card {
  padding: 12px;
}

@media (max-width: 1280px) {
  .led-form-grid {
    grid-template-columns: repeat(4, minmax(140px, 1fr));
  }
}

@media (max-width: 900px) {
  .led-form-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

@media (max-width: 640px) {
  .led-form-grid {
    grid-template-columns: 1fr;
  }

  .led-panel .cart-actions {
    width: 100%;
  }

  .led-panel .cart-actions button {
    width: 100%;
  }
}


.admin-users-table th,
.admin-audit-table th {
  background: #f6f9ff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.admin-users-table td,
.admin-audit-table td {
  padding-top: 14px;
  padding-bottom: 14px;
}

.admin-user-row td + td {
  border-left: 1px solid #f1f5f9;
}

.admin-audit-card .admin-table-wrap {
  max-height: 720px;
}

.admin-audit-card .admin-card-head,
.admin-users-card .admin-card-head {
  margin-bottom: 14px;
}

.admin-audit-card .meta,
.admin-users-card .meta,
.admin-create-card .meta,
.admin-roles-card .meta {
  color: #64748b;
}

@media (max-width: 1280px) {
  
}

/* Admin stats horizontal layout */




.admin-stats .metric-card {
  min-height: 92px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.admin-stats .metric-card-label {
  font-size: 13px;
}

.admin-stats .metric-card-value {
  margin-top: 6px;
  font-size: 18px;
}

@media (max-width: 1024px) {
  
}

@media (max-width: 640px) {
  
}


/* LED tab i18n/layout refresh */
.led-brand-groups {
  display: grid;
  gap: 16px;
}

.led-brand-group {
  display: grid;
  gap: 12px;
}

.led-brand-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.led-brand-group-header h3 {
  margin: 0;
  font-size: 18px;
  color: #0f172a;
}

.led-price-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}


.led-config-grid {
  display: block;
}

.led-config-shell {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbff 0%, #f3f7fe 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
  align-self: start;
}

.led-config-primary-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.led-config-extra-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #dbe3ef;
}

.led-config-shell .field,
.led-config-shell .field.compact {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.led-config-shell label {
  font-size: 13px;
  color: #475569;
}

.led-config-shell input,
.led-config-shell select {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
}

.led-config-toggle {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  color: #334155;
  font-size: 14px;
}

.led-config-toggle input {
  min-height: 0;
}

.led-price-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}

.led-price-label {
  font-size: 12px;
  color: #64748b;
}

.led-price-value {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  text-align: right;
}

.led-card-meta {
  line-height: 1.35;
}

@media (max-width: 900px) {
  .led-price-grid {
    grid-template-columns: 1fr;
  }

  .led-config-primary-row,
  .led-config-extra-grid {
    grid-template-columns: 1fr;
  }
}

.version-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #eef2ff;
  color: #334155;
  font-weight: 600;
  white-space: nowrap;
}


.catalog-description-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-search-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.95fr);
  gap: 20px;
  align-items: start;
}

.admin-search-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.admin-search-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.admin-search-form-grid {
  grid-template-columns: 1fr;
  align-items: end;
}

.admin-search-form-grid .field,
.admin-search-form-grid .field.compact,
.admin-search-form-grid .field.grow {
  min-width: 0;
}

.admin-search-form-grid input,
.admin-search-form-grid select {
  width: 100%;
  max-width: 100%;
}

.admin-search-insights-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-search-test-meta {
  min-height: 20px;
}

.admin-search-test-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.admin-search-result-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #d7dce5;
  border-radius: 12px;
  background: #f8fbff;
}

.admin-search-result-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-search-result-desc {
  color: #475569;
  font-size: 13px;
  line-height: 1.45;
}

.admin-search-column .admin-table-wrap,
.admin-search-insights-card .admin-table-wrap {
  max-height: 360px;
}

@media (max-width: 1240px) {
  .admin-search-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .admin-search-form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .admin-search-form-grid,
  .admin-search-test-results {
    grid-template-columns: 1fr;
  }
}

.search-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.search-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.search-pill-reason {
  background: rgba(59, 91, 219, 0.12);
  color: #2c45a7;
}

.search-pill-category {
  background: rgba(56, 161, 105, 0.12);
  color: #256447;
}

.madrix-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.madrix-shell-header {
  align-items: start;
  gap: 18px;
}

.madrix-shell-head {
  display: grid;
  gap: 8px;
}

.madrix-shell-actions {
  display: flex;
  justify-content: flex-end;
  align-self: stretch;
}

.madrix-subtitle {
  margin: 0;
  color: var(--muted-text, #5f6f89);
  max-width: 860px;
  line-height: 1.55;
}

.madrix-link {
  text-decoration: none;
}

.madrix-input-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.madrix-column,
.madrix-lists-grid {
  display: grid;
  gap: 16px;
}

.madrix-lists-grid {
  grid-template-columns: 1fr 1fr;
}

.madrix-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.madrix-column-header h3,
.madrix-panel h3 {
  margin: 0;
}

.madrix-card {
  border: 1px solid rgba(133, 153, 189, 0.28);
  border-radius: 20px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(245, 248, 255, 0.9), rgba(255, 255, 255, 0.98));
  display: grid;
  gap: 12px;
}

.madrix-result-card {
  background: linear-gradient(180deg, rgba(236, 244, 255, 0.95), rgba(248, 251, 255, 0.98));
}

.madrix-card-title {
  font-weight: 700;
  color: #1c2740;
}

.madrix-inline-grid {
  display: grid;
  gap: 12px;
}

.madrix-inline-grid-2 {
  grid-template-columns: 1fr;
}

.madrix-inline-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.madrix-inline-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.madrix-inline-grid-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.madrix-inline-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted-text, #5f6f89);
  font-size: 0.92rem;
}

.madrix-result-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.madrix-result-metric {
  border: 1px solid rgba(133, 153, 189, 0.22);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.82);
}

.madrix-result-license {
  background: linear-gradient(180deg, rgba(227, 235, 255, 0.9), rgba(245, 248, 255, 0.96));
}

.madrix-result-label {
  font-size: 0.9rem;
  color: var(--muted-text, #5f6f89);
}

.madrix-result-value {
  margin-top: 8px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #111b34;
}

.madrix-license-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.madrix-license-card {
  border: 1px solid rgba(133, 153, 189, 0.22);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.92);
}

.madrix-license-card.is-qualifies {
  border-color: rgba(93, 121, 255, 0.35);
}

.madrix-license-card.is-match {
  border-color: rgba(66, 96, 230, 0.6);
  box-shadow: 0 0 0 2px rgba(66, 96, 230, 0.12);
  background: linear-gradient(180deg, rgba(235, 241, 255, 0.96), rgba(255, 255, 255, 0.98));
}

.madrix-license-title {
  font-weight: 800;
  color: #111b34;
}

.madrix-license-metric {
  margin-top: 8px;
  color: #44536f;
}

.madrix-remove-button {
  min-width: 72px;
}

@media (max-width: 1180px) {
  .madrix-input-grid,
  .madrix-lists-grid,
  .madrix-license-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .madrix-inline-grid-5,
  .madrix-inline-grid-4,
  .madrix-inline-grid-3,
  .madrix-inline-grid-2,
  .madrix-result-grid {
    grid-template-columns: 1fr;
  }

  .madrix-inline-hint,
  .madrix-column-header {
    flex-direction: column;
    align-items: stretch;
  }
}
/* Header layout fix */
.header-meta-group {
  display: grid;
  grid-template-columns: auto auto minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 8px 12px;
}
.header-version-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
#versionBadge {
  justify-self: start;
}
#dbVersionBadge {
  justify-self: start;
}
#logoutButton {
  justify-self: end;
}
#meta-summary {
  grid-column: 1 / -1;
  justify-self: end;
  white-space: nowrap;
  font-size: 12px;
}
@media (max-width: 1024px) {
  .header-meta-group {
    grid-template-columns: 1fr 1fr;
  }
  #meta-summary {
    justify-self: start;
  }
}

/* Catalog search row */
.controls-panel {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(280px, 1fr) auto;
  gap: 16px;
  align-items: end;
}
.controls-panel .actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.controls-panel .field label {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5a6b87;
}
.controls-panel .field input,
.controls-panel .field select {
  height: 40px;
  border-radius: 10px;
  background: #f7faff;
  border: 1px solid #d7deea;
}
.controls-panel .field input:focus,
.controls-panel .field select:focus {
  border-color: #3a5ee6;
  box-shadow: 0 0 0 3px rgba(58, 94, 230, 0.18);
}
@media (max-width: 980px) {
  .controls-panel {
    grid-template-columns: 1fr;
  }
  .controls-panel .actions {
    justify-content: stretch;
  }
}


.madrix-link-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.led-systems-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 4px;
  border: 1px solid rgba(133, 153, 189, 0.22);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(242, 246, 255, 0.96), rgba(255, 255, 255, 0.98));
}

.led-systems-tab-button {
  min-width: 170px;
}

.led-quote-panel {
  display: grid;
  gap: 16px;
}

.led-quote-top-grid {
  grid-template-columns: minmax(280px, 2fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(120px, 0.8fr) minmax(190px, 1fr);
  gap: 12px;
}

.led-quote-section {
  border: 1px solid rgba(133, 153, 189, 0.22);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(247, 250, 255, 0.9), rgba(255, 255, 255, 0.95));
  padding: 12px;
}

.led-quote-pricing-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.led-quote-pricing-grid .field,
.led-quote-pricing-grid .field.compact,
.led-quote-pricing-grid .field.grow {
  width: 100%;
  min-width: 0;
}

.led-quote-pricing-grid label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.led-quote-pricing-grid input,
.led-quote-pricing-grid select {
  width: 100%;
  min-width: 0;
}

.led-quote-extras-grid {
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 10px;
}

.led-quote-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 10px;
}

.led-quote-display-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 10px;
}

.led-quote-source-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}

.led-quote-source-block {
  border: 1px solid rgba(133, 153, 189, 0.24);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(241, 246, 255, 0.85), rgba(255, 255, 255, 0.96));
  padding: 10px;
}

.led-quote-source-table {
  max-height: 260px;
}

.led-quote-metric-card {
  border: 1px solid rgba(133, 153, 189, 0.24);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(241, 246, 255, 0.9), rgba(255, 255, 255, 0.98));
  padding: 10px 12px;
}

.led-quote-metric-label {
  font-size: 0.8rem;
  color: #4f6280;
  margin-bottom: 6px;
}

.led-quote-metric-value {
  font-size: 1rem;
  font-weight: 700;
  color: #223554;
}

.led-quote-table-wrap {
  max-height: min(58vh, 620px);
}

.led-quote-table-wrap table th,
.led-quote-table-wrap table td {
  white-space: nowrap;
}

@media (max-width: 1280px) {
  .led-quote-top-grid {
    grid-template-columns: 1fr 1fr;
  }
  .led-quote-pricing-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .led-quote-extras-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
  .led-quote-metrics {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
  .led-quote-display-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
  .led-quote-source-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .led-quote-top-grid,
  .led-quote-pricing-grid,
  .led-quote-extras-grid,
  .led-quote-metrics,
  .led-quote-display-grid {
    grid-template-columns: 1fr;
  }
}

.madrix-inner-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 4px;
  border: 1px solid rgba(133, 153, 189, 0.22);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(242, 246, 255, 0.96), rgba(255, 255, 255, 0.98));
}

.madrix-inner-pane {
  display: none;
  gap: 18px;
}

.madrix-inner-pane.active {
  display: grid;
}

.madrix-planner-grid {
  display: grid;
  grid-template-columns: minmax(340px, 1.1fr) minmax(360px, 0.9fr);
  gap: 18px;
}

.madrix-planner-summary-card {
  background: linear-gradient(180deg, rgba(232, 239, 255, 0.95), rgba(248, 251, 255, 0.98));
}

.madrix-helper-text {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted-text, #5f6f89);
}

.madrix-warning-box {
  display: none;
  border-radius: 18px;
  border: 1px solid rgba(232, 87, 87, 0.24);
  background: linear-gradient(180deg, rgba(255, 237, 237, 0.96), rgba(255, 247, 247, 0.98));
  color: #7d1f1f;
  padding: 16px 18px;
}

.madrix-warning-box.has-items {
  display: grid;
  gap: 10px;
}

.madrix-warning-entry {
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(232, 87, 87, 0.18);
}

.madrix-warning-box ul {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.madrix-warning-title {
  font-weight: 800;
}

.madrix-planner-sections {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.madrix-device-grid {
  display: grid;
  gap: 14px;
}
.madrix-device-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(133, 153, 189, 0.22);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.88);
}

.madrix-device-card.is-primary {
  border-color: rgba(66, 96, 230, 0.42);
  box-shadow: 0 0 0 2px rgba(66, 96, 230, 0.08);
  background: linear-gradient(180deg, rgba(241, 246, 255, 0.98), rgba(255, 255, 255, 0.98));
}

.madrix-device-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.madrix-device-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  color: #111b34;
}

.madrix-device-meta {
  margin-top: 4px;
  color: var(--muted-text, #5f6f89);
}

.madrix-device-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(66, 96, 230, 0.12);
  color: #2842a4;
}

.madrix-device-note {
  color: #44536f;
  font-size: 0.92rem;
}

.madrix-price-grid {
  display: grid;
  gap: 6px;
  padding-top: 4px;
}

.madrix-price-row,
.madrix-price-subrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.madrix-price-row {
  font-size: 0.92rem;
}

.madrix-price-subrow {
  font-size: 0.82rem;
  color: var(--muted-text, #5f6f89);
  margin: -2px 0 2px;
}

.madrix-price-empty {
  color: var(--muted-text, #5f6f89);
  font-size: 0.92rem;
}

@media (max-width: 1180px) {
  .madrix-planner-grid,
  .madrix-planner-sections,
  .madrix-engineering-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .madrix-link-group {
    justify-content: flex-start;
  }

  .madrix-inner-tabs {
    display: grid;
    grid-template-columns: 1fr;
  }
}


.madrix-planner-stack {
  display: grid;
  gap: 18px;
}

.madrix-planner-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.madrix-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.madrix-transfer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding-top: 6px;
}

.madrix-planner-sections {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.madrix-engineering-header {
  align-items: stretch;
}

.madrix-section-head {
  display: grid;
  gap: 10px;
}

.madrix-section-note {
  margin: 0;
  max-width: 820px;
  color: var(--muted-text, #5f6f89);
  line-height: 1.55;
}

.madrix-engineering-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.madrix-engineering-card {
  display: grid;
  gap: 16px;
  min-height: 100%;
  border: 1px solid rgba(133, 153, 189, 0.22);
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(244, 248, 255, 0.98), rgba(255, 255, 255, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.madrix-engineering-card-title {
  font-size: 1.05rem;
  color: #111b34;
}

.madrix-engineering-metrics {
  display: grid;
  gap: 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(133, 153, 189, 0.18);
}

.madrix-engineering-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 10px 0;
}

.madrix-engineering-row + .madrix-engineering-row {
  border-top: 1px solid rgba(133, 153, 189, 0.16);
}

.madrix-engineering-label {
  color: #5a6b87;
  line-height: 1.45;
}

.madrix-engineering-value {
  text-align: right;
  color: #111b34;
  white-space: nowrap;
}

.madrix-engineering-foot {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(233, 240, 252, 0.55);
  border: 1px solid rgba(133, 153, 189, 0.16);
}

.madrix-engineering-foot-row {
  display: grid;
  gap: 6px;
}

.madrix-engineering-foot-row + .madrix-engineering-foot-row {
  padding-top: 10px;
  border-top: 1px solid rgba(133, 153, 189, 0.16);
}

.madrix-engineering-foot-row-note {
  align-content: start;
}

.madrix-engineering-meta-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c7d98;
}

.madrix-engineering-meta-value {
  color: #22304d;
}

.madrix-engineering-meta-note {
  margin: 0;
  color: #31405c;
  line-height: 1.55;
}

.madrix-bom-header {
  align-items: end;
}

.madrix-bom-wrap {
  max-height: 520px;
  border: 1px solid rgba(133, 153, 189, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.madrix-bom-table {
  min-width: 1600px;
}

.madrix-bom-table td {
  vertical-align: top;
}

.madrix-bom-line-name {
  display: grid;
  gap: 8px;
}

.madrix-bom-line-title {
  color: #111b34;
  line-height: 1.45;
}

.madrix-bom-line-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.82rem;
  color: #586886;
}

.madrix-bom-line-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.madrix-bom-line-meta span + span::before {
  content: "|";
  color: #94a3b8;
  margin-right: 2px;
}

.madrix-bom-line-description {
  color: #425270;
  line-height: 1.5;
}

.madrix-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(66, 96, 230, 0.1);
  color: #2842a4;
  font-size: 0.78rem;
}

.madrix-chip.manual {
  background: rgba(245, 158, 11, 0.16);
  color: #9a5a00;
}

.madrix-chip.is-warning {
  background: rgba(245, 158, 11, 0.16);
  color: #9a5a00;
}

.madrix-bom-note-stack {
  display: grid;
  gap: 8px;
  min-width: 240px;
}

.madrix-bom-note-primary {
  color: #31405c;
  line-height: 1.5;
}

.madrix-bom-note-secondary {
  color: #64748b;
  font-size: 0.84rem;
  line-height: 1.55;
}

.madrix-bom-input {
  min-width: 110px;
  width: 100%;
  padding: 8px 10px;
  background: #fff;
}

.madrix-bom-actions {
  display: grid;
  gap: 8px;
}

.madrix-bom-actions button {
  padding: 8px 10px;
  min-width: 92px;
}

.madrix-device-card.is-selected {
  border-color: rgba(29, 78, 216, 0.5);
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.12);
  background: linear-gradient(180deg, rgba(237, 244, 255, 0.98), rgba(255, 255, 255, 0.98));
}

.madrix-device-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.madrix-device-status {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1d4ed8;
}

.madrix-totals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.madrix-total-card {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(133, 153, 189, 0.22);
  border-radius: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.9);
}

.madrix-total-card h4 {
  margin: 0;
  font-size: 0.95rem;
}

.madrix-total-values {
  display: grid;
  gap: 4px;
}

.madrix-total-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.92rem;
}

.madrix-total-line strong {
  color: #111b34;
}

.madrix-total-normalized {
  margin-top: 2px;
  font-size: 0.82rem;
  color: #5a6c8d;
}

.madrix-empty-state {
  color: #64748b;
  font-size: 0.92rem;
}

.madrix-option-note {
  font-size: 0.86rem;
  color: #52627f;
}

@media (max-width: 900px) {
  .madrix-transfer-meta,
  .madrix-form-actions,
  .madrix-device-actions {
    justify-content: flex-start;
  }

  .madrix-bom-table {
    min-width: 1120px;
  }
}

.admin-tabs-cell {
  min-width: 260px;
}

.admin-tabs-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  min-height: 54px;
  border: 1px solid #cfd8e6;
  border-radius: 14px;
  background: #f8fbff;
}

.admin-tabs-checklist-inline {
  min-width: 240px;
}

.admin-tab-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #dbe4f0;
  color: #334155;
  font-size: 13px;
  line-height: 1;
}

.admin-tab-check input {
  margin: 0;
  width: 15px;
  height: 15px;
}

body,
body *,
body *::before,
body *::after {
  font-weight: 400 !important;
}



.resizable-grid-table {
  table-layout: fixed;
}

.resizable-grid-table th[data-col-key] {
  position: sticky;
  top: 0;
}

.resizable-grid-table th.is-resizable {
  position: sticky;
  user-select: none;
}

.resizable-grid-table td {
  min-width: 0;
}

.inventory-panel-actions {
  align-items: flex-end;
  gap: 12px;
}

.inventory-controls-panel {
  grid-template-columns: minmax(180px, 240px) minmax(220px, 320px) minmax(260px, 1fr) auto;
}

.inventory-updated-at {
  white-space: nowrap;
  align-self: center;
  color: #64748b;
}

.search-debug-button {
  align-self: flex-start;
  padding: 4px 10px;
  font-size: 12px;
}

.search-debug-content {
  display: grid;
  gap: 16px;
}

.search-debug-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.search-debug-card {
  border: 1px solid #dbe4f0;
  border-radius: 14px;
  background: #f8fbff;
  padding: 14px;
}

.search-debug-card h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.search-debug-card ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.search-debug-score {
  color: #475569;
}

@media (max-width: 900px) {
  .search-debug-grid {
    grid-template-columns: 1fr;
  }

  .inventory-panel-actions {
    align-items: stretch;
  }

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

  .inventory-updated-at {
    align-self: flex-start;
  }
}


@media (max-width: 760px) {
  .madrix-engineering-grid {
    grid-template-columns: 1fr;
  }

  .madrix-engineering-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .madrix-engineering-value {
    text-align: left;
  }
}



/* Admin users table visual tighten */
.admin-tabs-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-width: 320px;
}

.admin-tabs-checklist-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-tab-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid #dbe3ef;
  background: #ffffff;
  font-size: 12px;
  line-height: 1.2;
  color: #1f2937;
  white-space: nowrap;
}

.admin-tab-check input {
  width: 14px;
  height: 14px;
}

.admin-tab-with-subtabs {
  display: grid;
  gap: 6px;
}

.admin-subtab-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-left: 22px;
}

.admin-subtab-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid #dbe3ef;
  background: #f8fbff;
  font-size: 12px;
  color: #334155;
}

.admin-subtab-check input {
  width: 13px;
  height: 13px;
  margin: 0;
}

.admin-subtab-checklist.is-disabled {
  opacity: 0.55;
}

.admin-actions {
  min-width: 170px;
  align-items: stretch;
}

.admin-actions button {
  font-size: 12px;
  padding: 8px 10px;
}

.admin-users-table td {
  vertical-align: top;
}

.admin-users-card .admin-table-wrap {
  max-height: 520px;
  overflow: auto;
}

.admin-users-table {
  min-width: 980px;
}

.admin-users-card .admin-table-wrap::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

.admin-users-card .admin-table-wrap::-webkit-scrollbar-thumb {
  background: #cfd8e3;
  border-radius: 999px;
}

.admin-users-card .admin-table-wrap {
  max-height: 60vh;
  overflow-y: auto;
  overflow-x: auto;
  scrollbar-gutter: stable;
}

.admin-users-card .admin-table-wrap::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

.admin-users-card .admin-table-wrap::-webkit-scrollbar-thumb {
  background: #c7d2e0;
  border-radius: 999px;
}


.feedback-dialog-body {
  display: grid;
  gap: 16px;
}

.feedback-form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.feedback-form-grid .grow {
  grid-column: span 2;
}

.feedback-list {
  display: grid;
  gap: 12px;
}

.feedback-item {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 6px;
  background: #f8fafc;
}

.feedback-item-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.feedback-item-title {
  font-weight: 600;
}

.feedback-item-meta {
  font-size: 12px;
  color: #64748b;
}

.feedback-item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-feedback-card textarea {
  width: 100%;
  min-height: 60px;
  resize: vertical;
}

@media (max-width: 640px) {
  .feedback-form-grid {
    grid-template-columns: 1fr;
  }
  .feedback-form-grid .grow {
    grid-column: span 1;
  }
}

.admin-header-row button {
  justify-self: end;
}

.feedback-alert {
  background: #ef4444 !important;
  color: #fff !important;
  border-color: #ef4444 !important;
}


.admin-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-content: start;
  width: 100%;
  box-sizing: border-box;
  padding: 20px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.9) 0%, rgba(244, 247, 255, 0.9) 100%);
  border-radius: 22px;
}

.admin-header-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-width: 0;
}
.admin-header-row button {
  justify-self: end;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 4px;
  justify-items: stretch;
}
.admin-stats .metric-card {
  min-height: 92px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.admin-stats .metric-card-label { font-size: 13px; }
.admin-stats .metric-card-value { margin-top: 6px; font-size: 18px; }

.admin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: stretch;
}
.admin-lower-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: stretch;
}

@media (max-width: 1024px) {
  .admin-header-row { grid-template-columns: 1fr; }
  .admin-header-row button { justify-self: start; }
  .admin-stats { grid-template-columns: 1fr; }
}

/* Admin header alignment hotfix */
.admin-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  width: 100%;
}
.admin-header-row button {
  margin-left: auto;
}


/* Project user: hide non-project price columns */
body.project-user #catalogResultsTable col[data-col-key="list1"],
body.project-user #catalogResultsTable col[data-col-key="list2"],
body.project-user #catalogResultsTable col[data-col-key="dealer"],
body.project-user #catalogResultsTable th[data-col-key="list1"],
body.project-user #catalogResultsTable th[data-col-key="list2"],
body.project-user #catalogResultsTable th[data-col-key="dealer"],
body.project-user #catalogResultsTable td[data-col-key="list1"],
body.project-user #catalogResultsTable td[data-col-key="list2"],
body.project-user #catalogResultsTable td[data-col-key="dealer"] {
  display: none;
}

body.project-user #madrixPlannerBomTable col[data-col-key="list1"],
body.project-user #madrixPlannerBomTable col[data-col-key="list2"],
body.project-user #madrixPlannerBomTable col[data-col-key="dealer"],
body.project-user #madrixPlannerBomTable th[data-col-key="list1"],
body.project-user #madrixPlannerBomTable th[data-col-key="list2"],
body.project-user #madrixPlannerBomTable th[data-col-key="dealer"],
body.project-user #madrixPlannerBomTable td[data-col-key="list1"],
body.project-user #madrixPlannerBomTable td[data-col-key="list2"],
body.project-user #madrixPlannerBomTable td[data-col-key="dealer"] {
  display: none;
}

body.project-user #ledTab thead th:nth-child(8),
body.project-user #ledTab thead th:nth-child(9),
body.project-user #ledTab thead th:nth-child(10),
body.project-user #ledBomBody td:nth-child(8),
body.project-user #ledBomBody td:nth-child(9),
body.project-user #ledBomBody td:nth-child(10) {
  display: none;
}

body.project-user #madrixPlannerBomTable thead th:nth-child(8),
body.project-user #madrixPlannerBomTable thead th:nth-child(9),
body.project-user #madrixPlannerBomTable thead th:nth-child(10),
body.project-user #madrixPlannerBomBody td:nth-child(8),
body.project-user #madrixPlannerBomBody td:nth-child(9),
body.project-user #madrixPlannerBomBody td:nth-child(10) {
  display: none;
}


.admin-panel,
.admin-grid,
.admin-lower-grid,
.admin-card,
.admin-users-card,
.admin-audit-card {
  min-width: 0;
}

.admin-users-card,
.admin-audit-card {
  overflow: visible;
}

.admin-users-card .admin-table-wrap,
.admin-audit-card .admin-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  scrollbar-gutter: stable both-edges;
}

.admin-users-table {
  min-width: 1320px;
  width: max-content;
}

.admin-audit-table {
  min-width: 920px;
  width: max-content;
}

.admin-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 148px;
}

.admin-inline-country {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.admin-inline-country label {
  font-size: 12px;
  color: #64748b;
}

.admin-country-card {
  display: grid;
  gap: 16px;
}

.admin-country-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 320px) auto;
  gap: 12px;
  align-items: end;
}

.admin-country-grid {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-country-pane {
  display: grid;
  gap: 14px;
}

.admin-country-checklist {
  max-width: none;
}

.admin-country-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.admin-country-results {
  display: grid;
  gap: 10px;
  max-height: 280px;
  overflow: auto;
  padding: 12px;
  border: 1px solid #dbe3ef;
  border-radius: 16px;
  background: #f8fbff;
}

.admin-country-result {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #dde6f2;
  border-radius: 12px;
  background: #ffffff;
}

.admin-country-result-title {
  font-size: 13px;
  color: #0f172a;
  margin-bottom: 4px;
}

.admin-selection-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 44px;
  padding: 12px;
  border: 1px solid #dbe3ef;
  border-radius: 16px;
  background: #f8fbff;
}

.admin-selection-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid #d7e2ef;
  background: #ffffff;
  max-width: 100%;
}

.admin-selection-pill span {
  font-size: 12px;
  color: #1f2937;
}

.admin-selection-pill button {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  cursor: pointer;
}

.admin-user-filter-dialog {
  width: min(980px, calc(100vw - 32px));
}

.admin-user-filter-dialog-body {
  display: grid;
  gap: 16px;
}

.admin-user-filter-head {
  align-items: end;
}

@media (max-width: 1200px) {
  .admin-country-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .admin-country-toolbar,
  .admin-country-search-row {
    grid-template-columns: 1fr;
  }
}


/* Final admin layout lock */
.admin-panel {
  width: 100%;
  min-width: 0;
  overflow: visible;
}

.admin-panel > * {
  min-width: 0;
}

.admin-header-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: start !important;
  justify-content: stretch !important;
  gap: 16px !important;
  width: 100% !important;
  margin: 0 !important;
}

.admin-heading-group {
  min-width: 0;
}

.admin-header-row button {
  justify-self: end !important;
  align-self: start !important;
  margin-left: 0 !important;
}

.admin-grid,
.admin-lower-grid,
#adminSearchSection {
  width: 100%;
  min-width: 0;
}

.admin-card {
  width: 100%;
  min-width: 0;
  overflow: visible;
}

.admin-users-card .admin-table-wrap,
.admin-audit-card .admin-table-wrap,
.admin-search-column .admin-table-wrap,
.admin-search-insights-card .admin-table-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: auto !important;
  max-height: 70vh;
}

.admin-users-table {
  min-width: 1480px;
  width: max-content;
}

.admin-audit-table {
  min-width: 1040px;
  width: max-content;
}

.admin-actions {
  min-width: 180px;
}

@media (max-width: 1024px) {
  .admin-header-row {
    grid-template-columns: 1fr !important;
  }

  .admin-header-row button {
    justify-self: start !important;
  }

  .admin-stats {
    grid-template-columns: 1fr;
  }
}

/* Continue web UI refresh v1.2.0.96 */
.layout {
  width: min(1780px, calc(100vw - 24px));
}

.catalog-controls-panel,
.catalog-results-panel {
  width: 100%;
}

#catalogResultsTable col[data-col-key="actions"] {
  width: 184px;
}

#catalogResultsTable th:last-child,
#catalogResultsTable td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #ffffff;
  box-shadow: -14px 0 18px -16px rgba(15, 23, 42, 0.45);
}

#catalogResultsTable thead th:last-child {
  z-index: 4;
  background: #f8fafc;
}

#catalogResultsTable .cart-actions {
  min-width: 148px;
  align-items: stretch;
}

#catalogResultsTable .cart-actions button {
  width: 100%;
}

.admin-subtab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.admin-subtab-button {
  border: 1px solid #d7dce5;
  background: #e8eef8;
  color: #1e293b;
  border-radius: 12px;
  padding: 10px 14px;
  line-height: 1;
}

.admin-subtab-button.active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
}

#adminTab .admin-panel {
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

#adminTab .admin-header-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: start !important;
  gap: 16px !important;
  width: 100% !important;
}

#adminTab .admin-header-row > * {
  min-width: 0;
}

#adminTab .admin-header-row button {
  justify-self: end !important;
  align-self: start !important;
  margin-left: 0 !important;
}

#adminTab .admin-grid,
#adminTab .admin-lower-grid,
#adminTab #adminCountrySection,
#adminTab #adminSearchSection {
  width: 100%;
  min-width: 0;
}

#adminTab .admin-card {
  width: 100%;
  min-width: 0;
}

#adminTab .admin-users-card .admin-table-wrap,
#adminTab .admin-audit-card .admin-table-wrap,
#adminTab .admin-search-column .admin-table-wrap,
#adminTab .admin-search-insights-card .admin-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow: auto;
}

#adminTab .admin-country-card {
  width: 100%;
}

.admin-country-brand-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid #dbe3ef;
  border-radius: 16px;
  background: #f8fbff;
}

.admin-country-brand-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-country-brand-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-country-brand-search-row {
  align-items: end;
}

.admin-country-brand-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 340px;
  overflow: auto;
  padding: 4px;
}

.admin-country-brand-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #ffffff;
}

.admin-country-brand-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1200px) {
  .layout {
    width: min(100%, calc(100vw - 20px));
  }

  .admin-country-brand-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .admin-subtab-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  #adminTab .admin-header-row {
    grid-template-columns: 1fr !important;
  }

  #adminTab .admin-header-row button {
    justify-self: start !important;
  }
}

/* Mobile theme polish v1.2.0.97 */
@media (max-width: 900px) {
  body {
    align-items: stretch;
  }

  .layout {
    width: 100%;
    min-height: 100vh;
    padding: 12px;
    gap: 12px;
  }

  .panel {
    padding: 16px;
    border-radius: 18px;
  }

  .header-panel,
  .panel-title-row,
  .panel-title-row-proforma,
  .madrix-shell-header,
  .madrix-column-header,
  .feedback-item-head,
  .admin-card-head {
    flex-direction: column;
    align-items: stretch;
  }

  .header-panel > div:first-child {
    flex: 1 1 auto;
  }

  .header-meta-group {
    width: 100%;
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  #versionBadge,
  .language-picker,
  .user-badge,
  #securityButton,
  #feedbackButton,
  #logoutButton {
    width: 100%;
    justify-self: stretch;
  }

  .language-picker {
    justify-content: space-between;
  }

  .language-picker select {
    width: 100%;
    min-width: 0;
  }

  #meta-summary {
    grid-column: auto;
    justify-self: stretch;
    text-align: left;
    white-space: normal;
    word-break: break-word;
  }

  .tab-row {
    gap: 8px;
    padding: 8px;
    margin: 0 -2px;
    scroll-padding-inline: 12px;
  }

  .tab-button {
    min-height: 44px;
    padding: 10px 14px;
  }

  .controls-panel,
  .catalog-controls-panel {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .controls-panel .field,
  .controls-panel .actions,
  .field,
  .field.compact {
    width: 100%;
    min-width: 0;
  }

  .controls-panel .actions,
  .actions,
  .cart-actions,
  .proforma-toolbar-actions,
  .inventory-panel-actions,
  .madrix-form-actions,
  .madrix-device-actions,
  .madrix-link-group {
    width: 100%;
    justify-content: stretch;
  }

  .actions > button,
  .actions > label,
  .cart-actions > button,
  .cart-actions > label,
  .proforma-toolbar-actions > button,
  .inventory-panel-actions > button,
  .inventory-panel-actions > label,
  .madrix-form-actions > button,
  .madrix-device-actions > button,
  .madrix-link-group > a {
    width: 100%;
    flex: 1 1 100%;
  }

  .header-grid,
  .header-grid.compact-grid,
  .manual-item-grid,
  .admin-form-grid,
  .admin-audit-filter-grid,
  .admin-user-filter-head,
  .admin-country-grid,
  .led-form-grid,
  .led-config-grid,
  .led-config-extra-grid,
  .led-strategy-grid,
  .led-recommendation-grid,
  .madrix-inline-grid-2,
  .madrix-inline-grid-3,
  .madrix-inline-grid-4,
  .madrix-inline-grid-5,
  .madrix-engineering-grid,
  .madrix-license-grid,
  .madrix-lists-grid,
  .madrix-totals-grid,
  .feedback-form-grid {
    grid-template-columns: 1fr !important;
  }

  .led-layout-grid,
  .admin-grid,
  .admin-lower-grid,
  #adminSearchSection {
    grid-template-columns: 1fr !important;
  }

  .madrix-inline-hint,
  .madrix-device-head,
  .madrix-price-row,
  .madrix-price-subrow,
  .madrix-total-line {
    flex-direction: column;
    align-items: flex-start;
  }

  .madrix-transfer-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-country-brand-toolbar,
  .admin-country-brand-actions {
    width: 100%;
  }

  .admin-country-brand-actions > button {
    width: 100%;
  }

  .admin-country-brand-list {
    max-height: none;
  }

  .results-panel .table-wrap,
  .cart-panel .table-wrap,
  .saved-quotes-panel .table-wrap,
  .inventory-table-wrap,
  .review-panel .table-wrap,
  .admin-users-card .admin-table-wrap,
  .admin-audit-card .admin-table-wrap,
  .admin-search-column .admin-table-wrap,
  .admin-search-insights-card .admin-table-wrap,
  .madrix-bom-wrap {
    margin: 0 -4px;
    padding-bottom: 6px;
  }

  #catalogResultsTable col[data-col-key="actions"] {
    width: 160px;
  }

  #catalogResultsTable .cart-actions {
    min-width: 132px;
  }

  .admin-subtab-row {
    margin: 0 -4px;
    padding: 0 4px 6px;
  }

  .feedback-dialog-body,
  .login-card {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .layout {
    padding: 10px;
    gap: 10px;
  }

  .panel {
    padding: 14px;
    border-radius: 16px;
  }

  .header-panel h1,
  .panel-title-row h2,
  .panel-title-row-proforma h2 {
    font-size: 1.85rem;
    line-height: 1.1;
  }

  .header-panel > div:first-child p,
  .madrix-subtitle,
  .meta,
  #meta-summary {
    font-size: 13px;
  }

  .tab-button {
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 12px;
  }

  .table-wrap {
    border-radius: 12px;
  }

  .resizable-list-wrap {
    resize: none !important;
  }

  #catalogResultsTable th:last-child,
  #catalogResultsTable td:last-child {
    box-shadow: -10px 0 14px -14px rgba(15, 23, 42, 0.45);
  }

  .stock-pill,
  .admin-pill,
  .admin-tab-check,
  .admin-country-brand-option {
    font-size: 12px;
  }
}

/* Proforma view toggle mobile fix v1.2.0.99 */
@media (max-width: 900px) {
  .proforma-toolbar,
  .proforma-toolbar-priority,
  .proforma-toolbar-actions {
    width: 100%;
  }

  .proforma-toolbar-priority {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
    gap: 12px;
    flex: 1 1 auto;
  }

  .toolbar-field,
  .toolbar-field-primary,
  .toolbar-field-wide,
  .toolbar-field-view,
  .toolbar-field-currency {
    width: 100%;
    min-width: 0 !important;
  }

  .toolbar-field-view .price-source-switch,
  .toolbar-field-view .price-source-pill,
  .toolbar-field-currency .toolbar-select {
    width: 100%;
  }

  .toolbar-field-view .price-source-switch {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .toolbar-field-view .price-source-pill {
    flex: 1 1 100%;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .toolbar-field-view .price-source-pill,
  .toolbar-field-currency .toolbar-select {
    min-height: 44px;
  }
}

/* Layout stabilization overrides for admin and product selection */
.catalog-subtab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.catalog-subtab-button {
  min-width: 180px;
}

.catalog-subtab-pane {
  display: grid;
  gap: 16px;
}

.catalog-subtab-pane.hidden {
  display: none !important;
}

.catalog-compare-panel {
  width: 100%;
}

#catalogTab .catalog-controls-panel {
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
}

#catalogTab .catalog-controls-panel .field {
  flex: 1 1 280px;
  min-width: 0;
}

#catalogTab .catalog-controls-panel .actions {
  flex: 0 0 auto;
  margin-left: auto;
}

#resultsTableWrap {
  width: 100%;
  max-width: 100%;
  min-height: 430px;
  max-height: 620px;
  overflow: auto;
  scrollbar-gutter: stable both-edges;
}

@media (min-width: 901px) {
  .resizable-list-wrap {
    position: relative;
    resize: both;
    overflow: auto;
    min-width: 100%;
    width: 100%;
    max-width: 100%;
    scrollbar-gutter: stable both-edges;
  }

  .resizable-list-wrap::after {
    content: "";
    position: absolute;
    right: 10px;
    bottom: 8px;
    width: 13px;
    height: 13px;
    border-right: 2px solid rgba(71, 85, 105, 0.34);
    border-bottom: 2px solid rgba(71, 85, 105, 0.34);
    border-radius: 0 0 7px 0;
    pointer-events: none;
    opacity: 0.9;
  }

  #resultsTableWrap.resizable-list-wrap {
    min-height: 430px;
    max-height: min(78vh, 920px);
  }

  #stockTableWrap.resizable-list-wrap,
  #depoTableWrap.resizable-list-wrap {
    min-height: 520px;
    max-height: min(82vh, 980px);
  }
}

#catalogResultsTable {
  min-width: 1440px;
  width: 100%;
}

#catalogResultsTable col[data-col-key="select"] {
  width: 56px;
}

#catalogResultsTable .catalog-select-cell {
  width: 56px;
  min-width: 56px;
  text-align: center;
}

#catalogResultsTable .catalog-select-cell input {
  width: 18px;
  height: 18px;
}

#catalogResultsTable col[data-col-key="actions"] {
  width: clamp(160px, 16vw, 200px);
}

#catalogResultsTable col[data-col-key="entryQty"] {
  width: 96px;
}

#catalogResultsTable .cart-actions {
  min-width: 0;
  width: 100%;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

#catalogResultsTable .cart-actions button {
  width: 100%;
  min-height: 32px;
}

#catalogResultsTable th,
#catalogResultsTable td {
  padding: 7px 8px;
  line-height: 1.25;
}

#catalogResultsTable th[data-col-key="entryQty"],
#catalogResultsTable td[data-col-key="entryQty"] {
  text-align: center;
}

#catalogResultsTable .compact-icon-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  min-width: 0;
  width: 100%;
}

#catalogResultsTable .compact-icon-actions .icon-action-button {
  width: 100%;
  min-width: 0;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 7px;
  font-size: 15px;
}

#catalogResultsTable .cart-actions > button[data-add] {
  min-height: 30px;
  padding: 6px 8px;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.15;
}

.catalog-inline-qty-input {
  width: 72px;
  min-width: 72px;
  height: 34px;
  padding: 6px 8px;
  text-align: center;
}

.catalog-workspace-panel,
.catalog-results-panel {
  display: grid;
  gap: 16px;
}

.catalog-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.catalog-workspace-card,
.catalog-compare-drawer {
  border: 1px solid #dbe3ef;
  border-radius: 18px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  padding: 16px;
}

.catalog-search-chip-list,
.catalog-workspace-product-list,
.catalog-compare-grid {
  display: grid;
  gap: 12px;
}

.catalog-search-chip {
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #d7dce5;
  background: #ffffff;
  color: #1e293b;
}

.catalog-search-chip strong,
.catalog-workspace-product-title strong {
  font-size: 0.96rem;
}

.catalog-search-chip span,
.catalog-workspace-product-title .meta,
.catalog-workspace-product-head .meta {
  color: #64748b;
  font-size: 0.82rem;
}

.catalog-workspace-product-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid #dbe3ef;
  background: #ffffff;
}

.catalog-workspace-product-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.catalog-workspace-product-title {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.catalog-workspace-product-desc {
  color: #334155;
  line-height: 1.45;
  min-height: 42px;
}

.catalog-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.catalog-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.catalog-badge-stock {
  background: #dcfce7;
  color: #166534;
}

.catalog-badge-depo {
  background: #dbeafe;
  color: #1d4ed8;
}

.catalog-badge-campaign {
  background: #fef3c7;
  color: #92400e;
}

.catalog-badge-new {
  background: #ede9fe;
  color: #6d28d9;
}

.catalog-badge-manual {
  background: #e2e8f0;
  color: #334155;
}

.catalog-price-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.catalog-price-chip {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: #1e3a8a;
  font-size: 0.8rem;
}

.catalog-workspace-product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.catalog-workspace-product-actions button {
  flex: 1 1 180px;
}

.catalog-bulk-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 1px solid #dbe3ef;
  border-radius: 16px;
  background: #f8fbff;
}

.catalog-bulk-toolbar-summary {
  display: grid;
  gap: 4px;
}

.catalog-bulk-toolbar-controls {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.catalog-bulk-toolbar-controls .field {
  min-width: 120px;
}

.catalog-bulk-toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.catalog-toggle-active {
  background: #dbeafe !important;
  border-color: #93c5fd !important;
  color: #1d4ed8 !important;
}

.catalog-empty-state {
  padding: 18px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  color: #64748b;
  background: #f8fafc;
}

.catalog-compare-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

@media (max-width: 1380px) {
  .catalog-workspace-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .catalog-bulk-toolbar,
  .catalog-bulk-toolbar-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .catalog-bulk-toolbar-controls .field,
  .catalog-bulk-toolbar-actions,
  .catalog-bulk-toolbar-actions button,
  .catalog-workspace-product-actions button {
    width: 100%;
  }
}

#adminTab .admin-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
}

#adminTab .admin-header-row > * {
  min-width: 0;
}

#adminTab .admin-stats {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

#adminTab .admin-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

#adminTab .admin-lower-grid {
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  align-items: start;
}

#adminTab .admin-card {
  min-width: 0;
}

#adminTab .admin-form-grid,
#adminTab .admin-audit-filter-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

#adminTab .admin-form-grid .field.grow,
#adminTab .admin-audit-filter-grid .field.grow {
  grid-column: 1 / -1;
}

#adminTab .admin-tabs-checklist {
  width: 100%;
  max-width: none;
}

#adminTab .admin-table-wrap {
  max-width: 100%;
  overflow: auto;
  scrollbar-gutter: stable both-edges;
}

#adminTab .admin-users-table {
  min-width: 1320px;
  width: 100%;
}

#adminTab .admin-audit-table {
  min-width: 920px;
  width: 100%;
}

#adminTab .admin-actions {
  min-width: 0;
  width: 100%;
  flex-direction: column;
}

#adminTab .admin-actions button {
  width: 100%;
}

@media (max-width: 1180px) {
  .catalog-subtab-button {
    flex: 1 1 100%;
    width: 100%;
  }

  #catalogTab .catalog-controls-panel .field,
  #catalogTab .catalog-controls-panel .actions {
    flex: 1 1 100%;
    width: 100%;
  }

  #catalogTab .catalog-controls-panel .actions {
    margin-left: 0;
  }

  #adminTab .admin-grid,
  #adminTab .admin-lower-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  #adminTab .admin-stats {
    grid-template-columns: 1fr;
  }
}


/* Final admin layout pass */
#adminTab .admin-lower-grid {
  grid-template-columns: 1fr !important;
}

#adminTab .admin-users-card .admin-table-wrap,
#adminTab .admin-audit-card .admin-table-wrap {
  max-height: min(68vh, 760px);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable both-edges;
}

#adminTab .admin-users-table {
  min-width: 1280px;
  width: 100%;
}

#adminTab .admin-actions {
  flex-direction: column;
}

#resultsTableWrap {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}


/* Final admin layout lock v1.2.0.117 */
#adminTab .admin-panel {
  display: flex !important;
  flex-direction: column !important;
  gap: 20px !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  padding: 20px !important;
  overflow: visible !important;
  box-sizing: border-box !important;
}

#adminTab .admin-header-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: start !important;
  gap: 16px !important;
  width: 100% !important;
  min-width: 0 !important;
  justify-content: stretch !important;
}

#adminTab .admin-header-row > * {
  min-width: 0 !important;
}

#adminTab .admin-header-row button {
  justify-self: end !important;
  align-self: start !important;
  margin: 0 !important;
}

#adminTab .panel-title-row.admin-header-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: start !important;
}

#adminTab .admin-grid,
#adminTab .admin-lower-grid,
#adminTab #adminCountrySection,
#adminTab #adminSearchSection {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 20px !important;
  width: 100% !important;
  min-width: 0 !important;
  align-items: start !important;
}

#adminTab .admin-card {
  width: 100% !important;
  min-width: 0 !important;
  overflow: visible !important;
}

#adminTab .admin-subtab-row {
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  gap: 10px !important;
  align-items: center !important;
  padding-bottom: 4px !important;
  scrollbar-gutter: stable both-edges !important;
}

#adminTab .admin-subtab-row::-webkit-scrollbar {
  height: 8px;
}

#adminTab .admin-table-wrap,
#adminTab .admin-users-card .admin-table-wrap,
#adminTab .admin-audit-card .admin-table-wrap,
#adminTab .admin-search-column .admin-table-wrap,
#adminTab .admin-search-insights-card .admin-table-wrap {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  max-height: min(68vh, 760px) !important;
  overflow: auto !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable both-edges !important;
}

#adminTab .admin-users-table {
  min-width: 1380px !important;
  width: max-content !important;
}

#adminTab .admin-audit-table {
  min-width: 1040px !important;
  width: max-content !important;
}

#adminTab .admin-actions {
  min-width: 180px !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 8px !important;
}

#adminTab .admin-actions button {
  width: 100% !important;
}

@media (max-width: 1024px) {
  #adminTab .admin-header-row {
    grid-template-columns: 1fr !important;
  }

  #adminTab .admin-header-row button {
    justify-self: start !important;
  }

  #adminTab .admin-stats {
    grid-template-columns: 1fr !important;
  }
}

/* CRM */
#crmTab .crm-panel {
  width: 100%;
  border: 1px solid #cfd8e6;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
  padding: 16px;
}

#crmTab .panel-title-row h2,
#crmTab .panel-title-row h3 {
  color: #0f172a;
  font-weight: 800;
  letter-spacing: 0.01em;
}

#crmTab .panel-title-row h2 {
  font-size: 24px;
  line-height: 1.05;
}

#crmTab .panel-title-row h3 {
  font-size: 19px;
  line-height: 1.08;
}

#crmTab .crm-filter-grid,
#crmTab .crm-detail-grid,
#crmTab .crm-activity-grid {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}

#crmTab .crm-filter-grid {
  gap: 10px 12px;
  align-items: end;
}

#crmTab .crm-summary-line {
  margin: 8px 0 4px;
  color: #334155;
  background: #eef3fb;
  border: 1px solid #d3deef;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 0.9rem;
}

#crmTab .crm-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 10px 0 12px;
}

#crmTab .crm-kpi-card,
#crmTab .crm-insight-card {
  border: 1px solid #d6e0ef;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 249, 255, 0.96) 100%);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

#crmTab .crm-kpi-card {
  padding: 12px;
  min-width: 0;
}

#crmTab .crm-kpi-card.is-critical {
  border-color: #fecaca;
}

#crmTab .crm-kpi-card.is-open {
  border-color: #bfdbfe;
}

#crmTab .crm-kpi-card.is-warning {
  border-color: #fde68a;
}

#crmTab .crm-kpi-card.is-forecast {
  border-color: #bfdbfe;
}

#crmTab .crm-kpi-card.is-owner {
  border-color: #c7d2fe;
}

#crmTab .crm-kpi-label {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#crmTab .crm-kpi-value {
  margin-top: 6px;
  color: #0f172a;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.1;
}

#crmTab .crm-kpi-meta {
  margin-top: 8px;
  color: #475569;
  font-size: 0.84rem;
  line-height: 1.45;
}

#crmTab .crm-stage-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin: 10px 0 12px;
}

#crmTab .crm-stage-stat {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #d6e0ef;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 249, 255, 0.96) 100%);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

#crmTab .crm-stage-stat.is-open {
  border-top: 4px solid #94a3b8;
}

#crmTab .crm-stage-stat.is-won {
  border-top: 4px solid #22c55e;
  border-color: #86efac;
}

#crmTab .crm-stage-stat-label {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#crmTab .crm-stage-stat-value {
  color: #0f172a;
  font-size: 1.5rem;
  line-height: 1;
}

#crmTab .crm-popup-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 12px;
}

#crmTab .crm-popup-action-row button {
  min-width: 220px;
}

#crmTab .crm-insight-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

#crmTab .crm-insight-card {
  padding: 12px;
  min-width: 0;
}

#crmTab .crm-insight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

#crmTab .crm-insight-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

#crmTab .crm-reminder-list,
#crmTab .crm-performance-list {
  display: grid;
  gap: 8px;
}

#crmTab .crm-reminder-row,
#crmTab .crm-performance-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}

#crmTab .crm-reminder-main,
#crmTab .crm-performance-owner {
  display: grid;
  gap: 4px;
  min-width: 0;
}

#crmTab .crm-reminder-title,
#crmTab .crm-performance-owner strong {
  color: #0f172a;
  font-size: 0.94rem;
  font-weight: 700;
}

#crmTab .crm-reminder-meta,
#crmTab .crm-performance-owner span,
#crmTab .crm-reminder-date,
#crmTab .crm-performance-metrics span {
  color: #64748b;
  font-size: 0.82rem;
}

#crmTab .crm-reminder-side,
#crmTab .crm-performance-metrics {
  display: grid;
  gap: 4px;
  justify-items: end;
  text-align: right;
}

#crmTab .crm-mini-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  background: #e2e8f0;
  color: #334155;
}

#crmTab .crm-mini-badge.is-danger {
  background: #fee2e2;
  color: #991b1b;
}

#crmTab .crm-mini-badge.is-warning {
  background: #fef3c7;
  color: #92400e;
}

#crmTab .crm-mini-badge.is-info {
  background: #dbeafe;
  color: #1d4ed8;
}

#crmTab .crm-mini-badge.is-muted {
  background: #e2e8f0;
  color: #475569;
}

#crmTab .crm-insight-empty {
  color: #64748b;
  font-size: 0.88rem;
  padding: 8px 4px;
}

#crmTab .crm-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 12px;
  align-items: start;
}

#crmTab .crm-stage-column {
  border: 1px solid #cfd8e6;
  border-radius: 12px;
  padding: 12px;
  background: #f6f8fc;
  min-height: 220px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

#crmTab .crm-stage-column.is-open {
  background: #f3f6fb;
  border-color: #cfd8e6;
  border-top: 4px solid #94a3b8;
}

#crmTab .crm-stage-column.is-won {
  background: #ecfdf3;
  border-color: #86efac;
  border-top: 4px solid #22c55e;
}

#crmTab .crm-stage-column.is-lost {
  background: #fff1f2;
  border-color: #fda4af;
  border-top: 4px solid #ef4444;
}

#crmTab .crm-stage-column.is-drop-target {
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.25);
}

#crmTab .crm-stage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: #0f172a;
  font-weight: 700;
  margin-bottom: 10px;
}

#crmTab .crm-stage-header span:last-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #1e293b;
  font-weight: 700;
}

#crmTab .crm-stage-cards {
  display: grid;
  gap: 8px;
}

#crmTab .crm-card {
  width: 100%;
  text-align: left;
  border: 1px solid #cdd8e8;
  border-radius: 10px;
  background: #fff;
  padding: 11px;
  cursor: pointer;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

#crmTab .crm-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.1);
  border-color: #93c5fd;
}

#crmTab .crm-card.is-open {
  background: #ffffff;
}

#crmTab .crm-card.is-watch {
  background: #f8fafc;
  border-color: #94a3b8;
}

#crmTab .crm-card.is-warning {
  background: #fffbeb;
  border-color: #fbbf24;
}

#crmTab .crm-card.is-critical {
  background: #fff7ed;
  border-color: #fb7185;
  box-shadow: 0 0 0 1px rgba(251, 113, 133, 0.18), 0 8px 18px rgba(251, 113, 133, 0.12);
}

#crmTab .crm-card.is-won {
  background: #f0fdf4;
  border-color: #86efac;
}

#crmTab .crm-card.is-lost {
  background: #fff1f2;
  border-color: #fda4af;
}

#crmTab .crm-card.is-dragging {
  opacity: 0.7;
}

#crmTab .crm-card.is-selected {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.18), 0 10px 18px rgba(37, 99, 235, 0.12);
}

#crmTab .crm-card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}

#crmTab .crm-card-meta {
  font-size: 12px;
  color: #475569;
  margin-bottom: 4px;
}

#crmTab .crm-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin-top: 6px;
  flex-wrap: wrap;
}

#crmTab .crm-card-edit-button {
  margin-left: auto;
  font-size: 11px;
  padding: 4px 9px;
}

#crmTab .crm-priority {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
}

#crmTab .crm-priority.is-low {
  background: #dbeafe;
  color: #1e40af;
}

#crmTab .crm-priority.is-medium {
  background: #e2e8f0;
  color: #334155;
}

#crmTab .crm-priority.is-high {
  background: #fef3c7;
  color: #92400e;
}

#crmTab .crm-priority.is-urgent {
  background: #fee2e2;
  color: #991b1b;
}

#crmTab .crm-stage-empty {
  font-size: 12px;
  color: #64748b;
  padding: 8px;
}

#crmTab .crm-detail-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.crm-dialog,
.crm-lead-dialog {
  border: 0;
  padding: 0;
  width: min(1080px, calc(100vw - 32px));
  max-width: 1080px;
}

.crm-dialog::backdrop,
.crm-lead-dialog::backdrop {
  background: rgba(15, 23, 42, 0.38);
}

.crm-dialog-body,
.crm-lead-dialog-body {
  display: grid;
  gap: 12px;
  max-height: min(88vh, 920px);
  overflow: auto;
}

.crm-prompt-dialog {
  width: min(520px, calc(100vw - 32px));
  max-width: 520px;
}

.crm-lead-dialog .crm-panel-modal {
  margin: 0;
  min-width: 0;
}

.crm-team-dialog {
  width: min(1180px, calc(100vw - 32px));
  max-width: 1180px;
}

.crm-team-manager {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.crm-team-list-panel,
.crm-team-form-panel {
  min-width: 0;
}

.crm-team-list {
  display: grid;
  gap: 10px;
  max-height: min(68vh, 680px);
  overflow: auto;
  padding-right: 4px;
}

.crm-team-list-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px;
  border: 1px solid #d6e0ef;
  border-radius: 14px;
  background: #fff;
  color: #0f172a;
  text-align: left;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.crm-team-list-item.is-selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.crm-team-list-item strong {
  font-size: 0.94rem;
}

.crm-team-list-item span {
  color: #64748b;
  font-size: 0.82rem;
}

.crm-team-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.crm-team-form-grid .field-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
}

.crm-team-form-grid .field-checkbox label {
  margin: 0;
}

.crm-team-form-grid .field-checkbox input {
  width: auto;
}

.crm-team-member-list {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
  padding: 12px;
  border: 1px solid #d6e0ef;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 249, 255, 0.94) 100%);
}

.crm-team-member-option {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #0f172a;
  font-size: 0.9rem;
}

.crm-team-member-option input {
  width: auto;
}

.crm-team-inline-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

@media (max-width: 1280px) {
  #crmTab .crm-board {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  #crmTab .crm-insight-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  #crmTab .crm-board {
    grid-template-columns: 1fr;
  }

  #crmTab .crm-filter-grid,
  #crmTab .crm-detail-grid,
  #crmTab .crm-activity-grid {
    grid-template-columns: 1fr;
  }

  .crm-team-manager,
  .crm-team-form-grid {
    grid-template-columns: 1fr;
  }
}

.ops-panel {
  margin-top: 10px;
  border: 1px solid #dbe3ef;
  border-radius: 18px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  padding: 10px 12px;
  box-shadow: 0 10px 28px rgba(23, 38, 65, 0.06);
}

.ops-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.ops-panel-head h3 {
  margin: 0;
  font-size: 0.98rem;
}

.ops-help,
.ops-card-meta,
.ops-empty {
  color: #64748b;
  font-size: 0.9rem;
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.ops-split-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.ops-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  min-width: 0;
}

.ops-card-wide {
  grid-column: span 2;
}

.ops-card-full {
  grid-column: 1 / -1;
}

.ops-card-label {
  color: #475569;
  font-size: 0.86rem;
  margin-bottom: 6px;
}

.ops-card-value {
  color: #0f172a;
  font-size: 1.35rem;
  font-weight: 700;
}

#madrixPowerPanel .ops-grid {
  grid-template-columns: minmax(0, 1fr);
}

#madrixPowerPanel .madrix-power-compact-card {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 251, 255, 0.94) 100%);
  min-width: 0;
}

#madrixPowerPanel .madrix-power-compact-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 220px);
  gap: 10px;
  align-items: stretch;
}

#madrixPowerPanel .madrix-power-compact-stat,
#madrixPowerPanel .madrix-power-compact-meter {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  min-width: 0;
}

#madrixPowerPanel .madrix-power-compact-stat {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  align-content: center;
}

#madrixPowerPanel .madrix-power-compact-stat.is-secondary {
  justify-items: start;
}

#madrixPowerPanel .madrix-power-compact-label {
  color: #657790;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#madrixPowerPanel .madrix-power-compact-value {
  color: #112037;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

#madrixPowerPanel .madrix-power-compact-meta,
#madrixPowerPanel .madrix-power-compact-inline-meta {
  color: #64748b;
  font-size: 0.92rem;
}

#madrixPowerPanel .madrix-power-compact-meter {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
}

#madrixPowerPanel .madrix-power-compact-meter .ops-meter {
  margin: 0;
}

.ops-actions,
.ops-form-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.ops-form-grid input,
.ops-card select {
  min-height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 6px 10px;
}

.ops-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #334155;
}

.ops-list {
  display: grid;
  gap: 6px;
  max-height: 160px;
  overflow: auto;
  color: #334155;
  font-size: 0.9rem;
}

.ops-list-reminders {
  max-height: 156px;
  padding-right: 6px;
  align-content: start;
  scrollbar-width: thin;
  scroll-behavior: smooth;
}

.ops-list-row {
  line-height: 1.4;
  white-space: normal;
  word-break: break-word;
}

#crmOpsPanel .ops-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 8px;
}

#crmOpsPanel .crm-ops-card {
  display: grid;
  gap: 4px;
  align-content: start;
  min-width: 0;
  min-height: 0;
  padding: 10px 12px;
  border-radius: 12px;
}

#crmOpsPanel .crm-ops-stat {
  grid-column: span 2;
}

#crmOpsPanel .crm-ops-compact {
  grid-column: span 2;
}

#crmOpsPanel .crm-ops-narrative {
  grid-column: span 3;
}

#crmOpsPanel .crm-ops-action {
  grid-column: span 3;
}

#crmOpsPanel .crm-ops-reminder-feed {
  padding-top: 8px;
}

#crmOpsPanel .ops-card-label {
  margin-bottom: 2px;
  font-size: 0.72rem;
}

#crmOpsPanel .ops-card-value {
  font-size: 1rem;
  line-height: 1.18;
}

#crmOpsPanel .crm-ops-stat .ops-card-value {
  font-size: 1.45rem;
}

#crmOpsPanel .ops-card-meta {
  font-size: 0.78rem;
  line-height: 1.35;
}

#crmOpsPanel .crm-ops-narrative .ops-card-meta,
#crmOpsPanel .crm-ops-compact .ops-card-meta {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#crmOpsPanel .crm-ops-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#crmOpsPanel .crm-ops-action button {
  min-height: 34px;
  padding: 0 11px;
  font-size: 0.84rem;
  box-shadow: none;
}

#crmOpsPanel .ops-card select {
  min-height: 34px;
  padding: 4px 10px;
}

@media (min-width: 1440px) {
  #crmTab .crm-filter-grid {
    grid-template-columns: minmax(220px, 1.45fr) repeat(5, minmax(120px, 1fr)) auto;
  }
}

@media (max-width: 1439px) {
  #crmOpsPanel .ops-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  #crmOpsPanel .crm-ops-stat,
  #crmOpsPanel .crm-ops-compact {
    grid-column: span 2;
  }

  #crmOpsPanel .crm-ops-narrative,
  #crmOpsPanel .crm-ops-action {
    grid-column: span 3;
  }
}

@media (max-width: 960px) {
  #crmOpsPanel .ops-grid {
    grid-template-columns: 1fr;
  }

  #crmOpsPanel .crm-ops-stat,
  #crmOpsPanel .crm-ops-compact,
  #crmOpsPanel .crm-ops-narrative,
  #crmOpsPanel .crm-ops-action {
    grid-column: auto;
  }
}

.ops-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.ops-table th,
.ops-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: top;
}

.ops-table th {
  color: #475569;
  font-weight: 600;
  background: rgba(248, 250, 252, 0.9);
}

.ops-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #e2e8f0;
  color: #334155;
}

.ops-badge.is-danger {
  background: #fee2e2;
  color: #991b1b;
}

.ops-badge.is-warning {
  background: #fef3c7;
  color: #92400e;
}

.ops-badge.is-success {
  background: #dcfce7;
  color: #166534;
}

.ops-meter {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
  margin: 8px 0;
}

.ops-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #16a34a);
}

.ops-meter-wide {
  height: 16px;
}

.admin-action-checklist {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #cbd5e1;
}

.admin-subtab-title {
  color: #64748b;
  font-size: 0.82rem;
  margin-bottom: 5px;
}

@media (max-width: 760px) {
  #madrixPowerPanel .madrix-power-compact-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .ops-card-wide {
    grid-column: span 1;
  }
}

.admin-database-card,
.admin-database-result-card {
  margin-top: 18px;
}

.admin-database-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.admin-database-form-grid {
  align-items: end;
}

.admin-database-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
}

.admin-database-file-meta,
.admin-database-note {
  margin-top: 8px;
}

.admin-database-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.admin-database-result-grid > div,
.admin-database-warning {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #d9e2f3;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
}

.admin-database-result-grid strong,
.admin-database-warning strong {
  font-size: 0.82rem;
  color: #64748b;
}

.admin-database-warning {
  grid-column: 1 / -1;
  border-color: #f59e0b;
  background: rgba(254, 243, 199, 0.6);
}

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

.admin-support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.admin-runtime-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.admin-runtime-stats {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.admin-governance-inner-card,
.admin-support-card,
.admin-release-card {
  min-width: 0;
}

.admin-governance-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 12px 14px;
}

.admin-governance-form-grid .field,
.admin-governance-form-grid .field.compact,
.admin-governance-form-grid .field.grow {
  width: 100%;
  min-width: 0;
}

.admin-governance-form-grid input,
.admin-governance-form-grid select {
  width: 100%;
  min-width: 0;
}

.admin-governance-form-grid > .field:nth-child(3),
.admin-governance-form-grid > .field:nth-child(4),
.admin-governance-form-grid > .field:nth-child(6) {
  grid-column: 1 / -1;
}

.admin-template-card {
  gap: 10px;
}

.admin-validation-status {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
}

.admin-validation-status.is-valid {
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.admin-validation-status.is-invalid {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.admin-validation-status ul {
  margin: 8px 0 0 18px;
  padding: 0;
}

.admin-support-preview-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-support-preview-card {
  display: grid;
  gap: 8px;
  border: 1px solid #d7dce5;
  border-radius: 12px;
  padding: 14px;
  background: #f8fafc;
}

.admin-support-user-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.admin-session-current {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-support-session-button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 12px;
  box-shadow: none;
  white-space: nowrap;
}

.admin-release-list {
  margin: 0;
  padding-left: 18px;
  color: #334155;
}

.admin-release-list li + li {
  margin-top: 6px;
}

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

.admin-database-progress-dialog {
  width: min(540px, calc(100vw - 32px));
}

.admin-database-progress-dialog-body {
  display: grid;
  gap: 14px;
}

.admin-database-progress-file {
  margin: 6px 0 0;
  word-break: break-word;
}

.admin-database-progress-status-row,
.admin-database-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-database-progress-track {
  position: relative;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(226, 232, 240, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.32);
}

.admin-database-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3252d9 0%, #4f6cf5 100%);
  transition: width 0.18s ease;
}

.admin-database-progress-track.is-processing .admin-database-progress-bar {
  width: 100% !important;
  background: linear-gradient(90deg, #3252d9 0%, #7aa2ff 50%, #3252d9 100%);
  background-size: 220px 100%;
  animation: admin-database-progress-pulse 1.25s linear infinite;
}

.admin-database-progress-note {
  line-height: 1.5;
}

@keyframes admin-database-progress-pulse {
  from {
    background-position: 220px 0;
  }
  to {
    background-position: 0 0;
  }
}

@media (max-width: 760px) {
  .admin-database-actions {
    justify-content: stretch;
  }

  .admin-database-actions > button {
    width: 100%;
  }

  .admin-support-preview-toolbar {
    align-items: stretch;
  }

  .admin-support-preview-toolbar > * {
    width: 100%;
  }
}

.transport-shell-panel {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.transport-shell {
  display: grid;
  gap: 1rem;
}

.transport-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.transport-subtab-button {
  min-width: 10rem;
}

.transport-pane {
  display: grid;
  gap: 1rem;
}

.transport-loading-state,
.transport-status-note {
  border: 1px solid rgba(56, 88, 156, 0.14);
  border-radius: 1rem;
  background: rgba(239, 246, 255, 0.9);
}

.transport-status-note {
  padding: 0.75rem 1rem;
  color: #40506f;
  font-size: 0.95rem;
}

.transport-status-warning {
  border-color: rgba(221, 153, 38, 0.35);
  background: rgba(255, 249, 232, 0.96);
  color: #684b15;
}

.transport-flow-card {
  position: relative;
  overflow: visible;
  padding: 1.1rem 1.15rem 1rem;
  background:
    radial-gradient(circle at 12% 18%, rgba(74, 112, 202, 0.12), transparent 25%),
    radial-gradient(circle at 82% 12%, rgba(57, 178, 122, 0.12), transparent 28%),
    rgba(255, 255, 255, 0.94);
}

.transport-flow-card-head {
  gap: 1rem;
}

.transport-flow-phase-row {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 0.45rem;
  align-items: center;
  color: #5a6683;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.transport-flow-phase-row span {
  border: 1px solid rgba(56, 88, 156, 0.14);
  border-radius: 999px;
  background: rgba(242, 246, 252, 0.9);
  padding: 0.38rem 0.65rem;
}

.transport-flow-map {
  position: relative;
  min-height: 14rem;
  margin-top: 0.8rem;
  border: 1px solid rgba(56, 88, 156, 0.12);
  border-radius: 1.2rem;
  background:
    linear-gradient(90deg, rgba(245, 248, 255, 0.96), rgba(255, 255, 255, 0.9)),
    repeating-linear-gradient(90deg, rgba(71, 91, 135, 0.05) 0, rgba(71, 91, 135, 0.05) 1px, transparent 1px, transparent 8.5%);
  overflow: visible;
}

.transport-flow-svg {
  position: absolute;
  inset: 0.8rem 0.8rem 0.6rem;
  width: calc(100% - 1.6rem);
  height: calc(100% - 1.4rem);
  pointer-events: none;
}

.transport-flow-rail-shadow,
.transport-flow-rail {
  fill: none;
  stroke-linecap: round;
}

.transport-flow-rail-shadow {
  stroke: rgba(43, 58, 92, 0.12);
  stroke-width: 18;
}

.transport-flow-rail {
  stroke: rgba(54, 78, 139, 0.42);
  stroke-width: 6;
}

.transport-flow-stage-label {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 2;
  max-width: 7.5rem;
  text-align: center;
  pointer-events: none;
}

.transport-flow-stage-label span {
  display: inline-flex;
  padding: 0.22rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: #40506f;
  font-size: 0.74rem;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(37, 61, 112, 0.08);
}

.transport-flow-dot,
.transport-flow-cluster {
  position: absolute;
  z-index: 4;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.98);
  border-radius: 999px;
  box-shadow: 0 10px 22px rgba(26, 38, 72, 0.2);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.transport-flow-dot {
  width: 1.05rem;
  height: 1.05rem;
  padding: 0;
}

.transport-flow-cluster {
  min-width: 1.9rem;
  height: 1.45rem;
  padding: 0 0.38rem;
  background: #41506a;
  color: #fff;
  font-size: 0.73rem;
  font-weight: 800;
}

.transport-flow-dot:hover,
.transport-flow-dot:focus-visible,
.transport-flow-cluster:hover,
.transport-flow-cluster:focus-visible {
  z-index: 12;
  transform: translate(-50%, -50%) scale(1.18);
  box-shadow: 0 16px 34px rgba(26, 38, 72, 0.28);
}

.transport-flow-dot.is-selected {
  outline: 3px solid rgba(33, 76, 219, 0.26);
  outline-offset: 3px;
}

.transport-flow-normal {
  background: #2e6eea;
}

.transport-flow-delayed {
  background: #f08b26;
}

.transport-flow-document {
  background: #e2b43a;
}

.transport-flow-critical {
  background: #d9434e;
}

.transport-flow-delivered {
  background: #2ea66a;
}

.transport-flow-closed {
  background: #7f8999;
}

.transport-flow-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.75rem);
  transform: translateX(-50%) scale(0.96);
  display: grid;
  gap: 0.18rem;
  min-width: 14rem;
  max-width: 18rem;
  padding: 0.72rem 0.8rem;
  border: 1px solid rgba(56, 88, 156, 0.18);
  border-radius: 0.9rem;
  background: rgba(20, 28, 45, 0.96);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.32;
  text-align: left;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 18px 42px rgba(20, 28, 45, 0.28);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.transport-flow-tooltip strong {
  font-size: 0.82rem;
}

.transport-flow-dot:hover .transport-flow-tooltip,
.transport-flow-dot:focus-visible .transport-flow-tooltip,
.transport-flow-cluster:hover .transport-flow-tooltip,
.transport-flow-cluster:focus-visible .transport-flow-tooltip {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.transport-flow-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.transport-flow-legend-item {
  display: inline-flex;
  gap: 0.42rem;
  align-items: center;
  border: 1px solid rgba(56, 88, 156, 0.12);
  border-radius: 999px;
  background: rgba(247, 250, 255, 0.9);
  color: #40506f;
  padding: 0.35rem 0.58rem;
  font-size: 0.82rem;
}

.transport-flow-legend-dot {
  width: 0.68rem;
  height: 0.68rem;
  border-radius: 999px;
}

.transport-flow-legend-item strong {
  color: #1d2a43;
  font-size: 0.78rem;
}

.transport-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.9rem;
}

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

.transport-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(56, 88, 156, 0.12);
  border-radius: 1.25rem;
  padding: 1rem 1.1rem;
  box-shadow: 0 12px 28px rgba(37, 61, 112, 0.08);
}

.transport-card-nested {
  margin-top: 0.5rem;
}

.transport-toolbar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  gap: 0.85rem;
  align-items: end;
}

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

.transport-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.transport-main-grid {
  display: grid;
  grid-template-columns: minmax(18rem, 24rem) minmax(0, 1fr);
  gap: 1rem;
}

.transport-list-stack {
  display: grid;
  gap: 0.65rem;
  max-height: 78vh;
  overflow: auto;
  padding-right: 0.25rem;
}

.transport-list-item {
  display: grid;
  gap: 0.25rem;
  width: 100%;
  text-align: left;
  padding: 0.8rem 0.9rem;
  border-radius: 1rem;
  border: 1px solid rgba(56, 88, 156, 0.14);
  background: rgba(239, 243, 252, 0.7);
  color: inherit;
}

.transport-list-item:hover,
.transport-list-item.active {
  border-color: rgba(60, 84, 215, 0.35);
  background: rgba(224, 233, 255, 0.88);
}

.transport-list-item span {
  color: #5a6683;
  font-size: 0.9rem;
}

.transport-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.transport-field-span-2 {
  grid-column: span 2;
}

.transport-editor-actions {
  margin-top: 0.9rem;
}

.transport-inline-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  align-items: end;
}

.transport-inline-action {
  align-self: end;
}

.transport-link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #3250d8;
  font-weight: 600;
  text-align: left;
}

.transport-link-button:hover {
  text-decoration: underline;
}

.transport-selected-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: rgba(226, 236, 255, 0.88);
  border: 1px solid rgba(72, 101, 205, 0.14);
}

.transport-selected-banner.empty {
  background: rgba(245, 247, 252, 0.9);
  color: #5d6783;
}

.transport-table th,
.transport-table td {
  vertical-align: top;
}

@media (max-width: 1400px) {
  .transport-flow-map {
    min-width: 54rem;
  }

  .transport-flow-card {
    overflow-x: auto;
  }

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

  .transport-toolbar-search {
    grid-column: span 3;
  }

  .transport-main-grid,
  .transport-overview-grid,
  .transport-form-grid,
  .transport-inline-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .transport-flow-phase-row {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .transport-flow-stage-label span {
    font-size: 0.68rem;
  }

  .transport-flow-tooltip {
    min-width: 12.5rem;
  }

  .transport-toolbar,
  .transport-main-grid,
  .transport-overview-grid,
  .transport-form-grid,
  .transport-inline-grid {
    grid-template-columns: 1fr;
  }

  .transport-toolbar-search,
  .transport-field-span-2 {
    grid-column: span 1;
  }

  .transport-toolbar-actions {
    justify-content: stretch;
  }
}

@media (max-width: 1180px) {
  .proforma-template-toolbar,
  .proforma-qc-grid,
  .export-summary-qc-grid {
    grid-template-columns: 1fr;
  }
  .export-summary-dialog {
    width: min(960px, calc(100vw - 28px));
  }
}

@media (max-width: 720px) {
  .proforma-preview-meta-grid {
    grid-template-columns: 1fr;
  }

  .proforma-preview-row {
    grid-template-columns: 1fr;
  }
  .export-summary-grid {
    grid-template-columns: 1fr;
  }
  .export-summary-body {
    max-height: min(92vh, 980px);
    padding: 18px;
  }
  .export-summary-dialog .cart-actions button {
    width: 100%;
    min-width: 0;
  }
}

/* HUB visual foundation v1.2.0.205 */
:root {
  --hub-bg: #eef3fa;
  --hub-ink: #111827;
  --hub-muted: #5b667a;
  --hub-panel: rgba(255, 255, 255, 0.92);
  --hub-panel-strong: rgba(255, 255, 255, 0.98);
  --hub-line: rgba(83, 104, 145, 0.16);
  --hub-blue: #244fd7;
  --hub-blue-dark: #183c9d;
  --hub-slate: #46556c;
  --hub-shadow-soft: 0 18px 45px rgba(31, 49, 86, 0.09);
  --hub-shadow-tight: 0 10px 24px rgba(31, 49, 86, 0.08);
}

body {
  background:
    radial-gradient(circle at 6% 4%, rgba(61, 111, 235, 0.13), transparent 28rem),
    radial-gradient(circle at 90% 8%, rgba(38, 173, 121, 0.12), transparent 30rem),
    linear-gradient(180deg, #f7faff 0%, var(--hub-bg) 52%, #f6f8fc 100%);
  color: var(--hub-ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(55, 76, 115, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(55, 76, 115, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.85), transparent 78%);
}

.layout {
  width: min(1880px, 100%);
  gap: 18px;
}

.header-panel,
.tab-row,
.panel,
.admin-card,
.admin-country-card,
.admin-governance-inner-card,
.admin-support-card,
.admin-release-card,
.led-panel,
.led-quote-panel,
.madrix-panel,
.madrix-card,
.transport-card,
.ops-panel,
.crm-panel {
  border-color: var(--hub-line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 253, 255, 0.88)),
    var(--hub-panel);
  box-shadow: var(--hub-shadow-soft);
}

.header-panel {
  overflow: hidden;
  border-radius: 24px;
}

.header-panel::after {
  content: "";
  position: absolute;
  right: -7rem;
  top: -8rem;
  width: 18rem;
  height: 18rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(36, 79, 215, 0.16), transparent 68%);
  pointer-events: none;
}

.header-panel h1 {
  margin: 0;
  letter-spacing: -0.035em;
  font-weight: 650;
}

.header-panel p,
.meta,
.model-note,
.admin-helper {
  color: var(--hub-muted);
}

.version-badge,
.db-version-badge,
.user-badge {
  border: 1px solid rgba(64, 89, 140, 0.12);
  background: rgba(232, 240, 253, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.tab-row,
.transport-subtabs,
.led-systems-tabs,
.catalog-subtabs,
.admin-subtabs {
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
}

.tab-button,
.admin-subtab-button {
  min-height: 40px;
  border: 1px solid rgba(76, 95, 130, 0.12);
  border-radius: 14px;
  background: linear-gradient(180deg, #edf2f8, #dce4ee);
  color: #122034;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
  transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.tab-button:hover,
.admin-subtab-button:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #f6f9fd, #e5ecf5);
}

.tab-button.active,
.admin-subtab-button.active {
  border-color: rgba(36, 79, 215, 0.46);
  background: linear-gradient(135deg, var(--hub-blue), var(--hub-blue-dark));
  color: #fff;
  box-shadow: 0 12px 28px rgba(36, 79, 215, 0.25);
}

button {
  border-radius: 12px;
  background: linear-gradient(135deg, var(--hub-blue), var(--hub-blue-dark));
  box-shadow: 0 10px 22px rgba(36, 79, 215, 0.18);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(36, 79, 215, 0.22);
}

button.secondary {
  background: linear-gradient(135deg, var(--hub-slate), #2f3b4d);
  box-shadow: 0 10px 22px rgba(47, 59, 77, 0.16);
}

input,
select,
textarea,
.admin-input,
.admin-select {
  border-color: rgba(83, 104, 145, 0.24);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

input:focus,
select:focus,
textarea:focus,
.admin-input:focus,
.admin-select:focus {
  outline: 3px solid rgba(36, 79, 215, 0.14);
  border-color: rgba(36, 79, 215, 0.52);
}

.table-wrap,
.admin-table-wrap,
.inventory-table-wrap {
  border: 1px solid rgba(83, 104, 145, 0.12);
  background: var(--hub-panel-strong);
  box-shadow: var(--hub-shadow-tight);
}

thead th {
  background: linear-gradient(180deg, #f7f9fd, #eef3f9);
  color: #22314a;
}

.metric-card,
.led-summary-card,
.led-quote-metric-card,
.ops-card,
.madrix-result-card,
.transport-list-item {
  border-color: rgba(83, 104, 145, 0.14);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 20px rgba(31, 49, 86, 0.06);
}

.transport-flow-card {
  background:
    radial-gradient(circle at 9% 14%, rgba(36, 79, 215, 0.16), transparent 24%),
    radial-gradient(circle at 86% 10%, rgba(46, 166, 106, 0.13), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(247, 251, 255, 0.92));
}

/* Sidebar shell phase 1 v1.2.0.206 */
@media (min-width: 1101px) {
  .layout {
    width: min(1920px, 100%);
    min-height: 100vh;
    grid-template-columns: 15.5rem minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 16px 18px;
    padding: 18px 20px 18px 18px;
  }

  .header-panel {
    grid-column: 2;
    grid-row: 1;
    min-height: 5.8rem;
  }

  #warningBar {
    grid-column: 2;
    grid-row: 2;
  }

  .tab-row {
    grid-column: 1;
    grid-row: 1 / span 3;
    position: sticky;
    top: 18px;
    align-self: start;
    height: calc(100vh - 36px);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    padding: 1rem 0.75rem;
    border-radius: 1.4rem;
    overflow-x: hidden;
    overflow-y: auto;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 249, 255, 0.88)),
      rgba(255, 255, 255, 0.92);
    box-shadow: 0 22px 52px rgba(25, 44, 82, 0.12);
  }

  .tab-row::before {
    content: "Matrixpro HUB";
    display: flex;
    align-items: center;
    min-height: 2.7rem;
    margin: 0 0.15rem 0.55rem;
    padding: 0.15rem 0.55rem 0.75rem 2.3rem;
    border-bottom: 1px solid rgba(83, 104, 145, 0.13);
    color: #152238;
    font-size: 1rem;
    font-weight: 750;
    letter-spacing: -0.02em;
    background:
      linear-gradient(135deg, rgba(36, 79, 215, 0.95), rgba(66, 143, 238, 0.86)) 0.45rem 0.36rem / 1.35rem 1.35rem no-repeat;
    border-radius: 0.8rem;
  }

  .tab-row::after {
    content: "Sidebar faz 1";
    margin-top: auto;
    padding: 0.75rem 0.65rem 0.25rem;
    border-top: 1px solid rgba(83, 104, 145, 0.13);
    color: var(--hub-muted);
    font-size: 0.72rem;
  }

  .tab-row .tab-button {
    width: 100%;
    min-height: 2.55rem;
    justify-content: flex-start;
    text-align: left;
    padding: 0.62rem 0.78rem;
    border-radius: 0.78rem;
    background: transparent;
    box-shadow: none;
  }

  .tab-row .tab-button::before {
    content: attr(data-sidebar-icon);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    margin-right: 0.62rem;
    border-radius: 0.45rem;
    background: rgba(73, 91, 124, 0.08);
    color: #40506f;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    box-shadow: inset 0 0 0 1px rgba(73, 91, 124, 0.08);
  }

  .tab-row .tab-button:hover {
    background: rgba(232, 239, 249, 0.84);
    transform: translateX(2px);
  }

  .tab-row .tab-button.active {
    border-color: rgba(36, 79, 215, 0.22);
    background: linear-gradient(135deg, rgba(36, 79, 215, 0.96), rgba(24, 60, 157, 0.96));
    box-shadow: 0 12px 24px rgba(36, 79, 215, 0.22);
  }

  .tab-row .tab-button.active::before {
    background: rgba(255, 255, 255, 0.96);
    color: var(--hub-blue-dark);
    box-shadow: 0 0 0 0.22rem rgba(255, 255, 255, 0.16);
  }

  .sidebar-toggle-button {
    margin-top: auto;
    min-height: 2.45rem;
    width: 100%;
    padding: 0.58rem 0.7rem;
    border-radius: 0.78rem;
    background: rgba(238, 244, 252, 0.9);
    color: #40506f;
    box-shadow: none;
  }

  .sidebar-toggle-button:hover {
    background: rgba(222, 232, 247, 0.95);
    color: #142038;
    transform: translateY(-1px);
  }

  .tab-panel {
    grid-column: 2;
    grid-row: 3;
  }

  .tab-panel.active {
    min-width: 0;
  }

  body.sidebar-collapsed .layout {
    grid-template-columns: 5.4rem minmax(0, 1fr);
  }

  body.sidebar-collapsed .tab-row {
    padding-inline: 0.55rem;
  }

  body.sidebar-collapsed .tab-row::before {
    content: "";
    min-height: 2.8rem;
    margin-inline: 0;
    padding: 0;
    border-bottom: 0;
    background:
      linear-gradient(135deg, rgba(36, 79, 215, 0.95), rgba(66, 143, 238, 0.86)) center / 1.65rem 1.65rem no-repeat;
  }

  body.sidebar-collapsed .tab-row .tab-button {
    min-height: 2.9rem;
    justify-content: center;
    padding-inline: 0.35rem;
    font-size: 0;
  }

  body.sidebar-collapsed .tab-row .tab-button::before {
    width: 2.15rem;
    height: 2.15rem;
    margin-right: 0;
    font-size: 0.72rem;
  }

  body.sidebar-collapsed .sidebar-toggle-button {
    min-height: 2.9rem;
    padding-inline: 0.35rem;
    font-size: 0;
  }

  body.sidebar-collapsed .sidebar-toggle-button::before {
    content: "";
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 0.28rem;
    border: 2px solid currentColor;
    border-left-width: 5px;
  }

  body.sidebar-collapsed .tab-row::after {
    content: "F1";
    text-align: center;
    padding-inline: 0;
  }
}

@media (max-width: 1100px) {
  .layout {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .tab-row {
    position: sticky;
    top: 0.5rem;
    z-index: 15;
  }
}

/* Sidebar submenus and simple button reset v1.2.0.209 */
button {
  border: 0;
  border-radius: 8px;
  background: #1d4ed8;
  color: #fff;
  box-shadow: none;
  transform: none;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

button:hover {
  background: #1e40af;
  box-shadow: none;
  transform: none;
}

button.secondary {
  background: #475569;
  color: #fff;
  box-shadow: none;
}

button.secondary:hover {
  background: #334155;
  color: #fff;
}

.tab-button,
.admin-subtab-button {
  border: 0;
  border-radius: 8px;
  background: #cbd5e1;
  color: #0f172a;
  box-shadow: none;
  transform: none;
}

.tab-button:hover,
.admin-subtab-button:hover {
  background: #bac5d2;
  color: #0f172a;
  box-shadow: none;
  transform: none;
}

.tab-button.active,
.admin-subtab-button.active {
  background: #1d4ed8;
  color: #fff;
  box-shadow: none;
}

.sidebar-submenu {
  display: none;
}

.sidebar-submenu-button {
  width: 100%;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #334155;
  box-shadow: none;
  font-size: 0.86rem;
  line-height: 1.2;
  text-align: left;
}

.sidebar-submenu-button:hover {
  background: #e2e8f0;
  color: #0f172a;
  transform: none;
}

.sidebar-submenu-button.active {
  background: #e0e7ff;
  color: #1d4ed8;
  font-weight: 700;
}

@media (min-width: 1101px) {
  .tab-row {
    gap: 0.28rem;
    padding: 0.9rem 0.7rem;
  }

  .tab-row::after {
    display: none;
  }

  .tab-row .tab-button {
    min-height: 2.35rem;
    padding: 0.52rem 0.7rem;
    border-radius: 0.72rem;
    background: transparent;
    color: #1f2937;
    box-shadow: none;
  }

  .tab-row .tab-button:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: none;
  }

  .tab-row .tab-button.active {
    background: #1d4ed8;
    color: #fff;
    box-shadow: none;
  }

  .tab-row .tab-button.hidden + .sidebar-submenu {
    display: none !important;
  }

  .tab-row .tab-button.active + .sidebar-submenu {
    display: grid;
  }

  .sidebar-submenu {
    gap: 0.18rem;
    margin: -0.12rem 0 0.28rem 2.2rem;
    padding: 0.18rem 0 0.18rem 0.52rem;
    border-left: 2px solid #dbe3ee;
  }

  .sidebar-submenu-button {
    min-height: 1.85rem;
    padding: 0.34rem 0.54rem;
  }

  .catalog-subtab-row,
  .led-systems-tabs,
  .transport-subtabs,
  #adminTab .admin-subtab-row {
    display: none !important;
  }

  .sidebar-toggle-button.secondary {
    margin-top: auto;
    min-height: 2.55rem;
    width: 100%;
    padding: 0.58rem 0.7rem;
    border-radius: 0.78rem;
    background: #334155;
    color: #f8fafc;
    font-weight: 700;
    box-shadow: none;
  }

  .sidebar-toggle-button.secondary:hover {
    background: #1f2937;
    color: #fff;
    transform: none;
  }

  body.sidebar-collapsed .sidebar-submenu {
    display: none !important;
  }

  body.sidebar-collapsed .sidebar-toggle-button.secondary {
    border-radius: 0.78rem;
    background: #334155;
    color: #f8fafc;
  }
}

/* Shell phase 2: mobile drawer + active page panel v1.2.0.211 */
.header-brand-block {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.header-brand-copy {
  min-width: 0;
}

.mobile-nav-toggle,
.sidebar-drawer-head,
.sidebar-drawer-backdrop {
  display: none;
}

.active-page-panel {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}

.active-page-heading {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.active-page-breadcrumb {
  color: #64748b;
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.active-page-title-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.active-page-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.active-page-copy {
  min-width: 0;
}

.active-page-eyebrow {
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 600;
}

.active-page-copy h2 {
  margin: 0;
  font-size: clamp(1.08rem, 0.98rem + 0.42vw, 1.55rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.active-page-copy p {
  margin: 3px 0 0;
  color: #475569;
  max-width: 72ch;
  font-size: 0.95rem;
  line-height: 1.3;
}

.active-page-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.active-page-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #1e293b;
  font-size: 0.76rem;
  white-space: nowrap;
}

.active-page-chip strong {
  color: #64748b;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (min-width: 1101px) {
  .layout {
    grid-template-rows: auto auto auto minmax(0, 1fr);
  }

  .tab-row {
    grid-row: 1 / span 4;
  }

  #activePagePanel {
    grid-column: 2;
    grid-row: 3;
  }

  .tab-panel {
    grid-column: 2;
    grid-row: 4;
  }

  body.shell-warning-hidden #activePagePanel {
    grid-row: 2;
  }

  body.shell-warning-hidden .tab-panel {
    grid-row: 3;
  }

  body[data-active-tab="preaccount"] .layout {
    min-height: auto;
    grid-template-rows: auto auto auto auto;
  }

  body[data-active-tab="preaccount"] .tab-panel {
    align-self: start;
  }
}

@media (max-width: 1100px) {
  body.sidebar-drawer-open {
    overflow: hidden;
  }

  .layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto minmax(0, 1fr);
  }

  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    min-width: 4.5rem;
    padding: 0.55rem 0.9rem;
    border-radius: 0.82rem;
    background: #334155;
    color: #f8fafc;
    font-weight: 700;
    flex: 0 0 auto;
  }

  .mobile-nav-toggle:hover {
    background: #1f2937;
    color: #fff;
  }

  .sidebar-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 39;
    display: block;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(4px);
  }

  .sidebar-drawer-backdrop[hidden] {
    display: none;
  }

  .tab-row {
    position: fixed;
    inset: 0 auto 0 0;
    top: 0;
    width: min(320px, 86vw);
    height: 100vh;
    padding: 0.9rem 0.8rem 1rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.28rem;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 0 18px 18px 0;
    box-shadow: 0 22px 54px rgba(15, 23, 42, 0.28);
    transform: translateX(-112%);
    transition: transform 0.2s ease;
    z-index: 40;
    background: rgba(255, 255, 255, 0.98);
  }

  body.sidebar-drawer-open .tab-row {
    transform: translateX(0);
  }

  .tab-row::before,
  .tab-row::after {
    display: none;
  }

  .sidebar-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 0.4rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #dbe3ee;
  }

  .sidebar-drawer-brand {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
  }

  .sidebar-drawer-head .secondary {
    min-height: 2.2rem;
    padding-inline: 0.8rem;
  }

  .tab-row .tab-button {
    width: 100%;
    min-height: 2.5rem;
    justify-content: flex-start;
    text-align: left;
    padding: 0.54rem 0.72rem;
  }

  .tab-row .tab-button::before {
    content: attr(data-sidebar-icon);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.45rem;
    height: 1.45rem;
    margin-right: 0.68rem;
    border-radius: 0.42rem;
    background: rgba(73, 91, 124, 0.08);
    color: #40506f;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: -0.02em;
  }

  .tab-row .tab-button.hidden + .sidebar-submenu {
    display: none !important;
  }

  .tab-row .tab-button.active + .sidebar-submenu {
    display: grid;
  }

  .sidebar-submenu {
    gap: 0.18rem;
    margin: -0.05rem 0 0.25rem 2rem;
    padding: 0.18rem 0 0.18rem 0.52rem;
    border-left: 2px solid #dbe3ee;
  }

  .sidebar-submenu-button {
    min-height: 1.85rem;
    padding: 0.34rem 0.54rem;
  }

  .sidebar-toggle-button.secondary {
    display: none;
  }

  #warningBar {
    grid-row: 2;
  }

  #activePagePanel {
    grid-row: 3;
  }

  .tab-panel {
    grid-row: 4;
  }

  body.shell-warning-hidden #activePagePanel {
    grid-row: 2;
  }

  body.shell-warning-hidden .tab-panel {
    grid-row: 3;
  }

  body[data-active-tab="preaccount"] .layout {
    min-height: auto;
    grid-template-rows: auto auto auto auto;
  }

  body[data-active-tab="preaccount"] .tab-panel {
    align-self: start;
  }

  .active-page-panel {
    flex-direction: column;
    padding: 16px 16px 18px;
  }

  .active-page-meta {
    justify-content: flex-start;
  }
}

/* Shell phase 3: dashboard header + compact cards v1.2.0.212 */
.header-panel {
  display: grid;
  grid-template-columns: minmax(240px, 1.02fr) minmax(360px, 1.38fr) minmax(320px, 1.08fr);
  align-items: start;
  gap: 16px 18px;
  padding: 18px 20px;
}

.shell-search-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  align-self: center;
}

.shell-search-frame {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #d8e1ed;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 247, 255, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.shell-search-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #0f172a;
}

.shell-search-input:focus {
  outline: none;
  border: 0;
  box-shadow: none;
}

.shell-search-frame button {
  min-height: 2.45rem;
  padding: 0.58rem 1rem;
  white-space: nowrap;
}

.shell-search-hint {
  min-height: 1.1rem;
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.3;
}

.header-meta-group {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 10px;
  align-items: center;
  justify-items: end;
}

.header-utility-row,
.header-account-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.header-account-row .secondary,
.header-account-row .user-badge,
.header-utility-row .language-picker {
  min-height: 2.5rem;
}

.header-meta-summary {
  width: 100%;
  text-align: right;
}

.shell-notification-strip {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shell-notification-button.secondary {
  position: relative;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 14px;
  background: #334155;
  color: #f8fafc;
}

.shell-notification-button.secondary:hover {
  background: #1f2937;
}

.shell-notification-button.has-count.secondary {
  background: #1d4ed8;
}

.shell-notification-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.shell-notification-count {
  position: absolute;
  top: -5px;
  right: -5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #f97316;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 0 2px #fff;
}

.active-page-panel {
  display: grid;
  grid-template-columns: minmax(280px, 0.94fr) minmax(0, 1.18fr);
  gap: 10px 14px;
  align-items: start;
}

.active-page-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.active-page-meta {
  justify-content: flex-start;
}

.shell-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.shell-summary-card {
  min-width: 0;
  padding: 9px 12px 10px;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 255, 0.94));
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.shell-summary-card[data-tone="blue"] {
  border-color: rgba(29, 78, 216, 0.18);
  box-shadow: inset 0 2px 0 rgba(29, 78, 216, 0.78), 0 6px 18px rgba(15, 23, 42, 0.04);
}

.shell-summary-card[data-tone="green"] {
  border-color: rgba(22, 163, 74, 0.16);
  box-shadow: inset 0 2px 0 rgba(22, 163, 74, 0.72), 0 6px 18px rgba(15, 23, 42, 0.04);
}

.shell-summary-card[data-tone="amber"] {
  border-color: rgba(245, 158, 11, 0.18);
  box-shadow: inset 0 2px 0 rgba(245, 158, 11, 0.8), 0 6px 18px rgba(15, 23, 42, 0.04);
}

.shell-summary-card[data-tone="danger"] {
  border-color: rgba(239, 68, 68, 0.18);
  box-shadow: inset 0 2px 0 rgba(239, 68, 68, 0.78), 0 6px 18px rgba(15, 23, 42, 0.04);
}

.shell-summary-card-label {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.15;
}

.shell-summary-card-value {
  margin-top: 4px;
  color: #0f172a;
  font-size: 0.98rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.12;
  word-break: break-word;
}

.shell-summary-card-value.is-compact {
  font-size: 0.84rem;
  line-height: 1.22;
}

@media (max-width: 1480px) {
  .header-panel {
    grid-template-columns: minmax(220px, 1fr) minmax(300px, 1.2fr) minmax(280px, 1fr);
  }

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

@media (max-width: 1240px) {
  .header-panel,
  .active-page-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .header-meta-group {
    justify-items: start;
  }

  .header-utility-row,
  .header-account-row {
    justify-content: flex-start;
  }

  .header-meta-summary {
    text-align: left;
  }
}

@media (max-width: 1100px) {
  .header-panel {
    padding: 16px;
  }

  .shell-search-frame {
    padding: 8px 10px;
    border-radius: 16px;
  }

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

@media (max-width: 720px) {
  .shell-search-frame {
    flex-wrap: wrap;
  }

  .shell-search-frame button {
    width: 100%;
  }

  .header-utility-row,
  .header-account-row {
    gap: 8px;
  }

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

/* Shell header layout hotfix v1.2.0.213 */
.header-panel .header-meta-group {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: none;
  align-items: stretch;
  justify-items: stretch;
}

.header-panel .header-utility-row,
.header-panel .header-account-row {
  width: 100%;
  min-width: 0;
}

.header-panel .header-utility-row {
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.header-panel .header-version-stack {
  margin-inline-end: auto;
  flex: 0 0 auto;
}

.header-panel .shell-notification-strip {
  flex: 0 0 auto;
}

.header-panel .header-account-row {
  justify-content: flex-end;
  gap: 8px;
}

.header-panel .header-account-row .language-picker {
  margin-inline-end: auto;
  flex: 0 0 auto;
}

.header-panel #currentUserBadge {
  min-width: clamp(150px, 16vw, 220px);
  justify-content: center;
}

.header-panel #securityButton,
.header-panel #feedbackButton,
.header-panel #releaseNotesButton,
.header-panel #logoutButton {
  white-space: nowrap;
}

@media (max-width: 1660px) {
  .header-panel {
    grid-template-columns: minmax(240px, 0.92fr) minmax(420px, 1.08fr);
  }

  .header-panel .header-meta-group {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1320px) {
  .header-panel .header-utility-row,
  .header-panel .header-account-row {
    flex-wrap: wrap;
  }

  .header-panel .header-utility-row {
    justify-content: flex-start;
  }

  .header-panel .header-account-row {
    justify-content: flex-start;
  }

  .header-panel .header-account-row .language-picker,
  .header-panel .header-version-stack {
    margin-inline-end: 0;
  }

  .header-meta-summary {
    text-align: left;
  }
}

/* Shell phase 4: full module polish v1.2.0.213 */
:root {
  --hub-panel-outline: inset 0 1px 0 rgba(255, 255, 255, 0.86);
  --hub-panel-glow: 0 20px 40px rgba(31, 49, 86, 0.08);
  --hub-card-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(243, 247, 255, 0.95));
  --hub-card-line: rgba(73, 95, 136, 0.14);
  --hub-card-line-strong: rgba(53, 80, 136, 0.22);
  --hub-table-head: rgba(246, 249, 253, 0.98);
  --hub-field-bg: rgba(255, 255, 255, 0.98);
}

body[data-active-tab="catalog"] .active-page-icon,
body[data-active-tab="proforma"] .active-page-icon,
body[data-active-tab="stock"] .active-page-icon,
body[data-active-tab="depo"] .active-page-icon,
body[data-active-tab="led"] .active-page-icon,
body[data-active-tab="crm"] .active-page-icon,
body[data-active-tab="transport"] .active-page-icon,
body[data-active-tab="admin"] .active-page-icon,
body[data-active-tab="currency"] .active-page-icon {
  box-shadow: 0 10px 24px rgba(36, 79, 215, 0.15);
}

body[data-active-tab="catalog"] .active-page-icon {
  background: #e0ecff;
  color: #1d4ed8;
}

body[data-active-tab="proforma"] .active-page-icon {
  background: #ede9fe;
  color: #6d28d9;
}

body[data-active-tab="stock"] .active-page-icon {
  background: #dcfce7;
  color: #15803d;
}

body[data-active-tab="depo"] .active-page-icon {
  background: #fef3c7;
  color: #b45309;
}

body[data-active-tab="led"] .active-page-icon {
  background: #dbeafe;
  color: #1e40af;
}

body[data-active-tab="crm"] .active-page-icon {
  background: #fee2e2;
  color: #be123c;
}

body[data-active-tab="transport"] .active-page-icon {
  background: #cffafe;
  color: #0f766e;
}

body[data-active-tab="admin"] .active-page-icon {
  background: #e2e8f0;
  color: #334155;
}

body[data-active-tab="currency"] .active-page-icon {
  background: #fae8ff;
  color: #7e22ce;
}

.tab-panel.active {
  gap: 18px;
}

.tab-panel.active > .panel,
#adminTab .admin-card,
.metric-card,
.led-summary-card,
.led-quote-metric-card,
.ops-card,
.madrix-card,
.madrix-result-card,
.transport-card,
.transport-flow-card,
.proforma-preview-card,
.proforma-checklist-card {
  border-radius: 20px;
  box-shadow: var(--hub-panel-glow);
}

.panel,
#adminTab .admin-card,
.metric-card,
.led-summary-card,
.led-quote-metric-card,
.ops-card,
.madrix-card,
.madrix-result-card,
.transport-card {
  backdrop-filter: blur(14px);
}

.panel-title-row,
.admin-card-head,
.ops-panel-head,
.transport-flow-card-head {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px 14px;
}

.panel-title-row h2,
.panel-title-row h3,
.admin-card-head h3,
.ops-panel-head h3 {
  margin: 0;
  color: #112037;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.panel-title-row h2 {
  font-size: clamp(1.08rem, 1rem + 0.3vw, 1.34rem);
}

.panel-title-row h3,
.admin-card-head h3,
.ops-panel-head h3 {
  font-size: clamp(0.98rem, 0.94rem + 0.18vw, 1.14rem);
}

.field,
.field.compact,
.field.grow {
  min-width: 0;
  gap: 7px;
}

.field label,
.toolbar-field span {
  color: #667892;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

input,
select,
textarea {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--hub-card-line);
  background: var(--hub-field-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input::placeholder,
textarea::placeholder {
  color: #8a97ab;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(36, 79, 215, 0.42);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

button {
  min-height: 42px;
  padding: 0 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: 0 10px 22px rgba(36, 79, 215, 0.18);
}

button.secondary {
  box-shadow: 0 8px 18px rgba(70, 85, 108, 0.14);
}

.actions,
.cart-actions {
  gap: 10px;
}

.table-wrap {
  border: 1px solid var(--hub-card-line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.94));
  box-shadow: var(--hub-panel-outline);
  scrollbar-color: rgba(86, 104, 136, 0.48) rgba(226, 232, 240, 0.72);
}

.table-wrap::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.table-wrap::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.86);
  background: rgba(86, 104, 136, 0.42);
}

.table-wrap::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.52);
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--hub-table-head);
  backdrop-filter: blur(10px);
}

th {
  padding: 11px 12px;
  color: #6a7a93;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

td {
  padding: 12px;
  color: #15263c;
}

tbody tr:hover td {
  background: rgba(238, 244, 255, 0.82);
}

.metric-grid,
.led-quote-metrics,
.transport-card-grid,
.ops-grid,
.admin-database-stats,
.admin-database-result-grid,
.proforma-qc-grid {
  gap: 12px;
}

.metric-card,
.led-summary-card,
.led-quote-metric-card,
.ops-card,
.madrix-result-card,
.transport-card {
  border: 1px solid var(--hub-card-line);
  background: var(--hub-card-surface);
  box-shadow: var(--hub-panel-outline), var(--hub-shadow-tight);
}

.metric-card-label,
.led-quote-metric-label,
.ops-card-label {
  color: #657790;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.metric-card-value,
.led-quote-metric-value,
.ops-card-value {
  color: #112037;
  letter-spacing: -0.03em;
}

.catalog-controls-panel,
.catalog-results-panel,
.catalog-workspace-panel,
.catalog-compare-panel,
.header-fields-panel,
.cart-panel,
.saved-quotes-panel,
#currencyTab > .panel,
#stockTab > .panel,
#depoTab > .panel,
#crmTab .crm-panel,
#adminTab .admin-panel,
.led-panel,
.led-quote-panel {
  position: relative;
  overflow: hidden;
}

.catalog-controls-panel::before,
.catalog-results-panel::before,
.header-fields-panel::before,
.cart-panel::before,
.saved-quotes-panel::before,
#currencyTab > .panel::before,
#stockTab > .panel::before,
#depoTab > .panel::before,
#crmTab .crm-panel::before,
#adminTab .admin-panel::before,
.led-panel::before,
.led-quote-panel::before {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  top: 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(36, 79, 215, 0.9), rgba(36, 79, 215, 0.18) 55%, rgba(22, 163, 74, 0.34));
  pointer-events: none;
}

.controls-panel,
.pricing-rules-panel,
.proforma-template-toolbar,
.inventory-panel-actions,
#crmTab .crm-summary-line,
.transport-toolbar,
.transport-selected-banner,
.admin-database-result-grid > div,
.admin-database-warning,
.admin-support-preview-card {
  border: 1px solid var(--hub-card-line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(249, 251, 255, 0.98), rgba(242, 246, 253, 0.9));
  box-shadow: var(--hub-panel-outline);
}

.controls-panel,
.pricing-rules-panel,
.proforma-template-toolbar,
.transport-toolbar,
.admin-support-preview-card {
  padding: 14px 16px;
}

.inventory-panel-actions {
  padding: 12px 14px;
}

#crmTab .crm-summary-line {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
}

#resultsCount,
#stockCount,
#depoCount,
#currencyStatus,
#proformaTemplateMeta {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--hub-card-line);
  border-radius: 12px;
  background: rgba(240, 245, 255, 0.84);
}

.catalog-bulk-toolbar,
.brand-discount-list,
.catalog-workspace-card,
.catalog-compare-drawer,
.led-quote-section,
.led-quote-source-block,
.admin-tabs-checklist,
.admin-action-checklist,
.admin-subtab-checklist {
  border: 1px solid var(--hub-card-line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 255, 0.92));
  box-shadow: var(--hub-panel-outline);
}

.catalog-bulk-toolbar,
.led-quote-section,
.led-quote-source-block {
  padding: 14px 16px;
}

.admin-tabs-checklist,
.admin-subtab-checklist {
  padding: 12px;
}

.admin-action-checklist {
  padding-top: 12px;
}

/* Admin inner tab compaction: empty section shells no longer leave visual gaps. */
#adminTab .admin-panel {
  gap: 12px !important;
  padding: 16px !important;
}

#adminTab .admin-card {
  padding: 16px !important;
}

#adminTab .admin-card-head {
  margin-bottom: 10px;
  padding-bottom: 10px;
}

#adminTab .admin-stats {
  gap: 10px;
  margin: 0;
}

#adminTab .admin-stats .metric-card {
  min-height: 64px;
  padding: 10px 12px;
}

#adminTab .admin-support-grid,
#adminTab .admin-governance-grid {
  gap: 12px;
}

#adminTab #adminCountrySection.hidden,
#adminTab #adminSearchSection.hidden,
#adminTab #adminDatabaseSection.hidden,
#adminTab #adminGovernanceSection.hidden,
#adminTab #adminSupportSection.hidden,
#adminTab #adminReleaseSection.hidden,
#adminTab .admin-grid.hidden,
#adminTab .admin-lower-grid.hidden {
  display: none !important;
}

.led-layout-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.led-form-grid,
.led-quote-top-grid,
.led-quote-pricing-grid,
.led-quote-extras-grid,
#crmTab .crm-filter-grid,
#crmTab .crm-detail-grid,
.admin-form-grid,
.admin-audit-filter-grid,
.transport-form-grid,
.transport-inline-grid {
  gap: 12px 14px;
}

.led-quote-source-grid {
  gap: 12px;
}

.led-recommendation-card,
.led-strategy-card,
.led-warning-card,
.madrix-device-card,
.madrix-total-card {
  border-radius: 18px;
  border: 1px solid var(--hub-card-line);
  background: var(--hub-card-surface);
  box-shadow: var(--hub-panel-outline), var(--hub-shadow-tight);
}

#crmTab .crm-board {
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

#crmTab .crm-stage-column {
  border-radius: 20px;
  border: 1px solid var(--hub-card-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 247, 255, 0.93));
  box-shadow: var(--hub-panel-outline), var(--hub-shadow-tight);
}

#crmTab .crm-stage-header {
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(111, 129, 164, 0.14);
}

#crmTab .crm-card {
  border-radius: 16px;
  padding: 12px 13px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(244, 248, 255, 0.94));
}

.transport-shell {
  gap: 14px;
}

.transport-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.transport-list-item {
  border-radius: 16px;
  padding: 12px 13px;
}

#adminTab .admin-grid,
#adminTab .admin-lower-grid,
.admin-governance-grid,
.admin-support-grid {
  gap: 14px;
}

#adminTab .admin-card {
  padding: 18px;
}

#adminTab .admin-create-card {
  max-width: 1080px;
  padding: 14px 16px !important;
}

#adminTab .admin-create-card .admin-card-head {
  margin-bottom: 8px;
  padding-bottom: 8px;
}

#adminTab .admin-create-card .admin-form-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px 12px;
  align-items: start;
}

#adminTab .admin-create-card .field {
  gap: 6px;
}

#adminTab .admin-create-card .field.grow,
#adminTab .admin-create-card .admin-create-actions {
  grid-column: 1 / -1;
}

#adminTab .admin-create-card .admin-tabs-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px;
  min-height: 0;
  max-height: 170px;
  padding: 8px 10px;
  overflow: auto;
}

#adminTab .admin-create-card .admin-tab-check {
  gap: 6px;
  padding: 5px 8px;
  border-radius: 10px;
  font-size: 12px;
}

#adminTab .admin-create-card .admin-create-actions {
  justify-content: flex-end;
  margin-top: 2px;
}

#adminTab .admin-create-card .admin-create-actions button {
  min-width: 160px;
}

@media (max-width: 1280px) {
  #adminTab .admin-create-card {
    max-width: none;
  }

  #adminTab .admin-create-card .admin-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  #adminTab .admin-create-card .admin-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  #adminTab .admin-create-card .admin-form-grid {
    grid-template-columns: 1fr;
  }

  #adminTab .admin-create-card .admin-create-actions {
    justify-content: stretch;
  }

  #adminTab .admin-create-card .admin-create-actions button {
    width: 100%;
  }
}

#currencyTab .panel,
#stockTab > .panel,
#depoTab > .panel {
  padding-top: 18px;
}

@media (max-width: 1280px) {
  .led-layout-grid {
    grid-template-columns: 1fr;
  }

  #crmTab .crm-board {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }
}

@media (max-width: 900px) {
  #crmTab .crm-board {
    grid-template-columns: 1fr;
  }

  .controls-panel,
  .transport-toolbar {
    padding: 12px;
  }
}

/* Shell correction v1.2.0.215: compact header + aligned transport map */
@media (min-width: 1281px) {
  .header-panel {
    grid-template-columns: minmax(250px, 330px) minmax(420px, 1fr) minmax(500px, 0.96fr);
    align-items: center;
    gap: 10px 18px;
    min-height: 108px;
    padding: 14px 18px 12px;
  }

  .header-panel .header-meta-group {
    grid-column: auto;
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: 8px;
  }

  .header-panel .header-utility-row,
  .header-panel .header-account-row {
    justify-content: flex-end;
    gap: 8px;
  }

  .header-panel .header-version-stack {
    margin-inline-end: auto;
  }

  .header-panel .header-account-row .language-picker {
    margin-inline-end: auto;
  }
}

.header-brand-block {
  align-items: center;
}

.header-brand-copy h1 {
  font-size: clamp(1.45rem, 1.25rem + 0.55vw, 1.95rem);
  line-height: 1.08;
}

.header-brand-copy p {
  margin: 5px 0 0;
  max-width: 36rem;
  font-size: 0.9rem;
  line-height: 1.35;
}

.shell-search-block {
  width: min(680px, 100%);
  justify-self: stretch;
  gap: 6px;
}

.shell-search-frame {
  min-height: 46px;
  padding: 6px 8px 6px 14px;
}

.shell-search-frame button {
  min-height: 38px;
  padding: 0 16px;
}

.shell-search-hint {
  min-height: 0;
  padding-left: 4px;
  overflow: hidden;
  color: #667892;
  font-size: 0.76rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.version-badge,
.db-version-badge {
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  line-height: 1.1;
  white-space: nowrap;
}

.shell-notification-button.secondary {
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  border-radius: 12px;
}

.header-panel #currentUserBadge {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 18px;
}

.header-panel #securityButton,
.header-panel #feedbackButton,
.header-panel #releaseNotesButton,
.header-panel #logoutButton {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
}

.header-meta-summary {
  overflow: hidden;
  font-size: 0.76rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transport-shell {
  padding: 18px 20px;
}

.transport-subtabs {
  gap: 8px;
}

.transport-subtab-button {
  min-height: 42px;
  padding-inline: 18px;
}

.transport-flow-map {
  min-height: 13.2rem;
}

.transport-flow-dot {
  width: 1rem;
  height: 1rem;
}

.transport-flow-cluster {
  min-width: 1.8rem;
  height: 1.35rem;
}

.transport-flow-rail-shadow {
  stroke-width: 14;
}

.transport-flow-rail {
  stroke-width: 5;
}

@media (max-width: 1280px) {
  .header-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .header-panel .header-meta-group {
    grid-column: auto;
  }

  .transport-shell {
    padding: 14px;
  }
}

/* Shell correction v1.2.0.215b: collision-proof header and exact flow coordinates */
.header-panel {
  overflow: visible;
}

.header-panel .header-brand-block,
.header-panel .shell-search-block,
.header-panel .header-meta-group {
  min-width: 0;
}

@media (min-width: 1541px) {
  .header-panel {
    grid-template-columns: minmax(250px, 340px) minmax(380px, 1fr) minmax(670px, 720px);
    grid-template-areas: "brand search meta";
    gap: 12px 20px;
    align-items: center;
    min-height: 112px;
  }

  .header-brand-block {
    grid-area: brand;
  }

  .shell-search-block {
    grid-area: search;
    justify-self: center;
    width: min(680px, 100%);
  }

  .header-panel .header-meta-group {
    grid-area: meta;
    align-self: center;
    display: grid !important;
    gap: 8px;
  }

  .header-panel .header-utility-row,
  .header-panel .header-account-row {
    flex-wrap: nowrap !important;
    justify-content: flex-end;
    width: 100%;
  }

  .header-panel .header-account-row {
    display: flex;
    gap: 7px;
  }

  .header-panel .language-picker {
    gap: 6px;
    flex: 0 0 auto;
    font-size: 0.78rem;
  }

  .header-panel .language-picker select {
    min-width: 66px;
    min-height: 34px;
    padding: 6px 28px 6px 10px;
  }

  .header-panel #currentUserBadge {
    min-width: 170px;
    max-width: 198px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-panel #securityButton,
  .header-panel #feedbackButton,
  .header-panel #releaseNotesButton,
  .header-panel #logoutButton {
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.84rem;
    line-height: 1;
  }

  .header-panel .header-meta-summary {
    max-width: 100%;
    text-align: right;
  }
}

@media (max-width: 1540px) and (min-width: 921px) {
  .header-panel {
    grid-template-columns: minmax(260px, 0.86fr) minmax(380px, 1.14fr);
    grid-template-areas:
      "brand search"
      "meta meta";
    align-items: center;
  }

  .header-brand-block {
    grid-area: brand;
  }

  .shell-search-block {
    grid-area: search;
    justify-self: stretch;
    width: 100%;
  }

  .header-panel .header-meta-group {
    grid-area: meta;
    display: grid !important;
    gap: 8px;
  }

  .header-panel .header-utility-row,
  .header-panel .header-account-row {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .header-panel .header-account-row .language-picker,
  .header-panel .header-version-stack {
    margin-inline-end: 0;
  }

  .header-panel .header-meta-summary {
    text-align: left;
    white-space: normal;
  }
}

@media (max-width: 920px) {
  .header-panel {
    overflow: hidden;
  }

  .active-page-panel {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

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

  .header-panel .header-account-row,
  .header-panel .header-utility-row {
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  .shell-summary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .led-bom-footer {
    justify-content: stretch;
  }

  .led-bom-footer button {
    width: 100%;
  }
}

.tab-button,
.sidebar-submenu-button,
.catalog-subtab-button,
.led-systems-tab-button,
.transport-subtab-button,
.admin-subtab-button {
  padding-inline: 16px;
  line-height: 1.15;
  white-space: nowrap;
}

.transport-shell {
  padding: 20px 22px;
}

.transport-flow-svg {
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Compact shell cards + LED BOM footer v1.2.0.235 */
.active-page-panel {
  grid-template-columns: minmax(240px, 0.88fr) minmax(0, 1.12fr);
  gap: 8px 12px;
  padding: 10px 12px;
  align-items: center;
}

.active-page-heading {
  gap: 3px;
}

.active-page-breadcrumb {
  font-size: 0.63rem;
}

.active-page-title-row {
  gap: 8px;
  align-items: center;
}

.active-page-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
}

.active-page-eyebrow {
  font-size: 0.69rem;
}

.active-page-copy h2 {
  font-size: clamp(1rem, 0.96rem + 0.25vw, 1.24rem);
}

.active-page-copy p {
  margin-top: 2px;
  font-size: 0.84rem;
  line-height: 1.24;
}

.active-page-side {
  gap: 6px;
}

.active-page-meta {
  gap: 5px;
}

.active-page-chip {
  padding: 5px 9px;
  font-size: 0.72rem;
}

.active-page-chip strong {
  font-size: 0.62rem;
}

.shell-summary-grid {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 6px;
}

.shell-summary-card {
  padding: 7px 10px 8px;
  border-radius: 12px;
}

.shell-summary-card-label {
  font-size: 0.62rem;
  line-height: 1.05;
}

.shell-summary-card-value {
  margin-top: 3px;
  font-size: 0.88rem;
  line-height: 1.12;
}

.shell-summary-card-value.is-compact {
  font-size: 0.78rem;
}

.metric-grid {
  gap: 10px;
}

.metric-card,
.led-quote-metric-card {
  padding: 9px 11px;
  border-radius: 14px;
}

.metric-card-label,
.led-quote-metric-label {
  font-size: 0.68rem;
  line-height: 1.08;
}

.metric-card-value,
.led-quote-metric-value {
  margin-top: 3px;
  font-size: 0.98rem;
  line-height: 1.12;
}

.led-bom-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.led-bom-footer button {
  min-height: 38px;
}

/* Header rebuild v1.2.0.216: stable brand / search / actions shell */
.header-panel {
  display: grid !important;
  grid-template-columns: minmax(250px, 340px) minmax(420px, 1fr) minmax(360px, 520px) !important;
  grid-template-areas: "brand search actions" !important;
  align-items: center !important;
  gap: 14px 22px !important;
  min-height: auto !important;
  padding: 18px 22px !important;
  overflow: hidden !important;
}

.header-panel::after {
  z-index: 0;
}

.header-panel > * {
  position: relative;
  z-index: 1;
}

.header-panel .header-brand-block,
.header-panel .shell-search-block,
.header-panel .header-meta-group,
.header-panel .header-version-stack,
.header-panel .language-picker,
.header-panel #currentUserBadge,
.header-panel #securityButton,
.header-panel #feedbackButton,
.header-panel #releaseNotesButton,
.header-panel #logoutButton,
.header-panel #meta-summary {
  grid-area: auto !important;
  justify-self: auto !important;
}

.header-panel .header-brand-block {
  grid-area: brand !important;
  align-items: center !important;
}

.header-panel .header-brand-copy h1 {
  font-size: clamp(1.45rem, 1.05rem + 0.9vw, 2rem);
}

.header-panel .header-brand-copy p {
  max-width: 32rem;
  font-size: 0.86rem;
}

.header-brand-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  line-height: 1;
}

.header-brand-logo {
  display: block;
  width: auto;
  height: clamp(28px, 2.2vw, 42px);
  max-width: min(100%, 260px);
  object-fit: contain;
}

.header-panel .shell-search-block {
  grid-area: search !important;
  align-self: center !important;
  justify-self: stretch !important;
  width: 100% !important;
  max-width: 720px;
  margin-inline: auto;
}

.header-panel .shell-search-frame {
  min-height: 44px;
  padding: 6px 8px 6px 14px;
  border-radius: 16px;
}

.header-panel .shell-search-frame button {
  min-height: 34px;
  padding-inline: 15px;
}

.header-panel .header-meta-group {
  grid-area: actions !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: center !important;
  gap: 7px !important;
  width: 100% !important;
  max-width: 520px !important;
  margin-inline-start: auto !important;
}

.header-panel .header-utility-row,
.header-panel .header-account-row {
  display: flex !important;
  width: 100% !important;
  min-width: 0 !important;
  gap: 6px !important;
}

.header-panel .header-utility-row {
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
}

.header-panel .header-version-stack {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 6px !important;
  min-width: 0 !important;
  margin: 0 !important;
}

.header-panel .version-badge,
.header-panel .db-version-badge {
  min-height: 26px !important;
  max-width: 180px;
  padding: 5px 9px !important;
  overflow: hidden;
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-panel .shell-notification-strip {
  flex: 0 0 auto !important;
  gap: 5px !important;
}

.header-panel .shell-notification-button.secondary {
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  border-radius: 11px !important;
}

.header-panel .shell-notification-button:not(.has-count) .shell-notification-count {
  display: none;
}

.header-panel .shell-notification-count {
  top: -4px;
  right: -4px;
  min-width: 1.05rem;
  height: 1.05rem;
  font-size: 0.66rem;
}

.header-panel .header-account-row {
  align-items: center !important;
  justify-content: flex-end !important;
  flex-wrap: wrap !important;
}

.header-panel .header-account-row .language-picker {
  flex: 0 0 auto !important;
  margin: 0 !important;
  gap: 5px !important;
  font-size: 0.76rem !important;
}

.header-panel .language-picker select {
  min-width: 64px !important;
  min-height: 32px !important;
  padding: 5px 26px 5px 9px !important;
  border-radius: 11px !important;
}

.header-panel #currentUserBadge {
  flex: 1 1 145px !important;
  min-width: 135px !important;
  max-width: 210px !important;
  min-height: 32px !important;
  padding: 0 10px !important;
  overflow: hidden;
  border-radius: 15px !important;
  font-size: 0.76rem !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-panel #securityButton,
.header-panel #feedbackButton,
.header-panel #releaseNotesButton,
.header-panel #logoutButton {
  flex: 0 0 auto !important;
  min-height: 32px !important;
  padding: 0 10px !important;
  border-radius: 9px !important;
  font-size: 0.78rem !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.header-panel .header-meta-summary {
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
  color: #53657f;
  font-size: 0.72rem !important;
  line-height: 1.2 !important;
  text-align: right !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

@media (max-width: 1500px) and (min-width: 921px) {
  .header-panel {
    grid-template-columns: minmax(240px, 330px) minmax(360px, 1fr) !important;
    grid-template-areas:
      "brand search"
      "actions actions" !important;
  }

  .header-panel .header-meta-group {
    max-width: none !important;
    margin-inline-start: 0 !important;
  }

  .header-panel .header-utility-row,
  .header-panel .header-account-row {
    justify-content: flex-start !important;
  }

  .header-panel .header-meta-summary {
    text-align: left !important;
  }
}

@media (max-width: 920px) {
  .header-panel {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas:
      "brand"
      "search"
      "actions" !important;
    padding: 14px !important;
  }

  .header-panel .header-meta-group {
    max-width: none !important;
    margin-inline-start: 0 !important;
  }

  .header-panel .header-utility-row,
  .header-panel .header-account-row {
    justify-content: flex-start !important;
  }

  .header-panel #currentUserBadge {
    max-width: none !important;
  }

  .header-panel .header-meta-summary {
    text-align: left !important;
    white-space: normal !important;
  }
}

/* Full i18n/design audit repair v1.2.0.217 */
.catalog-subtab-row,
#adminSubtabRow,
#adminTab .admin-subtab-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px;
}

.catalog-subtab-button,
.admin-subtab-button,
.sidebar-submenu-button,
.transport-subtab-button,
.led-systems-tab-button {
  min-width: 0;
  padding-inline: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.led-quote-pricing-grid,
.led-quote-extras-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.led-quote-pricing-grid label,
.led-quote-extras-grid label,
.admin-governance-form-grid label {
  min-height: 1.9em;
  overflow: visible;
  line-height: 1.2;
  text-overflow: clip;
  white-space: normal;
}

.led-quote-pricing-grid input,
.led-quote-pricing-grid select,
.led-quote-extras-grid input,
.led-quote-extras-grid select,
.admin-governance-form-grid input,
.admin-governance-form-grid select {
  min-height: 42px;
}

.admin-governance-inner-card,
.admin-support-card,
.admin-release-card {
  overflow: hidden;
}

@media (max-width: 1500px) {
  .admin-governance-grid {
    grid-template-columns: 1fr;
  }

  .admin-governance-form-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .admin-governance-form-grid > .field:nth-child(3),
  .admin-governance-form-grid > .field:nth-child(4),
  .admin-governance-form-grid > .field:nth-child(6) {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  .catalog-subtab-row,
  #adminSubtabRow,
  #adminTab .admin-subtab-row {
    padding: 6px;
  }

  .catalog-subtab-button,
  .admin-subtab-button,
  .sidebar-submenu-button,
  .transport-subtab-button,
  .led-systems-tab-button {
    min-height: 38px;
    padding-inline: 12px;
  }
}

/* Header compaction v1.2.0.218: remove duplicate shortcut row */
.header-panel {
  grid-template-columns: minmax(240px, 320px) minmax(390px, 1fr) minmax(560px, 650px) !important;
  grid-template-areas: "brand search actions" !important;
  gap: 10px 18px !important;
  padding: 12px 18px !important;
}

.header-panel .header-brand-copy h1 {
  font-size: clamp(1.35rem, 1rem + 0.75vw, 1.75rem);
}

.header-panel .header-brand-copy p {
  margin-top: 4px;
  font-size: 0.82rem;
}

.header-panel .shell-search-frame {
  min-height: 40px;
  padding: 5px 7px 5px 13px;
  border-radius: 14px;
}

.table-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(98, 122, 168, 0.22);
  background: rgba(239, 244, 255, 0.95);
  color: #31415f;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.status-chip--parsed,
.status-chip--same {
  background: rgba(231, 236, 246, 0.98);
  color: #4d5d79;
}

.status-chip--reviewed,
.status-chip--added {
  background: rgba(227, 245, 235, 0.98);
  color: #22724b;
}

.status-chip--approved {
  background: rgba(222, 239, 255, 0.98);
  color: #245aa9;
}

.status-chip--changed {
  background: rgba(255, 239, 220, 0.98);
  color: #a55a12;
}

.status-chip--removed {
  background: rgba(255, 229, 229, 0.98);
  color: #a33d3d;
}

.meta-box {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(123, 148, 191, 0.2);
  background: rgba(247, 250, 255, 0.95);
}

.led-quote-review-list {
  display: grid;
  gap: 8px;
}

.led-quote-review-item {
  min-height: 40px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px dashed rgba(123, 148, 191, 0.28);
  background: rgba(255, 255, 255, 0.94);
  color: #31415f;
  font-size: 13px;
  line-height: 1.35;
}

.led-absen-compare-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.header-panel .shell-search-frame button {
  min-height: 30px;
  padding-inline: 13px;
}

.header-panel .header-meta-group {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  grid-template-areas:
    "account account"
    "utility summary" !important;
  align-items: center !important;
  gap: 5px 8px !important;
  max-width: 650px !important;
}

.header-panel .header-utility-row {
  grid-area: utility !important;
  width: auto !important;
  justify-content: flex-start !important;
}

.header-panel .header-account-row {
  grid-area: account !important;
  width: 100% !important;
  justify-content: flex-end !important;
  flex-wrap: nowrap !important;
  gap: 5px !important;
}

.header-panel .shell-notification-strip {
  display: none !important;
}

.header-panel .header-version-stack {
  flex: 0 0 auto !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 5px !important;
}

.header-panel .version-badge,
.header-panel .db-version-badge {
  min-height: 24px !important;
  max-width: 170px;
  padding: 4px 8px !important;
  font-size: 0.72rem;
}

.header-panel .language-picker select,
.header-panel #currentUserBadge,
.header-panel #securityButton,
.header-panel #feedbackButton,
.header-panel #releaseNotesButton,
.header-panel #logoutButton {
  min-height: 30px !important;
}

.header-panel #currentUserBadge {
  flex: 0 1 185px !important;
  min-width: 128px !important;
  max-width: 185px !important;
  padding-inline: 9px !important;
}

.header-panel #securityButton,
.header-panel #feedbackButton,
.header-panel #releaseNotesButton,
.header-panel #logoutButton {
  flex: 0 1 auto !important;
  padding-inline: 9px !important;
  font-size: 0.76rem !important;
}

.header-panel .header-meta-summary {
  grid-area: summary !important;
  font-size: 0.7rem !important;
  line-height: 1.15 !important;
}

@media (max-width: 1500px) and (min-width: 921px) {
  .header-panel {
    grid-template-columns: minmax(230px, 300px) minmax(360px, 1fr) minmax(545px, 610px) !important;
    grid-template-areas: "brand search actions" !important;
  }

  .header-panel .header-meta-group {
    max-width: none !important;
  }
}

@media (max-width: 1200px) and (min-width: 921px) {
  .header-panel {
    grid-template-columns: minmax(230px, 310px) minmax(360px, 1fr) !important;
    grid-template-areas:
      "brand search"
      "actions actions" !important;
  }

  .header-panel .header-meta-group {
    max-width: none !important;
  }
}

@media (max-width: 920px) {
  .header-panel .header-meta-group {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas:
      "utility"
      "account"
      "summary" !important;
  }

  .header-panel .header-account-row {
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
  }
}

/* Sidebar module icons v1.2.0.224 */
.tab-row .tab-button::before {
  content: none !important;
  display: none !important;
}

.tab-row .tab-button {
  display: inline-flex;
  align-items: center;
  gap: 0.62rem;
}

.sidebar-nav-icon {
  width: 1.45rem;
  height: 1.45rem;
  flex: 0 0 1.45rem;
  display: inline-grid;
  place-items: center;
  border-radius: 0.48rem;
  background: rgba(73, 91, 124, 0.08);
  color: #40506f;
  box-shadow: inset 0 0 0 1px rgba(73, 91, 124, 0.08);
}

.sidebar-nav-icon svg {
  width: 1rem;
  height: 1rem;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-row .tab-button.active .sidebar-nav-icon {
  background: rgba(255, 255, 255, 0.96);
  color: #1d4ed8;
  box-shadow: 0 0 0 0.18rem rgba(255, 255, 255, 0.14);
}

.active-page-icon {
  color: #1d4ed8;
}

.active-page-icon .sidebar-nav-icon {
  width: 100%;
  height: 100%;
  flex-basis: 100%;
  border-radius: inherit;
  background: transparent;
  color: inherit;
  box-shadow: none;
}

.active-page-icon .sidebar-nav-icon svg {
  width: 1.45rem;
  height: 1.45rem;
}

@media (min-width: 1101px) {
  body.sidebar-collapsed .tab-row .tab-button {
    gap: 0;
  }

  body.sidebar-collapsed .tab-row .tab-button .sidebar-nav-label {
    display: none;
  }

  body.sidebar-collapsed .tab-row .tab-button .sidebar-nav-icon {
    width: 2.15rem;
    height: 2.15rem;
    flex-basis: 2.15rem;
    margin: 0;
    border-radius: 0.65rem;
  }

  body.sidebar-collapsed .tab-row .tab-button .sidebar-nav-icon svg {
    width: 1.2rem;
    height: 1.2rem;
  }
}

/* Transport mail ingestion review */
.transport-mail-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.transport-mail-meta-grid > div {
  border: 1px solid var(--border-color, #d8e1ef);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.76);
}

.transport-mail-meta-grid span {
  display: block;
  color: var(--muted-color, #64748b);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.transport-mail-meta-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.transport-mail-body {
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid var(--border-color, #d8e1ef);
  border-radius: 12px;
  padding: 12px;
  background: #f8fafc;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.45;
}

/* Pre-accounting workspace */
.preaccount-shell-panel {
  padding: 0;
  overflow: visible;
}

.preaccount-shell {
  display: grid;
  gap: 12px;
  padding: 18px;
}

#preaccountTab,
#preaccountTab.active,
#preaccountMount {
  min-height: 0;
  overflow: visible;
}

.preaccount-shell .panel-title-row {
  gap: 12px;
  margin-bottom: 0;
}

.preaccount-toolbar-row {
  display: grid;
  gap: 8px;
}

.preaccount-country-row,
.preaccount-subtab-row {
  min-height: 0;
  padding: 5px;
  gap: 6px;
  overflow-x: auto;
}

.preaccount-country-button,
.preaccount-subtab-button {
  min-height: 34px;
  padding: 7px 13px;
  white-space: nowrap;
}

.preaccount-loading,
.preaccount-flash {
  border: 1px solid var(--border-color, #d8e1ef);
  border-radius: 10px;
  padding: 9px 12px;
  background: #f8fafc;
  color: #334155;
  font-size: 0.86rem;
}

.preaccount-flash[data-tone="success"] {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.preaccount-flash[data-tone="warning"] {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.preaccount-grid {
  display: grid;
  gap: 12px;
}

.preaccount-metrics-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.preaccount-project-metrics-grid {
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
}

.preaccount-two-col {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.preaccount-two-col > .panel {
  margin: 0;
  padding: 16px;
  min-width: 0;
}

.preaccount-form-grid,
.preaccount-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 10px;
  align-items: end;
}

.preaccount-form-grid .field.grow,
.preaccount-filter-grid .field.grow {
  grid-column: span 2;
}

.preaccount-form-grid .field,
.preaccount-filter-grid .field {
  margin: 0;
}

.preaccount-form-grid input,
.preaccount-form-grid select,
.preaccount-filter-grid input,
.preaccount-filter-grid select {
  min-height: 36px;
  padding-block: 7px;
}

.preaccount-bulk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
  padding: 9px 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.82);
}

.preaccount-bulk-toolbar-summary {
  color: #475569;
  font-size: 0.84rem;
  font-weight: 600;
}

.preaccount-bulk-toolbar-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.preaccount-select-cell {
  width: 40px;
  min-width: 40px;
  text-align: center;
  vertical-align: middle;
}

.preaccount-select-checkbox {
  width: 16px;
  height: 16px;
  accent-color: #3351db;
  cursor: pointer;
}

.preaccount-select-checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

@media (max-width: 900px) {
  .preaccount-bulk-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .preaccount-bulk-toolbar-actions {
    justify-content: stretch;
  }

  .preaccount-bulk-toolbar-actions button {
    width: 100%;
  }
}

.preaccount-history-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 12px;
  padding: 11px 12px;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.85);
}

.preaccount-history-banner.has-history {
  border-color: rgba(37, 99, 235, 0.24);
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.9), rgba(248, 250, 252, 0.92));
}

.preaccount-history-banner-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.preaccount-history-banner-copy strong {
  font-size: 0.9rem;
  color: #1e293b;
}

.preaccount-history-banner .meta {
  display: block;
}

.panel-title-row-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.preaccount-category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 10px;
}

.preaccount-category-tab {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: #f8fafc;
  color: #334155;
  font-size: 0.83rem;
  font-weight: 600;
}

.preaccount-category-tab.active {
  border-color: rgba(37, 99, 235, 0.28);
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}

.preaccount-form-actions,
.preaccount-inline-actions {
  margin-top: 10px;
  justify-content: flex-end;
}

.preaccount-form-panel {
  display: grid;
  gap: 10px;
}

.preaccount-form-panel-header {
  align-items: center;
}

.preaccount-panel-actions {
  margin-left: auto;
  justify-content: flex-end;
}

.preaccount-panel-actions button {
  min-height: 32px;
  padding: 6px 12px;
}

.preaccount-form-panel.is-collapsed {
  padding-block: 14px;
}

.preaccount-form-panel-body[hidden] {
  display: none;
}

.preaccount-plan-switch-panel {
  margin-bottom: 10px;
  padding: 14px 16px;
}

.preaccount-plan-switch-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.preaccount-plan-switch-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 11px 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(248, 250, 252, 0.98);
  color: #334155;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.preaccount-plan-switch-button strong {
  font-size: 0.9rem;
  color: inherit;
}

.preaccount-plan-switch-button.active {
  border-color: rgba(52, 81, 219, 0.4);
  background: rgba(52, 81, 219, 0.1);
  color: #2142d1;
  box-shadow: inset 0 0 0 1px rgba(52, 81, 219, 0.12);
}

.preaccount-plan-switch-button:hover {
  border-color: rgba(52, 81, 219, 0.3);
}

.preaccount-inline-actions {
  flex-wrap: nowrap;
  gap: 5px;
  margin-top: 0;
}

.preaccount-inline-actions button {
  min-height: 28px;
  padding: 5px 9px;
  font-size: 0.76rem;
}

.preaccount-entry-table th,
.preaccount-entry-table td,
.preaccount-shell .admin-audit-table th,
.preaccount-shell .admin-audit-table td {
  padding: 8px 10px;
  vertical-align: top;
}

.preaccount-money {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.preaccount-currency-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 999px;
  border: 1px solid rgba(102, 121, 151, 0.28);
  background: rgba(241, 245, 249, 0.9);
  color: #334155;
  font-size: 0.72rem;
  font-weight: 800;
}

.preaccount-resizable-table {
  table-layout: fixed;
  width: 100%;
}

.preaccount-projects-top,
.preaccount-project-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.2fr);
  gap: 12px;
}

.preaccount-projects-shell {
  display: grid;
  gap: 10px;
}

.preaccount-project-inline-form {
  margin-bottom: 8px;
}

.preaccount-project-list-header {
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.preaccount-projects-shell > .preaccount-project-list-panel {
  width: 100%;
}

.preaccount-project-dialog {
  width: min(980px, calc(100vw - 40px));
}

.preaccount-project-dialog-body {
  display: grid;
  gap: 10px;
  max-width: min(980px, calc(100vw - 40px));
  max-height: min(88vh, 920px);
  overflow: auto;
}

.preaccount-project-dialog-header {
  align-items: flex-start;
  gap: 12px;
}

.preaccount-project-dialog-actions {
  margin-top: 2px;
}

.preaccount-project-dialog .preaccount-project-form-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.preaccount-project-form-grid,
.preaccount-project-child-form-grid {
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 10px;
}

.preaccount-project-form-grid .span-2,
.preaccount-project-child-form-grid .span-2 {
  grid-column: span 2;
}

.preaccount-project-filter-grid {
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 6px;
}

.preaccount-project-selected-row {
  background: rgba(37, 99, 235, 0.06);
}

.preaccount-project-list-panel .table-wrap,
.preaccount-project-detail-grid .table-wrap {
  max-height: 360px;
}

.preaccount-project-overview-panel {
  padding: 10px 12px;
}

.preaccount-project-overview-panel .metric-card {
  min-height: 60px;
  padding: 9px 11px;
  border-radius: 13px;
}

.preaccount-project-overview-panel .metric-card-value {
  font-size: 1.02rem;
}

.preaccount-project-overview-panel .metric-card-label {
  font-size: 0.69rem;
}

.preaccount-project-list-panel--compact {
  padding: 12px 12px 10px;
}

.preaccount-project-filter-grid--compact {
  gap: 8px;
  align-items: center;
}

.preaccount-project-filter-grid--compact .preaccount-inline-actions {
  margin-top: 0;
}

.preaccount-project-compact-table {
  min-width: 1180px;
}

.preaccount-project-compact-table th,
.preaccount-project-compact-table td {
  padding: 6px 8px;
  font-size: 0.79rem;
}

.preaccount-project-name-cell {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.preaccount-project-name-cell strong {
  color: #0f172a;
  font-size: 0.86rem;
  line-height: 1.2;
}

.preaccount-project-name-cell span {
  color: #64748b;
  font-size: 0.72rem;
  line-height: 1.2;
}

.preaccount-project-actions {
  gap: 6px;
}

.preaccount-project-actions button {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 0.74rem;
  box-shadow: none;
}

.preaccount-project-total-row td {
  background: rgba(241, 245, 249, 0.94);
  border-top: 2px solid rgba(148, 163, 184, 0.32);
  font-weight: 700;
}

.preaccount-project-total-label {
  color: #0f172a;
}

.preaccount-project-total-money {
  vertical-align: top;
}

.preaccount-project-total-stack .metric-money-stack {
  gap: 2px;
}

.preaccount-project-total-stack .metric-money-line {
  gap: 5px;
}

.preaccount-project-total-stack .metric-currency-code {
  font-size: 0.68rem;
}

.preaccount-project-total-stack .metric-money-amount {
  font-size: 0.76rem;
}

.preaccount-project-detail-grid {
  grid-template-columns: minmax(0, 1fr);
}

.preaccount-project-detail-panel {
  width: 100%;
  padding: 12px;
}

.preaccount-project-detail-panel .panel-title-row {
  margin-bottom: 8px;
}

.preaccount-project-detail-panel .panel-title-row h3 {
  font-size: 0.98rem;
}

.preaccount-project-detail-panel .panel-title-row .meta {
  margin-top: 2px;
  font-size: 0.76rem;
  color: #64748b;
}

.preaccount-project-detail-panel .preaccount-form-panel {
  margin-bottom: 8px;
}

.preaccount-project-detail-panel .preaccount-form-panel .panel-title-row {
  margin-bottom: 0;
}

.preaccount-project-detail-panel .preaccount-form-panel h3 {
  font-size: 0.9rem;
}

.preaccount-project-detail-panel .preaccount-form-panel-body {
  gap: 8px;
}

.preaccount-project-detail-panel .admin-audit-table th,
.preaccount-project-detail-panel .admin-audit-table td {
  padding: 7px 8px;
  font-size: 0.8rem;
}

.preaccount-resizable-table th {
  position: sticky;
}

.preaccount-shell .admin-audit-table {
  width: 100%;
}

.preaccount-shell .admin-audit-table th,
.preaccount-shell .admin-audit-table td {
  overflow-wrap: anywhere;
}

.preaccount-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: calc(100% - 10px);
  min-height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.preaccount-sort-button[data-direction="asc"],
.preaccount-sort-button[data-direction="desc"] {
  color: #3451db;
}

.preaccount-filter-row th {
  padding-top: 6px;
  padding-bottom: 8px;
  background: rgba(248, 250, 252, 0.96);
}

.preaccount-column-filter-input {
  width: 100%;
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  font-size: 0.76rem;
}

.preaccount-column-filter-input::placeholder {
  color: #94a3b8;
}

.preaccount-clear-filters-button {
  width: 100%;
  min-height: 30px;
  padding: 5px 8px;
  font-size: 0.74rem;
}

.preaccount-table-empty-cell {
  padding: 18px 14px;
  text-align: center;
  color: #64748b;
  font-weight: 700;
}

.preaccount-column-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  touch-action: none;
}

.preaccount-column-resizer::after {
  content: "";
  position: absolute;
  top: 25%;
  right: 3px;
  width: 1px;
  height: 50%;
  background: rgba(100, 116, 139, 0.32);
}

.preaccount-entry-table td:first-child,
.preaccount-shell .admin-audit-table td:first-child {
  font-weight: 650;
}

.preaccount-aging-row {
  --aging-bg: transparent;
  --aging-border: transparent;
  background:
    linear-gradient(90deg, var(--aging-border) 0 4px, transparent 4px),
    var(--aging-bg);
}

.preaccount-aging-row--settled {
  --aging-bg: rgba(236, 253, 245, 0.72);
  --aging-border: #22c55e;
}

.preaccount-aging-row--not-due {
  --aging-bg: rgba(240, 253, 244, 0.58);
  --aging-border: #16a34a;
}

.preaccount-aging-row--due-soon {
  --aging-bg: rgba(254, 249, 195, 0.7);
  --aging-border: #eab308;
}

.preaccount-aging-row--due-today {
  --aging-bg: rgba(255, 237, 213, 0.76);
  --aging-border: #f97316;
}

.preaccount-aging-row--overdue-low {
  --aging-bg: rgba(255, 237, 213, 0.82);
  --aging-border: #f97316;
}

.preaccount-aging-row--overdue-medium {
  --aging-bg: rgba(254, 226, 226, 0.82);
  --aging-border: #ef4444;
}

.preaccount-aging-row--overdue-high {
  --aging-bg: rgba(254, 202, 202, 0.9);
  --aging-border: #b91c1c;
}

.preaccount-aging-row--cancelled,
.preaccount-aging-row--no-due {
  --aging-bg: rgba(241, 245, 249, 0.7);
  --aging-border: #94a3b8;
}

.preaccount-due-cell {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 150px;
}

.preaccount-aging-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: #f8fafc;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.preaccount-aging-chip--settled,
.preaccount-aging-chip--not-due {
  border-color: #bbf7d0;
  background: #dcfce7;
  color: #166534;
}

.preaccount-aging-chip--due-soon {
  border-color: #fde68a;
  background: #fef9c3;
  color: #854d0e;
}

.preaccount-aging-chip--due-today,
.preaccount-aging-chip--overdue-low {
  border-color: #fed7aa;
  background: #ffedd5;
  color: #9a3412;
}

.preaccount-aging-chip--overdue-medium {
  border-color: #fecaca;
  background: #fee2e2;
  color: #991b1b;
}

.preaccount-aging-chip--overdue-high {
  border-color: #fca5a5;
  background: #dc2626;
  color: #ffffff;
}

.preaccount-aging-chip--cancelled,
.preaccount-aging-chip--no-due {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #475569;
}

.preaccount-shell .metric-card {
  min-height: 76px;
  padding: 13px 15px;
}

.preaccount-shell .metric-card-label {
  font-size: 0.72rem;
}

.preaccount-shell .metric-card-value {
  font-size: 1.18rem;
}

.preaccount-shell .metric-card[data-tone="blue"] {
  border-color: rgba(59, 130, 246, 0.26);
  box-shadow: inset 0 3px 0 rgba(59, 130, 246, 0.22);
}

.preaccount-shell .metric-card[data-tone="green"] {
  border-color: rgba(34, 197, 94, 0.26);
  box-shadow: inset 0 3px 0 rgba(34, 197, 94, 0.2);
}

.preaccount-shell .metric-card[data-tone="amber"] {
  border-color: rgba(245, 158, 11, 0.28);
  box-shadow: inset 0 3px 0 rgba(245, 158, 11, 0.2);
}

.preaccount-shell .metric-card[data-tone="danger"] {
  border-color: rgba(239, 68, 68, 0.3);
  box-shadow: inset 0 3px 0 rgba(239, 68, 68, 0.22);
}

.preaccount-shell .metric-card[data-tone="slate"] {
  border-color: rgba(100, 116, 139, 0.26);
  box-shadow: inset 0 3px 0 rgba(100, 116, 139, 0.18);
}

.preaccount-metric-money-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.preaccount-metric-card-clickable {
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.preaccount-metric-card-clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.preaccount-metric-card-clickable:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.42);
  outline-offset: 2px;
}

.preaccount-metric-detail-dialog {
  width: min(560px, calc(100vw - 28px));
}

.preaccount-metric-detail-dialog::backdrop {
  background: rgba(15, 23, 42, 0.5);
}

.preaccount-metric-detail-dialog-body {
  padding: 18px 18px 16px;
  max-height: min(78vh, 760px);
  overflow: auto;
}

.preaccount-metric-detail-layout {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.preaccount-metric-detail-layout .preaccount-metric-section {
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.98));
}

.preaccount-metric-note {
  font-size: 0.76rem;
  color: #64748b;
  font-weight: 700;
}

.preaccount-calendar-card {
  overflow: visible;
  background:
    radial-gradient(circle at 10% 0%, rgba(191, 219, 254, 0.36), transparent 42%),
    radial-gradient(circle at 90% 0%, rgba(187, 247, 208, 0.28), transparent 36%),
    linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.98));
}

.preaccount-calendar-toolbar {
  display: grid;
  grid-template-columns: minmax(150px, 170px) minmax(150px, 170px) auto;
  gap: 10px 12px;
  align-items: end;
  margin-top: 12px;
}

.preaccount-calendar-toolbar-actions {
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
}

.preaccount-calendar-toolbar-note {
  grid-column: 1 / span 2;
}

.preaccount-calendar-toolbar-range {
  justify-self: end;
  align-self: center;
  font-weight: 700;
}

.preaccount-calendar-map {
  position: relative;
  min-height: 250px;
  margin-top: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  overflow: visible;
}

.preaccount-calendar-edge {
  position: absolute;
  top: 12px;
  z-index: 4;
  pointer-events: none;
}

.preaccount-calendar-edge-start {
  left: 16px;
}

.preaccount-calendar-edge-end {
  right: 16px;
}

.preaccount-calendar-edge-summary {
  min-width: 172px;
  max-width: 220px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 4px;
}

.preaccount-calendar-edge-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
}

.preaccount-calendar-edge-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: #0f172a;
}

.preaccount-calendar-edge-values {
  display: grid;
  gap: 4px;
}

.preaccount-calendar-edge-value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.78rem;
  color: #334155;
}

.preaccount-calendar-edge-currency {
  color: #64748b;
  font-weight: 700;
}

.preaccount-calendar-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.preaccount-calendar-rail-shadow,
.preaccount-calendar-rail {
  fill: none;
  stroke-linecap: round;
}

.preaccount-calendar-rail-shadow {
  stroke: rgba(148, 163, 184, 0.3);
  stroke-width: 18;
}

.preaccount-calendar-rail {
  stroke: rgba(148, 163, 184, 0.78);
  stroke-width: 8;
}

.preaccount-calendar-stage-label {
  position: absolute;
  transform: translateX(-50%);
  width: max-content;
  max-width: 132px;
  text-align: center;
  z-index: 2;
}

.preaccount-calendar-stage-label span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(255, 255, 255, 0.96);
  color: #475569;
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.preaccount-calendar-stage-anchor {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 3px solid rgba(99, 102, 241, 0.32);
  background: #ffffff;
  transform: translate(-50%, -50%);
  z-index: 2;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.86);
}

.preaccount-calendar-cluster {
  position: absolute;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  min-width: 38px;
  min-height: 38px;
  padding: 6px 10px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: #ffffff;
  cursor: pointer;
  z-index: 3;
  box-shadow: 0 18px 32px -18px rgba(15, 23, 42, 0.55);
  transition: box-shadow 160ms ease, z-index 160ms ease;
  will-change: transform;
}

.preaccount-calendar-cluster.is-empty {
  cursor: default;
  color: #64748b;
  background: rgba(226, 232, 240, 0.76);
  box-shadow: none;
}

.preaccount-calendar-critical {
  background: linear-gradient(135deg, #dc2626, #ef4444);
}

.preaccount-calendar-due {
  background: linear-gradient(135deg, #f97316, #fb923c);
}

.preaccount-calendar-upcoming {
  background: linear-gradient(135deg, #2563eb, #60a5fa);
}

.preaccount-calendar-incoming {
  background: linear-gradient(135deg, #16a34a, #4ade80);
}

.preaccount-calendar-mixed {
  background: linear-gradient(135deg, #7c3aed, #2563eb);
}

.preaccount-calendar-idle {
  background: rgba(226, 232, 240, 0.82);
}

.preaccount-calendar-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 14px);
  transform: translateX(-50%);
  transform-origin: bottom center;
  min-width: 240px;
  max-width: 320px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.94);
  color: #f8fafc;
  box-shadow: 0 22px 40px -18px rgba(15, 23, 42, 0.65);
  display: grid;
  gap: 6px;
  font-size: 0.78rem;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
  text-align: left;
  will-change: opacity;
}

.preaccount-calendar-tooltip strong {
  color: #ffffff;
}

.preaccount-calendar-tooltip-group-title {
  margin-top: 2px;
  color: #cbd5e1;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.preaccount-calendar-tooltip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.preaccount-calendar-cluster:hover,
.preaccount-calendar-cluster:focus-visible {
  z-index: 12;
  transform: translate(-50%, -50%);
  box-shadow: 0 22px 38px -18px rgba(15, 23, 42, 0.62);
}

.preaccount-calendar-cluster:hover .preaccount-calendar-tooltip,
.preaccount-calendar-cluster:focus-visible .preaccount-calendar-tooltip {
  opacity: 1;
  transform: translateX(-50%);
}

.preaccount-calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.preaccount-calendar-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(219, 227, 239, 0.9);
  background: rgba(255, 255, 255, 0.9);
  color: #334155;
  font-size: 0.77rem;
  font-weight: 700;
}

.preaccount-calendar-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

@media (max-width: 900px) {
  .preaccount-calendar-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preaccount-calendar-toolbar-actions,
  .preaccount-calendar-toolbar-note,
  .preaccount-calendar-toolbar-range {
    grid-column: 1 / -1;
  }

  .preaccount-calendar-toolbar-range {
    justify-self: start;
  }

  .preaccount-calendar-map {
    min-height: 220px;
    padding-top: 112px;
  }

  .preaccount-calendar-edge {
    top: 10px;
  }

  .preaccount-calendar-edge-start {
    left: 10px;
  }

  .preaccount-calendar-edge-end {
    right: 10px;
  }

  .preaccount-calendar-edge-summary {
    min-width: 132px;
    max-width: 152px;
    padding: 8px 10px;
  }

  .preaccount-calendar-edge-label {
    font-size: 0.65rem;
  }

  .preaccount-calendar-edge-count,
  .preaccount-calendar-edge-value-row {
    font-size: 0.72rem;
  }

  .preaccount-calendar-stage-label span {
    min-height: 24px;
    padding: 4px 8px;
    font-size: 0.67rem;
  }

  .preaccount-calendar-cluster {
    min-width: 32px;
    min-height: 32px;
    padding: 5px 8px;
    font-size: 0.74rem;
  }

  .preaccount-calendar-tooltip {
    min-width: 220px;
    max-width: min(260px, calc(100vw - 32px));
  }
}

@media (max-width: 640px) {
  .preaccount-calendar-toolbar {
    grid-template-columns: 1fr;
  }

  .preaccount-calendar-toolbar-actions {
    flex-wrap: wrap;
  }

  .preaccount-calendar-toolbar-actions button {
    flex: 1 1 100%;
  }
}

.preaccount-preview-dialog {
  width: min(1080px, calc(100vw - 40px));
}

.preaccount-preview-dialog-body {
  max-width: min(1080px, calc(100vw - 40px));
  max-height: min(88vh, 920px);
  overflow: hidden;
}

.preaccount-preview-layout {
  display: grid;
  gap: 14px;
  max-height: calc(min(88vh, 920px) - 96px);
  overflow-y: auto;
  padding-right: 4px;
}

.preaccount-preview-doc-row {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.preaccount-preview-doc-button {
  min-height: 32px;
  padding: 6px 12px;
  flex: 0 0 auto;
}

.preaccount-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  color: #475569;
}

.preaccount-preview-meta a {
  color: #3451db;
  text-decoration: none;
}

.preaccount-preview-stage {
  min-height: 320px;
  max-height: 62vh;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.98));
  overflow: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.preaccount-preview-frame,
.preaccount-preview-image {
  width: 100%;
  min-height: 320px;
  border: 0;
  display: block;
  background: #ffffff;
}

.preaccount-preview-image {
  object-fit: contain;
}

.preaccount-market-table-wrap {
  max-height: 560px;
  overflow: auto;
  scrollbar-gutter: stable both-edges;
}

.preaccount-shell .admin-table-wrap {
  max-height: min(58vh, 560px);
  overflow: auto;
  scrollbar-gutter: stable both-edges;
  scrollbar-color: rgba(86, 104, 136, 0.52) rgba(226, 232, 240, 0.78);
  -webkit-overflow-scrolling: touch;
}

.preaccount-shell .admin-table-wrap::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.preaccount-shell .admin-table-wrap::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.86);
  background: rgba(86, 104, 136, 0.46);
}

.preaccount-shell .admin-table-wrap::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.56);
}

.preaccount-market-table-wrap .preaccount-entry-table {
  min-width: 1180px;
}

.preaccount-preview-text {
  margin: 0;
  max-height: 220px;
  overflow: auto;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: #f8fafc;
  color: #0f172a;
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.field-note {
  margin-top: 6px;
  font-size: 0.84rem;
  color: #64748b;
}

.automation-shell-panel,
.automation-panel {
  display: grid;
  gap: 16px;
}

.automation-stats {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.automation-panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.automation-form-grid {
  grid-template-columns: minmax(260px, 1.4fr) minmax(170px, 0.7fr) minmax(160px, 0.6fr);
  align-items: end;
}

.automation-inline-toggle {
  min-width: 0;
}

.automation-toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
}

.automation-pin-input {
  letter-spacing: 0.24em;
  font-weight: 700;
  text-align: center;
}

.automation-option-grid,
.automation-preview-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.automation-inner-panel {
  padding: 16px;
}

.automation-inner-panel.is-disabled,
.automation-receipt-owner-field.is-disabled {
  opacity: 0.56;
}

.automation-inner-panel h4 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: #0f172a;
}

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

.automation-checkbox-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #d7dce5;
  border-radius: 12px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 0.9rem;
}

.automation-checkbox-card input {
  margin: 0;
}

.automation-receipt-owner-field {
  margin-top: 14px;
}

.automation-table-wrap {
  max-height: 420px;
}

.automation-bulk-textarea {
  min-height: 220px;
  font-family: "Noto Sans Mono", Consolas, "Courier New", monospace;
  font-size: 0.84rem;
  line-height: 1.45;
  resize: vertical;
}

.automation-actions-cell {
  white-space: nowrap;
}

.automation-actions-cell button + button {
  margin-left: 8px;
}

.automation-preview-card {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid #d7dce5;
  border-radius: 12px;
  background: #f8fafc;
}

.automation-preview-code {
  margin-top: 8px;
  font-family: "JetBrains Mono", "Consolas", "SFMono-Regular", monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1d4ed8;
}

.automation-preview-pre {
  margin: 8px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "JetBrains Mono", "Consolas", "SFMono-Regular", monospace;
  font-size: 0.84rem;
  line-height: 1.5;
  color: #334155;
}

@media (max-width: 1180px) {
  .preaccount-two-col {
    grid-template-columns: minmax(0, 1fr);
  }

  .automation-stats,
  .automation-form-grid,
  .automation-option-grid,
  .automation-preview-grid {
    grid-template-columns: 1fr;
  }

  .preaccount-form-grid .field.grow,
  .preaccount-filter-grid .field.grow {
    grid-column: span 1;
  }

  .preaccount-project-form-grid .span-2,
  .preaccount-project-child-form-grid .span-2 {
    grid-column: span 1;
  }
}

@media (max-width: 720px) {
  .preaccount-shell {
    padding: 12px;
  }

  .preaccount-form-grid,
  .preaccount-filter-grid,
  .preaccount-metrics-grid,
  .preaccount-projects-top,
  .preaccount-project-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .preaccount-project-filter-grid {
    grid-template-columns: 1fr;
  }

  .automation-checkbox-grid {
    grid-template-columns: 1fr;
  }

  .automation-panel-actions {
    width: 100%;
  }

  .automation-panel-actions button {
    flex: 1 1 auto;
  }

  .preaccount-inline-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

/* Mobile lightweight shell + catalog quick lookup v1.2.0.266 */
.catalog-mobile-head,
.catalog-mobile-field-label,
.catalog-mobile-price-label {
  display: none;
}

.catalog-mobile-price-value {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

@media (max-width: 1100px) {
  .layout {
    width: 100%;
    padding: 12px;
    gap: 12px;
  }

  .header-panel {
    position: sticky;
    top: 10px;
    z-index: 24;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(244, 248, 255, 0.96));
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.12);
  }

  .header-panel .header-brand-block {
    align-items: center;
    gap: 10px;
  }

  .header-panel .header-brand-copy {
    display: grid;
    gap: 4px;
  }

  .header-brand-title {
    margin: 0;
  }

  .header-brand-logo {
    width: auto;
    height: clamp(28px, 4vw, 34px);
    max-width: min(230px, 58vw);
    object-fit: contain;
  }

  .header-panel .header-brand-copy p {
    margin: 0;
    max-width: 34ch;
    color: #52647d;
    font-size: 0.84rem;
    line-height: 1.28;
  }

  .header-panel .mobile-nav-toggle {
    min-width: 46px;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 12px;
  }

  .header-panel .shell-search-block {
    order: 3;
    gap: 6px;
  }

  .header-panel .shell-search-frame {
    padding: 8px 10px;
    border-radius: 14px;
  }

  .header-panel .shell-search-frame button {
    min-height: 2.3rem;
    padding: 0.52rem 0.9rem;
  }

  .header-panel .shell-search-hint {
    min-height: 0;
    font-size: 0.74rem;
    line-height: 1.25;
  }

  .header-panel .header-meta-group {
    gap: 8px;
    justify-items: stretch;
  }

  .header-panel .header-utility-row {
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
  }

  .header-panel .header-version-stack {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }

  .header-panel #dbVersionBadge {
    display: none;
  }

  .header-panel .header-account-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .header-panel .header-account-row > * {
    width: 100%;
    min-width: 0;
  }

  .header-panel #currentUserBadge {
    min-width: 0;
  }

  .header-panel .header-meta-summary {
    margin-top: 2px;
    text-align: left;
    font-size: 0.73rem;
    line-height: 1.25;
  }

  #activePagePanel {
    padding: 12px 14px;
    gap: 10px;
  }

  .active-page-breadcrumb {
    display: none;
  }

  .active-page-title-row {
    gap: 8px;
  }

  .active-page-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 10px;
  }

  .active-page-eyebrow {
    font-size: 0.68rem;
  }

  .active-page-copy h2 {
    font-size: 1.02rem;
  }

  .active-page-copy p {
    margin-top: 2px;
    color: #5c6f88;
    font-size: 0.82rem;
    line-height: 1.28;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .active-page-meta {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .active-page-meta::-webkit-scrollbar {
    display: none;
  }

  .active-page-chip {
    padding: 5px 8px;
    font-size: 0.72rem;
  }

  #shellSummaryCards {
    display: none;
  }

  .tab-panel.active {
    gap: 12px;
  }

  .tab-panel.active > .panel,
  .tab-panel.active > .catalog-subtab-pane > .panel {
    border-radius: 18px;
  }

  .panel-title-row {
    gap: 8px;
  }
}

@media (max-width: 900px) {
  .layout {
    padding: 10px;
    gap: 10px;
  }

  .header-panel {
    top: 8px;
    padding: 12px;
    gap: 10px;
  }

  .header-panel .header-account-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .header-panel .header-account-row .language-picker,
  .header-panel #currentUserBadge {
    grid-column: span 2;
  }

  .header-panel .header-account-row .secondary {
    min-height: 38px;
    padding-inline: 10px;
    font-size: 0.84rem;
  }

  .catalog-subtab-row {
    margin-bottom: 10px;
    padding-bottom: 2px;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 8px;
    scrollbar-width: none;
  }

  .catalog-subtab-row::-webkit-scrollbar {
    display: none;
  }

  .catalog-subtab-button {
    flex: 0 0 auto;
    min-width: max-content;
  }

  #catalogTab .catalog-controls-panel {
    gap: 10px;
    padding: 14px;
  }

  #catalogTab .catalog-controls-panel .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .catalog-results-panel {
    overflow: visible;
  }

  #resultsTableWrap {
    min-height: 0;
    max-height: none;
    overflow: visible;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .resizable-list-wrap {
    resize: none !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  #catalogResultsTable,
  #catalogResultsTable tbody,
  #catalogResultsTable tr,
  #catalogResultsTable td {
    display: block;
    width: 100%;
  }

  #catalogResultsTable {
    min-width: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
  }

  #catalogResultsTable colgroup,
  #catalogResultsTable thead {
    display: none;
  }

  #catalogResultsTable tbody {
    display: grid;
    gap: 10px;
  }

  #catalogResultsTable tbody tr.catalog-result-row {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 10px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(245, 249, 255, 0.95));
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  }

  #catalogResultsTable tbody tr.catalog-result-row td {
    padding: 0;
    border: 0;
    position: static;
    right: auto;
    background: transparent !important;
    box-shadow: none !important;
  }

  #catalogResultsTable tbody tr.catalog-result-row .catalog-cell--select {
    position: absolute;
    top: 12px;
    right: 12px;
    width: auto;
  }

  #catalogResultsTable tbody tr.catalog-result-row .catalog-cell--brand,
  #catalogResultsTable tbody tr.catalog-result-row .catalog-cell--sku {
    display: none;
  }

  #catalogResultsTable tbody tr.catalog-result-row .catalog-cell--model,
  #catalogResultsTable tbody tr.catalog-result-row .catalog-cell--description,
  #catalogResultsTable tbody tr.catalog-result-row .catalog-cell--actions {
    grid-column: 1 / -1;
  }

  #catalogResultsTable tbody tr.catalog-result-row .catalog-cell--model {
    padding-right: 32px;
  }

  #catalogResultsTable tbody tr.catalog-result-row .catalog-cell--description {
    color: #475569;
  }

  #catalogResultsTable tbody tr.catalog-result-row .catalog-cell--stock,
  #catalogResultsTable tbody tr.catalog-result-row .catalog-cell--qty {
    align-self: start;
  }

  #catalogResultsTable tbody tr.catalog-result-row .catalog-cell--price {
    display: grid;
    gap: 4px;
    padding: 9px 10px;
    border: 1px solid rgba(191, 219, 254, 0.9);
    border-radius: 12px;
    background: rgba(239, 246, 255, 0.92) !important;
  }

  .catalog-mobile-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
  }

  .catalog-mobile-brand,
  .catalog-mobile-sku {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: #eff6ff;
    color: #3451db;
    font-size: 0.71rem;
    font-weight: 700;
  }

  .catalog-mobile-sku {
    background: #f8fafc;
    color: #475569;
  }

  .catalog-mobile-field-label,
  .catalog-mobile-price-label {
    display: inline-flex;
    align-items: center;
    color: #64748b;
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  .catalog-mobile-price-value {
    color: #0f172a;
    font-size: 0.92rem;
    font-weight: 760;
    line-height: 1.15;
  }

  #catalogResultsTable .model-stack {
    gap: 5px;
  }

  #catalogResultsTable .model-stack strong {
    display: block;
    color: #0f172a;
    font-size: 0.98rem;
    line-height: 1.24;
  }

  #catalogResultsTable .model-note {
    font-size: 0.76rem;
    line-height: 1.28;
  }

  #catalogResultsTable .catalog-description-cell {
    display: grid;
    gap: 6px;
  }

  #catalogResultsTable .catalog-description-cell > span {
    display: -webkit-box;
    overflow: hidden;
    color: #475569;
    font-size: 0.82rem;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  #catalogResultsTable .catalog-cell--qty input {
    width: 100%;
    min-width: 0;
    height: 40px;
  }

  #catalogResultsTable .catalog-cell--actions .cart-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 118px;
    gap: 8px;
    align-items: stretch;
  }

  #catalogResultsTable .catalog-cell--actions .compact-icon-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  #catalogResultsTable .catalog-cell--actions .icon-action-button,
  #catalogResultsTable .catalog-cell--actions button[data-add] {
    min-height: 38px;
    height: 100%;
  }

  #catalogResultsTable .catalog-cell--actions button[data-add] {
    padding: 0 10px;
    font-size: 0.8rem;
    line-height: 1.15;
  }

  #catalogResultsTable tbody .list-loading-row td {
    padding: 10px 12px;
    border: 1px dashed rgba(148, 163, 184, 0.42);
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.9);
    text-align: center;
  }
}

@media (max-width: 640px) {
  .header-panel .header-brand-copy p {
    max-width: none;
    font-size: 0.78rem;
  }

  .header-panel .shell-search-frame {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .header-panel .shell-search-frame button {
    width: auto;
    min-width: 78px;
  }

  #catalogTab .catalog-controls-panel .actions,
  #catalogResultsTable .catalog-cell--actions .cart-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  #catalogResultsTable tbody tr.catalog-result-row {
    grid-template-columns: minmax(0, 1fr);
  }

  #catalogResultsTable tbody tr.catalog-result-row .catalog-cell--stock,
  #catalogResultsTable tbody tr.catalog-result-row .catalog-cell--qty,
  #catalogResultsTable tbody tr.catalog-result-row .catalog-cell--price {
    grid-column: 1 / -1;
  }
}

/* Mobile quick shell simplification v1.2.0.272 */
@media (max-width: 900px) {
  body {
    background:
      linear-gradient(180deg, rgba(244, 247, 252, 0.98), rgba(236, 243, 252, 0.98)),
      #f5f7fb;
  }

  .layout {
    padding: 8px;
    gap: 8px;
  }

  .header-panel {
    padding: 11px 12px !important;
    gap: 10px !important;
    border-radius: 18px !important;
  }

  .header-panel .header-brand-block {
    align-items: center !important;
    gap: 10px !important;
  }

  .header-panel .header-brand-logo {
    height: 30px;
    max-width: min(180px, 100%);
  }

  .header-panel .header-brand-copy p,
  .header-panel .shell-search-hint,
  .header-panel .header-meta-summary {
    display: none !important;
  }

  .header-panel .header-meta-group {
    gap: 8px !important;
  }

  .header-panel .header-utility-row {
    justify-content: space-between !important;
    gap: 8px !important;
  }

  .header-panel .header-account-row {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .header-panel .header-account-row::-webkit-scrollbar {
    display: none;
  }

  .header-panel .header-account-row > * {
    flex: 0 0 auto;
  }

  .header-panel .language-picker,
  .header-panel #currentUserBadge,
  .header-panel #securityButton,
  .header-panel #feedbackButton,
  .header-panel #releaseNotesButton,
  .header-panel #logoutButton {
    min-height: 38px !important;
    white-space: nowrap;
  }

  .header-panel #currentUserBadge {
    max-width: 200px !important;
  }

  #activePagePanel {
    padding: 10px 12px !important;
    border-radius: 16px !important;
  }

  .active-page-breadcrumb,
  .active-page-eyebrow,
  .active-page-copy p,
  .active-page-meta {
    display: none !important;
  }

  .active-page-title-row {
    align-items: center;
    gap: 9px;
  }

  .active-page-icon {
    width: 34px !important;
    height: 34px !important;
    flex: 0 0 34px !important;
    border-radius: 10px !important;
  }

  .active-page-copy h2 {
    font-size: 0.98rem !important;
    line-height: 1.18 !important;
  }

  #shellSummaryCards {
    display: none !important;
  }

  .tab-row {
    width: min(360px, 100vw);
    padding: 0.8rem 0.75rem 1rem;
    border-radius: 0 18px 18px 0;
    overscroll-behavior: contain;
  }

  .sidebar-drawer-head {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: -0.15rem -0.05rem 0.5rem;
    padding: calc(env(safe-area-inset-top, 0px) + 0.1rem) 0.1rem 0.75rem;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
  }

  .tab-row .tab-button {
    min-height: 44px;
    padding: 0.65rem 0.8rem;
    border-radius: 12px;
  }

  .sidebar-submenu {
    margin: 0.05rem 0 0.4rem 1.05rem;
    padding: 0.18rem 0 0.18rem 0.6rem;
    border-left: 1px solid rgba(148, 163, 184, 0.42);
  }

  .sidebar-submenu-button {
    min-height: 38px;
    padding: 0.45rem 0.65rem;
    border-radius: 10px;
  }

  .catalog-subtab-row,
  .led-systems-tabs,
  .transport-subtabs,
  .preaccount-subtab-row,
  #adminTab .admin-subtab-row {
    margin-bottom: 8px;
    padding: 2px 0 6px;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    gap: 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .catalog-subtab-row::-webkit-scrollbar,
  .led-systems-tabs::-webkit-scrollbar,
  .transport-subtabs::-webkit-scrollbar,
  .preaccount-subtab-row::-webkit-scrollbar,
  #adminTab .admin-subtab-row::-webkit-scrollbar {
    display: none;
  }

  .catalog-subtab-button,
  .led-systems-tab-button,
  .transport-subtab-button,
  .preaccount-subtab-row .tab-button,
  #adminTab .admin-subtab-button {
    flex: 0 0 auto;
    min-height: 38px;
    border-radius: 11px;
  }

  .tab-panel.active {
    gap: 10px;
  }

  .tab-panel.active > .panel,
  .tab-panel.active > .catalog-subtab-pane > .panel,
  .tab-panel.active > .led-systems-pane > .panel {
    padding: 14px;
    border-radius: 16px;
  }

  .panel-title-row {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }

  .panel-title-row h2,
  .panel-title-row h3 {
    font-size: 1rem;
    line-height: 1.2;
  }

  .table-wrap,
  .admin-table-wrap,
  .inventory-table-wrap {
    max-height: 55vh;
    overflow: auto;
    scrollbar-gutter: stable both-edges;
  }
}

@media (max-width: 640px) {
  .layout {
    padding: 6px;
    gap: 8px;
  }

  .header-panel {
    padding: 10px !important;
    border-radius: 16px !important;
  }

  .header-panel .mobile-nav-toggle {
    min-height: 38px;
    padding-inline: 12px;
    border-radius: 11px;
  }

  .header-panel .header-brand-logo {
    height: 26px;
    max-width: min(150px, 100%);
  }

  .header-panel .shell-search-frame {
    min-height: 0;
    padding: 4px 5px 4px 10px;
    border-radius: 14px;
  }

  .header-panel .shell-search-input {
    min-height: 38px;
  }

  .header-panel .shell-search-frame button {
    min-width: 72px;
    min-height: 38px;
  }

  .header-panel .header-account-row {
    gap: 6px !important;
  }

  .header-panel .language-picker,
  .header-panel #currentUserBadge,
  .header-panel #securityButton,
  .header-panel #feedbackButton,
  .header-panel #releaseNotesButton,
  .header-panel #logoutButton {
    min-height: 36px !important;
    font-size: 0.8rem !important;
  }

  #activePagePanel {
    padding: 9px 10px !important;
    border-radius: 14px !important;
  }

  .active-page-icon {
    width: 30px !important;
    height: 30px !important;
    flex-basis: 30px !important;
  }

  .active-page-copy h2 {
    font-size: 0.92rem !important;
  }

  .tab-row {
    width: 100vw;
    max-width: 100vw;
    border-radius: 0;
    padding: calc(env(safe-area-inset-top, 0px) + 0.65rem) 0.7rem 1rem;
  }

  .sidebar-drawer-head {
    margin: 0 0 0.55rem;
    padding-top: 0;
  }

  .sidebar-drawer-brand {
    font-size: 1.02rem;
  }

  .tab-row .tab-button {
    min-height: 46px;
    padding: 0.68rem 0.78rem;
  }

  .sidebar-nav-label {
    font-size: 0.91rem;
  }

  .sidebar-submenu-button {
    min-height: 36px;
    font-size: 0.8rem;
  }

  .tab-panel.active > .panel,
  .tab-panel.active > .catalog-subtab-pane > .panel,
  .tab-panel.active > .led-systems-pane > .panel {
    padding: 12px;
    border-radius: 14px;
  }

  .panel-title-row .cart-actions,
  .panel-title-row .actions,
  .controls-panel .actions,
  .cart-actions {
    width: 100%;
  }

  .field {
    min-width: 0;
  }
}

/* UI density + catalog mobile overflow cleanup v1.2.2.99 */
.panel {
  padding: 16px;
  border-radius: 16px;
}

.tab-panel.active {
  gap: 14px;
}

.panel-title-row,
.controls-panel {
  gap: 10px 14px;
  flex-wrap: wrap;
}

.panel-title-row .cart-actions,
.panel-title-row .actions,
.controls-panel .actions {
  margin-left: auto;
}

.active-page-panel {
  grid-template-columns: minmax(220px, 0.82fr) minmax(0, 1.18fr);
  gap: 8px 10px;
  padding: 9px 12px;
}

.shell-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)) !important;
  gap: 6px;
}

.metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)) !important;
  gap: 8px 10px;
}

.metric-card,
.led-quote-metric-card,
.shell-summary-card {
  min-height: auto !important;
  padding: 8px 10px !important;
}

.metric-card-rich {
  gap: 4px;
  margin-top: 6px;
}

.preaccount-shell .metric-card,
.admin-stats .metric-card {
  min-height: 68px !important;
}

@media (max-width: 900px) {
  .tab-row {
    width: 100%;
    max-width: 100%;
  }

  #catalogTab,
  #catalogTab .catalog-subtab-pane,
  #catalogTab .catalog-results-panel,
  #catalogTab .catalog-controls-panel,
  #resultsTableWrap,
  #catalogResultsTable,
  #catalogResultsTable tbody,
  #catalogResultsTable tbody tr.catalog-result-row,
  #catalogResultsTable tbody tr.catalog-result-row td {
    min-width: 0 !important;
    max-width: 100%;
  }

  #catalogTab .catalog-subtab-pane,
  #catalogTab .catalog-results-panel,
  #resultsTableWrap {
    overflow-x: clip;
  }

  #catalogResultsTable tbody tr.catalog-result-row {
    overflow: hidden;
    gap: 8px 9px;
    padding: 11px;
  }

  #catalogResultsTable .catalog-description-cell,
  #catalogResultsTable .model-stack,
  #catalogResultsTable .catalog-cell--price,
  #catalogResultsTable .catalog-cell--actions,
  #catalogResultsTable .catalog-cell--stock,
  #catalogResultsTable .catalog-cell--qty {
    min-width: 0;
  }

  #catalogResultsTable .model-stack strong,
  #catalogResultsTable .model-note,
  #catalogResultsTable .catalog-description-cell > span,
  #catalogResultsTable .catalog-mobile-sku {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  #catalogResultsTable .catalog-cell--actions .cart-actions {
    grid-template-columns: minmax(0, 1fr) minmax(96px, 108px);
  }

  #catalogResultsTable .catalog-cell--actions .compact-icon-actions {
    min-width: 0;
  }

  .stock-pill,
  .catalog-mobile-brand,
  .catalog-mobile-sku,
  .catalog-badge {
    max-width: 100%;
    white-space: normal;
  }
}
