/* Admin-Layout */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; align-items: center; gap: 11px; padding: 18px 18px 16px; }
.side-brand b, .auth-brand b { display: block; font: 600 14.5px/1.2 var(--font-display); }
.side-brand span, .auth-brand span { color: var(--muted); font-size: 12px; }
.nav { display: grid; gap: 2px; padding: 6px 10px; }
.nav a { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: var(--r-sm); color: var(--muted); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-3); }
.nav a .ico { opacity: .85; }
.nav a em { margin-left: auto; font-style: normal; font-size: 11.5px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; line-height: 18px; }
.side-foot { margin-top: auto; padding: 14px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.side-server { display: flex; gap: 10px; align-items: center; }
.side-server b { display: block; font-size: 12.5px; font-weight: 600; }
.side-server span { color: var(--faint); font-size: 11.5px; }
.side-foot .btn { justify-content: flex-start; padding: 0 8px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; height: 60px; padding: 0 28px; background: rgba(7, 20, 29, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top .spacer { flex: 1; }
.page { padding: 22px 28px 40px; display: grid; gap: 18px; max-width: 1400px; width: 100%; }
.cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 1100px) { .cols { grid-template-columns: 1fr; } }
.link { color: var(--muted); font-size: 12.5px; text-decoration: none; }
.link:hover { color: var(--text); }
.stack { display: grid; gap: 14px; align-content: start; }
.row-set { display: flex; align-items: flex-start; gap: 16px; justify-content: space-between; }
.row-set p { margin: 2px 0 0; }
.wrap { word-break: break-all; }
.kv.wide { grid-template-columns: 180px 1fr; }
.kv.wide dd { text-align: left; white-space: normal; word-break: break-all; }
#totalChart { height: 190px; }

/* Ereignisse */
.events { list-style: none; margin: 0; padding: 4px 0; }
.events li { display: grid; grid-template-columns: 10px 70px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 8px 18px; border-bottom: 1px solid var(--line); }
.events li:last-child { border-bottom: 0; }
.events .dot { transform: translateY(-1px); }
.events time { color: var(--faint); font-size: 12px; }
.events .ev-text b { font-weight: 600; margin-right: 6px; }
.events.full li { grid-template-columns: 10px 150px minmax(0, 1fr); }
.events .none { display: block; color: var(--muted); padding: 22px 18px; }

/* Clients */
.search { max-width: 280px; height: 32px; }
.panel-head .seg { margin-left: auto; }
.client-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.client-cell b { display: block; font-weight: 600; }
.client-cell span { color: var(--faint); font-size: 12px; display: block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 7px; border-radius: 5px; font-size: 11.5px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip.up { color: var(--text); }
.chip.up::before, .chip.down::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.chip.down::before { background: var(--orange); }
canvas.spark { width: 96px; height: 24px; display: block; }
.tag { font-size: 11.5px; color: var(--orange-text); background: var(--orange-bg); border: 1px solid rgba(245, 124, 42, .25); padding: 0 6px; border-radius: 4px; line-height: 18px; }

/* Drawer */
.drawer-back { position: fixed; inset: 0; background: rgba(2, 8, 12, .55); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(720px, 100vw); background: var(--surface); border-left: 1px solid var(--line-strong); z-index: 21; display: flex; flex-direction: column; box-shadow: -30px 0 80px rgba(0, 0, 0, .45); animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.drawer-head p { margin: 3px 0 0; }
.drawer-head .spacer { flex: 1; }
.drawer-body { overflow-y: auto; padding: 18px 22px 30px; display: grid; gap: 18px; align-content: start; }
.drawer-body .panel-head { padding: 12px 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.note-row { display: flex; gap: 8px; }

/* Einladung */
dialog.modal.wide { width: min(760px, calc(100vw - 32px)); }
.invite-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 640px) { .invite-grid { grid-template-columns: 1fr; } }
.invite-qr, .totp-qr { background: #fff; border-radius: 10px; padding: 10px; display: grid; place-items: center; }
.invite-qr img, .totp-qr img { width: 100%; height: auto; image-rendering: pixelated; display: block; }
.invite-grid h3 { margin-bottom: 2px; }
.invite-grid p { margin: 0 0 8px; font-size: 12.5px; }
.copy-row { display: flex; gap: 8px; }
.copy-row .input { min-width: 0; }

/* Anmeldung */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(900px 500px at 50% -10%, rgba(76, 175, 42, .07), transparent 60%), var(--bg); }
.auth-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 26px 26px 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-form { display: grid; gap: 14px; }
.auth-form h1 { font-size: 18px; margin-bottom: 2px; }
.auth-form p { margin: 0; font-size: 12.5px; }
.auth-form .btn { height: 36px; }
.auth-err { color: var(--red-text); min-height: 1em; }
.auth-hint { color: var(--faint); }
.input.code { font-family: var(--mono); font-size: 18px; letter-spacing: .3em; text-align: center; height: 42px; }
.totp-qr { width: 200px; margin: 0 auto; }
.totp-secret summary { color: var(--muted); cursor: pointer; font-size: 12.5px; }
.totp-secret code { display: block; margin-top: 6px; word-break: break-all; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .side-brand { padding: 12px 16px; }
  .nav { grid-auto-flow: column; overflow-x: auto; padding: 6px 10px; }
  .side-foot { display: none; }
  .top { padding: 0 16px; }
  .page { padding: 16px; }
  .top h1 { font-size: 17px; }
}
