/**
 * RegistrationEditor.css
 */

.asas-reg-editor .reg-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	padding: 0 0 14px;
	margin-bottom: 14px;
	border-bottom: 1px solid #eef0f3;
}

/* When JS lifts the badge into the modal header (next to the name). */
.modal-header .reg-bar-badges {
	margin-left: 14px;
	display: inline-flex;
	vertical-align: middle;
}

.asas-reg-editor .reg-bar-id {
	font-size: 16px;
	font-weight: 700;
	color: #1f2937;
}

.asas-reg-editor .reg-bar-badges {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.asas-reg-editor .reg-pill {
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
}

/* Wider modal + full-width fields (context cards moved to a top row). */
.modal-dialog.asas-reg-modal {
	max-width: min(1360px, 94vw);
}

.asas-reg-editor .reg-fields {
	width: 100%;
}

/*
 * Die Herkunft der Anmeldung als Chip-Zeile im Kopf statt als Karte unten: vier
 * Angaben, die man liest und nicht bedient, brauchen keinen eigenen Kasten.
 */
.asas-reg-editor .reg-bar-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 18px;
	margin-left: auto;
}

/* Vertical sections: white header strip, light-gray body with white cards. */
.asas-reg-editor .reg-sections {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.asas-reg-editor .reg-section {
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
}

.asas-reg-editor .reg-section-h {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	background: #fff;
	border-bottom: 1px solid #eef0f3;
}

.asas-reg-editor .reg-section-title {
	margin: 0;
	font-size: 14px;
	font-weight: 700;
	color: #2f6798;
}

.asas-reg-editor .reg-section-title i {
	margin-right: 8px;
	opacity: .9;
}

.asas-reg-editor .reg-section-copy {
	flex: none;
	border: 1px solid #dde1e7;
	background: #fff;
	border-radius: 7px;
	color: #4b5563;
	font-size: 12px;
	padding: 5px 11px;
	cursor: pointer;
	white-space: nowrap;
}

.asas-reg-editor .reg-section-copy:hover {
	border-color: #3b5bdb;
	color: #3b5bdb;
}

.asas-reg-editor .reg-section-b {
	padding: 16px;
	background: #f6f7f9;
}

.asas-reg-editor .reg-group {
	margin-bottom: 0;
}

/* A card inside a section: framed, header strip, fields stacked full width. */
.asas-reg-editor .reg-gcard {
	height: 100%;
	margin: 0;
	border: 1px solid #e8eaee;
	border-radius: 9px;
	overflow: hidden;
	background: #fff;
}

.asas-reg-editor .reg-gcard .reg-group-h {
	margin: 0;
	padding: 10px 14px;
	border-bottom: 1px solid #eef0f3;
	background: #fafbfc;
}

.asas-reg-editor .reg-gcard .reg-group-b {
	padding: 14px;
}

.asas-reg-editor .reg-gcard-optional .reg-group-b {
	display: none;
}

/*
 * Eingeklappt bleibt nur die Kopfzeile stehen. Ohne das hier erbt die Karte das
 * height:100% von .reg-gcard und wird so hoch wie ihre aufgeklappte Nachbarkarte
 * in derselben Zeile — sichtbar als grosse weisse Flaeche unter dem Titel
 * (Mutter/Vater, Rechnungsfirma).
 */
.asas-reg-editor .reg-gcard-optional:not(.open) {
	height: auto;
}

.asas-reg-editor .reg-gcard-optional.open .reg-group-b {
	display: block;
}

.asas-reg-editor .reg-gcard-optional .reg-group-h {
	border-bottom: none;
}

.asas-reg-editor .reg-gcard-optional.open .reg-group-h {
	border-bottom: 1px solid #eef0f3;
}

.asas-reg-editor .reg-gcard-toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border: none;
	background: none;
	color: #9aa1b0;
	font-size: 12px;
	cursor: pointer;
	padding: 2px 4px;
}

.asas-reg-editor .reg-gcard-toggle:hover {
	color: #3b5bdb;
}

.asas-reg-editor .reg-gcard-chip {
	padding: 2px 8px;
	border-radius: 20px;
	background: #eef0f3;
	color: #6b7280;
	font-size: 11px;
}

.asas-reg-editor .reg-gcard-optional.open .reg-gcard-chip {
	background: #eaf2ff;
	color: #3b5bdb;
}

.asas-reg-editor .reg-gcard-optional.open .reg-gcard-toggle i {
	transform: rotate(180deg);
}

