:root { color-scheme: light; --navy: #061c36; --blue: #243a94; --gold: #f2c14e; --paper: #f5f6f8; --ink: #202938; --line: #d8dfe8; }
* { box-sizing: border-box; }
body { margin: 0; padding: 0 16px 36px; background: var(--paper); color: var(--ink); font: 15px/1.5 'Trebuchet MS', sans-serif; overflow-wrap: anywhere; }
a { color: inherit; }
button, input, textarea { font: inherit; }
[hidden], #print-document { display: none !important; }
.toolbar, .paper { width: min(100%, 940px); margin: auto; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 0; }
.toolbar a { color: var(--blue); font-size: .88rem; }
button { border: 1px solid transparent; border-radius: 5px; padding: 9px 14px; min-height: 42px; background: var(--navy); color: white; font-weight: 700; cursor: pointer; }
button:hover { background: var(--blue); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.paper { padding: clamp(16px, 4vw, 44px); background: white; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 34px rgba(6,28,54,.09); }
.quotation-header, .company-details { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.quotation-header { border-bottom: 3px solid var(--gold); padding-bottom: 17px; }
.quotation-header img { height: auto; width: min(42%, 230px); display: block; }
.document-title { text-align: right; color: var(--navy); }
.document-title h1 { margin: 0; font: 500 clamp(30px, 6vw, 57px)/1 Georgia, serif; letter-spacing: -.035em; }
.document-title p, .document-title span { font-size: clamp(8px, 1.5vw, 11px); font-weight: 700; letter-spacing: .07em; }
.document-title p { margin: 0 0 5px; }
.company-details { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: .8rem; }
.company-details address { font-style: normal; }
.company-details div { text-align: right; }
.hint { color: #4e5c73; font-size: .9rem; }
h2 { margin: 25px 0 14px; padding: 7px 10px; border-left: 3px solid var(--gold); color: var(--navy); background: var(--paper); font-size: .85rem; letter-spacing: .045em; text-transform: uppercase; }
.customer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
label, .line-amount { min-width: 0; display: grid; gap: 4px; align-content: start; font-size: .8rem; font-weight: 700; }
input:not([type=checkbox]), textarea { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 4px; padding: 8px 9px; background: white; color: var(--ink); font-size: 1rem; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--navy); }
textarea { resize: vertical; }
.quote-line { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr) minmax(0, .6fr) minmax(0, 1fr) minmax(72px, .85fr) auto; align-items: end; gap: 8px; min-width: 0; margin: 0 0 12px; padding: 10px; border: 1px solid var(--line); border-radius: 5px; }
.quote-line legend { padding: 0 5px; color: var(--blue); font-size: .77rem; font-weight: 700; }
.line-amount output { display: block; padding: 9px 0; font-variant-numeric: tabular-nums; font-size: .85rem; }
.secondary, .remove { color: var(--navy); border-color: var(--line); background: white; }
.secondary:hover, .remove:hover { background: var(--paper); }
.remove { font-size: .75rem; padding: 7px; }
.remove:disabled { opacity: .5; cursor: not-allowed; }
.totals { width: min(100%, 330px); margin: 20px 0 0 auto; }
.total-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.totals input[type=number] { width: 96px; }
.vat-toggle { display: flex; align-items: center; gap: 8px; padding: 8px 2px; }
.grand { padding: 9px 12px; background: var(--navy); color: white; font-weight: 700; }
.totals output { text-align: right; font-variant-numeric: tabular-nums; }
.vat-note { margin: 8px 0 0; color: #4e5c73; font-size: .76rem; }

@media (max-width: 760px) {
  .quote-line { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quote-line label:first-of-type { grid-column: span 2; }
  .remove { justify-self: end; }
}
@media (max-width: 490px) {
  .customer-grid { grid-template-columns: 1fr; }
  .company-details { flex-wrap: wrap; }
  .company-details div { text-align: left; }
  .quote-line { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quote-line label:first-of-type { grid-column: 1 / -1; }
  .toolbar button { font-size: .85rem; }
}

@page { size: A4; margin: 13mm; }
@media print {
  body { margin: 0; padding: 0; background: white; font-size: 10pt; }
  .toolbar, #quote-editor { display: none !important; }
  #print-document { display: block !important; }
  .paper { width: 100%; margin: 0; padding: 0; box-shadow: none; border: 0; border-radius: 0; }
  .quotation-header, .company-details { break-inside: avoid; }
  .document-title h1 { font-size: 32pt; }
  .quotation-header img { width: 51mm; }
  .company-details div { text-align: right; }
  .company-details a { text-decoration: none; }
  h2 { break-after: avoid; margin-top: 5mm; print-color-adjust: exact; }
  table { width: 100%; border-collapse: collapse; table-layout: fixed; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; }
  th, td { padding: 5px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
  th { color: var(--navy); font-size: 9pt; }
  th:nth-child(1) { width: 36%; }
  th:nth-child(2) { width: 24%; }
  th:nth-child(3) { width: 8%; }
  th:nth-child(n+3), td:nth-child(n+3) { text-align: right; }
  #print-details { display: grid; grid-template-columns: 1fr 1fr; gap: 2mm 5mm; }
  #print-details div { break-inside: avoid; }
  #print-details dt { font-size: 8pt; color: var(--navy); text-transform: uppercase; font-weight: bold; }
  dd { margin: 0; }
  #print-totals { width: 76mm; margin-left: auto; break-inside: avoid; }
  #print-totals div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 2mm 0; }
  #print-totals div:last-child { font-weight: bold; border-bottom: 2px solid var(--navy); }
  #print-notes p { white-space: pre-wrap; }
  .signoff { display: grid; grid-template-columns: 1fr 1fr; gap: 8mm; margin-top: 14mm; break-inside: avoid; }
  .signoff span { padding-top: 2mm; border-top: 1px solid var(--navy); }
}

iframe#nl-badge-frame { display: none; }
