:root { color-scheme: light; font-family: 'Segoe UI', Arial, sans-serif; color: #172330; background: #f3f6fa; --navy: #152536; --muted: #526477; --border: #d9e2eb; --orange: #a83b23; --green: #23624b; --rail: #f4f7fb; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled, input:disabled { cursor: not-allowed; opacity: .58; }
:focus-visible { outline: 3px solid #bf542f; outline-offset: 3px; }
.container { max-width: 1280px; margin: 0 auto; padding-inline: clamp(16px,4vw,54px); }
.top { background: #142335; color: #fff; box-shadow: inset 0 -1px #ffffff17; }
.top-inner { min-height: 66px; display: flex; align-items: center; gap: 20px; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; white-space: nowrap; font-weight: 650; }
.logo { display: block; width: 112px; height: 54px; object-fit: contain; background: #fff; border-radius: 5px; }
.top .logo { width: 88px; height: 40px; }
nav, .account, .actions, .section-title, .toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
nav { gap: 4px; }
nav a { padding: 9px 10px; border-radius: 6px; color: #e1e9ea; font-size: .88rem; white-space: nowrap; }
nav a:hover, nav a[aria-current] { background: #2a4058; color: #fff; }
.account { flex-wrap: nowrap; white-space: nowrap; }
.account small, .account strong { display: block; font-size: .8rem; }
.account small { color: #c3d4d9; }
.top .icon-button { color: #fff; border-color: #52666e; background: transparent; }
.main { padding-block: 32px 60px; }
.pagehead { display: flex; align-items: end; gap: 14px; justify-content: space-between; margin-bottom: 20px; }
.eyebrow { font-size: .8rem; font-weight: 700; color: var(--orange); margin-bottom: 6px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.65rem,3.4vw,2.25rem); line-height: 1.12; letter-spacing: -.035em; overflow-wrap: anywhere; }
h2 { font-size: 1.15rem; line-height: 1.3; }
small { color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.tile { display: flex; flex-direction: column; justify-content: space-between; min-height: 225px; padding: 22px; border: 1px solid var(--border); border-radius: 12px; background: #fff; gap: 16px; }
.tile:hover { border-color: #577980; box-shadow: 0 8px 15px #172b3511; }
.tile:first-child { border-top: 4px solid #ad4927; }
.tile-top { display: flex; align-items: center; justify-content: space-between; color: #45636b; }
.tile-icon { background: #eef3f1; border-radius: 8px; width: 44px; height: 44px; display: grid; place-items: center; }
.tile svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.tile h2 { font-size: 1.24rem; margin-bottom: 4px; }
.tile span { color: var(--muted); font-size: .9rem; }
.tile strong { font-size: 1.75rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.panel { border: 1px solid var(--border); background: white; border-radius: 13px; overflow: hidden; box-shadow: 0 2px 5px #15253608; }
.panel + .panel { margin-top: 16px; }
.stack > .panel { margin-top: 0; }
.section { padding: clamp(14px,2vw,22px); }
.section-title, .toolbar { justify-content: space-between; }
.section-title, .section > h2, .toolbar { margin-bottom: 15px; }
.button, .search button, .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 13px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--navy); font-weight: 650; font-size: .88rem; text-align: center; }
.primary { background: #21436a; border-color: #21436a; color: #fff; }
.primary:hover { background: #162f4d; }
.secondary:hover, .search button:hover, .icon-button:hover { border-color: #6e848a; }
.icon-button { min-width: 37px; padding: 5px 8px; }
.tabs { display:flex; flex-wrap:wrap; gap:5px; padding:4px; border-radius:8px; background:#e6ece8; }
.tabs a { padding:7px 11px; border-radius:6px; font-size:.88rem; color:var(--muted); }
.tabs a[aria-current] { background:white; color:var(--navy); box-shadow:0 1px 2px #0002; font-weight:650; }
.search { display:flex; gap:6px; }
.search input { width: min(55vw,250px); }
.pager { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:10px; padding:12px 15px; border-top:1px solid var(--border); color:var(--muted); }
.table-wrap { overflow: auto; width: 100%; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .92rem; }
th { background: var(--rail); color: #465a63; font-size: .8rem; font-weight: 700; }
td, th { padding: 12px 14px; border-bottom: 1px solid #e8eeeb; vertical-align: middle; }
td small { display: block; margin-top: 3px; }
tr:last-child td { border-bottom: none; }
td:last-child .button { white-space: nowrap; }
.badge { display: inline-block; border-radius: 30px; padding: 5px 10px; white-space: nowrap; background: #edf1ef; color: #3d535b; font-size: .78rem; font-weight: 650; }
.approved,.done { background: #e2f0e9; color: #1a5d43; }
.sent,.working { background: #fff0dc; color: #754514; }
.review,.rejected { background: #fae7e3; color: #92321d; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.stack { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
label { display: grid; gap: 6px; min-width: 0; color: #3a515a; font-size: .86rem; font-weight: 600; }
input, select, textarea { min-height: 40px; width: 100%; min-width: 0; border: 1px solid #c6d3e2; color: #172330; background: #fff; border-radius: 8px; padding: 8px 10px; font-weight: 400; }
textarea { resize: vertical; }
.quote-overview .form-grid, #quote-form .section > .form-grid { margin-bottom: 0; }
.quote-products { overflow: visible; }
.quote-products:has(.stock-search[aria-expanded=true]) { position: relative; z-index: 4; }
.quote-fields { margin-top: 12px; }
.quote-fields[open] > summary { margin-bottom: 10px; }
.quote-fields .form-grid { margin-bottom: 0; }
.table-wrap:has(> .products) { container: quote-products / inline-size; overflow: visible; }
.products { table-layout: fixed; }
.products th { line-height: 1.3; }
.products td { vertical-align: top; padding-block: 9px; }
.products td:nth-last-child(2), .products td:nth-last-child(3) { padding-top: 20px; }
.products th:first-child { width: 31%; }
.products th:nth-child(2) { width: 10%; }
.products th:nth-child(4) { width: 9%; }
.products th:last-child { width: 55px; }
.products .line-total,.products .line-vat { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.products .unit:empty { display: none; }
.stock-picker { position: relative; }
.stock-results,.stock-create { position: absolute; z-index: 4; inset: calc(100% + 4px) 0 auto; border: 1px solid var(--border); border-radius: 8px; background: white; box-shadow: 0 4px 12px #23394424; }
.stock-results { max-height: 190px; overflow-y: auto; overscroll-behavior: contain; }
.stock-create { min-height: 44px; padding: 8px 10px; text-align: left; color: #21436a; font-weight: 650; }
.stock-results [role=option],.stock-empty { padding: 8px; overflow-wrap: anywhere; }
.stock-results [role=option] { cursor: pointer; }
.stock-results [role=option]:hover,.stock-results [aria-selected=true] { background: #e7efed; }
.stock-empty { color: var(--muted); }
.quote-dock { position: sticky; z-index: 3; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: white; box-shadow: 0 -2px 18px #15253614; }
.total-inline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; color: var(--muted); font-size: .84rem; }
.total-inline strong { margin-left: 5px; font-size: 1.03rem; color: var(--navy); font-variant-numeric: tabular-nums; }
#stock-dialog { width: min(100% - 24px,520px); max-height: 90dvh; border: 1px solid var(--border); border-radius: 14px; padding: 18px; color: var(--navy); box-shadow: 0 12px 48px #10203146; }
#stock-dialog::backdrop { background: #10203188; }
#stock-dialog .form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
#stock-dialog label:first-child { grid-column: 1/-1; }
.contact-results:not(:empty), .alert { background: #f9e9e3; color: #79351d; padding: 12px 14px; border-radius: 7px; margin-bottom: 15px; }
.contact-results button { margin: 4px; }
.metadata, .doc-meta { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; margin: 18px 0; }
.metadata > div, .doc-meta > div { min-width: 0; overflow-wrap: anywhere; }
.metadata small, .doc-meta small { display: block; margin-bottom: 4px; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 12px 0; }
.totals { margin: 18px 0 0 auto; max-width: 400px; width: 100%; }
.totals > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; }
.totals dd { margin: 0; white-space: nowrap; }
.totals .grand { background: #f7e9e2; color: #943d22; font-weight: 750; border-radius: 4px; }
.decision { display: grid; gap: 10px; margin-top: 16px; }
.correction,.no-print { margin-top: 18px; }
.correction form { margin-top: 12px; }
summary { cursor: pointer; font-weight: 650; color: var(--navy); }
.share-url { width: min(100%,430px); }
.ship-submit { display: flex; align-items: end; justify-content: space-between; margin-top: 15px; gap: 12px; }
.ship-submit label { width: min(520px,100%); }
.shipment-table { min-width: 580px; }
.shipment-table input { max-width: 110px; }
.public-main { padding: 24px; }
.login { max-width: 430px; margin: clamp(33px,12vh,130px) auto 0; padding: 30px; border-top: 4px solid #a64524; }
.login .logo { width: 130px; height: 64px; margin-bottom: 14px; }
.login h1 { font-size: 1.8rem; margin-bottom: 20px; }
.login .button { margin-top: 4px; }
.document-main { max-width: 1000px; margin: 20px auto; padding: 0 16px; }
.print-controls { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.paper { background: #fff; border: 1px solid var(--border); box-shadow: 0 8px 35px #23394416; padding: clamp(16px,5vw,43px); }
.doc-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 2px solid #a64524; padding-bottom: 13px; margin-bottom: 19px; }
.doc-header > div { text-align: right; }
.doc-header small { display: block; margin-top: 4px; font-size: .7rem; }
.doc-meta { grid-template-columns: repeat(2,minmax(0,1fr)); }
.document-table th { background: #203741; color: #fff; }
.document-table td { overflow-wrap: anywhere; }
.paper h2 { margin-top: 20px; }
.signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; margin-top: 45px; }
.signatures > div { border-top: 1px solid #a1a9a8; padding-top: 7px; }
@media (max-width: 1080px) { .top-inner { flex-wrap: wrap; gap: 5px 14px; padding-block: 10px; } nav { order: 3; flex-basis: 100%; } }
@media (max-width: 720px) { .tiles { grid-template-columns: 1fr; } .tile { min-height: 150px; } .form-grid,.metadata { grid-template-columns: repeat(2,minmax(0,1fr)); } .pagehead { align-items: start; flex-direction: column; } .main { padding-block: 25px 60px; } }
@container quote-products (width < 725px) {
  .products { display: block; }
  .products thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .products tbody { display: grid; gap: 12px; }
  .products tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; border: 1px solid var(--border); border-radius: 7px; padding: 9px; }
  .products td { display: block; min-width: 0; border: 0; padding: 3px; }
  .products td:nth-last-child(2), .products td:nth-last-child(3) { padding-top: 3px; }
  .products td:first-child { grid-column: 1/-1; }
  .products td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--muted); font-size: .75rem; }
  .products td:nth-child(2), .products td:nth-child(3) { display: flex; flex-direction: column; justify-content: space-between; }
  .products .remove-line { width: 100%; }
}
@media screen and (max-width: 620px) {
  :is(.shipment-table,.list-table,.document-table) { display: block; min-width: 0; }
  :is(.shipment-table,.list-table,.document-table) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  :is(.shipment-table,.list-table,.document-table) tbody { display: grid; gap: 12px; }
  :is(.shipment-table,.list-table,.document-table) tr { min-width: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; border: 1px solid var(--border); border-radius: 7px; padding: 9px; }
  :is(.shipment-table,.list-table,.document-table) td { display: block; min-width: 0; border: 0; padding: 3px; overflow-wrap:anywhere; }
  :is(.shipment-table,.list-table,.document-table) td:first-child,.list-table td:nth-child(2) { grid-column: 1/-1; width: auto; }
  :is(.shipment-table,.list-table,.document-table) td[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--muted); font-size: .75rem; }
  :is(.list-table,.document-table) td:empty { display: none; }
  .list-table td:has(.button) { grid-column:1/-1; }
  .list-table td .button { white-space:normal; }
  .panel:not(.section) > .table-wrap:has(.list-table) { padding:10px; }
  .shipment-table input { max-width: none; }
  .search { width:100%; }
  .search input { flex:1; }
  .totals > div { flex-wrap:wrap; }
  .doc-header small { overflow-wrap:anywhere; }
  .main { padding-block: 18px 32px; }
  .pagehead { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .top-inner { gap: 4px 10px; }
  nav { row-gap: 2px; }
  nav a { font-size: .81rem; padding: 9px 8px; }
  .app :is(input, select, textarea) { font-size: 16px; }
  .app :is(.button, .icon-button, .search button) { min-height: 44px; }
  .quote-dock { padding: 8px 10px max(8px,env(safe-area-inset-bottom)); }
  .quote-dock .actions { width: 100%; gap: 6px; }
  .quote-dock .actions button { flex: 1; }
  .stock-results [role=option] { min-height: 44px; }
}
@media (max-width: 420px) { .form-grid,.metadata { grid-template-columns: 1fr; } .account > div { display: none; } .ship-submit { flex-wrap: wrap; } td,th { padding: 8px; } }
@media screen and (max-width: 620px) {
  #quote-form .form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #quote-form label:has([name=title], [name=representative], [name=customer], textarea) { grid-column: 1/-1; }
  .quote-dock .total-inline { width: 100%; justify-content: space-between; gap: 4px 9px; }
  .quote-dock .total-inline strong { display: block; margin-left: 0; }
}
@page { size: A4; margin: 15mm; }
@media print {
  body { background: white; color: #132730; }
  .print-controls,.no-print { display: none; }
  .document-main, .paper { display: block; max-width: none; margin: 0; padding: 0; border: 0; box-shadow: none; }
  .table-wrap { overflow: visible; }
  .document-table { font-size: 10pt; }
  .document-table th,.document-table td { padding: 6px 7px; }
  .document-table th { color: #132730; background: #edf1f0; }
  .document-table thead { display: table-header-group; }
  .paper tr,.totals,.doc-header,.doc-meta,.signatures { break-inside: avoid; }
  .paper h1 { font-size: 23pt; }
}
