:root {
  color-scheme: light;
  --bg: #edf3f7;
  --panel: #fbfdff;
  --panel-soft: #f4f8fb;
  --panel-tint: #e6f5f4;
  --text: #102033;
  --muted: #607083;
  --line: #cfdbe6;
  --line-strong: #b8c9d8;
  --brand-blue: #1559b7;
  --brand-blue-dark: #0b3f8f;
  --brand-blue-soft: #eaf2ff;
  --teal: #0f8f8c;
  --teal-dark: #0d6f6c;
  --teal-soft: #e5f6f4;
  --accent: var(--brand-blue);
  --accent-strong: var(--brand-blue-dark);
  --warning: #b66a00;
  --warning-bg: #fff7e6;
  --ok: #0f766e;
  --danger: #b42318;
  --shadow: 0 10px 26px rgba(15, 43, 76, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 18px;
  font-weight: 800;
}

h2 {
  color: #12345f;
  font-size: 15px;
  font-weight: 800;
}

h3 {
  color: #24405f;
  font-size: 13px;
  font-weight: 800;
}

button,
input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  background: #fff;
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(21, 89, 183, 0.12);
}

textarea {
  resize: vertical;
}

button {
  min-height: 34px;
  padding: 7px 12px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

button:hover:not(:disabled) {
  background: var(--accent-strong);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

label {
  display: grid;
  gap: 5px;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

.topbar {
  display: flex;
  gap: 18px;
  align-items: center;
  min-height: 64px;
  padding: 7px 24px;
  background: #f9fcff;
  border-top: 3px solid var(--brand-blue);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 5px 18px rgba(12, 43, 82, 0.06);
}

.top-userbar {
  align-items: center;
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.top-userbar span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand img {
  width: 186px;
  height: 52px;
  object-fit: contain;
}

.edition-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid #ea580c;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.app-status-hidden {
  display: none !important;
}

.section-head p,
.muted {
  color: var(--muted);
  font-size: 12px;
}

.topbar-form {
  display: grid;
  grid-template-columns: 86px 68px 80px auto;
  gap: 10px;
  align-items: end;
  justify-content: end;
}

.switch {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  white-space: nowrap;
}

.switch input {
  width: 18px;
  min-height: 18px;
}

.tax-rate input,
.topbar-form input {
  min-height: 34px;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.topbar-actions button {
  white-space: nowrap;
}

.workspace {
  display: grid;
  grid-template-columns: 340px minmax(760px, 1fr);
  gap: 10px;
  height: calc(100vh - 66px);
  min-height: 660px;
  padding: 8px 10px;
}

.left-column,
.main-column,
.config-panel,
.lines-panel {
  min-width: 0;
  min-height: 0;
}

.left-column {
  display: block;
}

.main-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
}

.selection-panel,
.product-panel,
.config-panel,
.lines-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

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

.section-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.section-head h2::before {
  content: "";
  width: 4px;
  height: 15px;
  border-radius: 4px;
  background: var(--brand-blue);
}

.section-head span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.subsection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 0 8px;
}

.selection-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.selection-form button {
  grid-column: 1 / -1;
}

.selection-search {
  grid-column: 1 / -1;
  position: relative;
  display: grid;
  gap: 6px;
  padding: 8px;
  background: #f6faff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.compact-head {
  margin-bottom: 0;
}

.selection-results,
.quote-line-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.selection-results {
  flex: 1 1 auto;
}

.product-results {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 8px;
  right: 8px;
  display: grid;
  gap: 4px;
  max-height: 210px;
  overflow: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid #b7cce0;
  border-radius: 8px;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.14);
}

.product-results:empty {
  display: none;
}

.search-input {
  margin-bottom: 0;
}

.candidate-card,
.product-card,
.selected-product,
.quote-line-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.candidate-card {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 8px 9px;
  color: var(--text);
  background: #fff;
  box-shadow: 0 1px 0 rgba(15, 43, 76, 0.03);
  cursor: pointer;
}

.candidate-card:hover,
.product-card:hover {
  border-color: var(--brand-blue);
}

.candidate-card.active {
  background: #f0fbfb;
  border-color: var(--teal);
  box-shadow: 0 0 0 1px rgba(15, 143, 140, 0.2);
}

.candidate-rank {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #f59e0b;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.candidate-top {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.candidate-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.candidate-model-link {
  justify-self: start;
  min-height: 0;
  padding: 0;
  color: var(--brand-blue);
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.candidate-model-link:hover {
  color: var(--brand-blue-dark);
  text-decoration: underline;
}

.candidate-mini-metrics,
.product-meta,
.line-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  color: var(--muted);
  font-size: 12px;
}

.candidate-mini-metrics span,
.product-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
}

