/* Kundenportal. Admin nutzt admin.css. Keine Inline-Styles (CSP style-src 'self'). */

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("/static/fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("/static/fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- Tokens ----------------------------------------------------------------- */
:root {
  --bg: #f6f5fb;
  --surface: #ffffff;
  --surface-2: #f6f5fb;
  --ink: #15132b;
  --ink-2: #3a3756;
  --muted: #5b5875;
  --border: #e6e3f3;
  --border-strong: #c9c1f7;
  --primary: #5b3df5;
  --primary-hover: #4a2de8;
  --primary-ink: #3f23d9;
  --primary-soft: #eeeafe;
  --on-primary: #ffffff;
  --coral: #ff6b4a;
  --coral-soft: #ffe7e1;
  --coral-ink: #c2410c;
  --teal: #0ea5a0;
  --teal-soft: #d7f5f3;
  --teal-ink: #0b7c78;
  --sun: #ffc24b;
  --sun-soft: #fff1cc;
  --sun-ink: #8a5a00;
  --night: #1c1640;
  --ok-bg: #ddf7ee;
  --ok: #0b6b4f;
  --ok-dot: #12b886;
  --err-bg: #fde8e4;
  --err: #a3341c;
  --err-dot: #e8553a;
  --danger: #c2361b;
  --dots: rgba(91, 61, 245, .16);
  --glow-1: rgba(91, 61, 245, .20);
  --glow-2: rgba(255, 107, 74, .16);
  --glow-3: rgba(14, 165, 160, .16);
  --glass: rgba(255, 255, 255, .72);
  --shadow: 0 1px 2px rgba(21, 19, 43, .04), 0 12px 32px -22px rgba(21, 19, 43, .28);
  --shadow-hover: 0 2px 4px rgba(21, 19, 43, .04), 0 28px 48px -22px rgba(91, 61, 245, .45);
  --shadow-btn: 0 8px 20px -8px rgba(91, 61, 245, .6);
  --r-sm: 12px;
  --r: 18px;
  --r-lg: 24px;
  --r-xl: 28px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0d1f;
    --surface: #1a1730;
    --surface-2: #231f3d;
    --ink: #eceaf8;
    --ink-2: #d4d0ea;
    --muted: #a9a5c4;
    --border: #2f2a52;
    --border-strong: #4b4290;
    --primary: #8b78ff;
    --primary-hover: #a092ff;
    --primary-ink: #b4a8ff;
    --primary-soft: #2a2257;
    --on-primary: #0f0d1f;
    --coral-soft: #3d1f1a;
    --coral-ink: #ffa48f;
    --teal-soft: #0f3331;
    --teal-ink: #6fe0da;
    --sun-soft: #3a2f12;
    --sun-ink: #ffd683;
    --night: #17123a;
    --ok-bg: #123527;
    --ok: #8fe3c0;
    --err-bg: #3d1a17;
    --err: #ffab9a;
    --danger: #e8553a;
    --dots: rgba(139, 120, 255, .14);
    --glow-1: rgba(91, 61, 245, .28);
    --glow-2: rgba(255, 107, 74, .12);
    --glow-3: rgba(14, 165, 160, .14);
    --glass: rgba(26, 23, 48, .72);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 36px -22px rgba(0, 0, 0, .7);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, .3), 0 28px 48px -22px rgba(139, 120, 255, .45);
    --shadow-btn: 0 8px 20px -8px rgba(139, 120, 255, .55);
    color-scheme: dark;
  }
}

