/*
 * SVASS Trainingsteilnahme - Oberflaeche.
 *
 * Mobil zuerst: alle Felder stehen untereinander, ab 640 px im Raster.
 * Grosse Tippflaechen (mindestens 44 px) fuer Checkboxen und Knoepfe.
 */

.tt-wurzel {
	--tt-blau: #1f6fb8;
	--tt-blau-dunkel: #17558e;
	--tt-hell: #e6f1fb;
	--tt-text: #28251d;
	--tt-grau: #5f5e5a;
	--tt-linie: #d4d1ca;
	--tt-flaeche: #ffffff;
	--tt-grund: #f7f6f2;
	--tt-rot: #b3261e;
	--tt-gruen: #2e7d32;
	--tt-gelb: #8a5a00;
	color: var(--tt-text);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.5;
}

.tt-wurzel *,
.tt-wurzel *::before,
.tt-wurzel *::after {
	box-sizing: border-box;
}

.tt-wurzel [hidden] {
	display: none !important;
}

.tt-app {
	max-width: 1000px;
	margin: 0 auto;
}

.tt-wurzel h2 {
	font-size: 1.35rem;
	margin: 0 0 12px;
}

.tt-wurzel h3 {
	font-size: 1.1rem;
	margin: 20px 0 8px;
}

.tt-wurzel h4 {
	font-size: 1rem;
	margin: 16px 0 6px;
}

/* Hinweise */

.tt-hinweis {
	background: var(--tt-grund);
	border: 1px solid var(--tt-linie);
	border-radius: 6px;
	padding: 10px 14px;
	margin: 10px 0;
}

.tt-hinweis ul {
	margin: 6px 0 0 18px;
	padding: 0;
}

.tt-hinweis--fehler {
	border-color: var(--tt-rot);
	color: var(--tt-rot);
	background: #fdf1f0;
}

.tt-hinweis--ok {
	border-color: var(--tt-gruen);
	color: var(--tt-gruen);
	background: #f1f8f1;
}

.tt-hinweis--warn {
	border-color: var(--tt-gelb);
	color: var(--tt-gelb);
	background: #fdf7ec;
}

.tt-klein,
.tt-hilfe {
	color: var(--tt-grau);
	font-size: 0.875rem;
}

.tt-fehlertext {
	color: var(--tt-rot);
}

/* Kopf und Reiter */

.tt-kopf {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 8px;
	color: var(--tt-grau);
	font-size: 0.875rem;
	margin: 0 0 8px;
}

.tt-reiter,
.tt-unterreiter {
	display: flex;
	gap: 4px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border-bottom: 2px solid var(--tt-linie);
	margin: 0 0 16px;
}

.tt-reiter__knopf,
.tt-unterreiter__knopf {
	flex: 0 0 auto;
	min-height: 44px;
	padding: 8px 14px;
	border: 0;
	border-bottom: 3px solid transparent;
	background: transparent;
	color: var(--tt-text);
	font: inherit;
	cursor: pointer;
	white-space: nowrap;
}

.tt-reiter__knopf.ist-aktiv,
.tt-unterreiter__knopf.ist-aktiv {
	border-bottom-color: var(--tt-blau);
	color: var(--tt-blau);
	font-weight: 600;
}

.tt-unterreiter {
	border-bottom-width: 1px;
}

.tt-unterreiter__knopf {
	font-size: 0.9375rem;
}

/* Karten und Raster */

.tt-karte {
	background: var(--tt-flaeche);
	border: 1px solid var(--tt-linie);
	border-radius: 8px;
	padding: 16px;
	margin: 0 0 16px;
}

.tt-raster {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
}