.candidate-mini-metrics b {
  color: #344054;
  font-weight: 900;
}

.candidate-score-value {
  color: var(--teal-dark);
  font-size: 13px;
  white-space: nowrap;
}

.variant-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
}

.variant-tab {
  min-height: 19px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #fff;
  color: #344054;
  border-color: #cfd8df;
  font-size: 11px;
  line-height: 1.2;
}

.variant-tab.active {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #fff;
}

.product-card {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 9px;
  color: var(--text);
  text-align: left;
  background: #fff;
}

.product-card.search-option {
  min-height: 32px;
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 900;
  color: #0f172a;
}

.search-no-match {
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.product-card.active {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 2px rgba(21, 89, 183, 0.13);
}

.product-title,
.line-title,
.quote-line-top,
.quote-line-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #edf2f7;
  color: #344054;
}

.config-panel {
  position: relative;
}

.quote-config-board {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(250px, 1fr) minmax(250px, 340px);
  gap: 12px;
  align-items: stretch;
}

.selected-product {
  display: grid;
  gap: 9px;
  padding: 12px;
  margin-bottom: 0;
  background: #f8fbff;
  border-color: #c7d8ea;
  box-shadow: inset 4px 0 0 var(--brand-blue);
}

.selected-product.empty,
.empty-row {
  display: grid;
  place-items: center;
  min-height: 68px;
  padding: 12px;
  color: var(--muted);
  text-align: center;
  background: var(--panel-soft);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
}

.product-summary-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.product-summary-head strong {
  display: block;
  margin-top: 2px;
  color: #0b2447;
  font-size: 20px;
  overflow-wrap: anywhere;
}

.summary-label,
.summary-grid span,
.metric span,
.quote-line-prices span,
.quote-line-foot {
  color: var(--muted);
  font-size: 12px;
}

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

.summary-grid div,
.metric,
.totals div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.summary-grid strong {
  overflow-wrap: anywhere;
}

.ghost-button {
  background: #fff;
  color: var(--brand-blue-dark);
  border-color: #b8cceb;
}

.ghost-button:hover:not(:disabled) {
  color: #fff;
  background: var(--brand-blue);
  border-color: var(--brand-blue);
}

.product-curve-button {
  color: #fff;
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  box-shadow: 0 4px 10px rgba(21, 89, 183, 0.16);
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 7px;
}

.quote-config-inputs,
.quote-preview-panel {
  min-width: 0;
}

.quote-preview-panel {
  display: flex;
  flex-direction: column;
}

.quote-input-grid {
  grid-template-columns: 92px 150px;
  margin-bottom: 0;
}

.wide-field {
  grid-column: 1 / -1;
}

.config-note {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border: 1px solid #cfe4e6;
  border-radius: 8px;
  background: var(--teal-soft);
  color: #344054;
}

.quote-preview {
  min-height: 88px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ecf8f7;
  border-color: #bee3df;
}

.preview-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.metric {
  display: flex;
  min-height: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  justify-content: space-between;
  align-items: baseline;
}

.metric strong {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.metric.highlight {
  border-color: transparent;
  background: transparent;
}

.metric.highlight strong {
  color: var(--teal-dark);
  font-size: 20px;
}

.pricing-note {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--warning-bg);
}

.actions {
  margin-top: 8px;
  padding-top: 0;
  display: flex;
  justify-content: flex-end;
}

.actions button {
  min-width: 136px;
}

.lines-panel {
  gap: 8px;
}

.lines-head {
  display: grid;
  grid-template-columns: minmax(160px, auto) minmax(420px, 1fr) auto auto;
  align-items: end;
}

