/* Şartname oluşturma sayfası ve yazdırma görünümü. Temel bileşenler site.css içindedir; burada yalnız bu araca özgü düzen vardır. */

/* Düzenleyici */
.spec-page { padding-bottom: 64px; }
.spec-sec { margin-top: 32px; scroll-margin-top: 16px; }
.spec-sec > h2 { font-size: var(--fs-20, 20px); margin-bottom: 12px; }
.spec-sec > .muted { margin-bottom: 16px; max-width: 60em; }
.spec-nav a { font-weight: 500; }
.spec-nav-end { margin-left: auto; color: var(--muted); font-size: var(--fs-13); }
.spec-items .spec-no { width: 56px; }
.spec-items .select { width: auto; min-width: 96px; }
.spec-items .lines-qty { width: 120px; }
.spec-items .lines-qty .input { width: 104px; }
.spec-act { display: flex; gap: 4px 12px; flex-wrap: wrap; justify-content: flex-end; white-space: nowrap; }
td.spec-act { display: table-cell; text-align: right; }
td.spec-act .linkbtn + .linkbtn { margin-left: 12px; }
.linkbtn[disabled] { color: var(--muted); cursor: default; text-decoration: none; opacity: .55; }
.spec-add { margin-top: 16px; align-items: start; }
.spec-results { margin-top: 12px; border-top: 1px solid var(--line); }
.spec-results li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-14); }
.spec-results li > span { min-width: 0; }
.spec-preset { display: flex; gap: 12px; align-items: flex-end; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.spec-preset .field { flex: 1; margin-bottom: 0; }
.spec-item { display: block; margin-bottom: 16px; scroll-margin-top: 16px; }
.spec-item .panel-head h3 .num { color: var(--muted); font-weight: 400; margin-right: 4px; }
.spec-clauses li { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 8px 12px; align-items: start; padding: 6px 0; }
.spec-clauses li > label { padding-top: 8px; font-size: var(--fs-13); color: var(--muted); }
.spec-clauses .spec-act { padding-top: 8px; min-width: 150px; }
.spec-clauses .input.area { font-size: var(--fs-14); }
.spec-new { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; }
.spec-out form { display: inline-flex; }
.spec-clear { margin-top: 16px; }
.spec-new-project { margin: 0 0 16px; }
.spec-rename { display: flex; gap: 8px; align-items: center; }
.spec-rename .input { max-width: 420px; }
.spec-row-act { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.spec-projects td { vertical-align: middle; }

@media (max-width: 860px) {
  .spec-add > [class^="c-"] { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .spec-nav-end { margin-left: 0; width: 100%; }
  .spec-items .lines-qty { width: auto; }
  .spec-items td.spec-act { display: block; text-align: left; margin-top: 12px; }
  .spec-clauses .input.area { min-height: 92px; }
  .spec-clauses li { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 8px 0; }
  .spec-clauses li > label { padding-top: 0; }
  .spec-clauses .spec-act { justify-content: flex-start; padding-top: 0; min-width: 0; }
  .spec-preset { flex-direction: column; align-items: stretch; }
  .spec-rename, .spec-row-act { flex-wrap: wrap; justify-content: flex-start; }
  .spec-out .btn, .spec-out form, .spec-out form .btn { width: 100%; }
}

/* Yazdırma görünümü: ekranda A4 sayfa, yazdırmada yalnız belge */
.doc-body { background: var(--bg-alt); }
.doc-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; max-width: 210mm; margin: 0 auto; padding: 16px; }
.doc-bar p { flex-basis: 100%; color: var(--muted); font-size: var(--fs-13); }
.doc { box-sizing: border-box; max-width: 210mm; margin: 0 auto 32px; padding: 25mm; background: #fff; border: 1px solid var(--line); color: #000; font-size: 11pt; line-height: 1.45; }
.doc-head { text-align: center; margin-bottom: 8mm; }
.doc h1 { font-size: 15pt; font-weight: 600; margin-bottom: 4mm; }
.doc-sub { font-weight: 600; }
.doc-date { text-align: right; margin-top: 8mm; }
.doc h2 { font-size: 11pt; font-weight: 600; margin: 7mm 0 2mm; break-after: avoid; page-break-after: avoid; }
.doc h3 { font-size: 11pt; font-weight: 600; margin: 5mm 0 2mm; break-after: avoid; page-break-after: avoid; }
.doc-clause { display: grid; grid-template-columns: 16mm minmax(0, 1fr); margin-bottom: 1.5mm; text-align: justify; break-inside: avoid; page-break-inside: avoid; }
.doc-clause span:first-child { font-variant-numeric: tabular-nums; text-align: left; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 10pt; }
.doc-table th, .doc-table td { border: 1px solid #000; padding: 1.5mm 2mm; text-align: left; vertical-align: middle; }
.doc-table th { font-weight: 600; background: #e7e6e6; }
.doc-table .c { text-align: center; white-space: nowrap; }
.doc-table tr { break-inside: avoid; page-break-inside: avoid; }
.doc-table thead { display: table-header-group; }
.doc-sign { margin: 14mm 0 0 auto; width: 70mm; text-align: center; break-inside: avoid; page-break-inside: avoid; }
.doc-sign p:first-child { font-weight: 600; }

@media (max-width: 700px) {
  .doc { padding: 16px; border-left: 0; border-right: 0; }
  .doc-clause { grid-template-columns: 44px minmax(0, 1fr); text-align: left; }
}

@page { size: A4; margin: 25mm; }
@media print {
  .doc-body { background: #fff; }
  .doc-bar { display: none; }
  .doc { max-width: none; margin: 0; padding: 0; border: 0; }
  .doc-table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
