/* "Təhvil-təslim aktları" bölməsi (login.html#actsBlock, js/acts.js).
   1) Akt vərəqi (.act-sheet) — canlı önizləmə VƏ çap eyni markupdan istifadə edir; ölçülər mm ilə verilib ki, çapda A4 olsun.
   2) Bölmənin öz ekran interfeysi (.acts-*): siyahı, redaktor, önizləmə. */

/* ------------------------------------------------------------------ akt vərəqi */
.act-sheet {
  --act-gold: #897228;
  --act-gold-soft: #f4efe4;
  --act-rule: #cfcfcf;
  box-sizing: border-box;
  position: relative;
  width: 210mm;
  min-height: 296mm;
  padding: 8mm 20mm 6mm;
  background: #fff;
  color: #1a1a1a;
  font: 10pt/1.5 Arial, Helvetica, "Liberation Sans", sans-serif;
  text-align: left;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.act-sheet * { box-sizing: border-box; }
.act-head { display: flex; align-items: center; gap: 6mm; padding: 0 0 3.6mm; border-bottom: 0.6mm solid var(--act-gold); }
.act-head img { width: 23mm; height: 23mm; flex: none; }
.act-head p { margin: 0; font-size: 11pt; font-weight: 700; line-height: 1.38; }
.act-qr { flex: none; width: 21mm; height: 21mm; margin-left: auto; fill: #000; }
.act-qr.is-empty { display: flex; align-items: center; justify-content: center; box-sizing: border-box; padding: 1mm; border: 0.25mm dashed #aaa; color: #888; font-size: 6.5pt; font-weight: 400; line-height: 1.2; text-align: center; }
.act-title { margin: 3.4mm 0 0; text-align: center; font-size: 16pt; font-weight: 700; line-height: 1.2; }
.act-subno { width: 62mm; margin: 0.6mm auto 0; padding-bottom: 1mm; border-bottom: 0.3mm solid #d4d4d4; text-align: center; font-size: 9pt; color: #6b6b6b; }
.act-text { margin: 2.8mm 2mm 0; text-align: justify; }
.act-text + .act-text { margin-top: 1.8mm; }
.act-table { width: 100%; margin-top: 2.6mm; border-collapse: collapse; table-layout: fixed; font-size: 10pt; line-height: 1.25; }
.act-table th { padding: 2.2mm 3mm; background: var(--act-gold); border: 0.25mm solid var(--act-gold); color: #fff; font-weight: 700; text-align: left; }
.act-table td { padding: 2.2mm 3mm; border: 0.25mm solid var(--act-rule); overflow-wrap: anywhere; }
.act-table th:first-child, .act-table td:first-child { width: 12mm; text-align: center; }
.act-table th:last-child, .act-table td:last-child { width: 63mm; text-align: center; }
.act-table td small { display: block; color: #555; font-size: 9pt; }
.act-table tr.act-total td { background: var(--act-gold-soft); }
.act-table tr.act-total td:nth-child(2) { font-weight: 700; }
.act-table tr { break-inside: avoid; }
.act-rule { height: 0; margin: 3.2mm 0 0; border: 0; border-top: 0.25mm solid var(--act-rule); }
.act-sign { position: relative; display: grid; grid-template-columns: 1fr 1fr; margin-top: 0; }
.act-col { padding-top: 2.6mm; }
.act-sign, .act-recv { break-inside: avoid; page-break-inside: avoid; }
.act-col + .act-col { padding-left: 5mm; border-left: 0.25mm solid #c9c9c9; }
.act-col:only-child { grid-column: 1 / -1; }
.act-h { margin: 0 0 1.6mm; color: var(--act-gold); font-size: 10pt; font-weight: 700; letter-spacing: 0.02em; }
.act-signer { margin-bottom: 1mm; }
.act-signer > div:first-child { color: #333; line-height: 1.76; }
.act-f { margin: 0; line-height: 1.76; }
.act-f b { font-weight: 700; }
.act-blank { display: inline-block; width: 41mm; height: 0.9em; border-bottom: 0.25mm solid #111; vertical-align: baseline; }
.act-blank.wide { width: 52mm; }
.act-stamp {
  position: absolute; left: 52mm; top: 15mm; width: 20mm; height: 20mm; border: 0.3mm dashed #8a8a8a; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #8a8a8a; font-size: 10pt;
}
.act-note { margin: 3mm 0 0; padding-top: 3mm; border-top: 0.25mm solid var(--act-rule); color: #555; font-size: 9.5pt; font-style: italic; line-height: 1.7; text-align: justify; }
.act-recv { padding-top: 2.6mm; }
.act-recv .act-h { margin-bottom: 1.6mm; }
.act-sub { margin: 3mm 0 0; }
/* Sıx vərəq (2+ avadanlıq sətri və ya qaytarma/köçürmə): aralıqlar kiçilir — bir A4 səhifəyə sığır. */
.act-sheet.is-dense .act-blank, .act-sheet.is-dense .act-blank.wide { width: 40mm; }
.act-sheet.is-dense .act-table td, .act-sheet.is-dense .act-table th { padding: 1.5mm 3mm; }
.act-sheet.is-dense .act-f, .act-sheet.is-dense .act-signer > div:first-child { line-height: 1.6; }
.act-sheet.is-dense .act-text { margin-top: 2mm; }
.act-sheet.is-dense .act-rule { margin-top: 2.6mm; }

/* ------------------------------------------------------------------ çap: yalnız #actsPrintRoot (js/acts.js body-yə əlavə edir) */
#actsPrintRoot { display: none; }
@page acts { size: A4 portrait; margin: 0; }
@media print {
  body.is-printing-acts > *:not(#actsPrintRoot) { display: none !important; }
  body.is-printing-acts { background: #fff !important; }
  body.is-printing-acts #actsPrintRoot { display: block; page: acts; }
  #actsPrintRoot .act-sheet { break-after: page; page-break-after: always; }
  #actsPrintRoot .act-sheet:last-child { break-after: auto; page-break-after: auto; }
}

/* ------------------------------------------------------------------ bölmənin ekran interfeysi */
.acts-import { margin: 0 0 1rem; padding: 1rem 1.2rem; border: 1px dashed var(--cab-border, #cfd6e4); border-radius: 12px; background: var(--surface-soft, #f6f8fc); }
.acts-import p { margin: 0 0 0.7rem; }
.acts-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin: 0 0 0.8rem; }
.acts-tabs { display: inline-flex; gap: 0.3rem; }
.acts-tab { padding: 0.4rem 0.9rem; border: 1px solid var(--cab-border, #cfd6e4); border-radius: 999px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.acts-tab.is-active { background: #897228; border-color: #897228; color: #fff; }
.acts-search { flex: 1 1 14rem; max-width: 22rem; padding: 0.5rem 0.8rem; border: 1px solid var(--cab-border, #cfd6e4); border-radius: 10px; background: #fff; font: inherit; font-size: 0.92rem; }
.acts-search:focus { outline: none; border-color: #0b2545; box-shadow: 0 0 0 3px rgba(11, 37, 69, 0.12); }
.acts-count { color: var(--text-muted, #6b7280); font-size: 0.9rem; }
.acts-list td small { display: block; color: var(--text-muted, #6b7280); }
.acts-list .acts-col-check { width: 2.2rem; text-align: center; }
.acts-list .acts-col-num { width: 3.6rem; font-variant-numeric: tabular-nums; }
.acts-list .acts-col-total { width: 4.5rem; text-align: center; }
.acts-list .acts-col-act { white-space: nowrap; }
.acts-kind { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; background: #efe9d6; color: #6b5818; }
.acts-kind.is-person { background: #e3ecf8; color: #274a7a; }
.acts-empty { padding: 1.4rem; text-align: center; color: var(--text-muted, #6b7280); }

/* Düzülüş bölmənin REAL eninə görədir (yan menyudan sonra qalan yer): geniş olanda forma və önizləmə yan-yana, dar olanda alt-alta (önizləmə oxunaqlı qalsın). */
.acts-editor { margin-bottom: 1.4rem; container-type: inline-size; }
.acts-editor-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.4rem; align-items: start; }
@container (min-width: 1240px) { .acts-editor-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.acts-kind-switch { display: inline-flex; border: 1px solid var(--cab-border, #cfd6e4); border-radius: 10px; overflow: hidden; }
.acts-kind-switch button { padding: 0.5rem 1.2rem; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.acts-kind-switch button.is-active { background: #897228; color: #fff; }
.acts-fieldset { margin: 1.1rem 0 0; padding: 0; border: 0; }
.acts-fieldset > h4 { margin: 0 0 0.5rem; font-size: 0.95rem; }
.acts-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1.2fr) 5rem 2rem; gap: 0.5rem; margin-bottom: 0.45rem; align-items: center; }
.acts-row.is-giver { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 2rem; }
.acts-row input, .acts-form-textarea {
  min-width: 0; width: 100%; box-sizing: border-box; padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: 0.5rem;
  background: #fff; color: var(--ink); font-family: var(--font-body); font-size: 0.95rem;
}
.acts-row input[readonly] { background: #f3f4f7; color: #4b5563; }
.acts-row input:focus, .acts-form-textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 4px rgba(0, 34, 63, 0.1); }
.acts-row .acts-remove { width: 2rem; height: 2rem; border: 0; border-radius: 8px; background: transparent; color: #b4362b; font-size: 1.1rem; cursor: pointer; }
.acts-row .acts-remove:hover { background: rgba(180, 54, 43, 0.1); }
.acts-add-row { margin-top: 0.2rem; }
.acts-form-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.2rem; }
.acts-form-textarea { width: 100%; min-height: 5.2rem; resize: vertical; }
.acts-preview-wrap { min-width: 0; }
@container (min-width: 1240px) { .acts-preview-wrap { position: sticky; top: 1rem; } }
.acts-preview-wrap > h4 { margin: 0 0 0.5rem; font-size: 0.95rem; color: var(--text-muted, #6b7280); font-weight: 600; }
.acts-preview-frame { width: 100%; overflow: hidden; border: 1px solid var(--cab-border, #cfd6e4); border-radius: 8px; background: #e9ecf1; box-shadow: 0 6px 22px rgba(15, 23, 42, 0.12); }
.acts-preview-frame .act-sheet { transform-origin: top left; }
@media (max-width: 720px) {
  .acts-row { grid-template-columns: minmax(0, 1fr) 5rem 2rem; }
  .acts-row .acts-in-details, .acts-row .acts-in-serial { grid-column: 1 / -1; order: 3; }
  .acts-row .acts-row-link { order: 4; }
  .acts-row.is-giver { grid-template-columns: minmax(0, 1fr) 2rem; }
  .acts-row.is-giver .acts-in-position { grid-column: 1 / -1; order: 3; }
}

/* ------------------------------------------------------------------ vəziyyət, məqsəd, "Daha" paneli */
.acts-view-tabs { margin: 0 0 0.9rem; }
.acts-status-filter { padding: 0.45rem 0.6rem; border: 1px solid var(--line); border-radius: 0.5rem; background: #fff; color: var(--ink); font: inherit; }
.acts-kind.is-purpose { margin-left: 0.25rem; background: #f6e7dc; color: #8a4a17; }
.acts-status { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; white-space: nowrap; }
.acts-status.is-draft { background: #eceef2; color: #4b5563; }
.acts-status.is-printed { background: rgba(240, 160, 48, 0.16); color: #8a5200; }
.acts-status.is-signed { background: rgba(26, 122, 76, 0.12); color: #1a7a4c; }
.acts-status.is-cancelled { background: rgba(226, 75, 74, 0.12); color: #a32d2d; }
.acts-list tr.is-cancelled > td:not(.acts-col-act):not(.acts-col-check) { color: var(--text-muted, #6b7280); text-decoration: line-through; text-decoration-color: rgba(107, 114, 128, 0.5); }
.acts-list tr.is-cancelled .acts-status { display: inline-block; text-decoration: none; }
.acts-list .acts-col-act .link-action { margin-right: 0.5rem; }
.acts-detail-row > td { background: var(--surface-soft, #f6f8fc); }
.acts-facts { margin: 0 0 0.6rem; padding: 0 0 0 1.1rem; font-size: 0.9rem; }
.acts-facts li { margin: 0.15rem 0; }
.acts-detail-actions { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; }
.link-action.is-danger { color: #a32d2d; }
.acts-purpose-banner { margin: 0 0 0.9rem; padding: 0.6rem 0.8rem; border-left: 4px solid #897228; border-radius: 6px; background: #f4efe4; font-size: 0.92rem; }
.acts-hint { display: block; margin-top: 0.25rem; color: var(--text-muted, #6b7280); font-size: 0.82rem; }
.acts-hint.is-ok { color: #1a7a4c; }
.acts-hint[hidden] { display: none; }

/* inventardan seçim */
.acts-inv-picker { margin: 0 0 0.6rem; }
.acts-inv-picker input { width: 100%; box-sizing: border-box; padding: 0.6rem 0.75rem; border: 1px dashed #897228; border-radius: 0.5rem; background: #fffdf7; color: var(--ink); font-family: var(--font-body); font-size: 0.95rem; }
.acts-inv-results { max-height: 15rem; margin-top: 0.3rem; overflow-y: auto; border: 1px solid var(--line); border-radius: 0.5rem; background: #fff; }
.acts-inv-option { display: block; width: 100%; padding: 0.5rem 0.75rem; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: inherit; font: inherit; font-size: 0.92rem; text-align: left; cursor: pointer; }
.acts-inv-option:last-child { border-bottom: 0; }
.acts-inv-option:hover:not(:disabled) { background: #f4efe4; }
.acts-inv-option:disabled { color: var(--text-muted, #6b7280); cursor: not-allowed; }
.acts-inv-option small { display: block; color: var(--text-muted, #6b7280); }
.acts-inv-option .is-busy { color: #a32d2d; }
.acts-row-link { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.9rem; margin-top: -0.2rem; font-size: 0.85rem; }
.acts-inv-badge { padding: 0.05rem 0.5rem; border-radius: 999px; background: #efe9d6; color: #6b5818; font-weight: 600; }

/* kimdə nə var */
.acts-holdings .acts-holder { vertical-align: top; min-width: 11rem; }
/* Seriyası / Device ID-si yazılmamış kompüter (Kimdə nə var) */
.acts-missing { display: inline-block; margin-top: 0.2rem; padding: 0.05rem 0.5rem; border-radius: 999px; background: #fde8e6; color: #a3261c; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.acts-holder .acts-missing { display: block; width: max-content; }
.acts-holdings tr.is-missing td:not(.acts-holder) { background: #fff7f6; }
.acts-missing-filter { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; cursor: pointer; white-space: nowrap; }
/* QR etiketlər görünüşü */
.acts-qr .acts-qr-cell { width: 3.2rem; padding-top: 0.35rem; padding-bottom: 0.35rem; }
.acts-qr-thumb { display: block; width: 2.6rem; height: 2.6rem; fill: #000; background: #fff; }
/* Skriptdən gələnlər */
.acts-intake td { vertical-align: top; }
.acts-intake td small { display: block; color: var(--text-muted, #6b7280); font-size: 0.78rem; overflow-wrap: anywhere; }
.acts-intake-pick { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.acts-intake-pick select { min-width: 14rem; max-width: 30rem; flex: 1 1 14rem; padding: 0.35rem 0.4rem; border: 1px solid var(--cab-border, #cfd6e4); border-radius: 8px; background: #fff; font: inherit; font-size: 0.86rem; }
.acts-intake-pick .btn-submit, .acts-intake-pick .btn-ghost-dark { padding: 0.35rem 0.8rem; }
/* Köhnə aktları inventara bağla */
.acts-legacy-select { width: 100%; min-width: 14rem; max-width: 30rem; padding: 0.35rem 0.4rem; border: 1px solid var(--cab-border, #cfd6e4); border-radius: 8px; background: #fff; font: inherit; font-size: 0.86rem; }
.acts-legacy tr.is-muted > td { color: var(--text-muted, #6b7280); }
.acts-legacy-skipped { margin: 0 0 0.8rem; padding-left: 1.2rem; font-size: 0.88rem; color: var(--text-muted, #6b7280); }
.acts-legacy-skipped:empty { display: none; }
.acts-legacy-done { margin: 0 0 1rem; padding: 0.9rem 1.1rem; border: 1px solid #b7dfc4; border-radius: 12px; background: #eef9f1; }
.acts-legacy-done p { margin: 0 0 0.6rem; }

/* inventar cədvəli */
.inventory-col-check { width: 2.2rem; text-align: center; }
.inventory-number { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ QR etiket: 70 x 37 mm, A4-də 3 x 8 (hazır yapışqanlı vərəq ölçüsü) */
#labelsPrintRoot { display: none; }
@page labels { size: A4 portrait; margin: 0; }
@media print {
  body.is-printing-labels > *:not(#labelsPrintRoot) { display: none !important; }
  body.is-printing-labels { background: #fff !important; }
  body.is-printing-labels #labelsPrintRoot { display: grid; page: labels; grid-template-columns: repeat(3, 70mm); grid-auto-rows: 37mm; padding: 0; }
}
.device-label { box-sizing: border-box; display: flex; align-items: center; gap: 2.5mm; padding: 3mm; overflow: hidden; outline: 0.1mm dashed #bbb; background: #fff; color: #000; font: 8pt/1.25 Arial, Helvetica, sans-serif; break-inside: avoid; page-break-inside: avoid; }
.device-label-qr { flex: none; width: 29mm; height: 29mm; padding: 1mm; box-sizing: border-box; fill: #000; }
.device-label-text { display: flex; flex-direction: column; gap: 0.5mm; min-width: 0; }
.device-label-text b { font-size: 11pt; letter-spacing: 0.02em; }
.device-label-org { font-size: 7pt; color: #444; }
.device-label-name { overflow-wrap: anywhere; max-height: 7.6mm; overflow: hidden; }
/* Sahib (şəxsin adı və ya otaq) — etiketdən kimin olduğu bilinsin; çap anındakı vəziyyətdir. */
.device-label-holder { font-size: 9pt; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; max-height: 8.2mm; overflow: hidden; }
.device-label-holder em { display: block; font-size: 6.5pt; font-weight: 400; font-style: normal; color: #333; }
.device-label-text small { font-size: 6.5pt; color: #333; overflow-wrap: anywhere; }