.quote-meta {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(260px, 420px);
  gap: 10px;
  align-items: end;
}

.quote-meta input {
  min-height: 32px;
  padding: 6px 9px;
}

.line-actions {
  display: flex;
  gap: 8px;
  align-items: end;
}

.line-actions button {
  min-height: 34px;
  white-space: nowrap;
}

.line-actions button:disabled {
  opacity: 0.72;
}

.line-actions button:not(:disabled) {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
}

.quote-line-list {
  flex: 1 1 220px;
  min-height: 220px;
  padding: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.quote-table-wrap {
  width: 100%;
  min-height: 100%;
  overflow: auto;
}

.quote-lines-table {
  width: 100%;
  min-width: 1010px;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
}

.quote-lines-table th,
.quote-lines-table td {
  height: 34px;
  padding: 4px 6px;
  border-right: 1px solid #d8e3ec;
  border-bottom: 1px solid #d8e3ec;
  vertical-align: middle;
  font-size: 12px;
  white-space: nowrap;
}

.quote-lines-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 28px;
  color: #183a62;
  background: #eaf2f9;
  font-weight: 900;
  text-align: left;
  box-shadow: 0 1px 0 #d8e3ec;
}

.quote-lines-table th:nth-child(1),
.quote-lines-table td:nth-child(1) {
  width: 46px;
  text-align: center;
}

.quote-lines-table th:nth-child(2),
.quote-lines-table td:nth-child(2) {
  width: 132px;
}

.quote-lines-table th:nth-child(3),
.quote-lines-table td:nth-child(3) {
  width: 160px;
}

.quote-lines-table th:nth-child(4),
.quote-lines-table th:nth-child(5),
.quote-lines-table th:nth-child(6),
.quote-lines-table td:nth-child(4),
.quote-lines-table td:nth-child(5),
.quote-lines-table td:nth-child(6) {
  width: 72px;
}

.quote-lines-table th:nth-child(7),
.quote-lines-table td:nth-child(7) {
  width: 60px;
}

.quote-lines-table th:nth-child(8),
.quote-lines-table th:nth-child(9),
.quote-lines-table td:nth-child(8),
.quote-lines-table td:nth-child(9) {
  width: 92px;
}

.quote-lines-table th:nth-child(10),
.quote-lines-table td:nth-child(10) {
  width: 210px;
}

.quote-lines-table th:nth-child(11),
.quote-lines-table td:nth-child(11) {
  width: 64px;
  text-align: center;
}

.quote-lines-table tr:hover td {
  background: #f7fbff;
}

.quote-lines-table strong {
  color: #0d2a52;
  font-weight: 900;
}

.numeric,
.money-cell {
  text-align: right;
}

.money-cell {
  color: #0d2a52;
  font-weight: 900;
}

.quote-note-cell {
  overflow: hidden;
  text-overflow: ellipsis;
}

.quote-note-cell {
  color: var(--muted);
}

.quote-footer {
  display: grid;
  grid-template-columns: minmax(440px, 1fr) minmax(420px, auto);
  gap: 8px;
  align-items: end;
  padding-top: 8px;
  background: var(--panel);
  border-top: 1px solid var(--line);
}

.quote-terms {
  min-width: 0;
  padding: 7px 10px 8px;
  background: #f6faff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.quote-terms .subsection-head {
  margin-bottom: 5px;
}

.quote-terms-grid {
  display: grid;
  grid-template-columns: 110px minmax(180px, 1fr) minmax(210px, 1.15fr) minmax(170px, 0.9fr);
  grid-template-areas: "valid delivery payment freight";
  gap: 8px;
  align-items: end;
}

.valid-days-field {
  grid-area: valid;
}

.delivery-term-field {
  grid-area: delivery;
}

.payment-term-field {
  grid-area: payment;
}

.freight-note-field {
  grid-area: freight;
}

.quote-terms input {
  min-height: 28px;
  padding: 4px 8px;
}

.quote-terms label {
  gap: 3px;
  font-size: 11px;
}

