/* Adeverințe (v1.1): registrul cererilor, emiterea, datele istorice pentru pensie, catalogul. Toate clasele noi au prefixul .cert- */

/* ---------- registrul cererilor ---------- */
.cert-filters { gap: 6px; }
.cert-filters .seg { display: flex; flex-wrap: wrap; max-width: 100%; }
.cert-fsel { width: 190px; }
.cert-fsearch { width: 200px; }
.cert-cell { display: flex; flex-direction: column; min-width: 0; }
.cert-cell b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl td .cert-cell small { white-space: normal; }
.cert-due { display: flex; flex-direction: column; }
.cert-due small { white-space: nowrap; }
.cert-urg, .tbl td small.cert-urg { color: var(--amber-text); font-weight: 650; }
.cert-due.late small { color: var(--red-text); }
.tbl tr.cert-late td { background: #fff6f5; }
.cert-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.cert-clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: normal !important; }

/* meniurile „Adeverință ▾” / „Mai multe ▾”: pe ecrane înguste se întind pe lățimea rândului (fără derulare laterală) */
.cert-menu { display: flex; }
.cert-menu .menu { max-width: min(420px, calc(100vw - 24px)); }
.cert-menu .menu a, .cert-menu .menu button { white-space: normal; }
.cert-acts { position: relative; }
@media (max-width: 760px) {
  .cert-mrow { position: relative; }
  .cert-menu .menu-wrap { position: static; }
  .cert-menu .menu { left: 0; right: 0; min-width: 0; max-width: none; }
}

