/* ============================================================
   Precision Machine Co. — Quote Document Styles (shared)
   Referenced by all individual quote HTML files.
   Self-contained + print-ready.
   ============================================================ */

:root {
  --navy:    #0f2740;
  --navy-dk: #0a1c2e;
  --navy-md: #163755;
  --steel:   #2f6ba3;
  --steel-lt:#7fb2e0;
  --accent:  #f5821f;
  --acc-dk:  #e06f10;
  --ink:     #16212e;
  --muted:   #5a6b7d;
  --line:    #e3e9f0;
  --bg-alt:  #f4f7fa;
  --bg-blue: #eef3f8;
  --green:   #1d8a4e;
  --ff:      'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  --ffd:     'Oswald', 'Inter', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--ff);
  color: var(--ink);
  background: #d8dfe8;
  -webkit-font-smoothing: antialiased;
  padding: 32px 16px 64px;
}

@media print {
  body { background: #fff; padding: 0; }
  .print-btn { display: none !important; }
  .doc { box-shadow: none; }
  a { color: inherit; text-decoration: none; }
}

.print-btn {
  display: block;
  width: fit-content;
  margin: 0 auto 20px;
  padding: 10px 22px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--ffd);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s;
}
.print-btn:hover { background: var(--navy-md); }

.doc {
  max-width: 870px;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 4px 40px rgba(10,28,46,0.22);
  border-radius: 4px;
  overflow: hidden;
}

/* ---- Letterhead ---- */
.lh {
  background: var(--navy);
  color: #fff;
  padding: 28px 40px 26px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}