.inline-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.inline-input span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.remove-button {
  min-height: 24px;
  padding: 2px 7px;
  background: #fff;
  color: #c8322a;
  border-color: #ffc9c2;
  font-size: 12px;
}

.remove-button:hover {
  background: #fff1f0;
}

.totals {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  min-width: 0;
}

.tax-total-controls {
  display: grid !important;
  grid-template-columns: 64px 82px;
  gap: 7px;
  min-width: 158px !important;
}

.tax-total-controls .switch {
  min-height: 34px;
  padding: 0;
}

.tax-total-controls .tax-rate {
  width: 82px;
}

.tax-total-controls input {
  min-height: 30px;
}

.totals div {
  min-width: 102px;
  padding: 8px 10px;
  background: #f6faff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.totals div:last-child {
  background: var(--teal-soft);
  border-color: #b7ddd9;
  box-shadow: inset 0 -2px 0 rgba(15, 143, 140, 0.12);
}

.totals strong {
  color: #0b2447;
  font-size: 17px;
}

.totals div:last-child strong {
  color: var(--teal-dark);
  font-size: 18px;
}

.status-ok {
  color: var(--ok);
}

.status-warning {
  color: var(--warning);
}

.status-danger {
  color: var(--danger);
}

.curve-open {
  overflow: hidden;
}

.curve-modal[hidden] {
  display: none;
}

.curve-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}

.curve-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 29, 55, 0.46);
}

.curve-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1080px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
  background: #fbfdff;
  border: 1px solid #bfcddd;
  border-radius: 8px;
  box-shadow: 0 22px 56px rgba(10, 29, 55, 0.24);
}

.history-modal[hidden] {
  display: none;
}

.history-dialog {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.24);
  left: 50%;
  max-height: 82vh;
  overflow: hidden;
  position: fixed;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(920px, calc(100vw - 40px));
  z-index: 41;
}

.history-content {
  max-height: 62vh;
  overflow: auto;
  padding: 14px 16px 18px;
}

.history-table {
  border-collapse: collapse;
  font-size: 12px;
  width: 100%;
}

.history-table th,
.history-table td {
  border-bottom: 1px solid var(--border);
  padding: 8px;
  text-align: left;
}

.history-table th {
  background: var(--table-head);
  color: var(--text-muted);
  font-weight: 800;
}

