/*
 * Copyright (c) 2026 MF Funktechnik GbR. Alle Rechte vorbehalten.
 * MF Funktechnik GbR, Beckumer Strasse 32, 59555 Lippstadt
 * Tel. 02941 8282044 · info@mf-funktechnik.net
 */
:root {
  --bg: #f4f5f7; --card: #fff; --text: #1d2228; --muted: #6b7380; --line: #e3e6ea;
  --accent: #e07b00; --accent-dark: #b86400; --red: #c62828; --red-bg: #fdecea; --green: #2e7d32;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--red); min-height: 1.2em; margin: 8px 0; }
.ok { color: var(--green); min-height: 1.2em; }
.pad { padding: 16px; }
h1 { margin: 0; } h2 { margin: 0 0 12px; font-size: 18px; } h3 { margin: 18px 0 8px; font-size: 15px; }
code { background: #eef0f3; padding: 1px 5px; border-radius: 4px; }

button { font: inherit; border: 0; border-radius: 8px; padding: 8px 14px; cursor: pointer; }
button.primary { background: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover { background: var(--accent-dark); }
button.secondary { background: #e9ecef; }
button.danger { background: var(--red); color: #fff; }
button.link { background: none; color: var(--accent-dark); padding: 4px; }
button.small { padding: 4px 10px; font-size: 13px; }
input[type=text], input:not([type]), input[type=password], input[type=number], input[type=file], label > select {
  font: inherit; width: 100%; padding: 8px 10px; border: 1px solid #cfd4da; border-radius: 8px; background: #fff;
}
label { display: block; margin: 8px 0; font-weight: 500; }
label input, label > select { margin-top: 4px; font-weight: normal; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: normal; margin: 6px 0; }
label.check input { margin: 0; width: auto; }
fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 14px 0; padding: 8px 14px; }
legend { font-weight: 600; padding: 0 6px; }

.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.login-card { width: 340px; }
.card { background: var(--card); border-radius: 12px; padding: 18px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.card-head h2 { margin: 0; }

.topbar { display: flex; align-items: center; gap: 24px; background: #1d2228; color: #fff; padding: 0 20px; height: 56px; position: sticky; top: 0; z-index: 1000; }
.brand { font-weight: 700; white-space: nowrap; } .brand .muted { color: #9aa3ad; font-weight: normal; font-size: 13px; }
nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
nav button { background: none; color: #c8cdd3; }
nav button.active, nav button:hover { background: #343b44; color: #fff; }
.me { white-space: nowrap; font-size: 14px; } .me .link { color: #ffb35c; }
main { max-width: 1200px; margin: 20px auto; padding: 0 16px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } .topbar { flex-wrap: wrap; height: auto; padding: 8px; gap: 8px; } }
.row { display: flex; gap: 8px; align-items: center; } .row input { flex: 1; }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--line); padding: 8px 6px; }
.table td { border-bottom: 1px solid var(--line); padding: 8px 6px; vertical-align: middle; }
.table.compact td { padding: 4px 6px; }
.table tr:last-child td { border-bottom: 0; }
.table input[type=text], .table input:not([type]) { padding: 5px 8px; }

.pill { display: inline-block; background: #eef0f3; border-radius: 999px; padding: 1px 9px; font-size: 12px; margin: 1px 2px; }
.pill.red { background: var(--red-bg); color: var(--red); } .pill.orange { background: #fff1de; color: var(--accent-dark); }
.pill.green { background: #e6f4e7; color: var(--green); }
.status { display: inline-flex; align-items: center; gap: 6px; }
.status b { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: #2a2f36; color: #fff; font-size: 13px; }
.status.prio b { background: var(--red); }

#map { height: 340px; border-radius: 8px; overflow: hidden; background: #e9ecef; }

.alarm { background: var(--red-bg); border: 2px solid var(--red); border-radius: 12px; padding: 14px 18px; margin-bottom: 16px; display: flex; gap: 16px; align-items: center; animation: blink 1.2s ease-in-out infinite alternate; }
.alarm .big { font-size: 20px; font-weight: 700; color: var(--red); }
.alarm .grow { flex: 1; }
@keyframes blink { from { box-shadow: 0 0 0 0 rgba(198,40,40,.0); } to { box-shadow: 0 0 0 6px rgba(198,40,40,.25); } }

.live-group { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.live-group:last-child { border-bottom: 0; }
.speaking { color: var(--green); font-weight: 600; } .speaking.em { color: var(--red); }
.bc-banner { background: #fff1de; border: 1px solid var(--accent); border-radius: 8px; padding: 8px 12px; margin-bottom: 8px; font-weight: 600; }

dialog { border: 0; border-radius: 14px; padding: 0; width: min(720px, 96vw); box-shadow: 0 10px 40px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(20,24,28,.45); }
.dialog-body { padding: 20px 24px; max-height: 90vh; overflow-y: auto; }
.dialog-actions { display: flex; gap: 8px; margin-top: 12px; } .spacer { flex: 1; }
progress { width: 100%; height: 14px; margin: 12px 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

.insecure { background: #fff4e5; color: #8a4b00; border-bottom: 1px solid #f0c78a; padding: 8px 20px; font-size: 14px; text-align: center; }
.insecure .link { color: #b86400; font-weight: 600; text-decoration: underline; }
.tls-status { border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; font-weight: 500; }
.tls-status.none { background: #fff4e5; color: #8a4b00; }
.tls-status.pending { background: #eef4ff; color: #1d4ed8; }
.tls-status.active { background: #e6f4e7; color: var(--green); }
.tls-status.failed { background: var(--red-bg); color: var(--red); }
.tls-status .actions { margin-top: 8px; display: flex; gap: 8px; }
.row-buttons { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
input[type=email] { font: inherit; width: 100%; padding: 8px 10px; border: 1px solid #cfd4da; border-radius: 8px; }

.qr-body { text-align: center; }
.qr svg { width: 260px; height: 260px; margin: 8px auto; display: block; }
.qr-code-text { font-size: 20px; letter-spacing: .08em; font-family: ui-monospace, monospace; }
@media print {
  body * { visibility: hidden; }
  #qr-print, #qr-print * { visibility: visible; }
  #qr-print { position: absolute; inset: 0; }
  .no-print { display: none !important; }
}

.audit-filter { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin: 12px 0; }
.audit-filter label { margin: 0; font-size: 13px; }
.audit-filter input, .audit-filter select { font: inherit; padding: 6px 8px; border: 1px solid #cfd4da; border-radius: 8px; background: #fff; }
.audit-details { font-size: 12px; color: var(--muted); max-width: 320px; overflow-wrap: anywhere; }
pre.codes { background: #f4f5f7; padding: 12px 16px; border-radius: 8px; columns: 2; font-size: 15px; }
#me-btn { color: #fff; }

footer.copyright { text-align: center; font-size: 12px; color: var(--muted); padding: 16px 12px 24px; }
footer.copyright a { color: inherit; }
@media print { footer.copyright { display: none; } }
.mode-choice { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.mode-choice label.check { align-items: flex-start; }
.mode-choice input { margin-top: 3px; }
table.small { font-size: 0.85rem; margin: 6px 0 10px; }
table.small th, table.small td { padding: 5px 8px; }
.invite-opts { margin: 4px 0 8px; }
.invite-opts small { display: block; margin-left: 26px; }
.invite-step { border: 1px solid #e3e6ea; border-radius: 10px; padding: 12px 14px; margin: 12px 0; }
.invite-step h3, #form-title { font-size: 1rem; margin: 0 0 8px; }
.invite-step .button { display: inline-block; text-decoration: none; text-align: center; }
p.small, .small { font-size: 0.85rem; }
.mono { font-family: ui-monospace, monospace; letter-spacing: 1px; }
a.button.primary { background: var(--accent); color: #fff; font-weight: 600; padding: 10px 16px; border-radius: 8px; }
a.button.primary:hover { background: var(--accent-dark); }
pre.cmd { background: #1d2228; color: #f3f4f6; padding: 10px 12px; border-radius: 8px; white-space: pre-wrap; word-break: break-all; font-size: 0.85rem; }