.lh-brand { display: flex; align-items: center; gap: 14px; }
.lh-mark {
  width: 46px; height: 46px;
  background: rgba(245,130,31,0.18);
  border-radius: 10px;
  display: grid; place-items: center;
  flex-shrink: 0;
  color: var(--accent);
}
.lh-mark svg { width: 32px; height: 32px; }
.lh-name { font-family: var(--ffd); font-weight: 700; font-size: 1.38rem; letter-spacing: 0.04em; line-height: 1; }
.lh-sub { font-family: var(--ffd); font-size: 0.68rem; letter-spacing: 0.22em; color: var(--steel-lt); margin-top: 5px; }
.lh-contact { text-align: right; font-size: 0.84rem; color: #a8c0d8; line-height: 1.8; font-style: normal; }
.lh-contact strong { display: block; color: #fff; font-size: 0.82rem; letter-spacing: 0.06em; font-family: var(--ffd); text-transform: uppercase; margin-bottom: 4px; }
.lh-contact a { color: #a8c0d8; text-decoration: none; }

/* ---- Quote header ---- */
.qh {
  background: #fff;
  border-bottom: 3px solid var(--accent);
  padding: 22px 40px;
  display: flex; justify-content: space-between; align-items: flex-end;
  flex-wrap: wrap; gap: 12px;
}
.doc-type { font-family: var(--ffd); font-weight: 700; font-size: 2rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--navy); line-height: 1; }
.qh-meta { display: flex; flex-wrap: wrap; gap: 6px 28px; margin-top: 8px; font-size: 0.88rem; color: var(--muted); }
.qh-meta span { white-space: nowrap; }
.qh-meta strong { color: var(--ink); }
.qh-right { text-align: right; }
.qh-num { font-family: var(--ffd); font-weight: 700; font-size: 1.28rem; color: var(--navy); letter-spacing: 0.04em; }
.qh-status { display: inline-block; margin-top: 6px; background: #e8f5ee; color: var(--green); font-family: var(--ffd); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; padding: 4px 10px; border-radius: 4px; border: 1px solid #b8dfc9; }
.qh-status--won { background: #e8f5ee; color: var(--green); border-color: #b8dfc9; }
.qh-status--pending { background: #fff8ec; color: #b45309; border-color: #fcd58a; }

/* ---- Parties ---- */
.parties { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.party { padding: 22px 40px; }
.party + .party { border-left: 1px solid var(--line); background: var(--bg-alt); }
.party-label { font-family: var(--ffd); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--steel); margin-bottom: 10px; }
.party-name { font-weight: 700; font-size: 1.02rem; color: var(--navy); margin-bottom: 4px; }
.party-detail { font-size: 0.91rem; color: var(--muted); line-height: 1.65; }
.party-detail a { color: var(--steel); text-decoration: none; }

/* ---- Part scope ---- */
.scope {
  background: var(--navy);
  padding: 20px 40px;
  display: grid; grid-template-columns: repeat(3,1fr) 0.7fr; gap: 16px 24px; align-items: start;
}
.scope-key { font-family: var(--ffd); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--steel-lt); margin-bottom: 4px; }
.scope-val { font-size: 0.93rem; font-weight: 600; color: #fff; line-height: 1.35; }
.scope-val-sub { font-size: 0.82rem; color: #9fb8d0; font-weight: 400; margin-top: 2px; }
.scope-badge { display: inline-block; background: rgba(245,130,31,0.22); color: var(--accent); border: 1px solid rgba(245,130,31,0.4); font-family: var(--ffd); font-size: 0.7rem; letter-spacing: 0.08em; padding: 3px 8px; border-radius: 4px; margin-top: 6px; font-weight: 600; text-transform: uppercase; }

/* ---- Line items table ---- */
.items-wrap { border-bottom: 1px solid var(--line); }
.items-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.items-table thead th { background: var(--bg-blue); padding: 10px 14px; text-align: left; font-family: var(--ffd); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--steel); border-bottom: 2px solid var(--line); }
.items-table thead th.r { text-align: right; }
.items-table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink); }
.items-table tbody tr:last-child td { border-bottom: none; }
.items-table tbody tr:nth-child(even) td { background: #fafbfd; }
.col-num { width: 30px; color: var(--muted); font-size: 0.82rem; font-weight: 600; padding-right: 0; text-align: center; }
.desc-main { font-weight: 600; color: var(--navy); margin-bottom: 2px; }
.desc-sub { font-size: 0.83rem; color: var(--muted); line-height: 1.45; }
.desc-calc { font-size: 0.8rem; color: #8a9aab; margin-top: 3px; font-family: 'Courier New', monospace; }
.col-qty { width: 60px; text-align: right; color: var(--muted); font-size: 0.88rem; }
.col-unit { width: 100px; text-align: right; color: var(--muted); font-size: 0.88rem; }
.col-total { width: 100px; text-align: right; font-family: var(--ffd); font-weight: 600; font-size: 0.97rem; color: var(--navy); }

/* ---- Totals ---- */
.totals { padding: 18px 40px 20px; display: flex; justify-content: flex-end; border-bottom: 1px solid var(--line); background: #fff; }
.totals-table { width: 320px; border-collapse: collapse; font-size: 0.92rem; }
.totals-table td { padding: 5px 0; vertical-align: baseline; }
.totals-table .t-label { color: var(--muted); padding-right: 24px; }
.totals-table .t-val { text-align: right; font-family: var(--ffd); font-weight: 600; color: var(--navy); font-size: 0.97rem; }
.totals-table .t-sep td { border-top: 1px solid var(--line); padding-top: 10px; padding-bottom: 2px; }
.totals-table .t-grand .t-label { font-family: var(--ffd); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.9rem; color: var(--navy); }
.totals-table .t-grand .t-val { font-size: 1.28rem; color: var(--navy); }
.totals-table .t-unit { border-top: 1px solid var(--line); }
.totals-table .t-unit .t-label { font-size: 0.82rem; color: #8a9aab; }
.totals-table .t-unit .t-val { font-size: 0.88rem; color: var(--muted); }

/* ---- Notes ---- */
.notes { padding: 22px 40px 24px; background: #fafbfd; border-bottom: 1px solid var(--line); }
.notes-heading { font-family: var(--ffd); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--steel); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.notes ol { padding-left: 18px; display: grid; gap: 8px; }
.notes li { font-size: 0.87rem; color: var(--muted); line-height: 1.55; }
.notes li strong { color: var(--ink); }
.vol-table { margin-top: 14px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.vol-table thead th { background: var(--bg-blue); padding: 8px 14px; text-align: left; font-family: var(--ffd); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--steel); font-weight: 600; border-bottom: 1px solid var(--line); }
.vol-table thead th.r { text-align: right; }
.vol-table tbody td { padding: 8px 14px; border-bottom: 1px solid var(--line); color: var(--ink); }
.vol-table tbody tr:last-child td { border-bottom: none; }
.vol-table .vt-price { text-align: right; font-family: var(--ffd); font-weight: 600; color: var(--navy); font-size: 0.9rem; }
.vol-table .vt-note { color: var(--muted); font-size: 0.82rem; }
.vol-highlight td { background: #eef6f2 !important; }
.vol-badge { display: inline-block; background: #e8f5ee; color: var(--green); border: 1px solid #b8dfc9; font-family: var(--ffd); font-size: 0.65rem; letter-spacing: 0.08em; padding: 2px 7px; border-radius: 3px; margin-left: 6px; font-weight: 600; text-transform: uppercase; vertical-align: middle; }

/* ---- Terms ---- */
.terms { display: grid; grid-template-columns: repeat(4,1fr); border-bottom: 1px solid var(--line); }
.term { padding: 18px 20px; border-right: 1px solid var(--line); }
.term:last-child { border-right: none; }
.term-key { font-family: var(--ffd); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--steel); margin-bottom: 5px; }
.term-val { font-size: 0.9rem; font-weight: 600; color: var(--navy); line-height: 1.4; }
.term-val--warn { color: var(--acc-dk); }

/* ---- Signature block ---- */
.sig { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-bottom: 1px solid var(--line); }
.sig-issuer { padding: 24px 40px; border-right: 1px solid var(--line); background: var(--navy); color: #fff; }
.sig-accept { padding: 24px 40px; background: #fff; }
.sig-heading { font-family: var(--ffd); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 14px; color: var(--steel-lt); }
.sig-accept .sig-heading { color: var(--steel); }
.sig-name { font-weight: 700; font-size: 1.02rem; color: #fff; margin-top: 6px; }
.sig-accept .sig-name { color: var(--navy); }
.sig-title { font-size: 0.85rem; color: var(--steel-lt); margin-top: 2px; }
.sig-accept .sig-title { color: var(--muted); }
.sig-line { display: block; margin-top: 16px; border-bottom: 1px solid rgba(255,255,255,0.25); padding-bottom: 2px; font-size: 0.78rem; color: var(--steel-lt); }
.sig-accept .sig-line { border-color: var(--line); color: var(--muted); }
.sig-fields { display: grid; gap: 14px; margin-top: 16px; }
.sig-field-label { font-size: 0.75rem; color: var(--muted); font-family: var(--ffd); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 4px; }
.sig-field-line { display: block; border-bottom: 1px solid var(--line); height: 26px; }

/* ---- Doc footer ---- */
.doc-foot { background: var(--bg-alt); padding: 14px 40px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 0.79rem; color: #8a9aab; }

/* ---- Responsive ---- */
@media (max-width: 700px) {
  .lh { flex-direction: column; }
  .lh-contact { text-align: left; }
  .parties { grid-template-columns: 1fr; }
  .party + .party { border-left: none; border-top: 1px solid var(--line); }
  .scope { grid-template-columns: 1fr 1fr; }
  .terms { grid-template-columns: 1fr 1fr; }
  .sig { grid-template-columns: 1fr; }
  .sig-issuer { border-right: none; border-bottom: 1px solid var(--line); }
  .totals { padding: 18px 20px; }
  .totals-table { width: 100%; }
  .notes, .sig-issuer, .sig-accept { padding: 20px; }
  .lh, .qh, .party { padding: 18px 20px; }
}