.login-page {
  background: linear-gradient(180deg, #edf5f8 0%, #f7fafc 100%);
  min-height: 100vh;
}

.login-shell {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  padding: 30px;
  width: min(420px, 100%);
}

.login-card img {
  height: 42px;
  object-fit: contain;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.login-card h1 {
  color: var(--brand-blue);
  font-size: 24px;
  margin: 22px 0 6px;
}

.login-card p {
  color: var(--text-muted);
  margin: 0 0 22px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  color: var(--text-muted);
  display: grid;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
}

.login-form input {
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  height: 38px;
  padding: 0 10px;
}

.login-form button {
  background: var(--brand-blue);
  border: 0;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  height: 40px;
}

.login-message {
  color: #dc2626;
  min-height: 18px;
}

.curve-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: #f6faff;
  border-bottom: 1px solid #c9d8e7;
}

.curve-dialog-head h2 {
  color: #0b2447;
  font-size: 18px;
}

.curve-dialog-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.dimension-save-button {
  color: #fff;
  background: var(--brand-blue);
  border-color: var(--brand-blue);
}

.dimension-save-button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.dimension-save-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.curve-dialog-head p {
  color: var(--muted);
  font-size: 12px;
}

.curve-content {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding: 16px 18px 18px;
}

.dimension-preview {
  gap: 10px;
  min-height: 480px;
  display: grid;
}

.dimension-sheet-meta {
  display: grid;
  grid-template-columns:
    minmax(150px, 1.6fr)
    minmax(100px, 1fr)
    minmax(126px, 1.25fr)
    minmax(74px, 0.8fr)
    minmax(68px, 0.75fr)
    minmax(68px, 0.75fr)
    minmax(86px, 0.9fr)
    minmax(54px, 0.55fr)
    minmax(88px, 0.9fr)
    minmax(54px, 0.55fr);
  gap: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #cbd8e6;
  border-radius: 8px;
}

.dimension-meta-cell {
  display: grid;
  gap: 3px;
  min-height: 50px;
  padding: 8px 9px;
  border-right: 1px solid #d7e2ed;
}

.dimension-meta-cell:last-child {
  border-right: 0;
}

.dimension-meta-cell span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.dimension-meta-cell strong {
  color: #102033;
  font-size: 12px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.dimension-meta-cell.company strong {
  color: var(--brand-blue-dark);
}

.dimension-image-frame {
  display: grid;
  place-items: center;
  min-height: 480px;
  overflow: auto;
  padding: 14px;
  background: #f5f8fb;
  border: 1px solid #cbd8e6;
  border-radius: 8px;
}

.dimension-image-frame img {
  display: block;
  max-width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid #e1e7ee;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.curve-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 12px;
  align-items: start;
}

.curve-plot-stack {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.curve-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.curve-summary div {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.curve-summary span {
  color: var(--muted);
  font-size: 12px;
}

.curve-summary strong {
  overflow-wrap: anywhere;
}

.curve-chart-card,
.curve-mini-card,
.curve-aux-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: #fff;
  border: 1px solid #cfd8df;
  border-radius: 8px;
}

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

.curve-chart-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.curve-chart-head.compact-head {
  min-height: 0;
}

.curve-chart-shell {
  position: relative;
  min-width: 0;
}

.curve-live-readout {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px 9px;
  min-height: 30px;
  max-width: 520px;
  padding: 6px 8px;
  color: #344054;
  background: #f8fafb;
  border: 1px solid #d9e2ea;
  border-radius: 6px;
  font-size: 12px;
  text-align: right;
}

.curve-live-readout span {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}

.curve-live-readout b {
  color: #667085;
  font-weight: 700;
}

.mini-readout {
  max-width: none;
  min-height: 26px;
  padding: 4px 6px;
  justify-content: flex-start;
  text-align: left;
}

.curve-aux-card .curve-live-readout {
  max-width: 580px;
}

.curve-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  width: fit-content;
  padding: 3px;
  background: #eef3f7;
  border: 1px solid #d6e0e8;
  border-radius: 7px;
}

.curve-tab {
  min-height: 28px;
  padding: 5px 12px;
  color: #44515c;
  background: transparent;
  border-color: transparent;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.curve-tab.is-active {
  color: #fff;
  background: #005c66;
  border-color: #005c66;
  box-shadow: 0 2px 5px rgba(0, 92, 102, 0.18);
}

.curve-tab-panels {
  min-width: 0;
}

.curve-tab-panel[hidden] {
  display: none;
}

.curve-tab-panel {
  display: grid;
  gap: 8px;
}

.curve-mini-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: #344054;
}

.curve-mini-title h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}

.curve-mini-title span {
  color: var(--muted);
  font-size: 12px;
}

.curve-lower-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 0;
}

.curve-lower-title span {
  color: var(--muted);
  font-size: 12px;
}

.curve-mini-head {
  display: grid;
  gap: 7px;
}

.curve-svg {
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
}

.aux-curve {
  min-height: 138px;
}

.main-curve {
  min-height: 250px;
}

