/* NA-ME ERP proforma ekranı (Aşama 1, 02.10.2026) — YALNIZ ekran biçemleri.
   Basılı A4 belgenin şablonu proforma.js içindeki PRINT_CSS bölümündedir: belge ayrı bir pencereye
   document.write ile yazılır, stil sayfasının yüklenmesiyle print() arasında yarış olmasın diye satır
   içi tutulur (app.js'in NM_PRINT_CSS'i de aynı gerekçeyle satır içidir). Renkler app.css'in
   değişkenlerinden gelir (--ink, --muted, --line, --green-800 …). */

.pf-root { display: grid; gap: 16px; min-width: 0; }
.pf-loading { padding: 28px; color: var(--muted); text-align: center; }
.pf-shell { display: grid; gap: 14px; min-width: 0; }
.pf-body { display: grid; gap: 14px; min-width: 0; }
.pf-card { padding: 16px 18px; min-width: 0; }
.pf-card h4 { margin: 0 0 12px; font-family: Calibri, "Segoe UI", Arial, sans-serif; font-size: 15px; font-weight: 700; color: var(--ink); }
.pf-card h4 small, .pf-detail-head h3 small { color: var(--muted); font-size: 11px; font-weight: 500; }
.pf-card h5 { margin: 14px 0 6px; font-size: 12px; color: var(--muted); letter-spacing: .03em; text-transform: uppercase; }
.pf-card summary { cursor: pointer; list-style-position: inside; }
.pf-card summary h4 { display: inline; margin: 0; }

/* ---- Düzen yardımcıları ---- */
.pf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 14px; align-items: start; }
.pf-wide { grid-column: 1 / -1; }
.pf-grow { flex: 1 1 260px; min-width: 200px; }
.pf-field { display: block; min-width: 0; }
.pf-label { display: block; color: #40534d; font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.pf-field > .pf-label + * { margin-top: 5px; }
.pf-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 5px; }
.pf-inline input { margin-top: 0; }
.pf-check { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); font-size: 12px; font-weight: 700; cursor: pointer; }
.pf-check input { display: inline-block; margin: 0; }
.pf-hint { display: block; margin: 5px 0 0; color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.5; }
p.pf-hint { margin: 10px 0 0; }
.pf-muted { color: var(--muted); }
.pf-mono { font-family: Consolas, "Courier New", monospace; font-size: 12px; white-space: nowrap; }
.pf-digest { white-space: normal; overflow-wrap: anywhere; }
.pf-published details { margin-top: 12px; }
.pf-published .pf-actions { margin-top: 8px; }
.pf-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pf-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.pf-actions-foot { justify-content: flex-end; padding: 4px 2px 12px; }
.pf-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.pf-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; flex: 1 1 520px; }
.pf-filters .pf-field { min-width: 140px; }
.pf-table-wrap { width: 100%; overflow-x: auto; }
.pf-tabs { max-width: 100%; overflow-x: auto; }

