/* Teklif tablosu: müşteri formu, teklif sayfası ve admin ekranında ortak format */
.qt-scroll { overflow-x: auto; }
.qt-table { width: 100%; border-collapse: collapse; }
.qt-table th { background: #0a1446; color: #fff; font-size: .78rem; font-weight: 600; padding: 9px 8px; text-align: left; white-space: nowrap; }
.qt-table th:first-child { border-top-left-radius: 8px; }
.qt-table th:last-child { border-top-right-radius: 8px; }
.qt-table td { padding: 5px 4px; border-bottom: 1px solid #e2e5ef; vertical-align: middle; }
.qt-table input, .qt-table select { width: 100%; padding: 8px 9px; font: inherit; font-size: .9rem; border: 1px solid #e2e5ef; border-radius: 7px; background: #fff; color: inherit; }
.qt-table .qt-no { width: 36px; text-align: center; color: #5d6585; font-size: .85rem; }
.qt-table .qt-brand { width: 150px; }
.qt-table .qt-qty { width: 92px; }
.qt-table .qt-unit { width: 96px; }
.qt-table .qt-price { width: 120px; }
.qt-table .qt-total { width: 120px; text-align: right; font-weight: 700; white-space: nowrap; }
.qt-table th.qt-total, .qt-table th.qt-price { text-align: right; }
.qt-table .qt-in-qty, .qt-table .qt-in-price { text-align: right; }
.qt-table .qt-del { width: 34px; text-align: center; }
.qt-remove { width: 28px; height: 28px; border: 0; border-radius: 50%; background: #fdecec; color: #cf3434; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.qt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.qt-count { margin-left: auto; color: #5d6585; font-size: .85rem; }
.qt-paste { display: grid; gap: 8px; margin-top: 10px; padding: 12px; border: 1px dashed #c9a24b; border-radius: 10px; background: #fffbf0; }
.qt-paste[hidden] { display: none; }
.qt-paste label { font-size: .86rem; font-weight: 600; }
.qt-paste textarea { width: 100%; padding: 9px 10px; font: inherit; font-size: .9rem; border: 1px solid #e2e5ef; border-radius: 8px; }
.qt-paste .btn { justify-self: start; }
.qt-totals { margin: 14px 0 0 auto; max-width: 320px; }
.qt-totals > div { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border-bottom: 1px dashed #e2e5ef; }
.qt-totals dt { color: #5d6585; }
.qt-totals dd { margin: 0; font-weight: 600; white-space: nowrap; }
.qt-totals .grand { border-bottom: 0; font-size: 1.15rem; }
.qt-totals .grand dt, .qt-totals .grand dd { color: #0a1446; font-weight: 800; }

.qt-file { position: relative; overflow: hidden; cursor: pointer; }
.qt-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.qt-file:focus-within { outline: 3px solid #1e90dc; outline-offset: 2px; }
.qt-template { font-size: .84rem; }
.qt-file-msg { margin: 8px 0 0; padding: 8px 12px; border-radius: 8px; font-size: .86rem; background: #e7f7ef; color: #0d6440; }
.qt-file-msg.error { background: #fff8e6; color: #7a5a12; }
.qt-file-msg[hidden] { display: none; }

/* Salt okunur görünüm */
.qt-view td { padding: 10px 8px; }
.qt-view td.num, .qt-view th.num { text-align: right; white-space: nowrap; }

@media screen and (max-width: 720px) {
  .qt-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .qt-table, .qt-table tbody, .qt-table tr { display: block; width: 100%; }
  .qt-table tr { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px 34px 10px 10px; margin-bottom: 8px; border: 1px solid #e2e5ef; border-radius: 12px; background: #fff; }
  .qt-table td { display: block; width: auto !important; padding: 0; border: 0; text-align: left !important; }
  .qt-table td[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; font-size: .72rem; font-weight: 600; color: #5d6585; margin-bottom: 2px; }
  .qt-table td.qt-name { grid-column: 1 / -1; }
  .qt-table td.qt-no { display: none; }
  .qt-table td.qt-del { position: absolute; top: 6px; right: 4px; }
  .qt-totals { max-width: none; }
}

/* ---------- teklif belgesi (ekran ve A4 çıktı) */
.qdoc { --ink: #0e1530; --navy: #0a1446; --gold: #c9a24b; --blue: #1574b8; --muted: #5d6585; --line: #dfe3ee;
  position: relative; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 0 0 22px; margin-bottom: 18px; overflow: hidden;
  box-shadow: 0 10px 34px rgba(10, 20, 70, .1); font-size: .92rem; }
.qdoc-stripe { height: 8px; background: linear-gradient(90deg, var(--navy) 0 62%, var(--gold) 62% 100%); }
.qdoc-body { padding: 0 34px; }
.qdoc-top { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 20px 0 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.qdoc-logo { display: block; width: 168px; height: auto; }
.qdoc-title { text-align: right; }
.qdoc-title h1 { margin: 0 0 8px; font-family: 'Exo 2', system-ui, sans-serif; font-size: 1.75rem; font-weight: 800; letter-spacing: .05em; color: var(--navy); text-transform: uppercase; }
.qdoc-facts { display: inline-grid; grid-template-columns: auto auto; gap: 2px 12px; margin: 0; text-align: left; }
.qdoc-facts dt { color: var(--muted); }
.qdoc-facts dd { margin: 0; font-weight: 700; }
.qdoc-state { display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 4px; background: #fff1d6; color: #8a5a0c; font-size: .78rem; font-weight: 700; }
.qdoc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0 14px; }
.qdoc-party { padding: 12px 14px; background: #f6f7fb; border-left: 3px solid var(--navy); display: grid; gap: 1px; align-content: start; }
.qdoc-party.seller { border-left-color: var(--gold); }
.qdoc-party small { color: var(--muted); font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 3px; }
.qdoc-party strong { font-size: 1rem; color: var(--navy); }
.qdoc-intro { margin: 0 0 14px; color: #39415f; }
.qdoc .qt-view th { background: var(--navy); border-radius: 0 !important; padding: 10px 8px; font-size: .74rem; letter-spacing: .03em; text-transform: uppercase; }
.qdoc .qt-view td { padding: 8px; border-bottom: 1px solid var(--line); }
/* Belgede malzeme adına yer açmak için sayı sütunları içeriği kadar geniş */
.qdoc .qt-view .qt-no { width: 28px; }
.qdoc .qt-view .qt-brand { width: 92px; }
.qdoc .qt-view .qt-qty { width: 58px; }
.qdoc .qt-view .qt-unit { width: 52px; }
.qdoc .qt-view .qt-price { width: 86px; }
.qdoc .qt-view .qt-total { width: 92px; }
.qdoc .qt-view tbody tr:nth-child(even) td { background: #f8f9fc; }
.qdoc .qt-totals { margin-top: 0; max-width: 300px; }
.qdoc .qt-totals > div { padding: 7px 10px; border-bottom: 1px solid var(--line); }
.qdoc .qt-totals .grand { background: var(--navy); border: 0; font-size: 1.08rem; }
.qdoc .qt-totals .grand dt, .qdoc .qt-totals .grand dd { color: #fff; }
.qdoc-section { margin-top: 18px; }
.qdoc-section h2 { margin: 0 0 8px; padding-bottom: 5px; border-bottom: 2px solid var(--gold); font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--navy); font-family: inherit; }
.qdoc-terms { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 18px; margin: 0; }
.qdoc-terms dt { color: var(--muted); font-size: .76rem; }
.qdoc-terms dd { margin: 0; font-weight: 600; }
.qdoc-note { margin: 10px 0 0; white-space: pre-wrap; }
.qdoc-banks { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 6px 18px; }
.qdoc-banks div { display: grid; }
.qdoc-banks code { font-family: inherit; font-weight: 700; letter-spacing: .02em; }
.qdoc-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 26px; }
.qdoc-sign div { min-height: 92px; padding-top: 6px; border-top: 1px solid var(--ink); font-size: .8rem; display: grid; align-content: start; gap: 1px; }
.qdoc-sign span { color: var(--muted); }
.qdoc-foot { margin-top: 20px; padding-top: 10px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: .74rem; line-height: 1.5; }
.qdoc-foot strong { color: var(--navy); }
.quote-actions { display: flex; flex-wrap: wrap; gap: 10px; }

@media screen and (max-width: 600px) {
  .qdoc-body { padding: 0 16px; }
  .qdoc-parties, .qdoc-sign { grid-template-columns: 1fr; }
  .qdoc-title { text-align: left; }
}

/* A4 çıktı: "Yazdır / PDF" ile yalnızca belge basılır, renkler korunur */
@media print {
  @page { size: A4; margin: 12mm 12mm 14mm; }
  html, body { background: #fff !important; font-size: 10.5pt; }
  body * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .site-header, .topbar, .site-footer, .chat, .toast, .no-print, .skip-link { display: none !important; }
  .section, .section-tight { padding: 0 !important; }
  .container { width: 100% !important; max-width: none !important; margin: 0 !important; }
  .qdoc { border: 0; border-radius: 0; box-shadow: none; padding: 0; margin: 0; overflow: visible; font-size: 10pt; }
  .qdoc-body { padding: 0; }
  .qt-scroll { overflow: visible; }
  .qdoc-logo { width: 132px; }
  .qdoc-top { padding: 12px 0 10px; }
  .qdoc .qt-view td { padding: 5px 8px; }
  .qt-view thead { display: table-header-group; }
  .qt-view tr, .qdoc-party, .qdoc-sign, .qt-totals, .qdoc-section { break-inside: avoid; }
}