.chart-grid line {
  stroke: #dde4ea;
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.chart-axis line {
  stroke: #7b8792;
  stroke-width: 1.2;
  shape-rendering: crispEdges;
}

.chart-axis text {
  fill: #44515c;
  font-size: 11px;
}

.chart-axis .axis-title {
  fill: #17202a;
  font-size: 12px;
  font-weight: 700;
}

.chart-axis.head-axis line,
.chart-axis.head-axis text,
.chart-axis.head-axis .axis-title {
  fill: #16a34a;
  stroke: #16a34a;
}

.chart-axis.power-axis line,
.chart-axis.power-axis text,
.chart-axis.power-axis .axis-title {
  fill: #7c3aed;
  stroke: #7c3aed;
}

.chart-axis-right text {
  fill: #44515c;
}

.chart-axis-right.efficiency-axis text,
.chart-axis-right.efficiency-axis .axis-title {
  fill: #2563eb;
}

.chart-axis-right.efficiency-axis line {
  stroke: #2563eb;
}

.chart-axis-right.npsh-axis text,
.chart-axis-right.npsh-axis .axis-title {
  fill: #ec4899;
}

.chart-axis-right.npsh-axis line {
  stroke: #ec4899;
}

.qh-line,
.mini-line {
  fill: none;
  stroke: #16a34a;
  stroke-width: 2.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.mini-line {
  stroke-width: 2;
}

.mini-line.efficiency-curve {
  stroke: #2563eb;
}

.efficiency-line {
  fill: none;
  stroke: #2563eb;
  stroke-width: 2.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.mini-line.power-curve {
  stroke: #7c3aed;
}

.mini-line.npsh-curve {
  stroke: #ec4899;
}

.operating-point {
  fill: #dc2626;
  stroke: #fff;
  stroke-width: 2.2;
}

.power-point {
  fill: #dc2626;
}

.efficiency-point {
  fill: #dc2626;
  stroke: #fff;
  stroke-width: 2.1;
}

.npsh-point {
  fill: #dc2626;
  stroke: #fff;
  stroke-width: 2.1;
}

.bep-point {
  fill: #16a34a;
  stroke: #fff;
  stroke-width: 2.2;
}

.allowable-band {
  fill: rgba(185, 233, 242, 0.3);
}

.preferred-band {
  fill: rgba(185, 233, 242, 0.3);
}

.point-label {
  fill: #344054;
  font-size: 11px;
  font-weight: 800;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 3px;
  stroke-linejoin: round;
}

.bep-label {
  fill: #16a34a;
}

.curve-hover-capture {
  fill: transparent;
  cursor: crosshair;
  pointer-events: all;
}

.curve-hover-layer {
  pointer-events: none;
}

.curve-hover-layer.is-hidden {
  display: none;
}

.hover-line-x,
.hover-line-y {
  stroke: #dc2626;
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.hover-point {
  fill: #dc2626;
  stroke: #fff;
  stroke-width: 2;
}

.curve-hover-float {
  position: absolute;
  z-index: 2;
  min-width: 158px;
  padding: 8px 9px;
  color: #17202a;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #b9c7d2;
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
  font-size: 12px;
  pointer-events: none;
}

.curve-hover-float span {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  line-height: 1.55;
  white-space: nowrap;
}

.curve-hover-float b {
  color: #667085;
  font-weight: 700;
}

.curve-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  color: #344054;
  font-size: 12px;
}

.curve-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-line {
  width: 18px;
  height: 2px;
  background: #16a34a;
}

.legend-line.efficiency {
  background: #2563eb;
}

.legend-line.power {
  background: #7c3aed;
}

.legend-line.npsh {
  background: #ec4899;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-dot.operating {
  background: #dc2626;
}

.legend-dot.bep {
  background: #16a34a;
}

.legend-band {
  width: 18px;
  height: 10px;
  border-radius: 3px;
}

.legend-band.allowable {
  background: rgba(185, 233, 242, 0.5);
}

.legend-band.preferred {
  background: rgba(185, 233, 242, 0.7);
}

.curve-info-panel {
  position: sticky;
  top: 0;
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #f8fafb;
  border: 1px solid #cfd8df;
  border-radius: 8px;
}

.curve-info-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  background: #eef3f7;
  border: 1px solid #d6e0e8;
  border-radius: 7px;
}

.curve-info-tab {
  min-height: 30px;
  padding: 5px 6px;
  color: #44515c;
  background: transparent;
  border-color: transparent;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.curve-info-tab.is-active {
  color: #fff;
  background: #005c66;
  border-color: #005c66;
}

.curve-info-tab-panel[hidden] {
  display: none;
}

.curve-info-tab-panel {
  display: grid;
  gap: 8px;
}

.curve-info-panel h3 {
  margin-top: 0;
  color: #17202a;
  font-size: 15px;
}

.curve-info-panel p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.curve-info-list {
  display: grid;
  gap: 5px;
  margin: 0;
}

.curve-info-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e1e8ee;
}

.curve-info-list dt {
  color: var(--muted);
  font-size: 12px;
}

.curve-info-list dd {
  margin: 0;
  color: #17202a;
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.curve-info-readout {
  display: grid;
  gap: 6px;
  padding: 10px;
  background: #fff;
  border: 1px solid #d9e2ea;
  border-radius: 7px;
}

.curve-empty-panel {
  color: var(--muted);
  font-size: 12px;
}

.curve-info-readout [data-curve-side-readout] {
  display: grid;
  gap: 5px;
  min-height: 116px;
  color: var(--muted);
  font-size: 12px;
}

.curve-info-readout [data-curve-side-readout] span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.curve-info-readout [data-curve-side-readout] b {
  color: var(--muted);
}

.curve-info-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.admin-users-page {
  min-height: 100vh;
}

.admin-users-shell {
  min-height: calc(100vh - 66px);
  padding: 12px;
}

.admin-users-panel {
  display: grid;
  gap: 12px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.admin-message {
  min-height: 34px;
  padding: 8px 10px;
  color: var(--muted);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}

.admin-message:empty {
  display: none;
}

.admin-message.is-success {
  color: var(--ok);
  background: var(--teal-soft);
  border-color: #b7e1dd;
}

.admin-message.is-error {
  color: var(--danger);
  background: #fff1f0;
  border-color: #ffd0cc;
}

.admin-message.is-info {
  color: #24558d;
  background: var(--brand-blue-soft);
  border-color: #c7dcfb;
}

.admin-create-form {
  display: grid;
  grid-template-columns: 1fr 1fr 130px 130px 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.segmented-control {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: #eef3f7;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.segmented-control button {
  min-height: 28px;
  padding: 4px 10px;
  color: #344054;
  background: transparent;
  border-color: transparent;
  border-radius: 5px;
}

.segmented-control button.is-active {
  color: #fff;
  background: var(--brand-blue);
  border-color: var(--brand-blue);
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 6px;
  align-items: center;
}

.password-toggle {
  min-height: 34px;
  padding: 6px 8px;
}

.admin-table-wrap {
  overflow: auto;
  min-height: 260px;
  max-height: calc(100vh - 280px);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-users-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 13px;
}

.admin-users-table th,
.admin-users-table td {
  padding: 8px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.admin-users-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #24405f;
  background: #eaf2f7;
  font-size: 12px;
  font-weight: 800;
}

.admin-users-table td strong {
  color: var(--brand-blue);
}

.admin-users-table input,
.admin-users-table select {
  min-height: 30px;
  padding: 5px 8px;
}

.user-self-badge,
.user-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.user-self-badge {
  color: #24558d;
  background: var(--brand-blue-soft);
}

.user-status {
  margin-left: 0;
}

.user-status.is-active {
  color: var(--ok);
  background: var(--teal-soft);
}

.user-status.is-disabled {
  color: #7a4750;
  background: #f4e7e9;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.row-actions button {
  min-height: 30px;
  padding: 5px 8px;
  white-space: nowrap;
}

.danger-lite {
  color: var(--danger);
  border-color: #ffbdb7;
}

.danger-lite:hover:not(:disabled) {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.history-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.history-toolbar .is-active {
  color: #fff;
  background: var(--brand-blue);
  border-color: var(--brand-blue);
}

.admin-modal[hidden] {
  display: none;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
}

.admin-modal-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  width: min(520px, calc(100vw - 32px));
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(15, 33, 55, 0.22);
}

.reset-password-form {
  display: grid;
  gap: 12px;
}

@media (max-width: 820px) {
  .topbar,
  .topbar-form {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .workspace {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .left-column {
    grid-template-rows: auto;
  }

  .main-column,
  .quote-config-board {
    grid-template-columns: 1fr;
  }

  .curve-summary,
  .curve-workbench {
    grid-template-columns: 1fr;
  }

  .curve-info-panel {
    position: static;
  }

  .admin-create-form {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    padding: 12px;
  }

  .topbar-form,
  .selection-form,
  .config-grid,
  .summary-grid,
  .preview-grid {
    grid-template-columns: 1fr;
  }

  .admin-create-form {
    grid-template-columns: 1fr;
  }
}
