/* css/tc-meldung.css - zentrale Fehler-/Erfolgsmeldungen der Warenbewegungen (23.11.2026, Gesamtauftrag 22.11.,
   Aenderung 10), zu js/tc-meldung.js. Gross, kontraststark (Roman: eingeschraenktes Sehvermoegen), unabhaengig von der
   Scrollposition, auch auf dem Handy gut sichtbar. Hell: Text #3B0B0E auf #FFF1F1 (13,9:1), dunkel: #FFE4E4 auf #3A1416. */
:root {
	--tc-meldung-rot: #B3171E;
	--tc-meldung-hg: #FFF1F1;
	--tc-meldung-text: #3B0B0E;
	--tc-meldung-rand: #B3171E;
	--tc-meldung-gruen: #1B6B30;
	--tc-meldung-gruen-hg: #EAF6EE;
	--tc-meldung-gruen-text: #0F3D1C;
}
:root[data-theme="dunkel"] {
	--tc-meldung-rot: #FF6B6B;
	--tc-meldung-hg: #3A1416;
	--tc-meldung-text: #FFE4E4;
	--tc-meldung-rand: #FF6B6B;
	--tc-meldung-gruen: #5FD17F;
	--tc-meldung-gruen-hg: #12301C;
	--tc-meldung-gruen-text: #DDF7E4;
}

