:root {
  --ink: #08284c;
  --navy: #234774;
  --muted: #58708b;
  --line: #d5dfe9;
  --paper: #ffffff;
  --canvas: #eef2f5;
  --lime: #e4ee92;
  --footer: #1b314c;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

button, input, textarea { font: inherit; }

.quote-shell { width: min(100%, 970px); margin: 28px auto; padding: 0 22px 40px; }
.quote-main { min-width: 0; }
.quote-main .quote-shell { width: min(100%, 970px); margin: 0 auto; padding: 0 0 40px; }

.quote-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin: 0 0 18px; }
.toolbar-eyebrow, .signature p { margin: 0; color: var(--muted); font-size: 11px; }
.quote-toolbar h1 { margin: 3px 0 0; font-size: 22px; letter-spacing: -.4px; }
.toolbar-select { display: grid; gap: 5px; min-width: 235px; color: var(--muted); font-size: 10px; font-weight: 800; }
.toolbar-select select { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-size: 11px; font-weight: 700; outline: none; }
.toolbar-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 9px; }

.button { border: 1px solid var(--navy); border-radius: 8px; padding: 10px 13px; cursor: pointer; font-size: 12px; font-weight: 800; }
.button-primary { background: var(--navy); color: #fff; }
.button-secondary { background: #fff; color: var(--navy); }

.quote-document {
  position: relative;
  min-height: 1120px;
  overflow: hidden;
  padding: 48px 48px 52px;
  background: var(--paper);
  box-shadow: 0 7px 22px rgba(25, 49, 76, .12);
}

.quote-document::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(61deg, transparent 31%, rgba(228, 238, 146, .07) 31.15%, transparent 31.3%), linear-gradient(119deg, transparent 69%, rgba(35, 71, 116, .035) 69.15%, transparent 69.3%);
  content: "";
  pointer-events: none;
}
.quote-document > * { position: relative; z-index: 1; }
.lime-rule { position: absolute; top: 4px; right: 0; left: 0; height: 8px; background: var(--lime); }

.quote-header { display: flex; align-items: start; justify-content: space-between; gap: 28px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.brand-lockup { display: flex; align-items: center; padding-top: 2px; }
.official-logo { display: block; width: 265px; height: auto; max-height: 84px; object-fit: contain; object-position: left center; }
.official-logo.person-logo { width: 100px; height: 84px; }

.document-meta { display: grid; min-width: 150px; justify-items: end; gap: 3px; color: var(--muted); font-size: 9px; text-align: right; }
.document-meta h2 { margin: 0 0 2px; color: var(--ink); font-size: 19px; letter-spacing: .2px; }
.document-meta label { display: flex; align-items: center; justify-content: end; gap: 3px; }
.document-meta input { width: 96px; padding: 1px 0; border: 0; color: var(--muted); background: transparent; font-size: 9px; text-align: right; }
.document-meta .quote-code { color: var(--ink); font-weight: 700; }
.document-meta .quote-code input { width: 105px; padding: 3px 4px; background: var(--lime); color: var(--ink); font-weight: 900; }

.client-section { margin-top: 20px; }
.client-section h3, .concept-heading h3 { margin: 0 0 10px; color: var(--ink); font-size: 11px; letter-spacing: .35px; }
.client-section h3 strong { font-weight: 900; }
.client-section h3 span { margin-left: 4px; font-size: 18px; letter-spacing: -.45px; text-transform: none; }
.client-picker { margin-bottom: 9px; padding: 10px 13px; border: 1px dashed #b9c7d6; border-radius: 10px; background: rgba(248,250,252,.76); }
.client-picker label { display: grid; grid-template-columns: 155px minmax(0, 1fr); align-items: center; gap: 12px; color: var(--navy); font-size: 9px; }
.client-picker input { min-width: 0; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); font-size: 9px; outline: none; background: #fff; }
.client-card { display: grid; grid-template-columns: 1fr 1fr; column-gap: 34px; row-gap: 9px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; }
.client-card label { display: grid; grid-template-columns: 77px 1fr; align-items: baseline; gap: 8px; color: var(--ink); font-size: 9px; }
.client-card b { font-size: 9px; }
.client-card input { width: 100%; padding: 1px 0; border: 0; border-bottom: 1px solid transparent; outline: none; background: transparent; color: var(--muted); font-size: 9px; }

.concept-section { margin-top: 19px; }
.concept-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0; }
.text-button { border: 0; padding: 4px 0; background: transparent; color: var(--navy); cursor: pointer; font-size: 10px; font-weight: 800; }
.items-table { width: 100%; }
.items-head, .item-row { display: grid; grid-template-columns: minmax(210px, 1fr) 66px 120px 122px 25px; align-items: center; column-gap: 8px; }
.items-head { padding: 9px 8px; border-radius: 7px; background: var(--navy); color: #fff; font-size: 8px; font-weight: 900; letter-spacing: .25px; }
.items-head span:nth-child(2), .items-head span:nth-child(3), .items-head span:nth-child(4) { text-align: right; }
.item-row { min-height: 74px; padding: 9px 8px; border-bottom: 1px solid var(--line); }
.concept-cell { display: grid; gap: 3px; }
.item-title, .item-description, .item-quantity, .item-price { width: 100%; border: 0; border-bottom: 1px solid transparent; outline: none; background: transparent; color: var(--ink); }
.item-title { padding: 0; font-size: 10px; font-weight: 900; }
.item-description { min-height: 22px; padding: 0; resize: none; color: var(--muted); font-size: 8px; line-height: 1.35; }
.quantity-cell { text-align: right; }
.item-quantity { width: 100%; padding: 4px; color: #a54236; font-size: 9px; text-align: right; }
.price-cell { display: flex; justify-content: end; align-items: center; gap: 3px; color: var(--ink); font-size: 9px; }
.item-price { width: 90px; padding: 4px 0; font-size: 9px; text-align: right; }
.item-total { color: var(--ink); font-size: 9px; font-weight: 900; text-align: right; }
.delete-item { width: 21px; height: 21px; border: 0; border-radius: 4px; background: transparent; color: #a54236; cursor: pointer; font-size: 17px; line-height: 1; }

.quote-document input:focus, .quote-document textarea:focus { border-bottom-color: var(--navy); background: #f5f8fb; }
.quote-footer { display: grid; grid-template-columns: minmax(0, 1fr) 280px; align-items: start; gap: 30px; margin-top: 200px; }
.legal-note { margin: 0; padding: 13px 16px; border: 1px solid var(--line); border-left: 6px solid var(--lime); border-radius: 15px; color: var(--muted); font-family: inherit; font-size: 9px; font-weight: 400; letter-spacing: normal; line-height: 1.35; word-spacing: normal; text-align: left; white-space: normal; }
.signature { margin-top: 34px; padding-top: 12px; border-top: 1px solid var(--line); }
.signature strong, .signature span { display: block; }
.signature strong { margin-top: 2px; font-size: 12px; }
.signature span { color: var(--muted); font-size: 9px; }
.totals { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; }
.totals label, .total-line { display: flex; align-items: center; justify-content: space-between; min-height: 28px; padding: 0 11px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.totals output { color: var(--ink); font-weight: 900; }
.adjustment-input { display: flex; align-items: center; color: var(--ink); font-weight: 900; }
.adjustment-input input { width: 84px; border: 0; outline: none; color: var(--ink); font-size: 9px; font-weight: 900; text-align: right; }
.total-line { min-height: 36px; border: 0; background: var(--footer); color: #fff; font-size: 13px; font-weight: 900; }
.total-line output { color: #fff; font-size: 13px; }
.document-contact { display: flex; align-items: center; justify-content: center; gap: clamp(18px, 6vw, 68px); margin: 18px auto 0; padding: 0 18px 26px; color: var(--muted); font-size: 8px; }
.document-contact > a, .document-contact > span { display: inline-flex; align-items: center; gap: 5px; color: inherit; text-decoration: none; white-space: nowrap; }
.document-contact > a:hover { color: var(--navy); }
.contact-icon { width: 12px; height: 12px; flex: 0 0 12px; color: var(--navy); fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }

@media (max-width: 680px) {
  .quote-main { padding: 16px 10px 90px; }
  .quote-main .quote-shell { width: 100%; margin: 0 auto; padding: 0; }
  .quote-shell { margin-top: 16px; padding: 0 10px 24px; }
  .quote-toolbar, .quote-header { align-items: stretch; flex-direction: column; }
  .toolbar-actions { justify-content: start; }
  .toolbar-select { width: 100%; }
  .quote-document { min-height: auto; padding: 30px 18px 22px; }
  .official-logo { width: min(265px, 100%); max-height: 76px; }
  .official-logo.person-logo { width: 100px; }
  .document-meta { justify-items: start; text-align: left; }
  .document-meta label { justify-content: start; }
  .client-card { grid-template-columns: 1fr; column-gap: 0; }
  .items-head { display: none; }
  .item-row { grid-template-columns: minmax(0, 1fr) 78px 26px; gap: 6px; padding: 12px 0; }
  .concept-cell { grid-column: 1 / -1; }
  .price-cell { grid-column: 1; justify-content: start; }
  .item-total { grid-column: 2; }
  .delete-item { grid-column: 3; grid-row: 2; }
  .quote-footer { grid-template-columns: 1fr; gap: 24px; margin-top: 60px; }
  .signature { margin-top: 28px; }
  .totals { width: 100%; }
  .document-contact { flex-wrap: wrap; gap: 12px 22px; padding-bottom: 20px; text-align: center; }
}

@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  .app { display: block; }
  .sidebar, .mobile-nav { display: none !important; }
  .quote-main { padding: 0; }
  .quote-shell, .quote-main .quote-shell { width: 100%; margin: 0; padding: 0; }
  .quote-document { width: 210mm; min-height: 297mm; padding-bottom: 18mm; box-shadow: none; }
  .no-print, .delete-item, .client-picker { display: none !important; }
  .items-head, .item-row { grid-template-columns: minmax(210px, 1fr) 66px 120px 122px; }
  input, textarea { appearance: none; }
}
