/* ===========================================================
   BFVR Einladungen – Backend + Frontend
   =========================================================== */

:root { --bfvr-einl-accent: #c8102e; --bfvr-einl-border: #e0e0e0; }

/* ---------- Backend ---------- */
.bfvr-einl-admin .bfvr-einl-yearbar { margin: 1em 0; display: flex; align-items: center; gap: 1em; flex-wrap: wrap; }
.bfvr-einl-admin .bfvr-einl-table { margin-top: .5em; }
.bfvr-einl-admin .bfvr-einl-table th { font-size: 12px; }
.bfvr-einl-admin .bfvr-einl-table td { vertical-align: middle; }
.bfvr-einl-admin .bfvr-einl-table input[type="text"],
.bfvr-einl-admin .bfvr-einl-table input[type="date"],
.bfvr-einl-admin .bfvr-einl-table input[type="time"],
.bfvr-einl-admin .bfvr-einl-table input[type="number"] {
	width: 100%; box-sizing: border-box; min-width: 0;
}
.bfvr-einl-admin .col-fw { min-width: 160px; }
.bfvr-einl-admin .col-rahmen { min-width: 110px; }
.bfvr-einl-admin .col-notiz { min-width: 120px; }
.bfvr-einl-admin .col-anzahl input { width: 4.5em; }
.bfvr-einl-admin .col-unsicher, .bfvr-einl-admin .col-ang, .bfvr-einl-admin .col-del { text-align: center; }
.bfvr-einl-admin .col-unsicher input, .bfvr-einl-admin .col-ang input { margin: 0; }

.bfvr-einl-admin .bfvr-wer-boxes { display: flex; flex-wrap: wrap; gap: .15em .5em; }
.bfvr-einl-admin .bfvr-wer-boxes label { font-size: 12px; white-space: nowrap; display: inline-flex; align-items: center; gap: 2px; }

.bfvr-einl-admin .bfvr-row-del {
	color: #a00; text-decoration: none; font-size: 15px; cursor: pointer; border: 0; background: none;
}
.bfvr-einl-admin .bfvr-row-del:hover { color: #d00; }
.bfvr-einl-admin .bfvr-einl-newyear { display: flex; align-items: center; gap: .6em; flex-wrap: wrap; }

/* ---------- Frontend ---------- */
.bfvr-einl-front { max-width: 1100px; margin: 1em 0; font-size: 15px; }
.bfvr-einl-front .bfvr-einl-head { display: flex; align-items: center; justify-content: space-between; gap: 1em; flex-wrap: wrap; margin-bottom: .6em; }
.bfvr-einl-front h3 { margin: 0; color: var(--bfvr-einl-accent); }
.bfvr-einl-front .bfvr-einl-yearswitch select { padding: .2em .4em; }

.bfvr-einl-tablewrap { overflow-x: auto; }
.bfvr-einl-fronttable { width: 100%; border-collapse: collapse; }
.bfvr-einl-fronttable th, .bfvr-einl-fronttable td {
	text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--bfvr-einl-border); vertical-align: top;
}
.bfvr-einl-fronttable th {
	background: #1c2024; color: #fff; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em;
}
.bfvr-einl-fronttable tbody tr:nth-child(even) { background: #f6f6f7; }
.bfvr-einl-fronttable tr.bfvr-einl-overdue { background: #fff2f2; }
.bfvr-einl-empty { color: #777; }
.bfvr-einl-q { color: var(--bfvr-einl-accent); font-weight: 700; }

.bfvr-einl-badge { display: inline-block; padding: .15em .6em; border-radius: 50px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.bfvr-einl-badge.ok  { background: #e4f6e6; color: #1a7a2e; }
.bfvr-einl-badge.open{ background: #eef0f2; color: #555; }
.bfvr-einl-badge.due { background: var(--bfvr-einl-accent); color: #fff; }

.bfvr-einl-editlink { margin-top: .8em; }
.bfvr-einl-editlink a { color: var(--bfvr-einl-accent); font-weight: 600; text-decoration: none; }

/* Responsive: Tabelle auf schmalen Screens als Karten */
@media (max-width: 680px) {
	.bfvr-einl-fronttable thead { display: none; }
	.bfvr-einl-fronttable, .bfvr-einl-fronttable tbody, .bfvr-einl-fronttable tr, .bfvr-einl-fronttable td { display: block; width: 100%; }
	.bfvr-einl-fronttable tr { border: 1px solid var(--bfvr-einl-border); border-radius: 8px; margin-bottom: .8em; padding: .3em .2em; }
	.bfvr-einl-fronttable td { border: none; padding: .25rem .6rem; }
	.bfvr-einl-fronttable td::before {
		content: attr(data-label) ": "; font-weight: 600; color: #555; display: inline-block; min-width: 110px;
	}
	.bfvr-einl-fronttable td[data-label="Feuerwehr"] { font-weight: 700; font-size: 1.05em; }
}

/* ---------- Frontend-Editor (Berechtigte) ---------- */
.bfvr-einl-front-edit .bfvr-einl-editbadge {
	font-size: .7em; vertical-align: middle; background: var(--bfvr-einl-accent); color: #fff;
	padding: .15em .6em; border-radius: 50px; text-transform: uppercase; letter-spacing: .04em;
}
.bfvr-einl-flash { padding: .5em .8em; border-radius: 6px; margin: .5em 0; font-weight: 600; }
.bfvr-einl-flash.ok { background: #e4f6e6; color: #1a7a2e; }

.bfvr-einl-edittable { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 900px; }
.bfvr-einl-edittable th, .bfvr-einl-edittable td { padding: .3rem .4rem; border-bottom: 1px solid var(--bfvr-einl-border); vertical-align: middle; }
.bfvr-einl-edittable th { background: #1c2024; color: #fff; font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; text-align: left; }
.bfvr-einl-edittable input[type="text"],
.bfvr-einl-edittable input[type="date"],
.bfvr-einl-edittable input[type="time"],
.bfvr-einl-edittable input[type="number"] {
	width: 100%; box-sizing: border-box; padding: .3em .4em; border: 1px solid #ccc; border-radius: 4px; font-size: 13px; min-width: 0;
}
.bfvr-einl-edittable .col-fw { min-width: 180px; }
.bfvr-einl-edittable .col-anzahl input { width: 4em; }
.bfvr-einl-edittable .col-ang, .bfvr-einl-edittable .col-del { text-align: center; }
.bfvr-einl-front-edit .bfvr-wer-boxes { display: flex; flex-wrap: wrap; gap: .1em .5em; }
.bfvr-einl-front-edit .bfvr-wer-boxes label { font-size: 12px; white-space: nowrap; display: inline-flex; align-items: center; gap: 2px; font-weight: 400; }
.bfvr-einl-front-edit .bfvr-row-del { color: #a00; background: none; border: 0; font-size: 16px; cursor: pointer; line-height: 1; }
.bfvr-einl-front-edit .bfvr-row-del:hover { color: #d00; }

.bfvr-einl-front-edit .bfvr-einl-actions { margin: 1em 0; display: flex; gap: .6em; flex-wrap: wrap; }
.bfvr-einl-front-edit .bfvr-btn {
	display: inline-block; cursor: pointer; padding: .55em 1.2em; border-radius: 50px; border: 2px solid var(--bfvr-einl-accent);
	background: #fff; color: var(--bfvr-einl-accent); font-weight: 600; font-size: 14px; line-height: 1.2;
}
.bfvr-einl-front-edit .bfvr-btn:hover { background: #f7e9ec; }
.bfvr-einl-front-edit .bfvr-btn-primary { background: var(--bfvr-einl-accent); color: #fff; }
.bfvr-einl-front-edit .bfvr-btn-primary:hover { background: #9b0c23; }

.bfvr-einl-newyear-wrap { margin-top: 1.2em; border-top: 1px solid var(--bfvr-einl-border); padding-top: .8em; }
.bfvr-einl-newyear-wrap summary { cursor: pointer; font-weight: 600; color: var(--bfvr-einl-accent); }
.bfvr-einl-newyear { display: flex; align-items: center; gap: .8em; flex-wrap: wrap; margin-top: .8em; }
.bfvr-einl-newyear input[type="number"] { width: 7em; padding: .3em .4em; }

/* Eingeschränkter Frontend-Editor: nur Wer/Ang./Notiz editierbar */
.bfvr-einl-hint { font-size: 13px; color: #555; margin: .2em 0 .8em; }
.bfvr-einl-edittable-limited th.bfvr-editable { background: var(--bfvr-einl-accent); }
.bfvr-einl-edittable-limited td.bfvr-editable { background: #fff7f8; }
.bfvr-einl-edittable-limited td { font-size: 14px; }
.bfvr-einl-edittable-limited td.col-fw { font-weight: 600; }
.bfvr-einl-ang-toggle { white-space: nowrap; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.bfvr-einl-edittable-limited .col-notiz input { width: 100%; min-width: 140px; box-sizing: border-box; padding: .3em .4em; border: 1px solid #ccc; border-radius: 4px; }

/* Publiziert-Status */
.bfvr-einl-admin .col-pub { text-align: center; }
.bfvr-einl-admin .col-pub input { margin: 0; }
.bfvr-einl-front-edit tr.bfvr-unpub td { opacity: .55; }
.bfvr-einl-front-edit tr.bfvr-unpub td.bfvr-editable { opacity: 1; }
.bfvr-unpub-badge {
	display: inline-block; margin-left: .4em; padding: .1em .5em; border-radius: 50px;
	background: #eee; color: #777; font-size: 11px; font-weight: 600; white-space: nowrap;
}

/* PDF-Anhang */
.bfvr-einl-admin .col-pdf { white-space: nowrap; }
.bfvr-einl-admin .col-pdf .bfvr-pdf-name { font-size: 12px; margin: 0 .3em; display: inline-block; max-width: 140px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.bfvr-einl-admin .col-pdf .bfvr-pdf-remove { color: #a00; text-decoration: none; }
.bfvr-einl-pdf { white-space: nowrap; color: var(--bfvr-einl-accent); text-decoration: none; font-weight: 600; }
.bfvr-einl-pdf:hover { text-decoration: underline; }
.bfvr-einl-fronttable td[data-label="Einladung"] .bfvr-einl-pdf { font-size: .9em; }

/* Datum/Zeit zusammengefasst (Frontend) */
.bfvr-einl-time { color: #666; font-size: .92em; white-space: nowrap; }
.bfvr-einl-fronttable .bfvr-einl-time::before { content: "· "; color: #aaa; }
.bfvr-einl-edittable .bfvr-einl-time { display: inline-block; margin-left: .2em; }

/* Tabellen-Kopfzeile im Frontend immer weiss (gegen Theme-Overrides) */
.bfvr-einl-front .bfvr-einl-fronttable thead th,
.bfvr-einl-front .bfvr-einl-edittable thead th {
	color: #fff !important;
}