/* ---------- o cerere ---------- */
.cert-req { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.cert-doc { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-soft); min-width: 0; }
.cert-doc b { display: block; font-size: 13.5px; }
.cert-doc small { display: block; color: var(--text-weak); font-size: 12px; }
.cert-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.cert-box { display: flex; flex-direction: column; gap: 8px; padding: 8px 10px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); }
.cert-box .sect-title { border-top: 0; padding-top: 0; margin-top: 0; }
.cert-hist summary { cursor: pointer; font-size: 12.5px; color: var(--text-weak); }
.cert-hist ul { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.cert-hist small { display: block; color: var(--text-faint); font-size: 11.5px; }
@media (max-width: 900px) { .cert-req { grid-template-columns: minmax(0, 1fr); } }

/* ---------- emiterea ---------- */
.cert-tinfo b { display: block; color: var(--text); font-size: 13px; }
.cert-tinfo small { display: block; margin-top: 3px; }
.cert-note summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-weak); }
.cert-note > div { font-size: 12.5px; color: var(--text-weak); margin-top: 4px; }
.cert-issue-acts { padding-top: 4px; border-top: 1px solid var(--border-soft); }
.cert-checks { gap: 6px; }
.cert-plist { display: flex; flex-direction: column; max-height: 380px; overflow-y: auto; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); }
.cert-pit { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-bottom: 1px solid var(--border-soft); cursor: pointer; min-width: 0; font-size: 13px; }
.cert-pit:last-child { border-bottom: 0; }
.cert-pit.on { background: var(--brand-soft); }
.cert-pit input { width: 16px; height: 16px; flex: none; accent-color: var(--brand); }
.cert-pit small { display: block; color: var(--text-weak); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cert-pit > small { flex: none; max-width: 40%; }
.cert-bulk-opts { gap: 6px; padding-top: 18px; }
.cert-res { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; max-height: 420px; overflow-y: auto; }
.cert-res li { display: flex; align-items: flex-start; gap: 8px; padding: 4px 6px; border-radius: 6px; min-width: 0; }
.cert-res li small { display: block; color: var(--text-weak); font-size: 12px; overflow-wrap: anywhere; }
.cert-res li.ok svg { color: var(--green); flex: none; }
.cert-res li.skip { background: var(--amber-bg); } .cert-res li.skip svg { color: var(--amber-text); flex: none; }
.cert-res li.err { background: var(--red-bg); } .cert-res li.err svg { color: var(--red-text); flex: none; }

/* ---------- date istorice pentru pensie ---------- */
.cert-hpick { gap: 8px; }
.cert-ppick { max-width: 560px; }
.cert-periods { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.cert-chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; background: var(--bg); font-size: 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cert-range { gap: 6px; font-size: 13px; }
.cert-range .inp { width: 150px; }
.cert-comps { display: flex; flex-wrap: wrap; gap: 6px; }
.cert-comp { display: flex; align-items: center; gap: 4px; flex: 1 1 300px; min-width: 0; max-width: 100%; padding: 3px 4px 3px 8px; border: 1px solid var(--border-soft); border-radius: 6px; background: var(--bg-soft); }
.cert-comp b { flex: none; max-width: 42%; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cert-comp .inp { flex: 1 1 auto; min-width: 0; }
.cert-comp.add { background: #fff; border-style: dashed; padding-left: 4px; }
.cert-gridwrap { min-width: 0; }
.cert-grid { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 12.5px; }
.cert-grid col.c-m { width: 74px; }
.cert-grid col.c-t { width: 88px; }
.cert-grid col.c-bn { width: 48px; }
.cert-grid col.c-s { width: 17%; }
.cert-grid col.c-o { width: 11%; }
.cert-grid th { padding: 5px 3px; font-size: 11px; font-weight: 650; color: var(--text-weak); text-align: left; background: var(--bg-soft); border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cert-grid td { padding: 1px 2px; border-bottom: 1px solid var(--border-soft); min-width: 0; }
.cert-grid td.c-m { padding-left: 4px; white-space: nowrap; }
.cert-grid td.c-t { text-align: right; font-size: 12px; color: var(--text-weak); padding-right: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.cert-grid tr.cert-yr td { background: var(--bg-soft); padding: 4px 6px; font-size: 12px; border-bottom: 1px solid var(--border); }
.cert-grid tr.dirty td { background: #fffaf0; }
.cert-grid tr.late01 td { opacity: .62; }
.cert-in { width: 100%; min-width: 0; height: 26px; padding: 0 4px; border: 1px solid transparent; border-radius: 4px; background: transparent; font-size: 12.5px; color: var(--text); }
.cert-in:hover { border-color: var(--border); }
.cert-in:focus { border-color: var(--focus); background: #fff; outline: none; box-shadow: 0 0 0 2px rgba(27, 106, 201, .15); }
.cert-in:disabled { color: var(--text); opacity: 1; }
.cert-in.num { text-align: right; font-variant-numeric: tabular-nums; }
.cert-in.bad { border-color: var(--red); background: var(--red-bg); }
select.cert-in { padding: 0 1px; }
.cert-errs { max-height: 160px; overflow-y: auto; font-size: 12.5px; color: var(--red-text); }
@media (max-width: 760px) {
  .cert-fsel, .cert-fsearch { width: auto; flex: 1 1 150px; }
  .cert-range .inp { width: 140px; }
  .cert-comp b { max-width: 50%; }
  .cert-grid, .cert-grid tbody, .cert-grid td { display: block; width: 100%; }
  .cert-grid colgroup, .cert-grid thead { display: none; }
  .cert-grid tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 8px; padding: 6px 2px; border-bottom: 1px solid var(--border); }
  .cert-grid tr.cert-yr { display: block; padding: 0; }
  .cert-grid td { padding: 0; border: 0; }
  .cert-grid td.c-m { grid-column: 1 / -1; }
  .cert-grid td.c-t { text-align: left; }
  .cert-grid td[data-l]::before { content: attr(data-l); display: block; font-size: 10.5px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cert-grid td.c-m::before { display: none; }
  .cert-in { border-color: var(--border); height: 30px; }
  .cert-bulk-opts { padding-top: 0; }
}

/* ---------- catalogul și setările ---------- */
.cert-tflags { gap: 6px; padding-top: 18px; }
.cert-set { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cert-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 5px 12px; padding: 4px 0; }
.cert-kinds .check { align-items: flex-start; }
@media (max-width: 900px) { .cert-set { grid-template-columns: minmax(0, 1fr); } .cert-tflags { padding-top: 0; } }

/* ---------- foaia adeverinței (în document, ecran și tipar) ---------- */
.doc-body table.cert-tbl { margin: 4px 0 10px; }
.doc-body table.cert-tbl th, .doc-body table.cert-tbl td { font-size: 9.5pt; padding: 2px 4px; vertical-align: top; }
.doc-body table.cert-tbl small { font-size: 8.5pt; }
.doc-body table.cert-tbl.cert-small th, .doc-body table.cert-tbl.cert-small td { font-size: 8.5pt; padding: 1px 3px; }
.doc-body table.cert-tbl tfoot th { background: #f7f7f7; }
.doc-body .cert-num { text-align: right; white-space: nowrap; }
.doc-body .cert-nw { white-space: nowrap; }
.doc-body table.cert-kv td { font-size: 10.5pt; }
.doc-body table.cert-kv td:first-child { width: 46%; }
.doc-body .cert-small, .doc-body p.cert-small { font-size: 9.5pt; }
.doc-body table.sig.cert-sig3 td { width: 33.3%; font-size: 10.5pt; padding-right: 8px; }
.cert-bundle .doc-sheet + .doc-sheet { margin-top: 16px; }
@media print { .cert-bundle .doc-sheet + .doc-sheet { margin-top: 0; break-before: page; page-break-before: always; } }