@media (min-width: 640px) {
	.tt-raster {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
	.tt-raster--2 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.tt-feld {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: 0 0 8px;
}

.tt-feld label {
	font-weight: 600;
	font-size: 0.9375rem;
}

.tt-wurzel input[type="text"],
.tt-wurzel input[type="email"],
.tt-wurzel input[type="password"],
.tt-wurzel input[type="search"],
.tt-wurzel input[type="number"],
.tt-wurzel input[type="date"],
.tt-wurzel input[type="time"],
.tt-wurzel select,
.tt-wurzel textarea {
	width: 100%;
	min-height: 44px;
	padding: 8px 10px;
	border: 1px solid var(--tt-linie);
	border-radius: 6px;
	background: #fff;
	color: var(--tt-text);
	font: inherit;
	font-size: 16px;
}

.tt-wurzel textarea {
	min-height: 80px;
	resize: vertical;
}

.tt-wurzel input:focus,
.tt-wurzel select:focus,
.tt-wurzel textarea:focus,
.tt-knopf:focus-visible,
.tt-eintrag:focus-visible {
	outline: 2px solid var(--tt-blau);
	outline-offset: 1px;
}

.tt-zahl {
	max-width: 110px;
}

.tt-check {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	cursor: pointer;
}

.tt-check input {
	width: 22px;
	height: 22px;
	flex: 0 0 auto;
	margin: 0;
}

.tt-gruppe {
	border: 1px solid var(--tt-linie);
	border-radius: 6px;
	padding: 10px 12px;
	margin: 0 0 12px;
}

.tt-gruppe legend {
	font-weight: 600;
	padding: 0 6px;
}

.tt-checkliste {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0 16px;
	margin: 6px 0;
}

@media (min-width: 640px) {
	.tt-checkliste {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* Knoepfe */

.tt-knopf {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 8px 16px;
	border: 1px solid var(--tt-linie);
	border-radius: 6px;
	background: var(--tt-flaeche);
	color: var(--tt-text);
	font: inherit;
	text-decoration: none;
	cursor: pointer;
}

.tt-knopf:hover {
	background: var(--tt-grund);
}

.tt-knopf:disabled {
	opacity: 0.6;
	cursor: wait;
}

.tt-knopf--haupt {
	background: var(--tt-blau);
	border-color: var(--tt-blau);
	color: #fff;
	font-weight: 600;
}

.tt-knopf--haupt:hover {
	background: var(--tt-blau-dunkel);
	color: #fff;
}

.tt-knopf--gefahr {
	border-color: var(--tt-rot);
	color: var(--tt-rot);
}

.tt-knopf--klein {
	min-height: 36px;
	padding: 4px 10px;
	font-size: 0.875rem;
}

.tt-aktionen {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 16px 0 0;
}

/* Die Speicherleiste der Trainingszeiten bleibt unten sichtbar. */
.tt-aktionen--fest {
	position: sticky;
	bottom: 0;
	background: var(--tt-flaeche);
	padding: 10px 0;
	border-top: 1px solid var(--tt-linie);
	z-index: 2;
}

.tt-werkzeug {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 8px 0;
}

.tt-werkzeug input[type="search"],
.tt-werkzeug input[type="text"],
.tt-werkzeug select {
	flex: 1 1 200px;
	width: auto;
}

.tt-zaehler {
	font-weight: 600;
}

/* Mitgliederliste */

.tt-liste {
	border: 1px solid var(--tt-linie);
	border-radius: 6px;
	max-height: 60vh;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.tt-liste--kurz {
	max-height: none;
}

.tt-liste > p {
	margin: 10px 12px;
}

.tt-zeile {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 12px;
	min-height: 48px;
	padding: 8px 12px;
	border-bottom: 1px solid var(--tt-linie);
	cursor: pointer;
}

.tt-zeile:last-child {
	border-bottom: 0;
}

.tt-zeile input {
	width: 22px;
	height: 22px;
	margin: 0;
	flex: 0 0 auto;
}

.tt-zeile.ist-gewaehlt {
	background: var(--tt-hell);
}

.tt-zeile__name {
	flex: 1 1 160px;
	font-weight: 600;
}

.tt-zeile__alter {
	flex: 0 0 auto;
	font-variant-numeric: tabular-nums;
}

.tt-zeile__zusatz {
	flex: 1 1 100%;
	padding-left: 34px;
	color: var(--tt-grau);
	font-size: 0.8125rem;
}

.tt-zeile--ausserhalb .tt-zeile__name,
tr.tt-zeile--ausserhalb td {
	color: var(--tt-gelb);
}

/* Nicht-Mitglieder */

.tt-gast {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0 12px;
	padding: 10px 12px;
	border: 1px solid var(--tt-linie);
	border-radius: 6px;
	margin: 0 0 10px;
}

@media (min-width: 640px) {
	.tt-gast {
		grid-template-columns: 1fr 1fr 1fr auto;
		align-items: end;
	}
}

.tt-gast__ende {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 8px;
}

.tt-gast__alter {
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

/* Trainer und Betreuer */

.tt-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 4px 0;
}

.tt-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 4px 2px 12px;
	border-radius: 999px;
	background: var(--tt-hell);
	border: 1px solid #b9d5ef;
}

.tt-chip__weg {
	min-width: 32px;
	min-height: 32px;
	border: 0;
	background: transparent;
	font-size: 1.1rem;
	cursor: pointer;
	color: var(--tt-text);
}

.tt-summe {
	background: var(--tt-grund);
	border-radius: 6px;
	padding: 10px 14px;
	margin: 12px 0 0;
}

/* Liste der Trainings */

.tt-karten {
	display: grid;
	grid-template-columns: 1fr;
	gap: 8px;
	margin: 10px 0 0;
}

@media (min-width: 640px) {
	.tt-karten {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.tt-eintrag {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--tt-linie);
	border-radius: 8px;
	background: var(--tt-flaeche);
	color: var(--tt-text);
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.tt-eintrag:hover {
	border-color: var(--tt-blau);
}

.tt-eintrag__titel {
	font-weight: 600;
}

.tt-eintrag__info {
	color: var(--tt-grau);
	font-size: 0.875rem;
}

/* Ansicht eines Trainings */

.tt-daten {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 4px 16px;
	margin: 0 0 12px;
}

.tt-daten dt {
	font-weight: 600;
}

.tt-daten dd {
	margin: 0;
	white-space: pre-line;
	overflow-wrap: anywhere;
}

.tt-tabelle-huelle {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.tt-tabelle {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9375rem;
}

.tt-tabelle th,
.tt-tabelle td {
	padding: 6px 8px;
	border-bottom: 1px solid var(--tt-linie);
	text-align: left;
	vertical-align: top;
}

.tt-tabelle th {
	background: var(--tt-grund);
}

.tt-tabelle td input {
	min-width: 160px;
}

.tt-verlauf {
	margin: 0;
	padding-left: 18px;
	font-size: 0.875rem;
}

/* Trainingszeiten */

.tt-zeit {
	border-left: 4px solid var(--tt-blau);
}

.tt-zeit--aus {
	border-left-color: var(--tt-grau);
	opacity: 0.8;
}

.tt-zeit__kopf {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	margin: 0 0 8px;
}

/* Einstellungen */

.tt-untergruppen {
	margin: 8px 0;
}

.tt-ug {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 10px;
	align-items: end;
	padding: 8px 0;
	border-bottom: 1px dashed var(--tt-linie);
}

.tt-ug .tt-feld:first-child {
	grid-column: 1 / -1;
}

@media (min-width: 640px) {
	.tt-ug {
		grid-template-columns: 2fr 1fr 1fr auto;
	}
	.tt-ug .tt-feld:first-child {
		grid-column: auto;
	}
}

.tt-ug .tt-knopf {
	margin: 0 0 8px;
}

/* Ausklappfelder fuer Trainingszeiten, Trainer und Betreuer */

.tt-klapp-werkzeug {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 8px 0 4px;
}

.tt-klapp-werkzeug input[type="search"] {
	flex: 1 1 260px;
	min-width: 0;
	min-height: 44px;
	box-sizing: border-box;
}

.tt-klapp-werkzeug__knoepfe {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

.tt-klapp-werkzeug__zahl {
	margin-right: 4px;
}

.tt-klapp {
	border: 1px solid var(--tt-linie);
	border-radius: 6px;
	background: var(--tt-flaeche);
	margin: 8px 0;
}

.tt-klapp[hidden] {
	display: none;
}

.tt-klapp > summary {
	display: flex;
	flex-direction: column;
	gap: 2px;
	cursor: pointer;
	list-style: none;
	min-height: 44px;
	box-sizing: border-box;
	padding: 10px 40px 10px 12px;
	position: relative;
}

.tt-klapp > summary::-webkit-details-marker {
	display: none;
}

/* Pfeil rechts im Kopf, gedreht wenn offen */
.tt-klapp > summary::after {
	content: "";
	position: absolute;
	right: 16px;
	top: 50%;
	width: 8px;
	height: 8px;
	margin-top: -6px;
	border-right: 2px solid var(--tt-grau);
	border-bottom: 2px solid var(--tt-grau);
	transform: rotate(45deg);
}

.tt-klapp[open] > summary::after {
	transform: rotate(225deg);
	margin-top: -2px;
}

.tt-klapp > summary:focus-visible {
	outline: 2px solid var(--tt-blau);
	outline-offset: 2px;
}

.tt-klapp[open] > summary {
	border-bottom: 1px solid var(--tt-linie);
	background: var(--tt-hell);
}

.tt-klapp__titel {
	overflow-wrap: anywhere;
}

.tt-klapp__info {
	font-size: 0.875rem;
	color: var(--tt-grau);
	overflow-wrap: anywhere;
}

.tt-klapp__inhalt {
	padding: 4px 12px 12px;
}

/* Zuordnung von Trainern und Betreuern zu Sparten und Untergruppen */

.tt-zuordnung__sparte {
	padding: 4px 0;
}

.tt-zuordnung__sparte + .tt-zuordnung__sparte {
	border-top: 1px dashed var(--tt-linie);
}

.tt-zuordnung__ug {
	margin: 2px 0 2px 26px;
}

.tt-zuordnung__sparte > .tt-klein {
	margin-left: 26px;
}

.tt-zusammen ul {
	margin: 0;
	padding-left: 18px;
}

/* Oeffentliche Uebersicht */

.tt-zeiten-oeffentlich .tt-tabelle {
	margin: 0 0 20px;
}

/* CSV-Import und -Export */

.tt-csv {
	margin: 12px 0 16px;
	border: 1px solid var(--tt-linie);
	border-radius: 8px;
	background: var(--tt-grund);
}

.tt-csv > summary {
	cursor: pointer;
	padding: 12px 14px;
	min-height: 44px;
	box-sizing: border-box;
	font-weight: 600;
	color: var(--tt-blau-dunkel);
}

.tt-csv__inhalt {
	padding: 0 14px 14px;
}

.tt-csv__inhalt h3 {
	margin: 16px 0 6px;
	font-size: 1rem;
}

.tt-csv input[type="file"] {
	max-width: 100%;
}

.tt-csv__zahlen {
	font-weight: 600;
	margin: 10px 0;
}

.tt-csv__liste {
	margin: 6px 0 0;
	padding-left: 20px;
	overflow-wrap: anywhere;
}

.tt-csv__vorschau {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9375rem;
	background: var(--tt-flaeche);
}

.tt-csv__vorschau td {
	padding: 6px 8px;
	border-bottom: 1px solid var(--tt-linie);
	vertical-align: top;
}

.tt-csv__vorschau td:first-child {
	white-space: nowrap;
	font-weight: 600;
	width: 1%;
}

.tt-csv__neu td:first-child {
	color: var(--tt-gruen);
}

.tt-csv__geaendert td:first-child {
	color: var(--tt-blau-dunkel);
}

.tt-csv__unveraendert td:first-child {
	color: var(--tt-grau);
}

.tt-csv__entfernt td:first-child {
	color: var(--tt-rot);
}