/* --- Grundlagen & Hintergrund -------------------------------------------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font: 16px/1.55 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background-color: var(--bg);
  /* Weiche Farbflächen + Punkteraster, fixiert hinter dem Inhalt */
  background-image:
    radial-gradient(640px 420px at 88% -8%, var(--glow-1), transparent 70%),
    radial-gradient(520px 400px at -8% 55%, var(--glow-2), transparent 70%),
    radial-gradient(560px 380px at 65% 105%, var(--glow-3), transparent 70%),
    radial-gradient(var(--dots) 1.1px, transparent 1.6px);
  background-size: auto, auto, auto, 22px 22px;
  background-attachment: fixed;
}
a { color: var(--primary-ink); font-weight: 600; text-decoration: none; }
a:hover { color: var(--primary); text-decoration: underline; }
h1, h2, h3 { letter-spacing: -.02em; line-height: 1.15; }
h1 { font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.5rem); font-weight: 800; letter-spacing: -.03em; margin: .25rem 0 1.5rem; }
h2 { font-size: 1.15rem; font-weight: 800; margin: 0 0 1rem; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.muted { color: var(--muted); font-size: .92rem; }
.field-hint { margin: -.25rem 0 1rem; color: var(--muted); font-size: .85rem; }
.break { overflow-wrap: anywhere; }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* --- Kopfzeile ------------------------------------------------------------------ */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  max-width: 1200px; margin: 0 auto; padding: 1.25rem 1rem; }
@media (min-width: 720px) { .site-header { padding: 1.25rem 2.5rem; } }
.brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--ink); font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; }
.brand:hover { color: var(--ink); text-decoration: none; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--primary); color: #fff;
  display: grid; place-items: center; transition: transform .3s var(--ease); }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.05); }
.nav { display: flex; align-items: center; gap: 4px; padding: 5px; border-radius: 999px; background: var(--glass);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 1px 2px rgba(21, 19, 43, .06);
  border: 1px solid var(--border); }
.nav a, .nav button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 1.1rem; border: 0;
  border-radius: 999px; background: none; color: var(--ink-2); font: inherit; font-size: .95rem; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: background .2s, color .2s; }
