/* Training records (views/training.js). Mobile-first; colors only from app.css variables (dark mode safe). */

.tr-back { display: inline-flex; align-items: center; min-height: 36px; margin-bottom: 4px; font-weight: 600; text-decoration: none; color: var(--brand-2); }
.tr-dot { display: inline-block; flex: none; width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line); }
.badge.tr-unverified { background: var(--surface-2); color: var(--warn); box-shadow: inset 0 0 0 1px var(--line); }

/* summary tiles */
.tr-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.tr-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); min-width: 0; }
.tr-tile-n { font-size: 1.7rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--ink); }
.tr-tile-l { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 13.5px; font-weight: 600; color: var(--ink-3); margin-top: 2px; }
.tr-tile.bad { border-color: var(--bad); background: var(--bad-bg); } .tr-tile.bad .tr-tile-n { color: var(--bad); }
.tr-tile.warn { border-color: var(--warn); background: var(--warn-bg); } .tr-tile.warn .tr-tile-n { color: var(--warn); }
.tr-tile.good .tr-tile-n { color: var(--good); }
.tr-tile.info { background: var(--info-bg); } .tr-tile.info .tr-tile-n { color: var(--info); }
@media (min-width: 700px) { .tr-tiles { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); } }

/* alerts list */
.tr-alerts { margin-bottom: 14px; }
.tr-alerts h2 { margin-bottom: 6px; }
.tr-alerts .row-list { margin-bottom: 8px; }
.tr-alerts .row .badge { flex: none; }

