/* COmpanion – 02 Trainings (ergänzt app.css; nur modulspezifische Details) */

/* Allgemein */
.tr-session__meta .icon { color: var(--muted); flex: none; }
.tr-linkbtn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.tr-linkbtn.link-arrow { font-weight: 600; font-size: 14px; }
.tr-sub { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; line-height: 1.35; margin-top: 2px; }
.tr-show-sm { display: none; }
.tr-cat { display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 2px; line-height: 1.3; }
.tr-cat .catdot { width: 7px; height: 7px; margin-right: 5px; border-radius: 2px; }
.catdot { border-radius: 2px; }
.tr-filters select { width: auto; min-width: 150px; }
.tr-filters .check { white-space: nowrap; }
.table tr.tr-catrow > th { text-align: left; padding: 16px 12px 6px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--dark); font-weight: 700;
  border-bottom: 1px solid rgba(20,20,32,.12); background: rgba(255,255,255,.28); white-space: normal; }
.table tr.tr-catrow > th:first-child { padding-left: 22px; }
.table tr.tr-catrow > th .chip { text-transform: none; letter-spacing: 0; margin-left: 6px; height: 20px; font-size: 11px; }
.table tbody tr.tr-catrow:hover th { background: rgba(255,255,255,.28); }
.table tr.tr-grouprow > th { text-align: left; padding: 18px 22px 6px; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid rgba(20,20,32,.12); }
input[type=color] { width: 100%; height: 44px; padding: 4px; border: 1.5px solid rgba(20,20,32,.14); border-radius: var(--radius-sm); background: rgba(255,255,255,.72); cursor: pointer; }

/* Katalog: Ebene 2 – Matrix-Übersicht (Kacheln je Kategorie) */
.tr-sec + .tr-sec { margin-top: 28px; }
.tr-sec__head { display: flex; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; margin-bottom: 12px; }
.tr-sec__head h3 { font-size: 19px; }
.tr-sec__all { margin-left: auto; background: none; border: 0; padding: 0; font: inherit; font-weight: 600; font-size: 14px; color: inherit; cursor: pointer; }
.tr-sec__all:hover { color: var(--red); }
.tr-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.tr-tile { position: relative; display: flex; flex-direction: column; gap: 6px; text-align: left; font: inherit; color: inherit; cursor: pointer; padding: 14px 16px 14px 19px; min-height: 108px;
  background: var(--surface); border: 1px solid var(--glass-border); border-radius: var(--radius); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow); overflow: hidden; transition: background .15s, box-shadow .15s, transform .15s; }
.tr-tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--ink)); }
.tr-tile:hover { background: var(--surface-strong); box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 16px 40px rgba(18,18,30,.12); transform: translateY(-1px); }
.tr-tile:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.tr-tile[disabled] { opacity: .5; cursor: default; transform: none; }
.tr-tile.is-home { background: var(--surface-strong); box-shadow: inset 0 0 0 1.5px var(--ink), var(--glass-shadow); }
.tr-tile__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.tr-tile__top .chip { height: 20px; font-size: 11px; padding: 0 7px; flex: none; }
.tr-tile__name { font-weight: 700; font-size: 15.5px; line-height: 1.25; }
.tr-tile__count { font-size: 13.5px; color: var(--dark); }
.tr-tile__count b { font-size: 15px; }
.tr-tile__me { color: var(--info); font-weight: 600; }
.tr-tile__next { margin-top: auto; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }

