/* Teams-Tab und Browser-Ansicht für Gastgeber, Empfang, Notfall-Team und Administration */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid rgba(119, 151, 168, .6); outline-offset: 2px; }
h1, h2 { font-family: var(--font-display); font-weight: 600; margin: 0; }
a { color: var(--deep); }

.devbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding: 10px 24px; background: var(--warn-soft); color: var(--warn); font-size: 14px; }
.devbar input:not([type]) { height: 32px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); }

.app { max-width: 1200px; margin: 0 auto; padding: 24px 24px 48px; display: flex; flex-direction: column; gap: 20px; }
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand img { width: 44px; height: 44px; }
.brand h1 { font-size: 28px; line-height: 1.1; }
.sub { font-size: 14px; color: var(--muted); }

.btn-primary, .btn-danger, .btn-light, .btn-dark { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 10px; font-weight: 600; font-size: 15px; text-decoration: none; border: 0; }
.btn-primary, .btn-dark { background: var(--deep); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-light { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); font-weight: 500; }
.btn-danger svg, .btn-primary svg { width: 18px; height: 18px; stroke-width: 2.2; }
.btn-sm { min-height: 38px; padding: 0 12px; font-size: 14px; border-radius: 8px; }

.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs button { height: 44px; padding: 0 16px; border: 0; background: transparent; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--deep); }

.banner { padding: 14px 18px; border-radius: 12px; background: var(--danger); color: #fff; font-weight: 600; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.banner button { background: #fff; color: var(--danger); border: 0; border-radius: 8px; min-height: 38px; padding: 0 14px; font-weight: 600; }

.view { display: flex; flex-direction: column; gap: 16px; }
.view.center { align-items: center; text-align: center; padding: 60px 0; gap: 18px; }
.login-logo { height: 44px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; display: flex; flex-direction: column; gap: 4px; }
.stat span { font-size: 14px; color: var(--muted); }
.stat strong { font-family: var(--font-display); font-size: 30px; font-weight: 600; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.panel.pad { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.panel h2 { font-size: 19px; }
.panel-head { padding: 14px 20px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.seg { display: flex; gap: 4px; padding: 4px; background: #EEF2F4; border-radius: 10px; }
.seg button { height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 14px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.history-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.history-tools input, .history-tools select { height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.history-tools input { width: 240px; max-width: 100%; }

.list { display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: minmax(180px, 2fr) minmax(120px, 1.2fr) minmax(110px, 1fr) auto; gap: 12px 16px; align-items: center; padding: 14px 20px; border-top: 1px solid #EEF2F4; }
.row:first-child { border-top: 0; }
.row.highlight { background: #F0F5F7; box-shadow: inset 4px 0 0 var(--isa); }
.cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cell strong { font-weight: 600; overflow-wrap: anywhere; }
.cell span { font-size: 13px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.badge { display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: #EEF1F4; color: #4A505C; }
.badge.in { background: var(--ok-soft); color: var(--ok); }
.badge.coming { background: #E6EEF2; color: var(--deep); }
.badge.wait { background: var(--warn-soft); color: var(--warn); }
.empty { padding: 28px 20px; color: var(--muted); text-align: center; }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.note { margin: 0; font-size: 13px; color: var(--muted); }

/* ---------- Notfall ---------- */
.em-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; padding: 18px 20px; border-radius: 12px; background: var(--ink); color: #fff; }
.em-head h2 { font-size: 22px; }
.em-head span { font-size: 14px; color: #C9D3D9; }
.em-head.active { background: var(--danger); }
.em-head.active span { color: #FCE3E3; }
.em-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.em-progress { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.em-progress-row { display: flex; justify-content: space-between; font-weight: 600; }
.bar { height: 10px; border-radius: 999px; background: #F0D4D4; overflow: hidden; }
.bar-fill { height: 100%; width: var(--w, 0%); background: var(--ok-dot); border-radius: 999px; transition: width .3s ease; }
.em-missing { font-weight: 600; color: var(--danger); }
.em-missing.all { color: var(--ok); }
.em-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.person { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.person.missing { border: 2px solid var(--danger); }
.person.safe { opacity: .75; }
.person-top { display: flex; justify-content: space-between; gap: 10px; }
.person-top strong { font-size: 16px; }
.person-top span, .person small { font-size: 13px; color: var(--muted); }
.person-host { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; }
.person-host a { font-weight: 600; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.btn-safe { min-height: 46px; border-radius: 10px; font-weight: 600; border: 0; background: var(--ok-dot); color: #fff; }
.btn-safe[aria-pressed="true"] { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-dot); }

dialog { border: 0; border-radius: 16px; padding: 24px; max-width: 460px; width: calc(100% - 32px); box-shadow: 0 24px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(20, 33, 42, .45); }
dialog h2 { font-size: 22px; margin-bottom: 10px; }
dialog p { margin: 0 0 20px; line-height: 1.5; color: #33424B; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; font-weight: 500; box-shadow: 0 10px 30px rgba(0,0,0,.2); z-index: 10; max-width: calc(100% - 32px); }
.toast.error { background: var(--danger); }

@media (max-width: 720px) {
  .app { padding: 16px 16px 40px; }
  .row { grid-template-columns: 1fr; }
  .actions { justify-content: flex-start; }
  .history-tools input { width: 100%; }
}

/* Notfallliste drucken (oder als PDF speichern) */
@media print {
  body { background: #fff; font-size: 11pt; }
  .devbar, .top, .tabs, .banner, .em-actions, .btn-safe, .toast, .view:not(#view-emergency) { display: none !important; }
  .app { padding: 0; max-width: none; }
  .em-head { background: #fff !important; color: #000; border: 2px solid #000; }
  .em-head span { color: #000 !important; }
  .em-list { grid-template-columns: repeat(2, 1fr); }
  .person { break-inside: avoid; border: 1px solid #000 !important; opacity: 1 !important; }
}