.tc-meldung {
	/* popover-Standardstile neutralisieren */
	inset: auto;
	margin: 0;
	position: fixed;
	top: 16px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 100000;
	box-sizing: border-box;
	width: min(620px, calc(100vw - 24px));
	display: none;
	grid-template-columns: auto 1fr;
	grid-template-areas: "symbol inhalt" "aktionen aktionen" "balken balken";
	gap: 10px 16px;
	padding: 18px 20px 12px;
	border: 2px solid var(--tc-meldung-rand);
	border-left-width: 10px;
	border-radius: 10px;
	background: var(--tc-meldung-hg);
	color: var(--tc-meldung-text);
	box-shadow: 0 14px 40px rgba(0, 0, 0, .35);
	font-size: 1.15rem;
	line-height: 1.4;
	overflow: hidden;
}
.tc-meldung.tc-meldung--sichtbar { display: grid; animation: tc-meldung-ein .18s ease-out; }
@keyframes tc-meldung-ein { from { opacity: 0; transform: translate(-50%, -12px); } to { opacity: 1; transform: translate(-50%, 0); } }
.tc-meldung-symbol { grid-area: symbol; color: var(--tc-meldung-rot); line-height: 0; padding-top: 2px; }
.tc-meldung-inhalt { grid-area: inhalt; min-width: 0; }
.tc-meldung-titel { margin: 0 0 4px; font-size: 1.3rem; font-weight: 700; color: var(--tc-meldung-rot); }
.tc-meldung-text { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.tc-meldung-weitere { margin: 6px 0 0; font-size: .95rem; font-weight: 600; }
.tc-meldung-aktionen { grid-area: aktionen; display: flex; justify-content: flex-end; }
.tc-meldung .tc-meldung-ok { min-height: 44px; min-width: 140px; font-size: 1.05rem; }
.tc-meldung-fortschritt { grid-area: balken; height: 4px; background: rgba(0, 0, 0, .08); border-radius: 2px; overflow: hidden; }
.tc-meldung-fortschritt span { display: block; height: 100%; background: var(--tc-meldung-rot); transform-origin: left center; }

/* Meldungselement der Seite, dessen Text in das Overlay gespiegelt wird: nur noch fuer Screenreader/Scanner-Rueckmeldung */
.tc-meldung-gespiegelt {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* kurze Erfolgsmeldung (nicht blockierend) */
.tc-meldung-toast {
	inset: auto;
	margin: 0;
	position: fixed;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 99999;
	display: none;
	align-items: center;
	gap: 10px;
	max-width: calc(100vw - 24px);
	box-sizing: border-box;
	padding: 10px 16px;
	border: 2px solid var(--tc-meldung-gruen);
	border-radius: 999px;
	background: var(--tc-meldung-gruen-hg);
	color: var(--tc-meldung-gruen-text);
	font-size: 1.05rem;
	font-weight: 600;
	box-shadow: 0 8px 22px rgba(0, 0, 0, .25);
	pointer-events: none;
}
.tc-meldung-toast.tc-meldung-toast--sichtbar { display: inline-flex; }
.tc-meldung-toast-symbol { color: var(--tc-meldung-gruen); line-height: 0; }

@media (max-width: 600px) {
	.tc-meldung { top: 8px; padding: 14px 14px 10px; font-size: 1.1rem; gap: 8px 12px; }
	.tc-meldung-symbol svg { width: 32px; height: 32px; }
	.tc-meldung .tc-meldung-ok { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
	.tc-meldung.tc-meldung--sichtbar { animation: none; }
}

/* Entscheidungsdialog Lagerabweichung (js/tc-lagerabweichung.js) - schliesst nie automatisch */
.tc-la-dialog { max-width: min(640px, calc(100vw - 24px)); }
.tc-la-dialog .tc-modal-titel { font-size: 1.25rem; line-height: 1.35; }
.tc-la-angaben { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0 0 12px; font-size: 1.05rem; }
.tc-la-angaben dt { font-weight: 600; }
.tc-la-angaben dd { margin: 0; overflow-wrap: anywhere; }
.tc-la-angaben .tc-la-ist { font-weight: 700; color: var(--tc-meldung-rot); }
.tc-la-frage, .tc-la-hinweis { margin: 8px 0; font-weight: 600; }
.tc-la-option { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; margin: 8px 0 0; min-height: 52px; text-align: left; white-space: normal; }
.tc-la-option .tc-la-option-text { font-weight: 400; font-size: .95rem; }
@media (max-width: 600px) { .tc-la-angaben { grid-template-columns: 1fr; gap: 2px; } .tc-la-angaben dd { margin-bottom: 6px; } }

/* ======================================================================================================================
   23.11.2026 (OTS-1114): globales Meldungssystem - Warnung (gelb/orange), kritischer Fehler, Info (blau), Liste
   betroffener Felder, Referenznummer, gestapelte Toasts, Hervorhebung des Zielfelds. Symbol + Ueberschrift
   unterscheiden die Arten zusaetzlich zur Farbe.
   ====================================================================================================================== */
:root {
	--tc-meldung-orange: #8A4B00;
	--tc-meldung-orange-rand: #D97706;
	--tc-meldung-orange-symbol: #F59E0B;
	--tc-meldung-orange-hg: #FFF7E6;
	--tc-meldung-orange-text: #3A2200;
	--tc-meldung-blau: #0B5394;
	--tc-meldung-blau-hg: #EAF3FC;
	--tc-meldung-blau-text: #0A2A47;
}
:root[data-theme="dunkel"] {
	--tc-meldung-orange: #FFC266;
	--tc-meldung-orange-rand: #F59E0B;
	--tc-meldung-orange-symbol: #F59E0B;
	--tc-meldung-orange-hg: #3A2A0C;
	--tc-meldung-orange-text: #FFF0D6;
	--tc-meldung-blau: #8CC4FF;
	--tc-meldung-blau-hg: #0F2740;
	--tc-meldung-blau-text: #E0EEFF;
}
.tc-meldung--warnung {
	--tc-meldung-rot: var(--tc-meldung-orange);
	--tc-meldung-rand: var(--tc-meldung-orange-rand);
	--tc-meldung-hg: var(--tc-meldung-orange-hg);
	--tc-meldung-text: var(--tc-meldung-orange-text);
}
.tc-meldung--warnung .tc-meldung-symbol { color: var(--tc-meldung-orange-symbol); }
.tc-meldung--kritisch { border-width: 3px; border-left-width: 14px; box-shadow: 0 0 0 4px rgba(179, 23, 30, .25), 0 18px 48px rgba(0, 0, 0, .45); }
.tc-meldung--kritisch .tc-meldung-titel { font-size: 1.45rem; text-transform: none; }
.tc-meldung-fortschritt[hidden] { display: none; }
.tc-meldung-liste { margin: 8px 0 0; padding-left: 1.2em; font-size: 1rem; }
.tc-meldung-liste li { margin: 2px 0; }
.tc-meldung-listenlink { all: unset; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; font-weight: 600; color: inherit; }
.tc-meldung-listenlink:hover, .tc-meldung-listenlink:focus-visible { text-decoration-thickness: 2px; outline: 2px solid currentColor; outline-offset: 2px; border-radius: 3px; }
.tc-meldung-referenz { margin: 8px 0 0; font-size: .95rem; font-family: ui-monospace, Consolas, monospace; font-weight: 700; }
.tc-meldung .tc-meldung-ok:focus-visible { outline: 3px solid var(--tc-meldung-rand); outline-offset: 2px; }

/* Toasts (Info/Erfolg): Stapel unten mittig, nicht blockierend */
.tc-meldung-toasts {
	inset: auto;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	position: fixed;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 99999;
	display: none;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	max-width: calc(100vw - 24px);
	pointer-events: none;
	overflow: visible;
}
.tc-meldung-toasts.tc-meldung-toasts--sichtbar { display: flex; }
.tc-meldung-toasts .tc-meldung-toast { position: static; transform: none; display: inline-flex; animation: tc-meldung-toast-ein .18s ease-out; }
@keyframes tc-meldung-toast-ein { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.tc-meldung-toast--info { border-color: var(--tc-meldung-blau); background: var(--tc-meldung-blau-hg); color: var(--tc-meldung-blau-text); }
.tc-meldung-toast--info .tc-meldung-toast-symbol { color: var(--tc-meldung-blau); }

/* Zielfeld nach dem Schliessen einer Fehlermeldung: deutlicher roter Rahmen, kurz pulsierend */
.tc-meldung-feld-ziel { outline: 3px solid var(--color-feld-fehler, #B3171E); outline-offset: 3px; border-radius: 6px; animation: tc-meldung-ziel 1.2s ease-out 2; }
@keyframes tc-meldung-ziel { 0% { outline-color: var(--color-feld-fehler, #B3171E); } 50% { outline-color: transparent; } 100% { outline-color: var(--color-feld-fehler, #B3171E); } }
/* Felder mit Fehler aus der zentralen Pruefung (globaler invalid-Handler): roter Rahmen auch ausserhalb der Masken */
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--color-feld-fehler, #B3171E) !important; box-shadow: 0 0 0 1px var(--color-feld-fehler, #B3171E); }
@media (prefers-reduced-motion: reduce) {
	.tc-meldung-feld-ziel, .tc-meldung-toasts .tc-meldung-toast { animation: none; }
}
@media (max-width: 600px) {
	.tc-meldung-liste { font-size: .95rem; }
}
/* Feld-Erklaerung ausserhalb der Masken-Stile (Partnerportal, Kiosk) */
.pp-feld .tc-feld-fehlertext, .pp-formular .tc-feld-fehlertext { display: block; margin: 4px 0 0; color: var(--tc-meldung-rot); font-weight: 600; font-size: .95rem; }
