:root {
  color-scheme: light;
  font: 100%/1.5 "Segoe UI", system-ui, sans-serif;
  color: #172c42;
  background: #f0f3f7;
  --muted: #435b72;
  --border: #d7e1eb;
  --accent: #134678;
  --brand-gold: #af9777;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body { margin: 0; }
.container { width: min(100% - 2rem, 76rem); margin-inline: auto; }
.page-header { background: #102e4c; color: white; padding: 2rem 0 2.25rem; }
h1, h2, p, dl, dd { margin: 0; }
h1 { font-size: clamp(1.65rem, 4vw, 2.5rem); line-height: 1.15; }
.page-header p { margin-top: .65rem; color: #e4edf7; }
.layout {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  align-items: start;
  gap: 1.25rem;
  padding-block: 1.5rem;
}
.panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: clamp(1rem, 2.5vw, 1.75rem);
}
h2 { font-size: 1.2rem; margin-bottom: .8rem; }
form section { border-top: 1px solid var(--border); margin-top: 1.25rem; padding-top: 1rem; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.dimensions { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: .75rem; }
label { display: grid; align-content: end; gap: .3rem; font-size: .875rem; font-weight: 600; }
input, select, button { font: inherit; }
input, select {
  width: 100%;
  min-width: 0;
  min-height: 2.65rem;
  padding: .4rem .55rem;
  border: 1px solid #9db1c5;
  border-radius: .4rem;
  background-color: white;
  color: inherit;
}
input[aria-invalid="true"] { border-color: #a33921; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
fieldset { border: 0; padding: 0; margin: 0 0 .65rem; min-width: 0; }
fieldset:last-child { margin-bottom: 0; }
legend { padding: 0; margin-bottom: .25rem; color: var(--muted); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.25rem; }
button {
  cursor: pointer;
  color: var(--accent);
  background: white;
  border: 1px solid var(--accent);
  border-radius: .45rem;
  padding: .55rem .85rem;
  font-weight: 650;
}
.primary { color: white; background: var(--accent); }
button:disabled { cursor: default; opacity: .55; }
.order { color: var(--muted); overflow-wrap: anywhere; }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin: 1rem 0; }
.metrics div { background: #edf3fa; border-radius: .55rem; padding: .75rem; }
.metrics dt { color: var(--muted); font-size: .875rem; }
dd { font-weight: 700; overflow-wrap: anywhere; }
.metrics dd { font-size: 1.15rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th, td { padding: .55rem .35rem; text-align: right; border-bottom: 1px solid var(--border); }
th { color: var(--muted); }
th:first-child { text-align: left; }
td { font-variant-numeric: tabular-nums; }
.totals { margin-top: 1rem; }
.totals div { display: flex; justify-content: space-between; gap: .75rem; padding: .45rem 0; }
.totals dd { min-width: 0; text-align: right; }
.totals .grand-total { margin-top: .6rem; padding: .85rem; background: #102e4c; color: white; border-radius: .55rem; font-weight: 700; }
#message { color: #842e19; background: #fff1ec; padding: .75rem; border-radius: .45rem; }

@media (max-width: 54rem) {
  .layout { grid-template-columns: minmax(0, 1fr); }
}

@media print {
  :root, .page-header, .panel, .metrics div, .totals .grand-total { background: white; color: black; }
  .container { width: 100%; }
  .page-header { padding: 0 0 .5rem; }
  .page-header p, .actions { display: none; }
  .layout { display: block; padding: 0; }
  .panel { padding: .6rem 0; border: 0; }
  form section { margin-top: .45rem; padding-top: .35rem; }
  h2, fieldset { margin-bottom: .3rem; }
  input, select { appearance: none; min-height: 0; padding: 0; border: 0; }
  .metrics, tr, .totals div, fieldset { break-inside: avoid; }
  thead { display: table-header-group; }
  .table-wrap { overflow: visible; }
}
.workshop { padding-block: 1rem 2rem; }
.workshop-nav { margin: 0 0 1rem; align-items: center; }
.workshop-nav a { color: var(--accent); }
.workshop .layout { padding-top: 0; }
.workshop #login { max-width: 36rem; margin-inline: auto; }
.workshop .actions + .hint, .hint { margin-block: .55rem; color: var(--muted); }
.spaced { margin-top: 1.5rem; }
.record { padding: .85rem 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.record .actions { margin-top: .5rem; }
.warning { color: #842e19; background: #fff1ec; border-radius: .4rem; padding: .45rem .65rem; margin-block: .35rem; }
#notice:not(:empty) { margin-bottom: 1rem; padding: .6rem .8rem; border: 1px solid var(--border); background: white; border-radius: .4rem; }
#quote-preview p, .record p { margin-block: .25rem; }
.record summary { cursor: pointer; color: var(--accent); }
.inventory-section { margin-top: 1rem; }
.inventory-heading, .paper-card-heading, .history-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .65rem;
}
.inventory-heading { flex-wrap: wrap; align-items: center; }
.inventory-heading h2, .inventory-heading .actions { margin: 0; }
.inventory-metrics { grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); margin-bottom: 0; }
.inventory-filters { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)); gap: .75rem; }
#paper-list, #quote-list, #job-list { min-width: 0; }
.paper-card {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: .65rem;
  overflow-wrap: anywhere;
}
.paper-card h3 { margin: 0; font-size: 1rem; }
.inventory-secondary { color: var(--muted); font-size: .875rem; }
.paper-balance { border-top: 1px solid var(--border); padding-top: .65rem; }
.paper-balance strong { font-size: 1.4rem; }
.stock-badge { flex-shrink: 0; background: #edf3fa; color: #164b7e; border-radius: 1rem; padding: .2rem .55rem; font-size: .875rem; font-weight: 600; }
.stock-low { color: #842e19; background: #fff1ec; }
.paper-actions { margin-top: auto; padding-top: .35rem; }
.paper-tests summary, #history-panel summary { cursor: pointer; color: var(--accent); }
.paper-tests { font-size: .875rem; }
#history-panel summary { font-weight: 700; }
#stock-history { margin-top: .75rem; }
.history-row strong:last-child { text-align: right; }
.brand { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.4rem; }
.brand-logo {
  display: block;
  width: min(100%, 16rem);
  height: auto;
  padding: .55rem .65rem;
  border: 1px solid var(--brand-gold);
  border-radius: .55rem;
  background: #fff;
}
.panel { box-shadow: 0 2px 8px #102e4c10; }
button:not(:disabled):hover { background: #eaf1f9; }
button.primary:not(:disabled):hover { background: #0d335b; }
.workshop-nav {
  padding: .5rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: .75rem;
}
.workshop-nav button:not(.primary) { border-color: transparent; }
.workshop-nav #logout { margin-left: auto; }
.workshop-nav a { padding: .45rem .55rem; }
.workshop #login { margin-top: clamp(.75rem, 5vw, 4rem); }
#login .fields { grid-template-columns: minmax(0, 1fr); }
#login button { width: 100%; }
#quotations { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.quote-sidebar { display: grid; min-width: 0; gap: 1rem; }
.quote-preview-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .55rem; margin-bottom: .75rem; }
.quote-preview-heading h2 { margin: 0; }
.quote-preview-heading button { padding: .35rem .6rem; font-size: .875rem; }
@media screen and (min-width: 52rem) {
  .quote-sidebar { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
}
.quote-form-heading { margin-bottom: 1rem; }
.quote-form-heading h2 { margin-bottom: .3rem; }
.quote-sidebar > section:first-child { border-top: 3px solid var(--accent); }
#quote-form .fields + .fields { margin-top: .75rem; }
#quote-layers fieldset { padding: .55rem .65rem .7rem; border: 1px solid var(--border); border-radius: .5rem; }
#quote-layers legend { padding-inline: .25rem; }
#quote-form details, .quote-breakdown { background: #f3f6fb; padding: .65rem .8rem; border-radius: .5rem; }
#quote-form details .fields { margin-top: .6rem; }
#quote-form summary, .quote-breakdown summary { cursor: pointer; color: var(--accent); font-weight: 650; }
.quote-actions { border-top: 1px solid var(--border); padding-top: 1rem; }
.quote-metrics { margin-top: 0; }
#quote-preview h3 { font-size: 1rem; margin: .85rem 0 .4rem; }
.quote-breakdown { margin-top: .8rem; }
.workflow-heading { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .4rem; }
.workflow-heading h3 { margin: 0; font-size: 1rem; }
.workflow-card { border: 1px solid var(--border); border-radius: .65rem; padding: .85rem; margin-top: .75rem; }
.workflow-status { padding: .15rem .55rem; border-radius: 2rem; background: #eef2f5; color: #35495b; font-size: .875rem; font-weight: 650; }
.workflow-approved { background: #e7f0fb; color: #174777; }
.workflow-price { display: block; font-size: 1.15rem; margin-block: .3rem; }
.saved-quote-filters {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: .75rem;
  margin-top: 1rem;
  max-width: 40rem;
}
.saved-quote-card {
  margin-top: .75rem;
  padding: clamp(.8rem, 2vw, 1.2rem);
  border: 1px solid var(--border);
  border-radius: .75rem;
  overflow-wrap: anywhere;
}
.saved-quote-header { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem 1.25rem; flex-wrap: wrap; }
.saved-quote-header h3 { margin: .2rem 0; font-size: 1.15rem; }
.saved-quote-amount { display: grid; justify-items: end; gap: .3rem; margin-left: auto; }
.saved-quote-amount strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.saved-quote-card > .warning { margin-top: .75rem; }
.saved-quote-detail { margin-top: .85rem; padding: .65rem .75rem; background: #f3f6fb; border-radius: .45rem; }
.saved-quote-detail summary { cursor: pointer; color: var(--accent); font-weight: 650; }
.saved-quote-detail[open] > p { margin-block: .45rem; }
.saved-quote-card .actions { margin-top: .75rem; }
.calculation-section {
  margin-top: .8rem;
  padding: .85rem;
  border: 1px solid var(--border);
  border-radius: .5rem;
  background: white;
  overflow-wrap: anywhere;
}
.calculation-section > h3 { margin: 0 0 .5rem; font-size: 1rem; }
#quote-preview .calculation-section > h3 { margin-top: 0; }
.calculation-section > p + p { margin-top: .35rem; }
.calculation-table table { min-width: 33rem; }
.calculation-table thead { background: #edf3fa; }
.calculation-table tbody th { color: inherit; }
.calculation-table td { white-space: nowrap; }
.formula-table { margin-block: .65rem .25rem; table-layout: fixed; }
.formula-table thead { background: #edf3fa; }
.formula-table th, .formula-table td { padding: .55rem .65rem; text-align: left; vertical-align: top; }
.formula-table th:first-child { width: 32%; }
.formula-table tbody th { color: inherit; font-weight: 650; }
.formula-table tbody tr:nth-child(even) { background: #f7f9fc; }
.job-card .calculation-section > .dimension-metrics { max-width: none; margin-bottom: .65rem; }
.calculation-grade { display: block; font-weight: 400; color: var(--muted); }
.calculation-section .calculation-result {
  padding: .5rem .65rem;
  margin-block: .6rem;
  background: #edf3fa;
  border-radius: .35rem;
  font-weight: 650;
}
.calculation-formulas { margin-top: .65rem; }
.calculation-formulas > summary { color: var(--accent); cursor: pointer; }
.calculation-formulas > p { margin-top: .45rem; }
.calculation-section h4 { margin: .8rem 0 .45rem; font-size: .9rem; }
.dimension-metrics {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr));
  margin: 0;
  gap: .45rem;
}
.dimension-metrics div { padding: .55rem .65rem; }
.dimension-metrics dd { font-size: 1rem; }
.dimension-input .dimension-axis-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 34rem) {
  .dimension-input .dimension-axis-fields { grid-template-columns: minmax(0, 1fr); }
}
.calculation-section ul { padding-inline-start: 1.25rem; }
.calculation-section li + li { margin-top: .4rem; }
@media (max-width: 36rem) {
  .saved-quote-filters { grid-template-columns: minmax(0, 1fr); }
  .saved-quote-amount { margin-left: 0; justify-items: start; }
}
.workflow-card details { margin-block: .5rem; }
.workflow-metrics { grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); }
.workflow-metrics .job-blocked-metric { background: #fff1ec; }
.admin-table-wrap { border: 1px solid var(--border); border-radius: .65rem; }
.admin-table { min-width: 52rem; }
.admin-table > thead { background: #edf3fa; }
.admin-table > thead th, .admin-table > tbody > tr > :is(th, td) {
  padding: .7rem .65rem;
  text-align: left;
  vertical-align: top;
}
.admin-table > thead th { white-space: nowrap; }
.admin-table > tbody:nth-of-type(even) > tr:first-child { background: #f8fafd; }
.admin-table > tbody > tr:first-child > th { color: inherit; }
.admin-table > tbody:last-child > tr:last-child > :is(th, td) { border-bottom: 0; }
.admin-table .workflow-status { display: inline-block; white-space: nowrap; }
.admin-table .inventory-secondary { margin-top: .2rem; }
.admin-actions-trigger {
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
}
.admin-actions-menu {
  position: fixed;
  inset: auto;
  width: min(12rem, calc(100vw - 1rem));
  margin: 0;
  padding: .25rem;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: .5rem;
  background: white;
  color: inherit;
  box-shadow: 0 .55rem 1.5rem #102a452b;
}
.admin-actions-menu:popover-open { display: grid; gap: .15rem; }
.admin-actions-menu button {
  width: 100%;
  padding: .42rem .55rem;
  text-align: left;
  font-size: .875rem;
  border-color: transparent;
  overflow-wrap: anywhere;
}
.admin-actions-menu button.primary { background: white; color: var(--accent); }
.admin-actions-menu button.primary:hover:not(:disabled) { background: #eaf1f9; }
.admin-stock-warning { color: #842e19; font-weight: 650; }
.admin-detail-row { background: #f3f6fb; }
.admin-detail-row > td > div > .calculation-section:first-child { margin-top: 0; }
.admin-detail-row .description { max-width: 100%; }
.admin-data-table { min-width: 0; }
.admin-table-toolbar, .admin-table-footer, .admin-pager, .admin-column-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .75rem;
}
.admin-table-toolbar { align-items: end; justify-content: flex-start; margin-top: .55rem; }
.admin-table-toolbar button, .admin-pager button { padding: .38rem .6rem; font-size: .875rem; }
.admin-table-toolbar :is(input, select) { min-height: 2.2rem; }
.admin-table-footer { justify-content: space-between; margin-top: .65rem; }
.admin-pager { justify-content: flex-end; font-size: .875rem; }
.admin-column-controls { flex-wrap: nowrap; gap: .28rem; }
.admin-column-controls button { line-height: 1.3; padding: .18rem .22rem; font-size: inherit; }
.admin-column-controls .admin-column-sort {
  border-color: transparent;
  background: transparent;
  color: inherit;
  text-align: left;
  white-space: nowrap;
}
.admin-column-controls .admin-column-filter { border: 0; background: transparent; padding-inline: .4rem; }
.admin-actions-trigger:hover:not(:disabled),
.admin-column-controls .admin-column-filter:hover:not(:disabled) { background: #dfeaf6; }
.admin-column-controls .admin-column-filter[aria-pressed="true"] { color: var(--accent); background: #f0e6d6; }
.admin-empty { color: var(--muted); }
.column-filter-dialog {
  width: min(calc(100% - 1.5rem), 29rem);
  max-height: calc(100% - 1.5rem);
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: .75rem;
  color: inherit;
}
.column-filter-dialog::backdrop { background: #102a45b3; }
.column-filter-values { max-height: min(35vh, 15rem); overflow-y: auto; border: 1px solid var(--border); border-radius: .4rem; }
.column-filter-option { display: flex; gap: .55rem; align-items: center; padding: .4rem .55rem; overflow-wrap: anywhere; }
.column-filter-option input { min-height: 0; width: 1rem; height: 1rem; flex: 0 0 1rem; }
.column-filter-dialog .actions { justify-content: flex-end; }
.pricing-defaults { max-width: 46rem; }
.quote-charge-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(5rem, 8rem); align-items: center; gap: .65rem; padding: .45rem 0; }
.quote-charge-row + .quote-charge-row { border-top: 1px solid var(--border); }
.quote-charge-toggle { display: flex; align-items: center; gap: .55rem; overflow-wrap: anywhere; }
.quote-charge-toggle input { width: 1.05rem; height: 1.05rem; min-height: 0; flex: 0 0 auto; accent-color: var(--accent); }
.quote-charge-row input:disabled { background: #f2f5f9; color: var(--muted); }
.pricing-items-heading, .pricing-item-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 6rem;
  gap: .7rem;
  align-items: end;
}
.pricing-items-heading { padding: .55rem .7rem; background: #edf3fa; font-size: .875rem; font-weight: 650; }
.pricing-item-row { padding: .55rem .7rem; border-bottom: 1px solid var(--border); }
.pricing-item-row > button { min-height: 2.65rem; padding-inline: .45rem; }
.paper-pricing-section { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.paper-rate-fields { border: 1px solid var(--border); border-radius: .55rem; }
.paper-rate-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(5.5rem, 9rem); gap: .7rem; align-items: center; padding: .5rem .75rem; }
.paper-rate-row + .paper-rate-row { border-top: 1px solid var(--border); }
.paper-rate-row:nth-child(even) { background: #f7f9fc; }
.paper-rate-row > div { overflow-wrap: anywhere; }
@media (max-width: 34rem) {
  .pricing-items-heading { display: none; }
  .pricing-item-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pricing-item-row > label:first-child { grid-column: 1 / -1; }
}
.job-card { min-width: 0; padding: clamp(.85rem, 2vw, 1.2rem); border: 1px solid var(--border); border-radius: .75rem; overflow-wrap: anywhere; }
.job-card .dimension-metrics { margin-top: .65rem; max-width: 32rem; }
.job-shortages { margin-top: .75rem; }
.job-shortage-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; margin-top: .45rem; }
.job-shortage-row button { padding: .3rem .65rem; }
.job-card > details { margin-top: .75rem; }
.job-card > details > summary { cursor: pointer; color: var(--accent); font-weight: 650; }
.job-card .actions { align-items: center; justify-content: space-between; margin-top: .75rem; }
.calculator-workspace .table-wrap table { min-width: 37rem; }
.calculator-workspace .table-wrap td { white-space: nowrap; }
.calc-estimate-metrics > div:last-child { background: #f2eadc; }
#calc-price-message:empty { display: none; }
.calc-profit-table { margin-top: 0; font-variant-numeric: tabular-nums; }
.calc-profit-table :is(th, td):not(:first-child) { text-align: right; }
.calc-profit-table tbody tr:last-child { background: #eaf2fb; }
.calc-profit-table tbody tr:last-child td { font-weight: 650; color: #164b7e; }
.calc-profit-table tbody tr:last-child td.calc-loss { color: #842e19; background: #fff1ec; }
.calc-margin { margin-top: .5rem; display: flex; gap: .45rem; align-items: baseline; }
.calculator-workspace .metrics dd { font-size: clamp(1rem, 2vw, 1.35rem); }
#quote-dialog, #job-card-dialog {
  width: min(calc(100% - 1.25rem), 50rem);
  max-height: calc(100% - 1.25rem);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: .9rem;
  color: inherit;
  background: white;
  box-shadow: 0 1rem 4rem #102c3855;
}
#quote-dialog::backdrop, #job-card-dialog::backdrop { background: #102a45b3; }
#job-card-dialog { width: min(calc(100% - 1.25rem), 64rem); }
#reject-quote-dialog, #customer-dialog, #split-job-dialog {
  width: min(calc(100% - 2rem), 30rem);
  border: 1px solid var(--border);
  border-radius: .75rem;
  padding: 1.2rem;
  color: inherit;
}
#customer-dialog { width: min(calc(100% - 2rem), 42rem); max-height: calc(100% - 2rem); }
.workshop-form-dialog {
  width: min(calc(100% - 2rem), 44rem);
  max-height: calc(100% - 2rem);
  padding: 1.2rem;
  border: 1px solid var(--border);
  border-radius: .75rem;
  color: inherit;
}
.workshop-form-dialog::backdrop { background: #102a45b3; }
.workshop-form-dialog textarea { width: 100%; padding: .5rem; font: inherit; border: 1px solid #9db1c5; border-radius: .4rem; }
.workshop-form-dialog .actions { justify-content: flex-end; }
.purchase-line { margin: .8rem 0; padding: .55rem .75rem .75rem; border: 1px solid var(--border); border-radius: .5rem; }
.purchase-line > button { margin-top: .55rem; }
#reject-quote-dialog::backdrop, #customer-dialog::backdrop, #split-job-dialog::backdrop { background: #102a45b3; }
#reject-quote-dialog textarea, #customer-dialog textarea {
  width: 100%;
  padding: .5rem .65rem;
  border: 1px solid #9db1c5;
  border-radius: .4rem;
  font: inherit;
  resize: vertical;
}
#reject-quote-dialog .actions, #customer-dialog .actions, #split-job-dialog .actions { justify-content: flex-end; }
#order-list .admin-detail-row .admin-table { min-width: 34rem; }
.customer-address { grid-column: 1 / -1; }
.quote-customer-field { display: grid; gap: .35rem; align-content: end; }
.quote-customer-field > button { justify-self: start; padding: .25rem .5rem; font-size: .875rem; }
.quote-billing-address { white-space: pre-line; }
#reject-quote-dialog .danger { background: #92361f; color: white; border-color: #92361f; }
#reject-quote-dialog .danger:hover:not(:disabled) { background: #752b19; }
.job-print-sheet { padding: clamp(.8rem, 3vw, 1.5rem); color: #172c42; }
.job-print-heading { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem 1rem; margin-bottom: .65rem; }
.job-print-heading h2 { margin: 0; font-size: clamp(1.05rem, 3.5vw, 1.55rem); }
.print-brand-logo { display: block; width: min(100%, 12.5rem); height: auto; }
.job-print-section { margin-bottom: .85rem; }
.job-print-section h3 { margin: 0; padding: .35rem .5rem; background: #edf3fa; border: 1px solid #778ba2; font-size: 1rem; }
.job-print-table { width: 100%; margin-top: .35rem; table-layout: fixed; font-size: .8rem; }
.job-print-table th, .job-print-table td {
  border: 1px solid #778ba2;
  padding: .25rem .35rem;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  height: 1.65rem;
}
.job-print-table th { background: #f3f6fa; color: inherit; }
.job-print-table:has(th:nth-child(8)) th:first-child { width: 5%; }
.job-print-table:has(th:nth-child(8)) th:nth-child(3) { width: 23%; }
.quote-preview-toolbar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .65rem clamp(.8rem, 3vw, 1.5rem);
  background: #edf2f8;
  border-bottom: 1px solid var(--border);
}
.customer-quote { padding: clamp(1rem, 5vw, 2.75rem); overflow-wrap: anywhere; }
.customer-quote-header { border-bottom: 3px solid var(--brand-gold); padding-bottom: 1rem; }
.customer-quote-header .print-brand-logo { margin-bottom: .85rem; }
.customer-quote-header h2 { margin: 0; font-size: clamp(1.75rem, 6vw, 2.65rem); line-height: 1.15; }
.customer-quote-header p, .customer-quote-label, .customer-quote-table tbody p { color: var(--muted); }
.customer-quote-header p { margin-top: .4rem; }
.customer-quote-recipient { margin-block: 1.3rem; }
.customer-quote-recipient strong { font-size: 1.2rem; }
.customer-quote-table { min-width: 27rem; }
.customer-quote-table th { background: #edf3fa; }
.customer-quote-table td:first-child { text-align: left; width: 48%; }
.customer-quote-table td { vertical-align: top; }
.customer-quote-table th, .customer-quote-table td { padding: .75rem; }
.customer-quote-table td:not(:first-child) { white-space: nowrap; }
.customer-quote-total {
  margin: 1.25rem 0 0 auto;
  width: min(100%, 22rem);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: .4rem .75rem;
  padding: .85rem 1rem;
  border-radius: .55rem;
  background: #edf3fa;
}
.customer-quote-total strong { font-size: 1.35rem; }
@media (max-width: 51.99rem) {
  #quotations { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 54rem) {
  .workshop-nav #logout { margin-left: 0; }
}
@media (max-width: 42rem) {
  .inventory-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inventory-filters label:first-child { grid-column: 1 / -1; }
}
@media (max-width: 34rem) {
  .workshop .fields { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  .panel { box-shadow: none; }
  .calculator-workspace .table-wrap table { min-width: 0; }
  body:has(#quote-dialog[open], #job-card-dialog[open]) .page-header,
  body:has(#quote-dialog[open], #job-card-dialog[open]) #app,
  body:has(#quote-dialog[open], #job-card-dialog[open]) #notice,
  .quote-preview-toolbar, #quote-dialog::backdrop, #job-card-dialog::backdrop { display: none; }
  #quote-dialog[open], #job-card-dialog[open] {
    position: static;
    margin: 0;
    width: 100%;
    max-width: none;
    max-height: none;
    overflow: visible;
    border: 0;
    box-shadow: none;
  }
  .customer-quote, .job-print-sheet { padding: 0; }
  .job-print-heading h2 { font-size: 15pt; }
  .job-print-heading { margin-bottom: .3rem; break-after: avoid; }
  .print-brand-logo { width: 10rem; }
  .job-print-section h3 { font-size: 11pt; break-after: avoid; }
  .job-print-table { font-size: 9pt; }
  .job-print-table th, .job-print-table td { color: black; border-color: #333; height: 1.35rem; padding: .16rem .26rem; }
  .customer-quote-table { min-width: 0; }
  .customer-quote-total { break-inside: avoid; border: 1px solid var(--border); }
}

.workshop-page {
  --accent: #134678;
  --border: #dce5ee;
  --muted: #465d75;
  background: #f2f5f9;
  color: #172c42;
  min-height: 100vh;
}
.workshop-page .page-header { background: #102a45; }
.workshop-page:has(#app:not([hidden])) > .page-header { display: none; }
.workshop-page .workshop { width: 100%; padding: 0; }
.workshop-page #login {
  width: min(calc(100% - 2rem), 27rem);
  margin: clamp(2rem, 8vh, 6rem) auto;
  padding: clamp(1.25rem, 5vw, 2.5rem);
}
.workshop-page #login h2 { font-size: clamp(1.4rem, 3vw, 1.85rem); }
.workshop-page #login .fields { margin-top: 1.25rem; }
.workshop-page #notice:not(:empty) {
  position: fixed;
  z-index: 5;
  top: 1rem;
  right: 1rem;
  width: min(calc(100% - 2rem), 28rem);
  padding: .8rem 1rem;
  border-left: .28rem solid var(--accent);
  box-shadow: 0 .4rem 1.4rem #102a451f;
}
.workshop-page #app { display: grid; grid-template-columns: 15rem minmax(0, 1fr); align-items: start; }
.workshop-page .workshop-nav {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: .3rem;
  min-height: 100vh;
  max-height: 100vh;
  overflow: auto;
  margin: 0;
  padding: 1.1rem .8rem;
  border: 0;
  border-radius: 0;
  background: #102a45;
  color: #f2f7fc;
}
.workshop-nav-brand { display: grid; justify-items: start; gap: .6rem; padding: .45rem .45rem 1.2rem; line-height: 1.25; }
.workshop-nav-brand .brand-logo { width: min(100%, 13rem); }
.workshop-nav-brand strong { font-size: .9rem; }
.workshop-page .workshop-nav button, .workshop-page .workshop-nav a {
  display: block;
  width: 100%;
  padding: .61rem .7rem;
  border: 1px solid transparent;
  border-radius: .48rem;
  background: transparent;
  color: inherit;
  font-size: .91rem;
  text-align: left;
}
.workshop-page .workshop-nav button:hover, .workshop-page .workshop-nav a:hover { background: #203e5c; }
.workshop-page .workshop-nav button[aria-pressed="true"] {
  border-color: var(--brand-gold);
  background: #f0e6d6;
  color: #102a45;
}
.workshop-page .workshop-nav :focus-visible { outline-color: #dac5a7; }
.workshop-nav-footer { margin-top: auto; padding-top: .65rem; border-top: 1px solid #4a6078; }
.workshop-page .workshop-nav #logout { margin: 0; }
.workspace-content { min-width: 0; padding: clamp(.85rem, 2.6vw, 2.5rem); }
.workspace-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: 1.3rem; }
.workspace-header h1 { font-size: clamp(1.65rem, 4vw, 2.25rem); }
.workspace-header h1:focus { outline: none; }
.overview-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.overview-metrics .overview-tile {
  padding: 1rem;
  min-width: 0;
  text-align: left;
  border-color: var(--border);
  border-radius: .75rem;
  color: var(--muted);
}
.overview-tile span { display: block; }
.overview-tile strong { display: block; color: #134678; font-size: clamp(1.5rem, 4vw, 2.1rem); line-height: 1.2; margin-top: .35rem; }
.overview-tile:last-child strong { color: #842e19; }
.financial-panel { margin-top: 1rem; }
.financial-panel .inventory-heading label { min-width: min(100%, 9rem); }
.financial-metrics { grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); }
.financial-metrics dd { margin-top: .2rem; font-variant-numeric: tabular-nums; font-size: clamp(1.05rem, 2vw, 1.4rem); }
.financial-metrics dd > span { display: block; font-weight: 400; }
.financial-status { display: flex; flex-wrap: wrap; gap: .55rem 1.5rem; border-top: 1px solid var(--border); padding-top: .7rem; }
.financial-status div { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem; }
.financial-panel > .hint { margin-bottom: 0; }
.overview-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.overview-panel { min-width: 0; }
.overview-row { display: flex; justify-content: space-between; align-items: flex-start; gap: .55rem; padding: .8rem 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.overview-row button { flex-shrink: 0; padding: .35rem .6rem; font-size: .875rem; }
.help-manual { max-width: 62rem; }
.help-search { max-width: 32rem; margin-top: 1rem; }
.help-topic { margin-top: .65rem; border: 1px solid var(--border); border-radius: .55rem; background: white; }
.help-topic > summary { padding: .75rem .85rem; cursor: pointer; font-weight: 650; color: var(--accent); }
.help-topic[open] > summary { background: #edf3fa; border-bottom: 1px solid var(--border); border-radius: .55rem .55rem 0 0; }
.help-topic-content { padding: .8rem .95rem; }
.help-topic-content :is(h3, p, ol, ul, dl) { margin: 0 0 .65rem; }
.help-topic-content > :last-child { margin-bottom: 0; }
.help-topic-content h3 { font-size: 1rem; }
.help-topic-content :is(ol, ul) { padding-left: 1.3rem; }
.help-topic-content li + li { margin-top: .35rem; }
.help-troubleshooting > div + div { margin-top: .65rem; }
.help-troubleshooting dt { font-weight: 650; }
.help-troubleshooting dd { font-weight: 400; margin-top: .15rem; }
.workspace-content .panel { border-radius: .75rem; }
.workspace-content .admin-table-wrap { margin-top: .65rem; }
.workspace-content .admin-table > thead { background: #e7eff8; }
.workspace-content .admin-table > tbody > tr:first-child:hover { background: #edf4fa; }
.workspace-content #quote-form section { margin-top: 1.05rem; }
.workspace-content #quote-form h2 { font-size: 1.12rem; }
.workspace-content :is(button, input, select) { scroll-margin-top: 1rem; }
@media (max-width: 64rem) {
  .workshop-page #app { grid-template-columns: 12rem minmax(0, 1fr); }
  .overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 48rem) {
  .workshop-page #app { display: block; }
  .workshop-page .workshop-nav { position: static; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); min-height: 0; max-height: none; }
  .workshop-nav-brand, .workshop-nav-footer { grid-column: 1 / -1; }
  .workshop-nav-brand { padding-bottom: .45rem; }
  .workshop-nav-footer { display: flex; }
  .workshop-page .workshop-nav-footer :is(a, button) { width: auto; }
  .overview-columns { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 25rem) {
  .workshop-page .workshop-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-row { flex-wrap: wrap; }
}
@media print {
  .workshop-page { background: white; }
  .workshop-page #app .workshop-nav { display: none; }
  .workshop-page:has(#paper-calculator:not([hidden])) #app { display: block; }
  .workshop-page:has(#paper-calculator:not([hidden])) .workspace-content { padding: 0; }
  .workshop-page:has(#paper-calculator:not([hidden])) #notice { display: none; }
}
