/* ================= A4 Antetli Teklif ================= */
.a4 {
  --a-navy: #0a1a2f;
  --a-gold: #b8914a;
  --a-gold-l: #e9dcc0;
  --a-ink: #1d2531;
  --a-muted: #6b7584;
  --a-line: #dfe3ea;
  width: 210mm;
  min-height: 297mm;
  padding: 13mm 14mm 10mm;
  background: #fff;
  color: var(--a-ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 9pt;
  line-height: 1.45;
  position: relative;
  box-shadow: 0 30px 80px -30px rgba(10, 26, 47, .45), 0 0 0 1px rgba(10, 26, 47, .05);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.a4 * { box-sizing: border-box; }
.a4 table { border-collapse: collapse; width: 100%; }
.a4-frame > tbody > tr > td, .a4-frame > tfoot > tr > td { padding: 0; }
.a4-foot-space { height: 9mm; }
.a4-foot {
  position: absolute; left: 14mm; right: 14mm; bottom: 8mm;
  display: flex; justify-content: space-between;
  border-top: .6pt solid var(--a-line); padding-top: 2.5mm;
  font-size: 7pt; color: var(--a-muted); letter-spacing: .02em;
}

/* Antet */
.lh { display: flex; justify-content: space-between; align-items: center; gap: 10mm; }
.lh-brand { display: flex; align-items: center; gap: 4mm; }
.lh-logo { max-height: 23mm; max-width: 60mm; object-fit: contain; }
.lh-mark { width: 15mm; height: 15mm; color: var(--a-navy); flex: none; }
.lh-name { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 22pt; font-weight: 700; color: var(--a-navy); line-height: 1; letter-spacing: .01em; }
.lh-tag { font-size: 7pt; letter-spacing: .18em; text-transform: uppercase; color: var(--a-gold); margin-top: 1.6mm; font-weight: 600; }
.lh-contact { text-align: right; font-size: 7.6pt; color: var(--a-muted); line-height: 1.6; }
.lh-rule { margin: 5mm 0 6mm; height: 1.2mm; background: var(--a-navy); position: relative; }
.lh-rule span { position: absolute; right: 0; top: 0; bottom: 0; width: 38%; background: linear-gradient(90deg, var(--a-gold), #d9bd84); }

/* Başlık */
.q-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 6mm; margin-bottom: 6mm; }
.q-title > div:first-child { flex: 1; min-width: 0; }
.q-title h1 { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 26pt; font-weight: 600; color: var(--a-navy); line-height: 1; margin: 0; letter-spacing: .01em; }
.q-subject { margin-top: 2mm; font-size: 10pt; color: var(--a-ink); font-weight: 500; }
.q-meta { flex: none; display: grid; grid-template-columns: repeat(4, auto); border: .6pt solid var(--a-line); border-radius: 2mm; overflow: hidden; }
.q-meta div { padding: 2mm 3mm; border-left: .6pt solid var(--a-line); }
.q-meta div:first-child { border-left: 0; background: var(--a-navy); color: #fff; }
.q-meta div:first-child span { color: var(--a-gold-l); }
.q-meta span { display: block; font-size: 6.4pt; letter-spacing: .14em; text-transform: uppercase; color: var(--a-muted); }
.q-meta b { font-size: 9pt; font-weight: 600; white-space: nowrap; }

/* Taraflar */
.q-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 5mm; margin-bottom: 5mm; }
.box { border: .6pt solid var(--a-line); border-radius: 2mm; padding: 3.5mm 4mm 3mm; break-inside: avoid; }
.a4 h3 { font-size: 6.8pt; letter-spacing: .18em; text-transform: uppercase; color: var(--a-gold); font-weight: 700; margin: 0 0 2.2mm; }
.kv { display: grid; grid-template-columns: 30mm 1fr; gap: 2mm; padding: .7mm 0; border-bottom: .4pt dotted #e6e9ee; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--a-muted); font-size: 7.8pt; }
.kv b { font-weight: 500; font-size: 8.4pt; word-break: break-word; }

.q-desc { background: #f7f5f0; border-left: 1mm solid var(--a-gold); padding: 3mm 4mm; margin-bottom: 5mm; border-radius: 0 2mm 2mm 0; break-inside: avoid; }
.q-desc div { font-size: 8.6pt; }

/* Kalemler */
.q-items { margin-bottom: 4mm; }
.q-items thead { display: table-header-group; }
.q-items th { background: var(--a-navy); color: #fff; font-weight: 600; font-size: 7pt; letter-spacing: .1em; text-transform: uppercase; padding: 2.4mm 2mm; text-align: left; }
.q-items th:first-child { border-radius: 1.5mm 0 0 1.5mm; }
.q-items th:last-child { border-radius: 0 1.5mm 1.5mm 0; }
.q-items td { padding: 2mm; border-bottom: .5pt solid var(--a-line); vertical-align: top; }
.q-items tr { break-inside: avoid; }
.q-items .c-no { width: 7mm; color: var(--a-muted); text-align: center; }
.q-items .c-num { text-align: right; white-space: nowrap; }
.q-items .c-unit { width: 13mm; }
.q-items td.c-unit { color: var(--a-muted); }
.q-items .c-total { font-weight: 600; }
.d-name { font-weight: 500; }
.d-code { font-size: 7pt; color: var(--a-muted); margin-top: .4mm; }
.q-items .grp td { background: #f2eee5; color: var(--a-navy); font-weight: 700; font-size: 7.2pt; letter-spacing: .12em; text-transform: uppercase; padding: 1.8mm 2mm; border-bottom: 0; }
.q-items .grp-sum td { text-align: right; font-size: 7.8pt; color: var(--a-muted); border-bottom: .8pt solid #cfd5de; }
.q-items .grp-sum td.c-num { color: var(--a-ink); font-weight: 600; }
.q-items .empty { text-align: center; color: var(--a-muted); padding: 6mm; }

/* Toplamlar */
.q-sum { display: grid; grid-template-columns: 1fr 78mm; gap: 6mm; align-items: start; margin-bottom: 5mm; break-inside: avoid; }
.q-words { padding: 3mm 4mm; border: .6pt dashed #cfc4ad; border-radius: 2mm; background: #fcfaf6; }
.q-words span { display: block; font-size: 6.6pt; letter-spacing: .16em; text-transform: uppercase; color: var(--a-gold); font-weight: 700; margin-bottom: 1mm; }
.q-words b { font-weight: 500; font-style: italic; font-size: 8.6pt; }
.q-rate { margin: 2mm 0 0; font-size: 7pt; color: var(--a-muted); }
.totals td { padding: 1.5mm 2.5mm; border-bottom: .5pt solid var(--a-line); }
.totals td:last-child { text-align: right; white-space: nowrap; font-weight: 500; }
.totals small { color: var(--a-muted); font-size: 6.8pt; }
.totals .grand td { background: var(--a-navy); color: #fff; font-weight: 700; font-size: 10.5pt; border: 0; padding: 2.6mm 2.5mm; }
.totals .grand td:last-child { color: #f1dfb4; }
.totals .try td { font-size: 8pt; color: var(--a-muted); border-bottom: 0; }

.q-terms { margin-bottom: 4mm; break-inside: avoid; }
.q-terms div { font-size: 7.8pt; color: #3b4452; line-height: 1.6; }
.q-bank { margin-bottom: 5mm; break-inside: avoid; }
.q-bank div { display: flex; gap: 5mm; flex-wrap: wrap; align-items: baseline; font-size: 8pt; border: .6pt solid var(--a-line); border-radius: 2mm; padding: 2.5mm 4mm; }
.q-bank b { font-family: ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: .04em; font-size: 8.6pt; }
.q-bank span { color: var(--a-muted); }

.q-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 14mm; margin-top: 7mm; break-inside: avoid; }
.q-sign > div { display: flex; flex-direction: column; }
.q-sign span { font-size: 6.8pt; letter-spacing: .18em; text-transform: uppercase; color: var(--a-gold); font-weight: 700; }
.q-sign b { font-size: 9.4pt; margin-top: 1.2mm; min-height: 4mm; }
.q-sign small { font-size: 7.4pt; color: var(--a-muted); }
.sign-line { margin-top: 16mm; border-top: .6pt solid #9aa3b0; padding-top: 1.2mm; font-size: 7pt; color: var(--a-muted); text-align: center; }

/* ================= Yazdırma ================= */
@page { size: A4 portrait; margin: 11mm 12mm 12mm; }
@media print {
  html, body { background: #fff !important; margin: 0 !important; }
  .no-print, .sidebar, .topbar, .preview-bar, .toasts, #modal-root { display: none !important; }
  .layout, .main, .content, .preview-stage { display: block !important; padding: 0 !important; margin: 0 !important; background: #fff !important; overflow: visible !important; height: auto !important; min-height: 0 !important; }
  .a4 { width: auto; min-height: 0; padding: 0; box-shadow: none; margin: 0; transform: none !important; }
  .a4-foot { position: fixed; left: 0; right: 0; bottom: 0; }
}