.nav a:hover, .nav button:hover { background: var(--primary-soft); color: var(--primary-ink); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.header-actions { display: flex; align-items: center; gap: 1.25rem; margin-left: auto; }
.logout-form { margin: 0; padding-left: 1.25rem; border-left: 1px solid var(--border); }
.logout-btn { display: inline-flex; align-items: center; gap: .45rem; min-height: 40px; padding: 0 1rem;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted);
  font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.logout-btn:hover { color: var(--ink); border-color: var(--ink-2); }

.container { max-width: 1200px; margin: 0 auto; padding: .5rem 1rem 4rem; }
@media (min-width: 720px) { .container { padding: .5rem 2.5rem 4rem; } }
.narrow { max-width: 460px; margin: 1.5rem auto; }
.back { display: inline-block; margin-bottom: .25rem; font-size: .9rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.page-head h1 { margin: 0; }
.eyebrow { margin: 0 0 .35rem; color: var(--muted); font-weight: 500; }
.title-row { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }

/* --- Flächen ---------------------------------------------------------------------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 1.75rem;
  box-shadow: var(--shadow); transition: box-shadow .25s var(--ease), border-color .25s; }
.panel:hover { box-shadow: var(--shadow-hover); border-color: var(--border-strong); }
.panel + .panel { margin-top: 1.5rem; }
.panel-title { display: flex; align-items: center; gap: .65rem; margin: 0 0 1.1rem; font-size: 1.1rem; font-weight: 800; }
.ic { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-ink); }
.ic.coral { background: var(--coral-soft); color: var(--coral-ink); }
.ic.teal { background: var(--teal-soft); color: var(--teal-ink); }
.ic.sun { background: var(--sun-soft); color: var(--sun-ink); }

/* --- Buttons ---------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem; min-height: 48px; padding: 0 1.5rem;
  font: inherit; font-size: 1rem; font-weight: 700; color: var(--on-primary); background: var(--primary);
  border: 0; border-radius: 999px; cursor: pointer; text-decoration: none; box-shadow: var(--shadow-btn);
  transition: transform .2s var(--ease), box-shadow .2s, background .2s, color .2s;
}
.btn:hover {
  background: var(--primary-hover); color: var(--on-primary); text-decoration: none; transform: translateY(-2px);
}
.btn svg { transition: transform .2s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn.block { width: 100%; }
.btn.secondary { background: var(--primary-soft); color: var(--primary-ink); box-shadow: none; }
.btn.secondary:hover { background: var(--primary); color: var(--on-primary); }
.btn.ghost { background: transparent; color: var(--ink-2); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); transform: none; }
.btn.danger { background: var(--err-bg); color: var(--err); box-shadow: none; }
.btn.danger:hover { background: var(--danger); color: #fff; }
.btn.small { min-height: 44px; padding: 0 1.1rem; font-size: .9rem; }
button.link { background: none; border: 0; padding: 0; color: var(--primary-ink); font: inherit; font-weight: 600; cursor: pointer; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.actions.end { justify-content: flex-end; }
form.inline { display: inline; }

/* --- Formulare ---------------------------------------------------------------------- */
label { display: block; margin-bottom: 1rem; font-size: .88rem; font-weight: 600; color: var(--ink-2); }
input:not([type="checkbox"]):not([type="file"]), select, textarea {
  display: block; width: 100%; margin-top: .4rem; padding: .8rem .95rem; font: inherit; font-size: 1rem; font-weight: 500;
  color: var(--ink); background: var(--surface-2); border: 1.5px solid var(--border); border-radius: 14px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { outline: none; background: var(--surface); border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
textarea { resize: vertical; min-height: 6rem; }
label.checkbox { display: flex; gap: .6rem; align-items: center; font-weight: 600; }
label.checkbox input { width: 20px; height: 20px; accent-color: var(--primary); }
.grid-2, .grid-3 { display: grid; gap: 0 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.form-row { display: flex; gap: .6rem; align-items: center; margin-bottom: .75rem; flex-wrap: wrap; }
.form-row select { width: auto; min-width: 9.5rem; flex: 0 0 auto; margin: 0; border-radius: 999px; border-color: transparent;
  background: var(--primary-soft); color: var(--primary-ink); font-weight: 700; font-size: .92rem; }
.form-row select:hover { border-color: var(--primary); }
.form-row input { flex: 1 1 13rem; width: auto; margin: 0 !important; }
.form-row .addr-postal_code { flex: 0 1 7rem; }
.icon-btn { width: 44px; height: 44px; flex: 0 0 auto; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted); cursor: pointer; transition: background .2s, color .2s; }
.icon-btn:hover { background: var(--err-bg); color: var(--err); }
.add-row { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: 0 1rem; font: inherit; font-size: .9rem;
  font-weight: 700; color: var(--primary-ink); background: transparent; border: 1.5px dashed var(--border-strong);
  border-radius: 999px; cursor: pointer; transition: background .2s, border-color .2s; }
.add-row:hover { background: var(--primary-soft); border-color: var(--primary); }
.drop { position: relative; display: flex; align-items: center; gap: 1.1rem; margin: 0; padding: 1.25rem; cursor: pointer;
  border: 2px dashed var(--border-strong); border-radius: 20px; transition: background .2s, border-color .2s; }
.drop:hover, .drop:focus-within { background: var(--primary-soft); border-color: var(--primary); }
.drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop strong { display: block; color: var(--ink); font-size: 1rem; }
.drop .muted { font-weight: 500; }
.drop .ic { width: 56px; height: 56px; border-radius: 50%; }
.photo-current { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }

/* --- Meldungen & Badges --------------------------------------------------------------- */
.alert { display: flex; gap: .75rem; align-items: flex-start; padding: 1rem 1.25rem; border-radius: var(--r); margin-bottom: 1.25rem;
  font-weight: 500; }
.alert ul { margin: .25rem 0 0; padding-left: 1.25rem; }
.alert.success { background: var(--ok-bg); color: var(--ok); }
.alert.error { background: var(--err-bg); color: var(--err); }
.alert.info { background: var(--primary-soft); color: var(--primary-ink); }
.alert svg { flex: 0 0 auto; margin-top: 2px; }
.badge { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .8rem; border-radius: 999px; font-size: .82rem; font-weight: 700; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge.on { background: var(--ok-bg); color: var(--ok); }
.badge.on::before { background: var(--ok-dot); }
.badge.off { background: var(--err-bg); color: var(--err); }
.badge.off::before { background: var(--err-dot); }

/* --- Kartenübersicht -------------------------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.75rem; }
.tile { display: flex; flex-direction: column; overflow: hidden; color: var(--ink); background: var(--surface);
  border: 2px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); text-decoration: none;
  transition: transform .3s var(--ease), box-shadow .3s, border-color .3s; }
.tile:hover { color: var(--ink); text-decoration: none; transform: translateY(-6px); border-color: var(--primary); box-shadow: var(--shadow-hover); }
.tile-band { position: relative; height: 92px; overflow: hidden; background: var(--primary); }
.tile-band::after { content: ""; position: absolute; width: 130px; height: 130px; right: -34px; top: -46px; border-radius: 50%;
  background: rgba(255, 255, 255, .22); transition: transform .5s var(--ease); }
.tile:hover .tile-band::after { transform: scale(1.35); }
.tile-band.c1 { background: var(--coral); }
.tile-band.c2 { background: var(--teal); }
.tile-band.c3 { background: var(--night); }
.tile-body { position: relative; display: flex; flex-direction: column; gap: .9rem; padding: 0 1.5rem 1.5rem; margin-top: -38px; }
.tile-name { font-size: 1.2rem; font-weight: 800; letter-spacing: -.01em; }
.tile-sub { color: var(--muted); font-size: .9rem; margin-top: .1rem; }
.tile-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.tile-link { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; color: var(--muted); background: var(--surface-2);
  border-radius: 10px; padding: .5rem .65rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.go { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft);
  color: var(--primary-ink); transition: transform .3s var(--ease), background .3s, color .3s; }
.tile:hover .go { transform: translateX(4px); background: var(--primary); color: var(--on-primary); }
.tile-new { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .9rem; min-height: 300px;
  border: 2px dashed var(--border-strong); border-radius: var(--r-lg); color: var(--primary-ink); font-weight: 700;
  text-decoration: none; transition: background .2s, border-color .2s, transform .3s var(--ease); }
.tile-new:hover { background: var(--primary-soft); border-color: var(--primary); text-decoration: none; transform: translateY(-4px); }
.tile-new .ic { width: 56px; height: 56px; border-radius: 50%; }
.empty { text-align: center; padding: 3rem 1.5rem; }

/* Avatar: Foto oder Initialen */
.avatar { width: 76px; height: 76px; border-radius: 50%; border: 4px solid var(--surface); object-fit: cover;
  display: grid; place-items: center; background: var(--sun); color: #15132b; font-size: 1.5rem; font-weight: 800; }
.avatar.sm { width: 56px; height: 56px; border: 0; font-size: 1.15rem; }
.avatar.c1 { background: var(--night); color: #fff; }
.avatar.c2 { background: var(--primary-soft); color: var(--primary-ink); }

/* --- Kartendetail -------------------------------------------------------------------------- */
.split { display: flex; flex-wrap: wrap; gap: 1.75rem; align-items: flex-start; }
.split > .main { flex: 999 1 520px; min-width: 0; }
.split > .side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 1.5rem; }
.split > .side .panel + .panel { margin-top: 0; }
.hero { padding: 0; overflow: hidden; }
.hero-top { position: relative; overflow: hidden; display: flex; gap: 2.25rem; align-items: center; flex-wrap: wrap; padding: 2.5rem;
  background: var(--night); color: #fff; }
.hero-top::before, .hero-top::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.hero-top::before { width: 300px; height: 300px; right: -100px; top: -120px; background: #5b3df5; opacity: .6; }
.hero-top::after { width: 120px; height: 120px; right: 60px; bottom: -60px; background: var(--coral); }
.qr-box { position: relative; z-index: 1; width: 224px; max-width: 100%; padding: 14px; background: #fff; border-radius: var(--r-lg);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .55); transition: transform .3s var(--ease); }
.qr-box:hover { transform: rotate(-2deg) scale(1.03); }
.qr-box svg { display: block; width: 100%; height: auto; }
.hero-text { position: relative; z-index: 1; flex: 1 1 240px; min-width: 0; }
.hero-text .eyebrow { color: #c9c1f7; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.hero-text p { color: #e4e0fa; margin: .6rem 0 1.1rem; }
.link-box { display: flex; align-items: center; gap: .5rem; padding: 6px 6px 6px 1rem; border-radius: 16px; background: rgba(255, 255, 255, .1); }
.link-box span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, Menlo, monospace; font-size: .9rem; }
.copy { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: 0 1rem; border: 0; border-radius: 12px;
  background: #fff; color: #15132b; font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; transition: background .2s, color .2s; }
.copy:hover { background: var(--sun); }
.copy.done { background: var(--ok-dot); color: #fff; }
.hero-bottom { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; padding: 1.25rem 1.75rem; }
.hero-bottom .muted { font-weight: 700; margin-right: .4rem; }
.chip { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: 0 1.1rem; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-ink); font-size: .9rem; font-weight: 700; text-decoration: none;
  transition: transform .2s var(--ease), background .2s, color .2s; }
.chip:hover { background: var(--primary); color: var(--on-primary); text-decoration: none; transform: translateY(-2px); }
.file-help { flex: 1 1 100%; margin: .25rem 0 0; }
.file-help summary { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; list-style: none; font-size: .9rem; }
.file-help summary::-webkit-details-marker { display: none; }
.file-help[open] summary { margin-bottom: .25rem; }
.file-help-list { display: grid; gap: .6rem; margin: 0; }
.file-help-list div { padding: .7rem .9rem; border-radius: 12px; background: var(--surface-2); }
.file-help-list dt { font-weight: 700; }
.file-help-list dd { margin: .15rem 0 0; color: var(--muted); font-size: .9rem; }
.file-help .field-hint { margin: .75rem 0 0; }
.tag-list { list-style: none; margin: 0 0 .5rem; padding: 0; }
.tag-list li { padding: .25rem 0; }
.tag-no { font-size: 1.25rem; font-weight: 700; letter-spacing: .05em; }
.slug-input { display: flex; align-items: center; gap: .4rem; margin-top: .35rem; }
.slug-input input { flex: 1 1 auto; min-width: 0; margin: 0; }
.slug-input .mono { white-space: nowrap; }
.status { display: flex; align-items: center; gap: 1rem; }
.status strong { display: block; font-size: 1.02rem; }
.switch { position: relative; width: 58px; height: 34px; flex: 0 0 auto; padding: 0; border: 0; border-radius: 999px; cursor: pointer;
  background: #c9c5d9; transition: background .25s; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .25); transition: transform .25s var(--ease); }
.switch[aria-checked="true"] { background: var(--ok-dot); }
.switch[aria-checked="true"]::after { transform: translateX(24px); }
.person { display: flex; align-items: center; gap: .9rem; margin-bottom: 1rem; }
.person strong { display: block; font-size: 1.1rem; }
.kv { margin: 0; }
.kv div { display: flex; justify-content: space-between; gap: 1rem; padding: .65rem 0; border-top: 1px solid var(--border); font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }

/* --- Formular mit Live-Vorschau -------------------------------------------------------------- */
.editor { display: flex; flex-wrap: wrap; gap: 2rem; align-items: flex-start; }
.editor > form { flex: 999 1 560px; min-width: 0; }
.editor > aside { flex: 1 1 320px; display: flex; flex-direction: column; align-items: center; gap: .9rem; }
@media (min-width: 960px) { .editor > aside { position: sticky; top: 1.5rem; } }
.preview-label { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.phone { width: 300px; max-width: 100%; height: 600px; padding: 11px; border-radius: 46px; background: #15132b;
  box-shadow: 0 40px 60px -30px rgba(21, 19, 43, .55); }
.phone-screen { height: 100%; overflow: hidden auto; border-radius: 36px; background: #fff; color: #15132b; }
.phone-head { position: relative; height: 150px; overflow: hidden; background: #5b3df5; }
.phone-head::before { content: ""; position: absolute; width: 160px; height: 160px; right: -50px; top: -60px; border-radius: 50%; background: #7c63ff; }
.phone-head::after { content: ""; position: absolute; width: 70px; height: 70px; left: -20px; bottom: 16px; border-radius: 50%; background: #ff6b4a; }
.phone-avatar { position: relative; z-index: 1; width: 92px; height: 92px; margin: -46px auto 0; border-radius: 50%; border: 5px solid #fff;
  background: #ffc24b; display: grid; place-items: center; overflow: hidden; font-size: 1.9rem; font-weight: 800; color: #15132b; }
.phone-avatar img { width: 100%; height: 100%; object-fit: cover; }
.phone-name { padding: .8rem 1.25rem .2rem; text-align: center; font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; }
.phone-sub { padding: 0 1.25rem; text-align: center; font-size: .85rem; color: #5b5875; min-height: 1.2em; }
.phone-actions { display: flex; justify-content: center; gap: 1.1rem; padding: 1rem 1rem; }
.phone-actions span { display: flex; flex-direction: column; align-items: center; gap: .3rem; font-size: .7rem; font-weight: 600; color: #3a3756; }
.phone-actions i { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: #eeeafe; color: #5b3df5; }
.phone-list { margin: 0 .9rem 1rem; padding: .25rem 1rem; border-radius: 18px; background: #f6f5fb; font-size: .85rem; }
.phone-list:empty { display: none; }
.phone-list div { padding: .6rem 0; border-top: 1px solid #e6e3f3; }
.phone-list div:first-child { border-top: 0; }
.phone-list small { display: block; font-size: .72rem; color: #5b5875; }
.phone-list b { display: block; color: #5b3df5; font-weight: 600; overflow-wrap: anywhere; }
.preview-note { max-width: 290px; margin: 0; text-align: center; font-size: .82rem; color: var(--muted); }

/* --- Anmeldung / Registrierung (geteiltes Layout) ------------------------------------------------ */
.auth { display: flex; flex-wrap: wrap; min-height: 100vh; }
.auth-aside { position: relative; overflow: hidden; flex: 1 1 460px; display: flex; flex-direction: column; justify-content: space-between;
  gap: 2.5rem; padding: 2.5rem 1.5rem; background: var(--night); color: #fff; }
@media (min-width: 720px) { .auth-aside { padding: 3rem 3.5rem; border-radius: 0 40px 40px 0; } }
.auth-aside .brand, .auth-aside .brand:hover { color: #fff; }
.auth-aside .brand-mark { background: #fff; color: #5b3df5; }
.blob { position: absolute; border-radius: 50%; pointer-events: none; }
.blob.b1 { width: 420px; height: 420px; right: -140px; top: -120px; background: #5b3df5; opacity: .55; }
.blob.b2 { width: 220px; height: 220px; left: -70px; bottom: -60px; background: #ff6b4a; opacity: .85; }
.blob.b3 { width: 90px; height: 90px; right: 120px; bottom: 150px; background: #ffc24b; }
.auth-hero { position: relative; display: flex; align-items: center; gap: 2.5rem; flex-wrap: wrap; }
.auth-hero > div { flex: 1 1 280px; }
.auth-hero h1 { margin: 0 0 1rem; font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem); line-height: 1.08; }
.auth-hero p { margin: 0; max-width: 400px; color: #d9d5f5; font-size: 1.05rem; }
.pill-tag { display: inline-block; margin-bottom: 1rem; padding: .35rem .9rem; border-radius: 999px; background: rgba(255, 255, 255, .12);
  font-size: .8rem; font-weight: 600; letter-spacing: .04em; }
.tag-art { flex: 0 0 auto; transform: rotate(-8deg); transition: transform .6s var(--ease); }
.auth-aside:hover .tag-art { transform: rotate(-2deg) translateY(-6px); }
.auth-facts { position: relative; display: flex; gap: 1.5rem; flex-wrap: wrap; color: #d9d5f5; font-size: .9rem; }
.auth-facts span { display: inline-flex; align-items: center; gap: .5rem; }
.auth-main { flex: 1 1 440px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3rem 1rem; }
.auth-card { width: 100%; max-width: 440px; padding: 2.5rem 2rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.75rem; margin: 0 0 .4rem; }
.auth-card > p.muted:first-of-type { margin: 0 0 1.75rem; }
.auth-card form { margin-top: .5rem; }
.auth-card .foot { margin: 1.75rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.auth-main .alert { width: 100%; max-width: 440px; }

/* --- 2FA ----------------------------------------------------------------------------------------- */
.qr { width: 220px; max-width: 100%; margin: 1rem auto; padding: 12px; background: #fff; border-radius: var(--r); box-shadow: var(--shadow); }
.qr svg { display: block; width: 100%; height: auto; }
.secret { word-break: break-all; font-weight: 700; }
details { margin: .5rem 0 1.25rem; }
summary { cursor: pointer; font-weight: 600; color: var(--primary-ink); }

/* --- Kleinkram -------------------------------------------------------------------------------- */
.gap { height: 1.25rem; }
.status .muted, .person .muted { display: block; }
.hidden-copy { position: fixed; top: -1000px; left: -1000px; opacity: 0; }
details summary + * { margin-top: 1rem; }

/* --- Tabellen & Listen (Firma) ---------------------------------------------------------------- */
.table-wrap { overflow-x: auto; margin: 0 -.25rem; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: .7rem .5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { color: var(--muted); font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .2s; }
.table tbody tr:hover { background: var(--surface-2); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .6rem 0; border-top: 1px solid var(--border); }
.plain-list li:first-child { border-top: 0; }
.plain-list .muted { display: block; }
.plain-list.compact li { display: block; padding: .4rem 0; }
.error-list { margin: .5rem 0 0; padding-left: 1.2rem; }
.error-list li { margin: .15rem 0; }
.link-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .5rem; }
.org-note { display: flex; gap: .75rem; align-items: flex-start; }
.skip-box { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.skip-box p { margin: 0 0 .75rem; }
.form-aside { margin: -.5rem 0 1rem; text-align: right; font-size: .88rem; }

/* --- Language switch --------------------------------------------------------------------------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.lang-switch { display: flex; align-items: center; gap: .3rem; margin: 0; }
.lang-switch select { width: auto; margin: 0; padding: .45rem 2rem .45rem .9rem; border-radius: 999px; font-size: .88rem; font-weight: 600;
  background-color: var(--glass); border-color: var(--border); }
.lang-go { min-height: 36px; padding: 0 .7rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--ink-2); font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; }
.js .lang-go { display: none; }
.auth-lang { position: absolute; top: 1.5rem; right: 1.5rem; z-index: 2; }
.auth-lang select { background-color: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .25); }
.auth-lang select option { color: #15132b; }
.auth-lang .lang-go { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .25); }

/* --- Scan statistics ------------------------------------------------------------- */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: 1rem; }
.stat { display: flex; flex-direction: column; padding: .6rem .75rem; border-radius: 12px; background: var(--primary-soft); }
.stat strong { font-size: 1.5rem; line-height: 1.1; color: var(--ink); }
.stat span { color: var(--muted); font-size: .8rem; }
.chart-box { margin-bottom: .5rem; }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart-bar { fill: var(--primary); }
.chart-bar.alt { fill: var(--border); }
.chart-bar.empty { fill: var(--border); }
.chart-axis { stroke: var(--border); stroke-width: 1; }
.chart-label { fill: var(--muted); font-size: 11px; }

/* --- Support ------------------------------------------------------------------------------------ */
.badge.warn { background: var(--sun-soft); color: var(--sun-ink); }
.badge.warn::before { background: var(--sun); }
.badge.neutral { background: var(--surface-2); color: var(--muted); }
.panel.highlight { border-color: var(--border-strong); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.ticket-list li > a { display: block; min-width: 0; color: var(--ink); }
.ticket-list li > a:hover { text-decoration: none; color: var(--primary-ink); }
.thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1rem; }
.msg { padding: 1rem 1.1rem; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); }
.msg.operator, .msg.supervisor { background: var(--primary-soft); border-color: transparent; }
.msg.system { background: transparent; border-style: dashed; }
.msg-head { display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: .4rem; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.files { list-style: none; margin: .75rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; font-size: .9rem; }
.files a { display: inline-flex; align-items: center; gap: .4rem; overflow-wrap: anywhere; }
.close-form { margin-top: 1rem; }
input[type="file"] { display: block; width: 100%; margin-top: .4rem; font: inherit; font-size: .9rem; }

/* --- Phones ------------------------------------------------------------------------------------ */
.table-wrap { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
@media (max-width: 719px) {
  /* Header: navigation as one full-width row that scrolls sideways if it ever gets too long */
  .site-header { gap: .75rem; padding: 1rem; }
  .site-header .nav { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; justify-content: space-between; }
  .site-header .nav a { flex: 1 0 auto; justify-content: center; padding: 0 .8rem; white-space: nowrap; font-size: .9rem; }
  .header-actions { gap: .6rem; }
  .logout-form { padding-left: .6rem; }
  .logout-btn span { display: none; }
  .logout-btn { min-width: 44px; justify-content: center; padding: 0 .7rem; }
  .lang-switch select { max-width: 8.5rem; }
  .panel { padding: 1.25rem; }
  .page-head { margin-bottom: 1.25rem; }
  .page-head .actions, .page-head .actions .btn { width: 100%; }

  /* Sign-in pages: compact brand strip, the form comes right after it */
  .auth { align-content: flex-start; }
  .auth-aside { flex-basis: 100%; gap: 1rem; padding: 1.25rem 1rem 1.5rem; }
  .auth-aside .brand { padding-right: 9rem; }
  .auth-lang { top: 1.1rem; right: 1rem; }
  .auth-hero h1 { font-size: 1.6rem; margin: 0; }
  .auth-hero p, .auth-hero .pill-tag, .tag-art, .auth-facts, .blob.b3 { display: none; }
  .blob.b1 { width: 220px; height: 220px; right: -90px; top: -110px; }
  .blob.b2 { width: 110px; height: 110px; left: -50px; bottom: -60px; }
  .auth-main { padding: 1.5rem 1rem 2.5rem; justify-content: flex-start; }
  .auth-card { padding: 1.75rem 1.25rem; }

  /* Tables become stacked cards: one block per row, the column name in front of each value */
  .table.stack thead { display: none; }
  .table.stack, .table.stack tbody, .table.stack tr, .table.stack td { display: block; width: 100%; }
  .table.stack tr { padding: .75rem 0; border-bottom: 1px solid var(--border); }
  .table.stack tr:last-child { border-bottom: 0; }
  .table.stack td { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .3rem 0;
    border: 0; text-align: right; overflow-wrap: anywhere; }
  .table.stack td::before { content: attr(data-label); flex: 0 0 auto; color: var(--muted); font-size: .8rem; font-weight: 700;
    text-align: left; }
  .table.stack td[data-label=""]::before { content: none; }
  .table.stack td.right { justify-content: flex-end; }
  .table.stack td:first-child { font-weight: 700; }
}
