/* Quotation (designed proposal) and invoice documents. They print on A4 (use the browser's "Save as PDF"). */

.qdoc { --qa: #3a21a3; --qb: #8d6bff; color: #1d1d1f; background: #fff; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  max-width: 860px; margin: 0 auto; border-radius: 22px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.06); line-height: 1.5; color-scheme: light; }
.qdoc * { box-sizing: border-box; }
.q-cover { position: relative; overflow: hidden; color: #fff; padding: 36px 48px 34px; min-height: 520px; display: flex; flex-direction: column;
  background: radial-gradient(120% 90% at 100% 0%, var(--qb) 0%, transparent 60%), linear-gradient(150deg, var(--qa) 0%, color-mix(in srgb, var(--qa) 70%, var(--qb)) 100%); }
.q-orb { position: absolute; border-radius: 50%; pointer-events: none; }
.q-orb.o1 { width: 420px; height: 420px; right: -140px; top: -120px; background: radial-gradient(circle, rgba(255,255,255,.28), transparent 65%); }
.q-orb.o2 { width: 260px; height: 260px; left: -90px; bottom: -110px; background: radial-gradient(circle, rgba(255,255,255,.16), transparent 65%); }
.q-orb.o3 { width: 150px; height: 150px; right: 24%; top: 70px; border: 1px solid rgba(255,255,255,.22); }
.q-top { display: flex; justify-content: space-between; align-items: center; position: relative; }
.q-top img { height: 30px; filter: brightness(0) invert(1); }
.q-top span { font-size: 13px; font-weight: 600; letter-spacing: .04em; padding: 5px 12px; border-radius: 20px; background: rgba(255,255,255,.16); backdrop-filter: blur(10px); }
.q-hero { margin-top: auto; padding: 60px 0 40px; position: relative; max-width: 620px; }
.q-eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; opacity: .8; }
.q-hero h1 { font-size: 46px; line-height: 1.06; letter-spacing: -.03em; margin: 12px 0 14px; font-weight: 700; }
.q-for { font-size: 18px; margin: 0; opacity: .9; }
.q-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; position: relative; background: rgba(255,255,255,.18); border-radius: 16px; overflow: hidden; backdrop-filter: blur(16px); }
.q-meta > div { padding: 14px 16px; background: rgba(255,255,255,.08); }
.q-meta span { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; opacity: .75; }
.q-meta b { display: block; font-size: 15px; margin-top: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.q-sec { padding: 40px 48px 8px; break-inside: avoid; }
.q-label { font-size: 12.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--qa); margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.q-label::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, color-mix(in srgb, var(--qa) 30%, transparent), transparent); }
.q-lead { font-size: 19px; line-height: 1.55; color: #333338; margin: 0 0 22px; letter-spacing: -.01em; }
.q-highlights { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.q-highlights > div { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--qa) 6%, #fff); font-weight: 500; font-size: 15px; }
.q-highlights i { width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, var(--qa), var(--qb)); color: #fff; display: grid; place-items: center; flex: none; }
.q-highlights i svg { width: 14px; height: 14px; }

.q-items { display: flex; flex-direction: column; gap: 12px; }
.q-item { display: grid; grid-template-columns: 44px 1fr auto; gap: 16px; align-items: start; padding: 18px 20px; border-radius: 18px; background: #f7f7f9; break-inside: avoid; }
.q-n { font-size: 13px; font-weight: 700; color: var(--qa); width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--qa) 10%, #fff); font-variant-numeric: tabular-nums; }
.q-it-main h3 { margin: 0 0 3px; font-size: 17px; letter-spacing: -.01em; }
.q-it-main p { margin: 0; color: #55555c; font-size: 14.5px; }
.q-it-main small { display: inline-block; margin-top: 8px; font-size: 12.5px; color: #6e6e73; background: #fff; border-radius: 20px; padding: 2px 10px; box-shadow: 0 0 0 .5px rgba(0,0,0,.1); }
.q-it-amt { font-size: 18px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.q-it-amt small { display: block; font-size: 12px; color: #86868b; font-weight: 500; }

.q-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 12px; position: relative; }
.q-steps::before { content: ''; position: absolute; left: 20px; right: 20px; top: 19px; height: 2px; background: linear-gradient(90deg, var(--qa), var(--qb)); opacity: .35; }
.q-steps li { position: relative; padding-top: 52px; font-size: 14px; }
.q-dot { position: absolute; top: 0; left: 0; width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--qa), var(--qb)); color: #fff; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 5px #fff; }
.q-steps b { display: block; font-size: 15px; }
.q-steps em { font-style: normal; font-size: 13px; color: var(--qa); font-weight: 600; }
.q-steps p { margin: 4px 0 0; color: #6e6e73; font-size: 13px; }

.q-inv-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 16px; align-items: stretch; }
.q-total-card { border-radius: 20px; padding: 26px; color: #fff; background: linear-gradient(140deg, var(--qa), var(--qb)); display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.q-total-card::after { content: ''; position: absolute; width: 220px; height: 220px; border-radius: 50%; right: -70px; bottom: -90px; background: radial-gradient(circle, rgba(255,255,255,.25), transparent 70%); }
.q-total-card span { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; opacity: .8; }
.q-total-card b { font-size: 40px; letter-spacing: -.03em; margin: 4px 0; font-variant-numeric: tabular-nums; }
.q-total-card small { opacity: .8; }
.q-breakdown { border-radius: 20px; padding: 18px 22px; background: #f7f7f9; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.q-breakdown > div { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.q-breakdown span { color: #55555c; }
.q-breakdown .q-disc b { color: #248a3d; }
.q-breakdown .q-grand { border-top: 1px solid rgba(0,0,0,.1); padding-top: 10px; margin-top: 4px; font-size: 18px; }
.q-breakdown .q-grand span { color: #1d1d1f; font-weight: 600; }
.q-sched { margin-top: 18px; padding: 18px 20px; border-radius: 18px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.07); }
.q-sched-bar { display: flex; gap: 3px; height: 10px; border-radius: 6px; overflow: hidden; }
.q-sched-bar i { background: linear-gradient(90deg, var(--qa), var(--qb)); }
.q-sched-bar i:nth-child(2) { opacity: .7; } .q-sched-bar i:nth-child(3) { opacity: .5; } .q-sched-bar i:nth-child(n+4) { opacity: .35; }
.q-sched-list { display: flex; gap: 22px; margin-top: 14px; flex-wrap: wrap; }
.q-sched-list > div { display: flex; gap: 10px; align-items: center; }
.q-sw { width: 12px; height: 12px; border-radius: 4px; background: var(--qa); }
.q-sched-list b { display: block; font-size: 14.5px; }
.q-sched-list small { color: #6e6e73; font-variant-numeric: tabular-nums; }

.q-terms ul { margin: 0; padding: 0 0 0 18px; color: #55555c; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.q-accept { padding-bottom: 40px; }
.q-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 30px; font-size: 13.5px; color: #6e6e73; }
.q-sign span { display: block; height: 1px; background: #c7c7cc; margin-bottom: 8px; }
.q-accept-box { border-radius: 22px; padding: 28px; text-align: center; background: color-mix(in srgb, var(--qa) 6%, #fff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--qa) 18%, transparent); }
.q-accept-box h3 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.01em; }
.q-accept-box p { margin: 0 0 18px; color: #55555c; }
.q-accept-box form { display: flex; gap: 10px; max-width: 480px; margin: 0 auto; flex-wrap: wrap; }
.q-accept-box input { flex: 1; min-width: 200px; height: 48px; border-radius: 14px; border: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); padding: 0 16px; font-size: 16px; font-family: inherit; background: #fff; color: #1d1d1f; }
.q-accept-box button { height: 48px; border: 0; border-radius: 14px; padding: 0 24px; font-size: 16px; font-weight: 600; color: #fff; background: linear-gradient(135deg, var(--qa), var(--qb)); cursor: pointer; font-family: inherit; }
.q-err { color: #d70015; margin-top: 10px; font-size: 14px; min-height: 18px; }
.q-accepted { display: flex; gap: 14px; align-items: center; padding: 20px 24px; border-radius: 20px; background: rgba(52, 199, 89, .12); color: #1b6b30; }
.q-accepted i { width: 40px; height: 40px; border-radius: 50%; background: #34c759; color: #fff; display: grid; place-items: center; flex: none; }
.q-accepted i svg { width: 22px; height: 22px; }
.q-accepted b { display: block; font-size: 17px; }
.q-foot { display: flex; align-items: center; gap: 14px; padding: 22px 48px; background: #f5f5f7; font-size: 13px; color: #6e6e73; flex-wrap: wrap; }
.q-foot img { width: 30px; height: 30px; object-fit: contain; }
.q-foot b { display: block; color: #1d1d1f; }
.q-contacts { margin-left: auto; display: flex; gap: 16px; flex-wrap: wrap; }

@media (max-width: 700px) {
  .q-cover { padding: 26px 22px; min-height: 460px; }
  .q-hero h1 { font-size: 34px; }
  .q-meta { grid-template-columns: 1fr 1fr; }
  .q-sec { padding: 30px 22px 4px; }
  .q-highlights, .q-inv-grid { grid-template-columns: 1fr; }
  .q-item { grid-template-columns: 1fr auto; padding: 16px; }
  .q-n { display: none; }
  .q-steps { grid-auto-flow: row; }
  .q-steps::before { left: 19px; right: auto; top: 20px; bottom: 20px; width: 2px; height: auto; }
  .q-steps li { padding: 4px 0 6px 56px; min-height: 44px; }
  .q-foot { padding: 20px 22px; }
  .q-contacts { margin-left: 0; }
}

/* ---------- Invoice ---------- */
.idoc { background: #fff; color: #1d1d1f; max-width: 860px; margin: 0 auto; padding: 44px 48px; border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.06);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif; font-size: 14px; line-height: 1.5; color-scheme: light; }
.idoc * { box-sizing: border-box; }
.i-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 24px; border-bottom: 1px solid #e5e5ea; }
.i-head img { height: 30px; }
.i-head p { margin: 10px 0 0; color: #6e6e73; font-size: 13px; }
.i-title { text-align: right; }
.i-title h1 { margin: 0; font-size: 30px; letter-spacing: -.02em; color: #3a21a3; }
.i-title b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.i-stamp { display: inline-block; margin-top: 10px; padding: 4px 14px; border-radius: 20px; font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.i-stamp.green { background: rgba(52,199,89,.14); color: #248a3d; }
.i-stamp.red { background: rgba(255,59,48,.12); color: #d70015; }
.i-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 24px 0; }
.i-parties span, .i-words > span, .i-pay > span { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: #86868b; font-weight: 600; }
.i-parties b { font-size: 16px; }
.i-parties p { margin: 2px 0 0; color: #55555c; }
.i-dates { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1px; background: #e5e5ea; border-radius: 14px; overflow: hidden; align-self: start; }
.i-dates > div { background: #f7f7f9; padding: 12px 14px; }
.i-dates b { font-size: 14px; font-variant-numeric: tabular-nums; }
.i-due { color: #3a21a3; }
.i-table { width: 100%; border-collapse: collapse; }
.i-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: #86868b; padding: 10px 10px; background: #f5f5f7; font-weight: 600; }
.i-table th:first-child { border-radius: 10px 0 0 10px; } .i-table th:last-child { border-radius: 0 10px 10px 0; }
.i-table td { padding: 12px 10px; border-bottom: 1px solid #f0f0f2; vertical-align: top; font-variant-numeric: tabular-nums; }
.i-table td small { display: block; color: #6e6e73; font-size: 12.5px; }
.i-table .r { text-align: right; white-space: nowrap; }
.i-sum { display: grid; grid-template-columns: 1fr 320px; gap: 24px; padding-top: 18px; }
.i-words b { display: block; font-weight: 500; margin-top: 2px; }
.i-pay { margin-top: 18px; padding: 14px; border-radius: 14px; background: #f7f7f9; }
.i-pay p { margin: 4px 0 0; }
.i-totals { display: flex; flex-direction: column; gap: 7px; }
.i-totals > div { display: flex; justify-content: space-between; gap: 10px; font-variant-numeric: tabular-nums; }
.i-totals span { color: #55555c; }
.i-totals .i-grand { font-size: 18px; font-weight: 700; border-top: 1px solid #e5e5ea; padding-top: 9px; margin-top: 3px; }
.i-totals .i-grand span { color: #1d1d1f; }
.i-totals .i-paid b { color: #248a3d; }
.i-notes { margin-top: 24px; padding-top: 16px; border-top: 1px solid #e5e5ea; font-size: 13px; }
.i-notes p { margin: 0 0 6px; }
.i-notes .muted { color: #86868b; }
.i-foot { display: flex; justify-content: space-between; margin-top: 30px; font-size: 12px; color: #a1a1a6; gap: 10px; flex-wrap: wrap; }
@media (max-width: 700px) {
  .idoc { padding: 24px 18px; }
  .i-head, .i-parties, .i-sum { grid-template-columns: 1fr; display: grid; }
  .i-title { text-align: left; }
  .i-dates { grid-template-columns: 1fr 1fr; }
  .i-table th:nth-child(4), .i-table td:nth-child(4), .i-table th:nth-child(5), .i-table td:nth-child(5) { display: none; }
}

/* ---------- Print ---------- */
@page { size: A4; margin: 0; }
@media print {
  html, body { background: #fff !important; }
  body.printing > *:not(.print-area) { display: none !important; }
  .print-area { display: block !important; }
  .qdoc, .idoc { box-shadow: none; border-radius: 0; max-width: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .q-cover { min-height: 297mm; page-break-after: always; }
  .idoc { padding: 16mm 14mm; }
  .q-sec, .q-item, .q-inv-grid, .q-steps { break-inside: avoid; }
  .q-accept-box { display: none; }
}
.print-area { display: none; }