/* Katalog: Ebene 3 – Liste */
.tr-listhead { display: flex; align-items: baseline; gap: 6px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.tr-listhead h3 { font-size: 20px; }
.tr-list tr.tr-row { cursor: pointer; }
.tr-list .tr-link.strong { font-weight: 700; }
.tr-list .tr-sub.tr-hide-sm { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; max-width: 560px; }
.tr-list td:first-child { min-width: 220px; }

/* Termin-Zeilen */
.session { grid-template-columns: 72px minmax(0, 1fr) auto; }
.session.is-cancelled .datebox { opacity: .45; }
.tr-session__main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tr-session__title { font-weight: 700; font-size: 15.5px; display: flex; align-items: center; }
.tr-session__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 13.5px; color: var(--dark); }
.tr-session__meta > span { display: inline-flex; align-items: center; gap: 5px; }
.tr-hint { font-size: 12.5px; color: var(--warning); }
.tr-action { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.tr-state { font-size: 13px; color: var(--muted); font-weight: 600; max-width: 180px; line-height: 1.3; }
.tr-link { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.tr-link:hover { color: var(--red); }

/* Detail-Modal */
.tr-detail .dl { font-size: 14px; }
.tr-trainers { display: flex; flex-direction: column; gap: 8px; }
.tr-text { font-size: 14.5px; color: var(--dark); }
.tr-goals { list-style: none; margin: 0; padding: 0; }
.tr-goals li { display: flex; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line-soft); font-size: 14.5px; }
.tr-goals li:first-child { border-top: 0; }
.tr-goals .icon { color: var(--success); flex: none; margin-top: 2px; }
.tr-detail .notice { margin-top: 12px; }

/* Pyramidal: Detailzeilen & kompakte Listen */
.tr-ok { color: var(--success); font-weight: 600; }
.tr-expand { display: flex; justify-content: space-between; align-items: center; gap: 10px 20px; flex-wrap: wrap; font-size: 14px; }
.tr-expand__text { display: flex; flex-direction: column; gap: 2px; }
.tr-expand--cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.tr-expand__title { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.tr-mini { list-style: none; margin: 0; padding: 0; }
.tr-mini li { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; padding: 5px 0; border-top: 1px solid var(--line-soft); }
.tr-mini li:first-child { border-top: 0; }
.tr-names { font-size: 13.5px; gap: 4px 16px; }
.tr-names dd { font-weight: 400; }
.tr-body-top { padding-bottom: 0; }
.tr-body-top details.expand, .tr-body-bottom details.expand { border-top: 0; }
.tr-body-bottom { padding-top: 0; }
.tr-body-bottom .table td { padding-top: 8px; padding-bottom: 8px; }
.tr-body-top details.expand > summary .icon { flex: none; }

/* Detail-Modal: nächster passender Termin + kompakte Terminliste */
.tr-next { background: var(--stage); padding: 12px 16px 4px; margin-top: 4px; border-left: 3px solid var(--c, var(--ink)); }
.tr-next__label { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.tr-next .session { border-top: 0; padding: 10px 0 12px; }
.tr-next .datebox { background: var(--surface-strong); }
.tr-sesstable td { padding-top: 10px; padding-bottom: 10px; }
.tr-sesstable tr.is-focus td { background: var(--stage-2); }
.tr-sesstable tr.is-focus td:first-child { box-shadow: inset 3px 0 0 var(--red); padding-left: 10px; }
.tr-sesstable .tr-action { flex-direction: row; justify-content: flex-end; align-items: center; flex-wrap: wrap; }

/* Global Learning Days */
.tr-eventpick select { min-width: 260px; }
.tr-mysel td { padding-top: 10px; padding-bottom: 10px; }
.tr-mysel .tr-link { text-align: left; }
.tr-daytabs { position: sticky; top: var(--tr-top, 64px); z-index: 20; display: flex; gap: 4px; padding: 5px; margin-bottom: 16px; overflow-x: auto; scrollbar-width: none;
  background: rgba(250,250,252,.82); border: 1px solid var(--glass-border); border-radius: var(--radius); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-shadow); }
.tr-daytab { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: 0; background: transparent; font: inherit; font-weight: 600; font-size: 14px;
  color: var(--dark); padding: 8px 12px; border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap; }
.tr-daytab small { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.tr-daytab__n { font-size: 11px; color: var(--dark); font-weight: 600; margin-left: 4px; min-width: 22px; height: 18px; padding: 0 5px; border-radius: 9px; background: rgba(20,20,32,.07); display: inline-flex; align-items: center; justify-content: center; }
.tr-daytab:hover { background: rgba(255,255,255,.7); }
.tr-daytab.is-active { background: var(--ink); color: var(--white); }
.tr-daytab.is-active small { color: #c9c8ce; }
.tr-daytab.is-active .tr-daytab__n { background: rgba(255,255,255,.18); color: var(--white); }

.tr-mxcard > summary { list-style: none; cursor: pointer; padding-bottom: 12px; }
.tr-mxcard > summary::-webkit-details-marker { display: none; }
.tr-mxcard > summary .card__title::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin: -4px 0 0 4px; transition: transform .15s; }
.tr-mxcard:not([open]) > summary .card__title::after { transform: rotate(-45deg); margin-top: 0; }
.tr-mx { width: 100%; border-collapse: collapse; font-size: 14px; }
.tr-mx th, .tr-mx td { padding: 3px 6px; text-align: center; border-bottom: 1px solid rgba(20,20,32,.06); }
.tr-mx thead th { font-size: 12px; font-weight: 700; padding: 6px; border-bottom: 2px solid var(--ink); white-space: nowrap; }
.tr-mx thead th .muted { font-weight: 500; }
.tr-mx .tr-mx__cat { text-align: left; padding-left: 22px; white-space: nowrap; font-weight: 500; }
.tr-mx th.tr-mx__cat button { background: none; border: 0; padding: 4px 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.tr-mx th.tr-mx__cat button:hover { color: var(--red); }
.tr-mx tr.is-home th.tr-mx__cat { font-weight: 700; }
.tr-mx__home { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; background: var(--ink); color: var(--white); padding: 1px 6px; border-radius: 3px; margin-left: 6px; vertical-align: 1px; }
.tr-mx__grp th { text-align: left; padding: 14px 22px 4px; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.tr-mx td button { position: relative; min-width: 40px; height: 30px; padding: 0 8px; border: 0; border-radius: var(--radius-sm); background: transparent; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; }
.tr-mx td button:hover { background: var(--ink); color: var(--white); }
.tr-mx td.is-0 { color: var(--soft); }
.tr-mx td.tr-mx__sum { border-left: 1px solid rgba(20,20,32,.1); }
.tr-mx td.tr-mx__sum button { font-weight: 600; color: var(--dark); }
.tr-mx td.has-mine button::after, .tr-mx__dot { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.tr-mx td.has-mine button::after { position: absolute; top: 3px; right: 3px; }
.tr-mx .is-sel { background: rgba(255,255,255,.55); }
.tr-mx thead th.is-sel { box-shadow: inset 0 -2px 0 var(--red); }
.tr-mx tbody tr.is-sel th, .tr-mx tbody tr.is-sel td { background: rgba(255,255,255,.7); }
.tr-mx tbody tr:last-child th, .tr-mx tbody tr:last-child td { border-bottom: 0; }
.tr-mx__legend { padding: 8px 22px 14px; display: flex; align-items: center; gap: 6px; }

.tr-prog td { padding-top: 9px; padding-bottom: 9px; }
.tr-prog .tr-link { text-align: left; }
.tr-prog tr.is-booked td { background: rgba(227, 243, 233, .7); }
.tr-prog tr.is-waitlist td { background: rgba(253, 241, 223, .75); }
.tr-prog tr.is-conflict .tr-link { color: var(--dark); }
.tr-prog .tr-hint { display: block; margin-top: 2px; }
.tr-prog td.actions .chip { cursor: default; }
.tr-full { color: var(--warning); font-weight: 600; }

/* Verwaltung */
.tr-tabs { display: flex; gap: 4px; padding: 4px; width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none;
  background: var(--surface); border: 1px solid var(--glass-border); border-radius: var(--radius); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-shadow); }
.tr-tabs__item { padding: 7px 16px; font-weight: 600; font-size: 14px; white-space: nowrap; border-radius: var(--radius-sm); color: var(--dark); }
.tr-tabs__item:hover { background: rgba(255,255,255,.7); color: var(--ink); }
.tr-tabs__item.is-active { background: var(--ink); color: var(--white); }
.tr-back .icon { transform: rotate(180deg); }
.tr-back { display: inline-flex; }
.tr-notice-action { align-items: center; flex-wrap: wrap; }
.tr-addform { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.tr-addform .field { min-width: 240px; max-width: 480px; }
.tr-status { width: auto; min-width: 150px; }
.tr-hints { display: inline-flex; gap: 4px; flex-wrap: wrap; vertical-align: middle; margin-left: 4px; }
.tr-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 16px; }
.tr-pickers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

@media (max-width: 640px) {
  .session { grid-template-columns: 60px minmax(0, 1fr); }
  .tr-action { align-items: flex-start; text-align: left; flex-direction: row; flex-wrap: wrap; }
  .tr-state { max-width: none; }
  .tr-expand--cols { grid-template-columns: minmax(0, 1fr); }
  .tr-next { padding: 10px 12px 2px; }
  .tr-sesstable .tr-action { justify-content: flex-start; }
  .tr-eventpick, .tr-eventpick select { width: 100%; min-width: 0; }
  .tr-pickers { grid-template-columns: minmax(0, 1fr); }
  .tr-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tr-tile { padding: 12px 12px 12px 15px; min-height: 96px; }
  .tr-tile__name { font-size: 14.5px; }
  .tr-tile__top { flex-direction: column; gap: 4px; }
  .tr-tile__count { font-size: 12.5px; }
  .tr-sec__head h3 { font-size: 17px; }
  .tr-filters .searchbox { flex: 1 1 100%; max-width: none; }
  .tr-filters select { flex: 1 1 140px; min-width: 0; }
  .tr-daytab { padding: 8px 6px; flex: 1 1 0; }
  .tr-daytab .tr-daytab__n { display: none; }
  .tr-prog td.actions .btn--sm { padding: 0 10px; }
  /* Matrix mobil: nur die Spalte des gewählten Tags (bzw. Gesamt) */
  .tr-mx [data-day]:not(.is-sel) { display: none; }
  .tr-mx .is-sel { background: transparent; }
  .tr-mx thead th.is-sel { box-shadow: none; }
  .tr-mx .tr-mx__cat { padding-left: 12px; white-space: normal; }
  .tr-mx__grp th { padding-left: 12px; }
  .tr-mx__legend { padding-left: 12px; }
  .tr-mxcard > summary { padding-left: 12px; padding-right: 12px; }
  .tr-addform .field { min-width: 0; width: 100%; }
}

/* Schmale Bildschirme: Tabellen ohne Nebeninformationen */
@media (max-width: 640px) {
  .tr-hide-sm, .tr-list .tr-sub.tr-hide-sm { display: none; }
  .tr-show-sm { display: block; }
  .tr-list td:first-child { min-width: 0; }
  .table .catdot { display: none; }
  .table tr.tr-catrow > th:first-child { padding-left: 12px; }
  .table tr.tr-grouprow > th { padding-left: 12px; }
  .tr-sesstable td { padding-left: 0; padding-right: 8px; }
  body[data-page="trainings"] .table th, body[data-page="trainings"] .table td { padding-left: 8px; padding-right: 8px; }
  body[data-page="trainings"] .table th:first-child, body[data-page="trainings"] .table td:first-child { padding-left: 12px; }
  body[data-page="trainings"] .table .chip { padding: 0 6px; }
  .tr-status { min-width: 0; width: 130px; }
  .tr-hints { display: flex; margin: 4px 0 0; }
  body[data-page="trainings"] .table .person__sub { display: none; }
  body[data-page="trainings"] .table td.actions .btn { padding: 0 6px; }
}

@media (max-width: 1180px) {
  .tr-hide-md { display: none; }
}