/* ---- Liste ---- */
.pf-table { min-width: 860px; }
.pf-table th.pf-num { text-align: right; }
.pf-row.pf-legacy td { color: var(--muted); background: #fafbfe; }
.pf-link { padding: 0; border: 0; background: none; color: var(--green-800); font: inherit; font-weight: 800; text-align: left; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.pf-link:hover { color: var(--green-950); }
.pf-pager { padding-top: 12px; }
.pf-inactive td { color: var(--muted); background: #fafbfe; }

/* ---- Rozetler ---- */
.pf-status { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.pf-status-draft { color: #855916; background: var(--amber-soft); }
.pf-status-finalized { color: #1f6b40; background: #e3f4ea; }
.pf-status-cancelled { color: #a33a33; background: var(--red-soft); }
.pf-status-discarded { color: var(--muted); background: #eceff5; }
.pf-status-legacy { color: var(--blue); background: var(--blue-soft); }
.pf-rev { display: inline-flex; padding: 2px 8px; border-radius: 6px; color: var(--green-800); background: var(--green-100); font-size: 12px; font-weight: 800; vertical-align: middle; }
.pf-badge { display: inline-flex; padding: 3px 8px; border-radius: 6px; color: #5b3e91; background: #ece5f7; font-size: 11px; font-weight: 800; }
.pf-verify { display: inline-flex; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 800; }
.pf-verify-pending { color: #855916; background: var(--amber-soft); }
.pf-verify-usedinarchive { color: var(--blue); background: var(--blue-soft); }
.pf-verify-verified { color: #1f6b40; background: #e3f4ea; }
.pf-manual-mark { display: inline-flex; margin-left: 6px; padding: 2px 8px; border-radius: 6px; color: #7a4a05; background: #ffd9a3; font-size: 11px; font-weight: 800; vertical-align: middle; }
.pf-mark { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 12px; font-weight: 800; }
.pf-mark-auto { color: var(--green-800); }
.pf-mark-manual { color: #b45f06; }
.pf-icon-btn { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 5px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: #fff; font-size: 12px; font-weight: 800; cursor: pointer; }
.pf-icon-btn:disabled { opacity: .35; cursor: default; }
.pf-icon-btn.pf-danger { color: var(--red); border-color: #efcbc8; }

/* ---- Uyarı şeritleri ---- */
.pf-banner { margin: 10px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-left-width: 4px; border-radius: 8px; font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.pf-banner ul { margin: 6px 0 0; padding-left: 18px; }
.pf-banner button { margin-left: 6px; }
.pf-banner-info { border-color: #cfd5ee; border-left-color: #6d7bc3; background: #f7f8fd; color: #36406a; }
.pf-banner-warn { border-color: #ead6ae; border-left-color: #e0a63a; background: #fff9ed; color: #7a5410; }
.pf-banner-error { border-color: #efcbc8; border-left-color: var(--red); background: #fffafa; color: #8e2f29; }
.pf-banner-ok { border-color: #bfe2cd; border-left-color: #2f7d4f; background: #f1faf4; color: #1f6b40; }

/* ---- Ayrıntı başlığı ---- */
.pf-editor, .pf-view { display: grid; gap: 14px; min-width: 0; }
.pf-detail-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pf-title h3 { margin: 0; font-family: Calibri, "Segoe UI", Arial, sans-serif; font-size: 21px; font-weight: 700; overflow-wrap: anywhere; }
.pf-sub { margin-top: 4px; color: var(--muted); font-size: 12px; }
.pf-detail-head .pf-actions { margin-top: 0; }

/* ---- Kalem tablosu ---- */
table.pf-lines { min-width: 980px; }
.pf-lines td { vertical-align: top; }
.pf-lines .pf-no { width: 30px; color: var(--muted); text-align: center; }
.pf-lines .pf-code { width: 150px; }
.pf-lines .pf-desc { min-width: 240px; }
.pf-lines .pf-unit { width: 92px; }
.pf-lines .pf-qty, .pf-lines .pf-price { width: 112px; }
.pf-lines .pf-total { width: 108px; padding-top: 18px; font-weight: 800; }
.pf-lines .pf-line-actions { width: 96px; white-space: nowrap; }
.pf-lines input, .pf-lines textarea { width: 100%; padding: 7px 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: #fff; font: inherit; font-size: 12px; }
.pf-lines textarea { resize: vertical; min-height: 36px; }
.pf-lines input:focus, .pf-lines textarea:focus { border-color: #5969bd; outline: none; box-shadow: 0 0 0 3px rgba(39, 52, 139, .1); }
.pf-ambig { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 5px; padding: 6px; border: 1px dashed #e0a63a; border-radius: 7px; background: #fff9ed; font-size: 11px; font-weight: 700; color: #7a5410; }
.pf-auto-line { margin: 0 0 10px; color: var(--muted); font-size: 12px; }
.pf-lines-read td { vertical-align: top; }

/* ---- Sayfa altı alanları ---- */
.pf-blocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.pf-block { min-width: 0; }
.pf-block-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 5px; }
.pf-block textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; font: inherit; font-size: 12px; resize: vertical; }
.pf-block textarea:focus { border-color: #5969bd; outline: none; box-shadow: 0 0 0 3px rgba(39, 52, 139, .1); }
.pf-block .pf-banner { margin-top: 6px; }
.pf-block .pf-banner code { display: block; margin-top: 4px; white-space: pre-wrap; font-family: inherit; }
.pf-blocks-read { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-top: 14px; }
.pf-block-read p { margin: 4px 0 0; font-size: 12px; line-height: 1.55; }
.pf-read-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 12px; }
.pf-read-grid p { margin: 4px 0 0; font-size: 12px; line-height: 1.55; }

/* ---- Toplamlar ---- */
dl.pf-totals, dl.pf-preview { display: grid; gap: 6px; max-width: 420px; margin: 12px 0 0 auto; }
dl.pf-preview { margin: 0 0 12px; max-width: none; }
.pf-totals > div, .pf-preview > div { display: flex; justify-content: space-between; gap: 16px; padding: 6px 10px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.pf-totals dt, .pf-preview dt { color: var(--muted); }
.pf-totals dd, .pf-preview dd { margin: 0; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.pf-totals .pf-grand, .pf-preview .pf-grand { border-radius: 8px; border-bottom: 0; color: #fff; background: var(--green-950); }
.pf-totals .pf-grand dt, .pf-preview .pf-grand dt { color: #cfd6f6; }
.pf-list-plain, .pf-list-plain li { font-size: 12px; line-height: 1.6; }
.pf-list-plain { margin: 0; padding-left: 18px; }
.pf-list-plain .pf-blocking { color: var(--red); font-weight: 800; }
.pf-report { margin-top: 14px; }

/* ---- Pencere ---- */
dialog.pf-dialog { width: min(680px, calc((100vw - 28px) / var(--font-scale))); max-height: calc((100vh - 28px) / var(--font-scale)); padding: 0; border: 0; border-radius: 16px; color: var(--ink); background: #fff; box-shadow: 0 30px 90px rgba(0, 0, 0, .28); overflow: hidden; }
dialog.pf-dialog[open] { display: flex; flex-direction: column; }
dialog.pf-dialog::backdrop { background: rgba(8, 25, 21, .52); backdrop-filter: blur(3px); }
.pf-dialog-head { display: flex; flex: 0 0 auto; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 22px 14px; border-bottom: 1px solid var(--line); }
.pf-dialog-head h3 { margin: 3px 0 0; font-family: Calibri, "Segoe UI", Arial, sans-serif; font-size: 20px; font-weight: 700; }
.pf-x { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 20px; cursor: pointer; }
.pf-dialog-body { min-height: 0; padding: 16px 22px 20px; overflow: auto; overscroll-behavior: contain; font-size: 13px; line-height: 1.55; }
.pf-dialog-body p { margin: 0 0 10px; }
.pf-dialog-foot { display: flex; flex: 0 0 auto; justify-content: flex-end; gap: 8px; padding: 12px 22px; border-top: 1px solid var(--line); background: #fafbfe; }

@media (max-width: 760px) {
  .pf-card { padding: 12px; }
  .pf-title h3 { font-size: 18px; }
  .pf-filters { flex-basis: 100%; }
  dl.pf-totals { max-width: none; }
}

/* Uygulama kabuğunu yazdırırsanız yalnız bu ekranın içeriği çıkar; basılı belge ise ayrı pencerededir. */
@media print {
  .pf-actions, .pf-toolbar, .pf-tabs, .pf-pager, .pf-icon-btn { display: none !important; }
}