.asas-reg-editor .reg-cell {
	width: 100%;
}

/* "dim": an empty field (e.g. Teilzahlungen) stays visible but is toned down. */
.asas-reg-editor .reg-dim .reg-input {
	background: #f5f6f8;
	border-color: #e6e8ec;
}

.asas-reg-editor .reg-dim .reg-label {
	color: #9aa1b0;
}

.asas-reg-editor .reg-textarea {
	min-height: 76px;
	resize: vertical;
}

/* OneDrive panel on the Dokumente section. */
.asas-reg-editor .reg-doc-b {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.asas-reg-editor .reg-doc-hint {
	font-size: 12px;
	color: #8b93a3;
	margin: 0;
}

.asas-reg-editor .reg-doc-box {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: 1px solid #bcd0f5;
	background: #f4f7fe;
	color: #3b5bdb;
	border-radius: 8px;
	padding: 12px 14px;
	font-size: 13px;
	text-decoration: none;
}

.asas-reg-editor .reg-doc-link:hover {
	border-color: #3b5bdb;
}

.asas-reg-editor .reg-doc-disabled {
	border-style: dashed;
	border-color: #dde1e7;
	background: #fafbfc;
	color: #9aa1b0;
	cursor: not-allowed;
}

.asas-reg-editor .reg-flow-hint {
	font-weight: 400;
	text-transform: none;
	letter-spacing: 0;
	color: #9aa1b0;
}

.asas-reg-editor .reg-group-h {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 0 0 8px;
	padding-bottom: 5px;
	border-bottom: 1px solid #e5e7eb;
}

.asas-reg-editor .reg-group-title {
	font-size: 12px;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: #3b5bdb;
	font-weight: 700;
}

.asas-reg-editor .reg-group-title i {
	margin-right: 6px;
	opacity: .85;
}

.asas-reg-editor .reg-group-copy {
	border: none;
	background: none;
	color: #6b7280;
	font-size: 12px;
	cursor: pointer;
	padding: 2px 4px;
}

.asas-reg-editor .reg-group-copy:hover {
	color: #3b5bdb;
}

.asas-reg-editor .reg-field {
	padding: 2px 0 12px;
}

.asas-reg-editor .reg-label {
	display: flex;
	align-items: center;
	gap: 6px;
	color: #32373c;
	font-size: 13px;
	font-weight: 500;
	margin: 0 0 5px;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.asas-reg-editor .reg-import-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #3b82f6;
	display: inline-block;
	opacity: .7;
}

.asas-reg-editor .reg-legend {
	display: flex;
	gap: 18px;
	margin: 0 0 14px;
	font-size: 12px;
	color: #6b7280;
}

.asas-reg-editor .reg-legend-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.asas-reg-editor .reg-legend-swatch {
	width: 11px;
	height: 11px;
	border-radius: 3px;
	background: #fff8e6;
	border: 1px solid #e0a11a;
	display: inline-block;
}

.asas-reg-editor .reg-payer {
	border: none;
	background: none;
	border-radius: 0;
	padding: 0;
	margin: 0 0 12px;
}

.asas-reg-editor .reg-payer-h {
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 12px;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: #3b5bdb;
	font-weight: 700;
	margin: 0 0 8px;
}

.asas-reg-editor .reg-payer-body {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.asas-reg-editor .reg-payer-body .reg-select {
	flex: 0 0 220px;
	max-width: 260px;
}

.asas-reg-editor .reg-payer-hint {
	font-size: 12px;
	color: #5b6478;
}

.asas-reg-editor .reg-control {
	display: flex;
	align-items: center;
	gap: 6px;
}

/*
 * Inside a narrow card the Kategorie→Produkt cascade stacks instead of sitting
 * side by side, so both selects keep a usable width.
 */
.asas-reg-editor .reg-cascade {
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
	min-width: 0;
}

.asas-reg-editor .reg-input {
	flex: 1;
}

.asas-reg-editor .reg-changed .reg-input {
	border-color: #e0a11a;
	background: #fff8e6;
}

.asas-reg-editor .reg-orig {
	display: none;
	font-size: 11px;
	color: #b7791f;
	margin-top: 3px;
}

.asas-reg-editor .reg-orig span {
	text-decoration: line-through;
	opacity: .85;
}

.asas-reg-editor .reg-changed .reg-orig {
	display: block;
}

.asas-reg-editor .reg-copy {
	flex: none;
	border: 1px solid #dde1e7;
	background: #f7f8fa;
	border-radius: 7px;
	width: 38px;
	height: 38px;
	color: #9aa1b0;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.asas-reg-editor .reg-copy:hover {
	border-color: #3b5bdb;
	color: #3b5bdb;
}

.asas-reg-editor .reg-card {
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 14px;
	margin-bottom: 14px;
}

.asas-reg-editor .reg-card h4 {
	margin: 0 0 10px;
	font-size: 12px;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: #6b7280;
}

.asas-reg-editor .reg-card h4 small {
	text-transform: none;
	letter-spacing: 0;
	font-weight: 400;
}

.asas-reg-editor .reg-card-resolved {
	border-color: #bfe3d0;
	background: #f4fbf7;
}

.asas-reg-editor .reg-card-resolved h4 {
	color: #2f9e6f;
}

.asas-reg-editor .reg-card-warn {
	border-color: #f0d9a8;
	background: #fff8e6;
}

.asas-reg-editor .reg-card-warn h4 {
	color: #b7791f;
}

.asas-reg-editor .reg-warnlist {
	margin: 0;
	padding-left: 18px;
	font-size: 13px;
	color: #8a5a12;
}

.asas-reg-editor .reg-warn-hint {
	margin-top: 8px;
	font-size: 12px;
	color: #b7791f;
}

.asas-reg-editor .reg-meta {
	display: inline-flex;
	align-items: baseline;
	gap: 6px;
	font-size: 12px;
}

.asas-reg-editor .reg-meta span {
	color: #6b7280;
	flex: none;
}

.asas-reg-editor .reg-meta b {
	font-weight: 600;
	color: #1f2937;
}

.asas-reg-editor .reg-meta-empty {
	color: #9aa;
	font-weight: 400;
}

/*
 * Der Bearbeitungsblock unter den Datenbereichen: Status und Wartegrund
 * nebeneinander, die Notizen darunter ueber die volle Breite. Er sieht aus wie
 * ein Datenbereich, weil er einer ist — nur beschreibt er die Bearbeitung und
 * nicht die eingereichten Angaben.
 */
.asas-reg-editor .reg-work {
	margin-top: 16px;
}

.asas-reg-editor .reg-work-field label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: #6b7280;
	margin-bottom: 4px;
}

.asas-reg-editor .reg-work-field .form-control {
	width: 100%;
}

.asas-reg-editor .reg-work-field select:disabled {
	background: #f3f4f6;
	color: #9ca3af;
}

.asas-reg-editor .reg-notes {
	resize: vertical;
}

.asas-reg-editor .reg-status-hint {
	margin-top: 6px;
	font-size: 12px;
	color: #6b7280;
	min-height: 16px;
}

.asas-reg-editor .reg-status-hint.err {
	color: #dc3545;
}

.asas-reg-editor .reg-status {
	flex: 0 1 auto;
	min-width: 0;
	font-size: 13px;
	color: #6b7280;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.asas-reg-editor .reg-status.dirty {
	color: #e0a11a;
	font-weight: 600;
}

/*
 * ONE sticky bar at the bottom of the scrolling modal body: status left, buttons
 * right. Opaque + top shadow so scrolled content never shows through it (§13).
 */
.asas-reg-editor .reg-actions {
	position: sticky;
	bottom: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 16px;
	padding: 12px 0;
	background: #fff;
	border-top: 1px solid #e5e7eb;
	box-shadow: 0 -8px 16px -10px rgba(15, 23, 42, .25);
}

.asas-reg-editor .reg-actions-spacer {
	flex: 1;
}

/* Loeschen steht links und mit Abstand vor allem, was nach vorn fuehrt. */
.asas-reg-editor .reg-actions .reg-delete {
	margin-right: 8px;
}

/*
 * Der Knopf traegt den Ton des Zustands, in den er fuehrt — denselben Wert wie
 * der Statuspunkt oben. Er kommt aus den Stammdaten und wird als Custom Property
 * auf den Container gesetzt; der Wert hier ist nur der Notnagel.
 */
.asas-reg-editor .reg-admission {
	background: var(--reg-admission, #e0a11a);
	border-color: var(--reg-admission, #e0a11a);
	color: #fff;
}

.asas-reg-editor .reg-admission:hover,
.asas-reg-editor .reg-admission:focus {
	filter: brightness(.92);
	color: #fff;
}

/* Responsive: sections stay stacked, cards go single-column on small screens. */
@media (max-width: 760px) {
	.asas-reg-editor .reg-actions .btn {
		flex: 1;
	}
}