/* technician grid */
.tr-search { max-width: 420px; }
.tr-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .tr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1050px) { .tr-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card.tr-tech { display: flex; flex-direction: column; gap: 8px; margin: 0; text-decoration: none; color: var(--ink); min-width: 0; transition: border-color .15s; }
.card.tr-tech + .card.tr-tech { margin-top: 0; }
.card.tr-tech:hover, .card.tr-tech:focus-visible { border-color: var(--brand-2); }
.tr-tech-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tr-tech-head b { font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-tech-head .spacer { flex: 1; }
.tr-chev { font-size: 1.6rem; line-height: 1; color: var(--ink-3); }
.tr-tech .chip-row { gap: 6px; }
.tr-tech-meta { color: var(--ink-3); }

/* one technician */
.tr-group { margin-top: 18px; }
.tr-group-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 8px; }
.tr-group-head h2 { margin: 0; }
.tr-recs { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 900px) { .tr-recs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card.tr-rec { margin: 0; min-width: 0; border-left: 4px solid var(--line); }
.card.tr-rec + .card.tr-rec { margin-top: 0; }
.card.tr-rec.tr-expired { border-left-color: var(--bad); }
.card.tr-rec.tr-soon { border-left-color: var(--warn); }
.card.tr-rec.tr-current { border-left-color: var(--good); }
.card.tr-rec.tr-replaced { opacity: .72; }
.tr-rec-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.tr-rec-head h3 { margin: 0; overflow-wrap: anywhere; }
.tr-rec-head .chip-row { gap: 6px; }
@media (min-width: 520px) { .tr-rec-head { flex-direction: row; align-items: flex-start; justify-content: space-between; } .tr-rec-head .chip-row { justify-content: flex-end; flex: none; max-width: 55%; } }
.tr-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; margin: 0 0 8px; }
.tr-facts div { min-width: 0; }
.tr-facts dt { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-3); }
.tr-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
@media (min-width: 520px) { .tr-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tr-notes { white-space: pre-wrap; color: var(--ink-2); background: var(--surface-2); border-radius: var(--radius-s); padding: 8px 10px; font-size: 14.5px; }
.tr-actions { margin-top: 10px; }
.tr-actions .spacer { flex: 1; }
.tr-verified-by { display: block; margin-top: 6px; }
.tr-empty { text-align: center; padding: 26px 16px; }

/* file thumbnails */
.tr-files { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 2px; }
.tr-file-wrap { position: relative; }
.tr-file { display: flex; flex-direction: column; width: 96px; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; background: var(--surface-2); text-decoration: none; color: var(--ink-2); }
.tr-file img { width: 96px; height: 72px; object-fit: cover; display: block; background: var(--surface); }
.tr-pdf-icon { display: flex; align-items: center; justify-content: center; height: 72px; font-weight: 800; letter-spacing: .05em; color: var(--bad); background: var(--bad-bg); }
.tr-file-name { font-size: 11.5px; padding: 3px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-file:hover { border-color: var(--brand-2); }
.tr-file-x { position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--bad); font-weight: 700; cursor: pointer; box-shadow: var(--shadow); }

/* add / edit modal */
.tr-form .tr-row3 { display: grid; grid-template-columns: minmax(0, 1fr) 84px; gap: 12px; }
.tr-form .tr-state { text-transform: uppercase; }
.tr-form .tr-noexp { margin-top: 8px; font-size: 13.5px; min-height: 34px; }
.tr-form .tr-verify { display: flex; flex-wrap: wrap; border-radius: var(--radius-s); padding: 8px 12px; min-height: 44px; height: auto; }
.tr-pending { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tr-x { border: 0; background: transparent; color: inherit; font-weight: 700; cursor: pointer; padding: 0 2px; min-height: 0; }

/* printed training file (screen preview inherits app colors; print forces ink on white) */
.tr-doc { color: #111; background: #fff; font-size: 12.5px; }
.tr-doc .doc-head { display: flex; align-items: flex-start; gap: 14px; padding-bottom: 10px; border-bottom: 2px solid #111; margin-bottom: 10px; }
.tr-doc .doc-logo { max-height: 64px; max-width: 160px; object-fit: contain; }
.tr-doc .doc-co { flex: 1; line-height: 1.35; }
.tr-doc .doc-co-name { font-size: 16px; font-weight: 800; }
.tr-doc .doc-title { text-align: right; }
.tr-doc .doc-title-main { font-size: 17px; font-weight: 800; }
.tr-doc .doc-title-meta { color: #444; }
.tr-doc h3 { margin: 14px 0 4px; font-size: 13.5px; text-transform: uppercase; letter-spacing: .04em; }
.tr-doc-sum { font-weight: 600; }
.tr-doc-tbl { width: 100%; border-collapse: collapse; table-layout: fixed; }
.tr-doc-tbl th:nth-child(1) { width: 26%; } .tr-doc-tbl th:nth-child(2) { width: 12%; } .tr-doc-tbl th:nth-child(3) { width: 14%; } .tr-doc-tbl th:nth-child(4), .tr-doc-tbl th:nth-child(5) { width: 10%; } .tr-doc-tbl th:nth-child(6) { width: 13%; }
.tr-doc-tbl td { overflow-wrap: anywhere; }
.tr-doc-tbl th, .tr-doc-tbl td { border: 1px solid #bbb; padding: 4px 6px; text-align: left; vertical-align: top; }
.tr-doc-tbl th { background: #eee; font-size: 11.5px; }
.tr-doc-tbl tr { break-inside: avoid; }
.tr-doc-sub { color: #555; font-size: 11px; }
.tr-doc-sign { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; margin-top: 36px; }
.tr-doc-sign div { border-top: 1px solid #111; padding-top: 4px; font-size: 11.5px; }
@media print {
  body.printing > :not(.print-holder) { display: none !important; }
  body.printing { background: #fff; }
  .print-holder .tr-doc { margin: 0; }
}
.print-holder { display: none; }
@media print { body.printing .print-holder { display: block; } }
.tr-tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 420px) { .tr-tiles.three .tr-tile { padding: 10px; } .tr-tiles.three .tr-tile-l { font-size: 12.5px; } }
.tr-alerts .row .main b, .tr-alerts .row .main small { white-space: normal; }
