/* ============================================================
   TRAININGSHAUS-DASHBOARD
   Oben 4 Karten (Neu anlegen) · links Anmeldungen · rechts Aufgaben
   ============================================================ */
.thd-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }

/* Oben: 4 Karten */
.thd-top { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin-bottom: 24px; }
.thd-new { display: flex; flex-direction: column; gap: 4px; padding: 20px; min-height: 120px; text-decoration: none; color: var(--ink);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.thd-new:hover { border-color: var(--we); }
.thd-new { --we: var(--accent-dark); --we-hell: var(--accent-tint); background: var(--paper); }
.thd-new-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none;
  border-radius: 8px; background: color-mix(in srgb, var(--we, var(--accent-dark)) 14%, transparent); margin-bottom: auto; }
.thd-new-icon i { font-size: 20px; color: var(--we, var(--accent-dark)); }
.thd-new .thd-new-icon { margin-bottom: 12px; }
.thd-new-titel { font-size: 16px; font-weight: 700; }
.thd-new-sub { font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Darunter: links groß, rechts schmal */
.thd-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.thd-panel { padding: 20px 24px; min-height: 420px; }
.thd-panel-kopf { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.thd-h { font-size: 16px; font-weight: 700; color: var(--ink); margin: 0; }
.thd-h2 { font-size: 13px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .5px; margin: 24px 0 4px; }

/* Anmeldungen je Wochenende */
.thd-we { display: block; padding: 14px 16px; margin-bottom: 10px; background: var(--paper); border: 1px solid var(--line);
  border-radius: 8px; text-decoration: none; color: var(--ink); }
.thd-we { --we: var(--accent-dark); border-radius: 12px; padding: 16px 20px; }
.thd-we:hover { border-color: var(--we); }
.thd-we .thd-bar > span { background: var(--we); }
.thd-we .thd-bar.is-voll > span { background: var(--danger); }
.thd-we-baustein { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: var(--we-dunkel); background: color-mix(in srgb, var(--we) 16%, transparent); padding: 1px 8px; border-radius: 999px; margin-bottom: 4px; }
.thd-we-kopf strong { display: block; }
.thd-we-kopf { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 8px; }
.thd-we-kopf strong { font-size: 16px; }
.thd-we-kopf small { display: block; font-size: 12px; color: var(--ink-soft); }
.thd-we-zahl { font-size: 28px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; flex: none; }
.thd-we-zahl span { font-size: 16px; font-weight: 600; color: var(--ink-soft); }
.thd-we-status { font-size: 12px; color: var(--ink-soft); margin-top: 8px; }
.thd-bar { height: 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.thd-bar > span { display: block; height: 100%; background: var(--accent-dark); }
.thd-bar.is-voll > span { background: var(--danger); }

/* Listen */
.thd-list { list-style: none; margin: 0; padding: 0; }
.thd-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.thd-list li:first-child { border-top: 0; }
.thd-list-text { flex: 1; min-width: 0; font-size: 14px; color: var(--ink); }
.thd-list-text small { display: block; font-size: 12px; color: var(--ink-soft); }
a.thd-todo { text-decoration: none; }
a.thd-todo:hover { color: var(--accent-dark); }
.thd-todo-icon { font-size: 18px; color: var(--we, var(--accent-dark)); }
.thd-list li.is-dringend .thd-todo-icon { color: var(--danger); }
.thd-list li.is-dringend .thd-todo { font-weight: 700; }
.thd-punkt { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--we, var(--accent-dark));
  margin-right: 6px; vertical-align: 1px; }
.thd-link { color: var(--accent-dark); font-weight: 700; font-size: 13px; text-decoration: none; }
.thd-leer { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--ink-soft); font-size: 14px; }
.thd-leer i { color: var(--pal-gruen); font-size: 20px; }

@media (max-width: 1024px) {
  .thd-top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .thd-main { grid-template-columns: 1fr; }
  .thd-panel { min-height: 0; }
}
@media (max-width: 480px) {
  .thd-top { grid-template-columns: 1fr; }
}

/* Statistik */
.thd-stat { margin-top: 24px; min-height: 0; }
.thd-kacheln { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.thd-kachel { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px;
  display: flex; align-items: center; gap: 14px; }
.thd-kachel .thd-new-icon { margin: 0; }
.thd-kachel b { display: block; font-size: 28px; font-weight: 800; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.thd-kachel span { font-size: 12px; color: var(--ink-soft); }
.thd-charts { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; }
.thd-chart { margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; }
.thd-chart figcaption { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 12px; }

/* Säulen */
.thd-saeulen { display: flex; align-items: stretch; gap: 10px; height: 200px; border-bottom: 1px solid var(--line); }
.thd-saeule { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; text-decoration: none; }
.thd-saeule-wert { font-size: 12px; font-weight: 700; color: var(--ink-soft); height: 18px; }
.thd-saeule:hover .thd-saeule-wert { opacity: 1; color: var(--ink); }
.thd-saeule-spur { position: relative; flex: 1; width: 100%; max-width: 44px; }
.thd-saeule-max, .thd-saeule-fill { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 4px 4px 0 0; }
.thd-saeule-max { border: 1px dashed var(--ink-faint); border-bottom: 0; background: transparent; }
.thd-saeule { --we: var(--accent-dark); }
.thd-saeule-fill { left: 4px; right: 4px; background: var(--we); transition: filter .15s; }
.thd-saeule.is-kommend .thd-saeule-fill { background: repeating-linear-gradient(135deg, var(--we) 0 4px, color-mix(in srgb, var(--we) 45%, transparent) 4px 8px); }
.thd-saeule:hover .thd-saeule-fill { filter: brightness(.9); }
.thd-saeule-label { font-size: 11px; color: var(--ink-soft); margin-top: 6px; position: relative; top: 1px; white-space: nowrap; transform: translateY(100%); height: 0; }
.thd-saeulen { margin-bottom: 26px; }
.thd-legende { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12px; color: var(--ink-soft); }
.thd-legende span { display: inline-block; width: 12px; height: 12px; border-radius: 8px; margin-right: -8px; vertical-align: middle; }
.thd-l-fill { background: var(--accent-dark); }
.thd-l-max { border: 1px dashed var(--ink-faint); }
.thd-l-kommend { background: repeating-linear-gradient(135deg, var(--ink-soft) 0 3px, transparent 3px 6px); }
.thd-legende em { margin-left: auto; font-style: normal; color: var(--ink-faint); }

/* Querbalken je Baustein */
.thd-hbar { display: grid; grid-template-columns: 170px minmax(0, 1fr) 32px; align-items: center; gap: 10px; padding: 7px 0; }
.thd-hbar-name { font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thd-hbar-spur { height: 12px; background: var(--surface); border-radius: 0 4px 4px 0; }
.thd-hbar-spur span { display: block; height: 100%; background: var(--we, var(--accent-dark)); border-radius: 0 4px 4px 0; }
.thd-hbar-wert { font-size: 13px; font-weight: 700; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 1024px) {
  .thd-charts { grid-template-columns: 1fr; }
  .thd-kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Anmelde-Block: links Zahlen, rechts Einladung */
.thd-we { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: center; cursor: pointer; }
.thd-we-info { min-width: 0; }
.thd-einl { display: flex; align-items: center; gap: 14px; padding-left: 20px; border-left: 1px solid var(--line); min-width: 0; }
.thd-einl-bild { width: 84px; height: 84px; flex: none; border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--we) 12%, var(--paper)); border: 1px solid color-mix(in srgb, var(--we) 30%, var(--line));
  box-shadow: 0 2px 6px rgba(0,0,0,.08); transition: transform .15s ease; text-decoration: none; }
.thd-einl-bild:hover { transform: scale(1.06); }
.thd-einl-bild i { font-size: 28px; color: var(--we); }
.thd-einl-bild img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thd-einl-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.thd-einl-titel { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-soft); }
.thd-einl-status { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--pal-kupfer); }
.thd-einl-status.is-ok { color: var(--pal-gruen); }
.thd-einl-status i { font-size: 16px; }
.thd-einl-links { display: flex; gap: 12px; font-size: 13px; }
.thd-einl-links a { color: var(--we-dunkel, var(--accent-dark)); font-weight: 700; text-decoration: none; }
.thd-einl-links a:hover { text-decoration: underline; }
body.dark-mode .thd-einl-status { color: var(--pal-senf-mittel); }
body.dark-mode .thd-einl-status.is-ok { color: var(--pal-gruen-mittel); }
body.dark-mode .thd-einl-links a { color: var(--we); }

@media (max-width: 768px) {
  .thd-we { grid-template-columns: 1fr; }
  .thd-einl { border-left: 0; border-top: 1px solid var(--line); padding: 14px 0 0; min-width: 0; }
}

/* Veranstaltungen-Dashboard nutzt dieselben Stile */
.thd-small { font-size: 12px; color: var(--ink-soft); }
.thd-einl-info .thd-small { font-size: 13px; }
/* Aufgaben-Überschrift als Link (Inventar, Gemeinschaften) */
.thd-list-text a.thd-todo { color: var(--ink); }
.thd-list-text a.thd-todo:hover { color: var(--accent-dark); }
