/* Websair — printable document templates (10 styles). A4 @ 96dpi = 794×1123px. */

.doc {
  position: relative;
  width: 794px; min-height: 1123px;
  background: #fff; color: #1d1f20;
  padding: 52px 56px 44px;
  font-family: var(--font-body);
  font-size: 13px; line-height: 1.5;
  box-shadow: var(--shadow-lg);
  --acc: var(--color-accent);
  --ink: #1d1f20;
}
.doc * { box-sizing: border-box; }
.doc .bpc, .doc .accent-rail { display: none; }

/* header */
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.doc-brand { display: flex; gap: 16px; align-items: flex-start; }
.doc-logo { width: 150px; height: auto; flex: none; }
.doc-logo-ph { height: 60px; display: grid; place-items: center; box-sizing: border-box;
  border: 1px dashed #9aa3ab; background: #f4f6f8; color: #6b7178;
  font-family: var(--font-heading); font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase; text-align: center; }
.dc-name { font-family: var(--font-heading); font-weight: 600; font-size: 22px; line-height: 1; }
.dc-line { font-size: 11px; color: #55585a; max-width: 260px; }
.doc-company { display: flex; flex-direction: column; gap: 2px; }
.doc-meta { text-align: right; flex: none; }
.doc-type { font-family: var(--font-heading); font-weight: 600; font-size: 26px; letter-spacing: 0.02em; color: var(--acc); text-transform: uppercase; margin-bottom: 8px; }
.meta-tbl { border-collapse: collapse; margin-left: auto; font-size: 12px; }
.meta-tbl th { text-align: left; color: #77797b; font-weight: 500; font-family: var(--font-body); padding: 2px 12px 2px 0; }
.meta-tbl td { text-align: right; font-family: var(--font-heading); font-weight: 600; }

/* parties */
.doc-parties { display: flex; gap: 24px; margin: 26px 0 0; }
.party { flex: 1; }
.party-supply { flex: 0 0 210px; }
.party-label { font-family: var(--font-heading); font-weight: 600; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--acc); margin-bottom: 5px; }
.party-name { font-family: var(--font-heading); font-weight: 600; font-size: 15px; }
.party-line { font-size: 11.5px; color: #55585a; }

/* items */
.doc-items { width: 100%; border-collapse: collapse; margin: 24px 0 0; font-size: 12.5px; }
.doc-items thead th { font-family: var(--font-heading); font-weight: 600; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; text-align: left; padding: 9px 10px; color: #fff; background: var(--acc); }
.doc-items .c-num { text-align: right; }
.doc-items .c-idx { width: 34px; text-align: center; }
.doc-items tbody td { padding: 9px 10px; border-bottom: 1px solid #e5e6e7; vertical-align: top; }
.doc-items .c-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.li-name { font-weight: 500; }
.li-sub { font-size: 11px; color: #77797b; margin-top: 2px; }
.li-empty { text-align: center; color: #999; padding: 20px; }

/* foot / totals */
.doc-foot { display: flex; justify-content: space-between; gap: 32px; margin-top: 26px; align-items: flex-start; }
.doc-left { flex: 1; }
.words { font-size: 12px; margin-bottom: 14px; }
.words-label, .notes-label { display: block; font-family: var(--font-heading); font-weight: 600; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--acc); margin-bottom: 3px; }
.doc-notes { font-size: 11.5px; color: #55585a; margin-bottom: 12px; max-width: 340px; }
.doc-bank { font-size: 11px; color: #55585a; line-height: 1.6; }
.bank-grid { display: flex; gap: 20px; align-items: flex-start; }
.bank-lines { flex: 1; }
.bank-row { display: flex; gap: 8px; padding: 2px 0; }
.bank-row span { flex: 0 0 108px; color: #77797b; }
.bank-row b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.bank-qr { flex: none; text-align: center; width: 96px; }
.bank-qr img { width: 96px; height: 96px; object-fit: contain; border: 1px solid #e5e6e7; display: block; }
.bank-qr span { display: block; font-size: 9.5px; color: #77797b; margin-top: 4px; line-height: 1.3; }
.doc-totals { flex: 0 0 264px; font-size: 13px; }
.tt-row { display: flex; justify-content: space-between; padding: 6px 0; font-variant-numeric: tabular-nums; }
.tt-row span:first-child { color: #55585a; }
.tt-grand { border-top: 2px solid var(--acc); margin-top: 4px; padding-top: 10px; font-family: var(--font-heading); font-weight: 600; font-size: 18px; }
.tt-grand span:first-child { color: var(--ink); }
.tt-grand span:last-child { color: var(--acc); }

/* sign */
.doc-sign { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-top: 40px; padding-top: 18px; border-top: 1px solid #e5e6e7; }
.terms { font-size: 10.5px; color: #888; max-width: 360px; }
.sign-box { text-align: center; font-size: 12px; }
.sign-for { font-family: var(--font-heading); font-weight: 600; }
.sign-space { height: 46px; }
.sign-auth { border-top: 1px solid #bbb; padding-top: 5px; color: #55585a; }

/* ══════════════════════ TEMPLATE VARIANTS ══════════════════════ */

/* 1 — Aurora: steel band under header */
.doc-aurora { --acc: #5980a6; border-top: 6px solid var(--acc); }
.doc-aurora .doc-head { padding-bottom: 18px; border-bottom: 1px solid #e5e6e7; }

/* 2 — Slate: dark reversed header block */
.doc-slate { --acc: #416180; padding-top: 0; }
.doc-slate .doc-head { background: #1d2d3d; margin: 0 -56px 4px; padding: 40px 56px 26px; color: #fff; }
.doc-slate .dc-name, .doc-slate .doc-type, .doc-slate .meta-tbl td { color: #fff; }
.doc-slate .dc-line, .doc-slate .meta-tbl th { color: #c3ccd5; }
.doc-slate .doc-logo { background: #fff; padding: 8px; border-radius: 2px; }
.doc-slate .doc-parties { margin-top: 24px; }

/* 3 — Meridian: centered, double-rule, letterspaced */
.doc-meridian { --acc: #48607a; }
.doc-meridian .doc-head { flex-direction: column; align-items: center; text-align: center; gap: 12px; border-bottom: 3px double var(--acc); padding-bottom: 20px; }
.doc-meridian .doc-brand { flex-direction: column; align-items: center; gap: 8px; }
.doc-meridian .doc-company { align-items: center; }
.doc-meridian .dc-line { max-width: 460px; }
.doc-meridian .doc-meta { text-align: center; }
.doc-meridian .meta-tbl { margin: 8px auto 0; }
.doc-meridian .doc-type { letter-spacing: 0.28em; font-size: 22px; }
.doc-meridian .doc-items thead th { background: transparent; color: var(--acc); border-top: 2px solid var(--acc); border-bottom: 2px solid var(--acc); }

/* 4 — Minimal: no fills, quiet */
.doc-minimal { --acc: #1d1f20; }
.doc-minimal .doc-type { font-weight: 400; color: #1d1f20; }
.doc-minimal .doc-items thead th { background: transparent; color: #77797b; border-bottom: 1.5px solid #1d1f20; }
.doc-minimal .party-label, .doc-minimal .words-label, .doc-minimal .notes-label { color: #77797b; }
.doc-minimal .tt-grand { border-top-color: #1d1f20; }
.doc-minimal .tt-grand span:last-child { color: #1d1f20; }

/* 5 — Corporate: left accent column */
.doc-corporate { --acc: #416180; padding-left: 78px; }
.doc-corporate::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 14px; background: var(--acc); }
.doc-corporate .doc-head { border-bottom: 2px solid var(--acc); padding-bottom: 16px; }
.doc-corporate .doc-type { background: var(--acc); color: #fff; padding: 6px 14px; display: inline-block; }
.doc-corporate .meta-tbl { margin-top: 10px; }

/* 6 — Blueprint: full Industry wireframe with corner marks */
.doc-blueprint { --acc: #5980a6; border: 1.5px solid #b9c4cf; padding: 54px; }
.doc-blueprint .bpc { display: block; position: absolute; width: 16px; height: 16px; color: #5980a6; }
.doc-blueprint .bpc::before { content: ""; position: absolute; left: 7px; top: 0; width: 1.5px; height: 100%; background: currentColor; }
.doc-blueprint .bpc::after { content: ""; position: absolute; top: 7px; left: 0; height: 1.5px; width: 100%; background: currentColor; }
.doc-blueprint .bpc.tl { top: -8px; left: -8px; } .doc-blueprint .bpc.tr { top: -8px; right: -8px; }
.doc-blueprint .bpc.bl { bottom: -8px; left: -8px; } .doc-blueprint .bpc.br { bottom: -8px; right: -8px; }
.doc-blueprint .doc-type { letter-spacing: 0.1em; }
.doc-blueprint .doc-head { border-bottom: 1px dashed #b9c4cf; padding-bottom: 16px; }
.doc-blueprint .doc-items thead th { background: transparent; color: var(--acc); border: 1px solid #b9c4cf; }
.doc-blueprint .doc-items tbody td { border-bottom: 1px dashed #dfe4e9; }
.doc-blueprint .party, .doc-blueprint .doc-totals { border: 1px solid #dfe4e9; padding: 12px; }

/* 7 — Monochrome: black & white, heavy rules */
.doc-mono { --acc: #1d1f20; }
.doc-mono .doc-head { border-bottom: 3px solid #1d1f20; padding-bottom: 16px; }
.doc-mono .doc-type { color: #1d1f20; }
.doc-mono .doc-logo { filter: grayscale(1) contrast(1.1); }
.doc-mono .doc-items thead th { background: #1d1f20; color: #fff; }
.doc-mono .party-label, .doc-mono .words-label, .doc-mono .notes-label { color: #1d1f20; }
.doc-mono .tt-grand { border-top: 3px solid #1d1f20; }
.doc-mono .tt-grand span:last-child { color: #1d1f20; }

/* 8 — Bold: oversized colored title */
.doc-bold { --acc: #5980a6; }
.doc-bold .doc-head { align-items: center; }
.doc-bold .doc-type { font-size: 46px; line-height: 0.9; }
.doc-bold .dc-name { font-size: 26px; }
.doc-bold .doc-items thead th { font-size: 11px; padding: 12px 10px; }
.doc-bold .party-name { font-size: 17px; }
.doc-bold .tt-grand { font-size: 22px; background: var(--acc); color: #fff; margin: 8px -12px 0; padding: 12px; }
.doc-bold .tt-grand span, .doc-bold .tt-grand span:last-child { color: #fff; }

/* 9 — Elegant: light, airy, letterspaced serif-condensed */
.doc-elegant { --acc: #728fab; padding: 60px 64px; }
.doc-elegant .doc-head { border-bottom: 1px solid #d8dde2; padding-bottom: 24px; }
.doc-elegant .doc-type { font-weight: 400; letter-spacing: 0.24em; font-size: 20px; }
.doc-elegant .doc-items thead th { background: transparent; color: var(--acc); border-bottom: 1px solid var(--acc); letter-spacing: 0.14em; }
.doc-elegant .doc-items tbody td { padding: 12px 10px; }
.doc-elegant .tt-grand { border-top: 1px solid var(--acc); font-weight: 400; letter-spacing: 0.04em; }

/* 10 — Compact: dense, small type for long item lists */
.doc-compact { --acc: #416180; padding: 40px 44px; font-size: 12px; }
.doc-compact .doc-head { padding-bottom: 12px; border-bottom: 1px solid #e5e6e7; }
.doc-compact .doc-type { font-size: 20px; margin-bottom: 4px; }
.doc-compact .doc-logo { width: 120px; }
.doc-compact .doc-parties { margin-top: 16px; }
.doc-compact .doc-items { margin-top: 14px; font-size: 11.5px; }
.doc-compact .doc-items thead th { padding: 6px 8px; }
.doc-compact .doc-items tbody td { padding: 5px 8px; }
.doc-compact .doc-foot { margin-top: 16px; }
.doc-compact .sign-space { height: 32px; }

/* ══════════════════════ PRINT ══════════════════════ */
@media print {
  @page { size: A4; margin: 0; }
  body { overflow: visible !important; background: #fff !important; }
  body > *:not(#docRoot) { display: none !important; }
  #docRoot .doc-overlay { position: static; background: #fff; }
  #docRoot .doc-bar { display: none !important; }
  #docRoot .doc-scroll { padding: 0; overflow: visible; display: block; }
  .doc { box-shadow: none; margin: 0 auto; width: 100%; min-height: auto; page-break-after: always; }
}
