/* Circuitul de semnare (v1.2): chenarele de semnătură din documente, certificatul de semnare, paginile de la birou
   (prefix .sgn-) și componenta salariatului din chioșc / portal (prefix .sgn-e-). Fără derulare laterală la 390 și 1366 px. */

/* ---------- chenarele de semnătură din documente ({{semnatura.<rol>}}) ---------- */
.sigf { display: inline-flex; flex-direction: column; align-items: flex-start; vertical-align: bottom; max-width: 100%; }
.sigf-box { display: inline-block; position: relative; width: 55mm; max-width: 100%; height: 16mm; border: 1px dashed #9aa3ad; border-radius: 3px; background: #fbfcfd; }
.sigf-r-angajator .sigf-box::after, .sigf-r-salariat .sigf-box::after, .sigf-r-hr .sigf-box::after, .sigf-r-martor .sigf-box::after {
  position: absolute; left: 5px; top: 3px; font: 600 7.5pt var(--font); color: #8a939e; letter-spacing: .3px; text-transform: uppercase; }
.sigf-r-angajator .sigf-box::after { content: "semnătura angajatorului"; }
.sigf-r-salariat .sigf-box::after { content: "semnătura salariatului"; }
.sigf-r-hr .sigf-box::after { content: "semnătura HR"; }
.sigf-r-martor .sigf-box::after { content: "semnătura martorului"; }
.sigf-on { gap: 1px; }
.sigf-img { display: block; height: 16mm; width: auto; max-width: 60mm; }
.sigf-txt { display: inline-block; padding: 2mm 3mm; border: 1px solid #b7c2cc; border-radius: 3px; font: 8.5pt var(--font); color: #1f3b57; background: #f3f7fb; }
.sigf-meta { font: 7.5pt var(--font); color: #444; }
.sigf-date { display: inline-block; min-width: 22mm; }
.sigf-date:empty { border-bottom: 1px dotted #777; height: 1.1em; vertical-align: bottom; }

/* documentul semnat = foaia documentului + foaia „Certificat de semnare” */
.sgn-bundle .doc-sheet + .doc-sheet { margin-top: 14px; }
.doc-body table.sgn-cert-t th, .doc-body table.sgn-cert-t td { font-size: 9pt; padding: 2px 4px; vertical-align: top; }
.doc-body table.sgn-cert-t small, .doc-body table.sgn-cert-h td, .doc-body table.sgn-cert-kv td { font-size: 9pt; }
.doc-body table.sgn-cert-kv td:first-child { width: 32%; font-weight: 700; }
.doc-body .sgn-cert-sigc { width: 30mm; }
.doc-body .sgn-cert-sig { display: block; height: 12mm; width: auto; max-width: 30mm; }
.doc-body .sgn-hash { font-family: ui-monospace, Consolas, monospace; font-size: 8pt; word-break: break-all; }
.doc-body .sgn-nw { white-space: nowrap; }
.doc-body .sgn-wrap { word-break: break-word; }

@media print {
  .sigf-box { border-style: solid; border-color: #bbb; background: none; }
  .sigf-box::after { content: none !important; }
  body.printing-doc .print-root .sgn-bundle .doc-sheet + .doc-sheet { margin-top: 0; break-before: page; page-break-before: always; }
}

/* ---------- citirea ca text mare (telefon): foaia se așază pe lățimea ecranului ---------- */
.sgn-read { min-width: 0; overflow-wrap: anywhere; }
.sgn-read .doc-sheet { width: auto; max-width: 100%; min-height: 0; box-shadow: none; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; font-size: 16px; }
.sgn-read .doc-sheet + .doc-sheet { margin-top: 12px; }
.sgn-read .doc-frame { height: auto; width: 100%; table-layout: fixed; }
.sgn-read .doc-body { padding: 14px 14px 18px; }
.sgn-read .doc-body table { table-layout: fixed; width: 100%; }
.sgn-read .doc-body td, .sgn-read .doc-body th { font-size: 14px; overflow-wrap: anywhere; word-break: break-word; }
.sgn-read .doc-body table.sig td { display: block; width: auto !important; padding: 6px 0; }
.sgn-read .doc-body .sgn-nw { white-space: normal; }
.sgn-read .doc-body table.sgn-cert-t th, .sgn-read .doc-body table.sgn-cert-t td, .sgn-read .doc-body table.sgn-cert-h td { font-size: 11px; padding: 2px 3px; }
.sgn-read .doc-body .sgn-cert-sigc { width: 22%; }
.sgn-read img { max-width: 100%; height: auto; }
.sgn-read .sigf-img { height: 54px; }
.sgn-read .sigf-box { width: 180px; height: 54px; }
.sgn-read .doc-band-top img { height: 40px; }
/* benzile antetului (imagini 2000 × 198 px): pe lățimea ecranului, întregi (nu tăiate în dreapta) */
.sgn-read .doc-band-top::before, .sgn-read .doc-band-bottom::after { height: auto; aspect-ratio: 2000 / 198; background-size: 100% 100%; background-position: center; }
.sgn-read .doc-band-top .co { padding: 4px 10px 0; font-size: 10px; }

/* ---------- birou: piese comune ---------- */
.sgn-prog { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sgn-bar { position: relative; display: flex; height: 7px; border-radius: 99px; background: var(--bg); overflow: hidden; }
.sgn-bar i { display: block; height: 100%; background: var(--green); }
.sgn-bar b { display: block; height: 100%; background: var(--red); }
.sgn-prog small { font-size: 11.5px; color: var(--text-weak); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sgn-chips { display: flex; gap: 4px; min-width: 0; overflow: hidden; flex-wrap: nowrap; }
.sgn-chips.wrap { flex-wrap: wrap; }
.sgn-chip { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px 0 2px; border-radius: 99px; font-size: 11.5px; font-weight: 650; white-space: nowrap; background: var(--bg); color: var(--text-weak); }
.sgn-chip i { font-style: normal; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: #fff; font-size: 10px; }
.sgn-chip.green { background: var(--green-bg); color: var(--green-text); }
.sgn-chip.amber { background: var(--amber-bg); color: var(--amber-text); }
.sgn-chip.red { background: var(--red-bg); color: var(--red-text); }
.sgn-late { color: var(--red-text); font-weight: 650; }
.sgn-why { display: block; color: var(--amber-text); white-space: normal !important; }
.sgn-wait { display: flex; flex-direction: column; white-space: nowrap; }
.tbl tr.sgn-on td { background: #fff8f5; }
.sgn-cb { width: 17px; height: 17px; accent-color: var(--brand); cursor: pointer; }
.sgn-onlysm { display: none !important; }
@media (max-width: 760px) {
  /* tabelele devin carduri: bifa lângă titlu, fără eticheta „Documentul”, persoana sub titlu */
  .tbl.cards td.sgn-cbcell { float: left; width: auto !important; padding: 3px 10px 0 0; }
  .tbl.cards td.sgn-tcell[data-l]::before { display: none; }
  .sgn-onlysm { display: block !important; }
}

/* pașii (semnatarii în ordine) */
.sgn-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sgn-steps li { display: flex; gap: 10px; align-items: flex-start; min-width: 0; position: relative; }
.sgn-steps li + li::before { content: ""; position: absolute; left: 11px; top: -8px; height: 8px; border-left: 2px solid var(--border); }
.sgn-dot { flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 750; background: var(--bg); color: var(--text-weak); border: 2px solid var(--border); }
.st-semnat .sgn-dot { background: var(--green); border-color: var(--green); color: #fff; }
.st-refuzat .sgn-dot { background: var(--red); border-color: var(--red); color: #fff; }
.st-de_semnat .sgn-dot { border-color: #d39b2a; color: var(--amber-text); background: var(--amber-bg); }
.st-anulat { opacity: .55; }
.sgn-st-h { gap: 6px; flex-wrap: nowrap; }
.sgn-steps small { display: block; }

/* documentul pe toată pagina */
.sgn-item { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.sgn-item-doc { min-width: 0; }
.sgn-side { position: sticky; top: 66px; min-width: 0; }
.sgn-me { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 2px solid var(--brand); border-radius: var(--radius); background: var(--brand-soft); }
.sgn-me .btn.big { height: 42px; font-size: 15px; }
.sgn-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.sgn-hashes .kv { grid-template-columns: minmax(90px, max-content) minmax(0, 1fr); }
.sgn-hashes .mono { font-family: ui-monospace, Consolas, monospace; font-size: 11px; word-break: break-all; }
.sgn-audit { list-style: none; margin: 0; padding: 4px 12px 8px; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
.sgn-audit li { min-width: 0; overflow-wrap: anywhere; }
.sgn-audit small { display: block; }
.sgn-saved { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; min-width: 0; }
.sgn-saved img { height: 54px; width: auto; max-width: 55%; border-bottom: 1px solid var(--border-strong); }
.sgn-sumlist { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; background: var(--bg-soft); border-radius: var(--radius-sm); font-size: 13px; max-height: 170px; overflow-y: auto; }

/* plicul */
.sgn-envhead { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.sgn-envhead .sgn-prog { max-width: 520px; }
.sgn-order { font-size: 13px; color: var(--text-weak); }

/* plicul nou */
.sgn-new { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.sgn-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 8px; }
.sgn-filters .searchbox { min-width: 0; }
.sgn-filters .nowrap-row .inp { min-width: 0; }
.sgn-pick { border: 1px solid var(--border); border-radius: var(--radius-sm); max-height: 430px; overflow-y: auto; overflow-x: hidden; background: #fff; }
.sgn-pick.fixed { max-height: none; }
.sgn-pick-it { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--border-soft); cursor: pointer; min-width: 0; font-size: 13px; }
.sgn-pick-it:last-child { border-bottom: 0; }
.sgn-pick-it.on { background: #fff8f5; }
.sgn-pick-it input { width: 16px; height: 16px; flex: none; accent-color: var(--brand); }
.sgn-pick-it small { display: block; color: var(--text-weak); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sgn-signers { display: flex; flex-direction: column; gap: 6px; }
.sgn-srow { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; grid-template-areas: "ord role btn" "ord who who"; gap: 4px 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-soft); align-items: center; }
.sgn-ord { grid-area: ord; width: 52px; text-align: center; font-weight: 700; padding: 0 4px; align-self: start; }
.sgn-srole { grid-area: role; min-width: 0; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.sgn-srole small { font-size: 11.5px; }
.sgn-sbtn { grid-area: btn; display: flex; gap: 0; }
.sgn-swho { grid-area: who; min-width: 0; }
.sgn-swho .seg button { padding: 0 8px; }
.sgn-go { padding-top: 4px; }
.sgn-cpick { max-width: 460px; }

/* blocul din vizualizarea documentului */
.sgn-docblock { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border: 1px solid var(--border); border-left: 3px solid var(--brand); border-radius: var(--radius-sm); background: var(--bg-soft); font-size: 13px; min-width: 0; }
.sgn-docblock .right { flex-wrap: wrap; }

/* semnarea la ghișeu (modul tabletă din documents.css) */
.sgn-done { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 10px; text-align: center; }
.sgn-done svg { color: #fff; background: var(--green); border-radius: 50%; padding: 10px; width: 64px; height: 64px; }
.sgn-done b { font-size: 20px; }

@media (max-width: 1100px) { .sgn-item { grid-template-columns: minmax(0, 1fr); } .sgn-side { position: static; } .sgn-new { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .sgn-filters { grid-template-columns: minmax(0, 1fr); }
  .sgn-acts .btn { flex: 1 1 100%; }
  .sgn-srole small { display: none; }
}

/* ---------- salariatul: chioșc și portal (butoane mari, text mare) ---------- */
.sgn-e { display: flex; flex-direction: column; gap: 12px; min-width: 0; font-size: 17px; }
.sgn-e-h { margin: 0; font-size: 26px; font-weight: 800; }
.sgn-e-h2 { margin: 6px 0 0; font-size: 19px; font-weight: 750; }
.sgn-e-list { display: flex; flex-direction: column; gap: 8px; }
.sgn-e-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; min-height: 64px; border: 2px solid var(--border); border-radius: 14px; background: #fff; text-align: left; font-size: 17px; color: var(--text); cursor: pointer; min-width: 0; }
.sgn-e-item:disabled { cursor: default; opacity: .8; }
.sgn-e-item:not(:disabled):hover { border-color: var(--brand); }
.sgn-e-item svg { flex: none; color: var(--brand); }
.sgn-e-item .grow { min-width: 0; }
.sgn-e-item b { display: block; font-size: 18px; overflow-wrap: anywhere; }
.sgn-e-item small { display: block; font-size: 14.5px; color: var(--text-weak); overflow-wrap: anywhere; }
.sgn-e-pill { flex: none; padding: 5px 12px; border-radius: 99px; font-size: 14px; font-weight: 750; background: var(--bg); color: var(--text-weak); white-space: nowrap; }
.sgn-e-pill.amber { background: var(--amber-bg); color: var(--amber-text); }
.sgn-e-pill.green { background: var(--green-bg); color: var(--green-text); }
.sgn-e-pill.red { background: var(--red-bg); color: var(--red-text); }
.sgn-e-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; font-size: 16px; line-height: 1.4; border: 2px solid transparent; }
.sgn-e-note svg { flex: none; margin-top: 2px; }
.sgn-e-note.blue { background: var(--blue-bg); color: var(--blue-text); border-color: #c4d8f2; }
.sgn-e-note.amber { background: var(--amber-bg); color: #6f4800; border-color: #efcf88; }
.sgn-e-note.green { background: var(--green-bg); color: var(--green-text); border-color: #b7e0c4; }
.sgn-e-note.red { background: var(--red-bg); color: var(--red-text); border-color: #f0b4af; font-weight: 600; }
.sgn-e-head { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.sgn-e-head .grow { min-width: 0; }
.sgn-e-head h2 { margin: 2px 0 0; font-size: 21px; font-weight: 800; overflow-wrap: anywhere; }
.sgn-e-head small { display: block; color: var(--text-weak); font-size: 14.5px; }
.sgn-e-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 18px; border: 2px solid var(--border-strong); border-radius: 14px; background: #fff; font-size: 17px; font-weight: 700; color: var(--text); cursor: pointer; flex: none; }
.sgn-e-btn:disabled { opacity: .45; cursor: not-allowed; }
.sgn-e-btn.brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.sgn-e-btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.sgn-e-btn.red { background: var(--red); border-color: var(--red); color: #fff; }
.sgn-e-btn.grow { flex: 1 1 auto; }
.sgn-e-row2 { display: flex; gap: 8px; flex-wrap: wrap; }
.sgn-e-signers { display: flex; flex-wrap: wrap; gap: 6px; }
.sgn-e-sg { padding: 4px 10px; border-radius: 10px; background: var(--bg); font-size: 14px; color: var(--text-weak); }
.sgn-e-sg.semnat { background: var(--green-bg); color: var(--green-text); }
.sgn-e-sg.de_semnat { background: var(--amber-bg); color: var(--amber-text); }
.sgn-e-hint { font-size: 14.5px; color: var(--text-weak); }
.sgn-e-doc { background: #fff; color: #000; }
.sgn-e-act { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 2px solid var(--border); border-radius: 16px; background: #fff; }
.sgn-e-act .sigpad canvas { height: 200px; }
.sgn-e-check { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 700; cursor: pointer; }
.sgn-e-check input { width: 28px; height: 28px; flex: none; accent-color: var(--brand); }
.sgn-e-lbl { display: flex; flex-direction: column; gap: 6px; font-size: 15px; font-weight: 700; color: var(--text-weak); }
.sgn-e-inp { width: 100%; min-height: 52px; padding: 10px 14px; border: 2px solid var(--border-strong); border-radius: 12px; font-size: 18px; background: #fff; color: var(--text); }
textarea.sgn-e-inp { min-height: 110px; }
.sgn-e-inp:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 4px rgba(27, 106, 201, .15); }
.sgn-e-done { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 18px 6px; }
.sgn-e-done .ok, .sgn-e-done .no { width: 88px; height: 88px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: var(--green); }
.sgn-e-done .no { background: var(--red); }
.sgn-e-done h2 { margin: 0; font-size: 24px; }
.sgn-e-done p { margin: 0; max-width: 520px; color: var(--text-weak); }
.sgn-e-foot { font-size: 13.5px; color: var(--text-faint); }
/* în chioșc, bara fixă de jos e mai înaltă decât spațiul lăsat de .ky-body pe telefon (≈175 px față de 130 px): loc în plus ca butoanele să nu rămână sub ea */
.ky .sgn-e { padding-bottom: 72px; }
@media (max-width: 560px) {
  .sgn-e { font-size: 16px; }
  .sgn-e-h { font-size: 22px; }
  .sgn-e-head { flex-direction: column; }
  .sgn-e-btn { min-height: 48px; padding: 0 14px; font-size: 16px; }
  .sgn-e-row2 .sgn-e-btn { flex: 1 1 auto; }
}
