/* ADRLOGIK – Design-System. Mobile-first. Hell/Dunkel über Tokens. */
:root {
  --bg: #f2f5f9; --surface: #ffffff; --surface-2: #eaf0f6; --surface-3: #dfe8f1;
  --text: #121d28; --muted: #556677; --border: #d6dfe9;
  --primary: #0b5cab; --primary-hover: #094a8b; --on-primary: #ffffff; --primary-soft: #e1eefb; --primary-text: #0b5cab;
  --accent: #e0354a;
  --danger: #b42318; --danger-soft: #fdeceb; --success: #146c43; --success-soft: #e2f5ea; --warn: #8f5200; --warn-soft: #fff1d9; --info-soft: #e1eefb;
  --st-open: #b45309; --st-open-bg: #fff0dc; --st-read: #0b5cab; --st-read-bg: #e1eefb; --st-in_progress: #6d3fc0; --st-in_progress-bg: #efe8fb;
  --st-waiting: #8f5200; --st-waiting-bg: #fdf3c8; --st-closed: #146c43; --st-closed-bg: #e2f5ea;
  --shadow: 0 1px 2px rgba(16, 32, 48, .06), 0 4px 16px rgba(16, 32, 48, .06);
  --shadow-lg: 0 12px 40px rgba(16, 32, 48, .22);
  --radius: 16px; --radius-sm: 10px; --focus: 0 0 0 3px rgba(11, 92, 171, .45);
  --topbar-h: 60px; --bottom-h: 68px; --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
:root[data-theme="dark"] { color-scheme: dark; --bg: #0c1218; --surface: #141d26; --surface-2: #1b2733; --surface-3: #243342; --text: #e9eff5; --muted: #a2b2c2; --border: #283644;
  --primary: #5aaaf2; --primary-hover: #7bbcf6; --on-primary: #05121f; --primary-soft: #16304a; --primary-text: #8cc6fa;
  --danger: #ff8b80; --danger-soft: #3a1d1b; --success: #5fd49a; --success-soft: #163626; --warn: #f2b45a; --warn-soft: #3b2b10; --info-soft: #16304a;
  --st-open: #ffb870; --st-open-bg: #3b2812; --st-read: #8cc6fa; --st-read-bg: #16304a; --st-in_progress: #c7aaff; --st-in_progress-bg: #2c2147;
  --st-waiting: #f4d56d; --st-waiting-bg: #38300f; --st-closed: #6fdca5; --st-closed-bg: #163626;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3); --shadow-lg: 0 12px 40px rgba(0, 0, 0, .6); --focus: 0 0 0 3px rgba(90, 170, 242, .6); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; --bg: #0c1218; --surface: #141d26; --surface-2: #1b2733; --surface-3: #243342; --text: #e9eff5; --muted: #a2b2c2; --border: #283644;
  --primary: #5aaaf2; --primary-hover: #7bbcf6; --on-primary: #05121f; --primary-soft: #16304a; --primary-text: #8cc6fa;
  --danger: #ff8b80; --danger-soft: #3a1d1b; --success: #5fd49a; --success-soft: #163626; --warn: #f2b45a; --warn-soft: #3b2b10; --info-soft: #16304a;
  --st-open: #ffb870; --st-open-bg: #3b2812; --st-read: #8cc6fa; --st-read-bg: #16304a; --st-in_progress: #c7aaff; --st-in_progress-bg: #2c2147;
  --st-waiting: #f4d56d; --st-waiting-bg: #38300f; --st-closed: #6fdca5; --st-closed-bg: #163626;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3); --shadow-lg: 0 12px 40px rgba(0, 0, 0, .6); --focus: 0 0 0 3px rgba(90, 170, 242, .6); } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
body.modal-open { overflow: hidden; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--primary-text); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
hr { border: 0; border-top: 1px solid var(--border); width: 100%; margin: 4px 0; }
blockquote { margin: 6px 0 0; padding: 6px 12px; border-left: 3px solid var(--border); color: var(--muted); white-space: pre-wrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 8px; top: -60px; background: var(--primary); color: var(--on-primary); padding: 10px 16px; border-radius: 10px; z-index: 300; }
.skip-link:focus { top: 8px; }
.icon { display: inline-flex; width: 1.25em; height: 1.25em; flex: none; }
.icon svg { width: 100%; height: 100%; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .strong { font-weight: 650; } .center { text-align: center; } .pad { padding: 20px; } .mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.grow { flex: 1; min-width: 0; } .tight { gap: 6px !important; }
.stack { display: flex; flex-direction: column; gap: 14px; } .stack-sm { display: flex; flex-direction: column; gap: 8px; } .stack-lg { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap, .wrap { flex-wrap: wrap; } .between { justify-content: space-between; }
.inline { display: inline-flex; align-items: center; gap: 6px; }
.h-sm { font-size: 1.1rem; display: flex; align-items: center; gap: 8px; } .h-xs { font-size: .95rem; margin-top: 4px; }
.fade-in { animation: fade .25s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .001s !important; transition-duration: .001s !important; scroll-behavior: auto !important; } }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; background: var(--surface-2); font-weight: 600; text-decoration: none !important; transition: transform .1s, background .15s, box-shadow .15s; position: relative; color: var(--text); }
.btn:hover { background: var(--surface-3); } .btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 4px 14px rgba(11, 92, 171, .28); } .btn-primary:hover { background: var(--primary-hover); }
.btn-soft { background: var(--primary-soft); color: var(--primary-text); } .btn-soft:hover { background: var(--surface-3); }
.btn-ghost { background: transparent; border-color: var(--border); } .btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; } :root[data-theme="dark"] .btn-danger { color: #1a0402; }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger); }
.btn-success { background: var(--success); color: #fff; } :root[data-theme="dark"] .btn-success { color: #04180d; }
.btn-sm { min-height: 38px; padding: 0 12px; font-size: .9rem; border-radius: 10px; } .btn-lg { min-height: 52px; font-size: 1.05rem; } .btn-xl { min-height: 64px; font-size: 1.15rem; border-radius: 16px; }
.btn-block { width: 100%; } .btn small { display: block; font-weight: 400; opacity: .85; }
.btn.busy::after { content: ""; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 44px; min-height: 44px; border-radius: 12px; border: 0; background: transparent; color: var(--text); position: relative; text-decoration: none !important; }
.icon-btn:hover { background: var(--surface-2); }
.lang-btn span:last-child { font-size: .75rem; font-weight: 700; }
.link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }

/* ---------- Formulare ---------- */
.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > label, .field > legend { font-weight: 650; font-size: .92rem; padding: 0; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
input[readonly] { background: var(--surface-2); }
.hint { color: var(--muted); font-size: .85rem; display: flex; gap: 6px; align-items: flex-start; } .hint .icon { margin-top: 2px; }
.privacy-hint { background: var(--info-soft); padding: 8px 10px; border-radius: 10px; margin-top: 8px; color: var(--text); }
.grid-form { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .grid-form { grid-template-columns: 1fr 1fr; } }
.search-box { position: relative; flex: 1; min-width: 0; } .search-box .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box input { padding-left: 42px; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; } .seg-item { flex: 1 1 110px; position: relative; }
.seg-item input { position: absolute; opacity: 0; inset: 0; }
.seg-item label { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); font-weight: 600; cursor: pointer; transition: all .15s; }
.seg-item input:checked + label { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-text); box-shadow: inset 0 0 0 1px var(--primary); }
.seg-item input:focus-visible + label { box-shadow: var(--focus); }
.seg-urgent input:checked + label { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(4, 1fr); } }
.cat-item { position: relative; } .cat-item input { position: absolute; opacity: 0; inset: 0; }
.cat-item label { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; min-height: 82px; padding: 10px 6px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface); font-size: .85rem; font-weight: 600; cursor: pointer; transition: all .15s; }
.cat-item label .icon { width: 26px; height: 26px; color: var(--primary-text); }
.cat-item input:checked + label { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.cat-item input:focus-visible + label { box-shadow: var(--focus); }
.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; min-height: 44px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { flex: none; width: 48px; height: 28px; border-radius: 99px; background: var(--surface-3); border: 1.5px solid var(--border); position: relative; transition: background .2s; margin-top: 2px; }
.switch-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); transition: transform .2s; }
.switch input:checked + .switch-ui { background: var(--primary); border-color: var(--primary); } .switch input:checked + .switch-ui::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-ui { box-shadow: var(--focus); }
.switch-text { display: flex; flex-direction: column; font-weight: 500; } .switch-text small { font-weight: 400; }

/* ---------- Karten, Badges ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-grid { display: grid; gap: 12px; grid-template-columns: 1fr; } @media (min-width: 700px) { .card-grid { grid-template-columns: repeat(2, 1fr); } } @media (min-width: 1280px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 8px; border-radius: 99px; font-size: .78rem; font-weight: 700; background: var(--surface-2); color: var(--text); white-space: nowrap; }
.badge .icon { width: 14px; height: 14px; }
.st-open { background: var(--st-open-bg); color: var(--st-open); } .st-read { background: var(--st-read-bg); color: var(--st-read); } .st-in_progress { background: var(--st-in_progress-bg); color: var(--st-in_progress); }
.st-waiting { background: var(--st-waiting-bg); color: var(--st-waiting); } .st-closed { background: var(--st-closed-bg); color: var(--st-closed); }
.pr-low { background: var(--surface-2); color: var(--muted); } .pr-normal { background: var(--surface-2); color: var(--text); } .pr-high { background: var(--st-open-bg); color: var(--st-open); } .pr-urgent { background: var(--danger-soft); color: var(--danger); box-shadow: inset 0 0 0 1.5px var(--danger); }
.chip-role { font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--primary-soft); color: var(--primary-text); }
.avatar { --size: 40px; width: var(--size); height: var(--size); border-radius: 50%; flex: none; display: inline-grid; place-items: center; overflow: hidden; background: hsl(var(--hue) 55% 42%); color: #fff; font-weight: 700; font-size: calc(var(--size) * .38); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: .95rem; background: var(--surface-2); }
.alert > .icon { margin-top: 1px; } .alert.compact { padding: 9px 12px; font-size: .88rem; }
.alert-error { background: var(--danger-soft); color: var(--danger); } .alert-ok { background: var(--success-soft); color: var(--success); } .alert-warn { background: var(--warn-soft); color: var(--warn); } .alert-info { background: var(--info-soft); color: var(--text); }
.alert-info > .icon { color: var(--primary-text); }

/* ---------- App-Shell ---------- */
.app { min-height: 100dvh; display: block; }
.sidebar { display: none; }
.content { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 40; height: var(--topbar-h); display: flex; align-items: center; gap: 6px; padding: 0 10px 0 12px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.topbar h1 { font-size: 1.15rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; letter-spacing: .02em; text-decoration: none !important; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #0b5cab, #0e8ad6); box-shadow: 0 4px 12px rgba(11, 92, 171, .35); }
.brand-mark .icon { width: 22px; height: 22px; } .brand-mobile { margin-right: 2px; }
#back-btn:not([hidden]) + .brand-mobile { display: none; }
.nav-badge { position: absolute; top: 0; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--accent); color: #fff; font-size: .7rem; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg); }
.nav-badge.static { position: static; margin-left: auto; border: 0; }
.bell .nav-badge { top: 2px; right: 0; }
.nav-ico { position: relative; display: inline-flex; }
.offline-banner { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 10px 14px; background: var(--warn-soft); color: var(--warn); font-weight: 600; font-size: .92rem; position: sticky; top: var(--topbar-h); z-index: 39; }
main#main { outline: none; padding-bottom: calc(var(--bottom-h) + 24px + var(--safe-b)); }
.page { max-width: 1180px; margin: 0 auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 18px; } .page.narrow { max-width: 760px; }
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: calc(var(--bottom-h) + var(--safe-b)); padding: 6px 6px var(--safe-b); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--border); }
.bn-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; color: var(--muted); font-size: .72rem; font-weight: 650; text-decoration: none !important; border-radius: 12px; min-height: 52px; justify-content: center; }
.bn-item .icon { width: 26px; height: 26px; } .bn-item.active { color: var(--primary-text); } .bn-item.active .nav-ico::before { content: ""; position: absolute; inset: -4px -12px; background: var(--primary-soft); border-radius: 14px; z-index: -1; }
.bn-item .nav-ico { z-index: 0; }
.bn-item.fab .nav-ico { background: var(--primary); color: var(--on-primary); width: 54px; height: 54px; border-radius: 50%; align-items: center; justify-content: center; margin-top: -26px; box-shadow: 0 6px 18px rgba(11, 92, 171, .45); border: 4px solid var(--bg); transition: transform .15s; }
.bn-item.fab:active .nav-ico { transform: scale(.92); } .bn-item.fab.active .nav-ico::before { display: none; } .bn-item.fab { color: var(--text); }
body.chat-open .bottom-nav { display: none; } body.chat-open main#main { padding-bottom: 0; }
.fab-mobile { position: fixed; right: 16px; bottom: calc(var(--bottom-h) + 18px + var(--safe-b)); width: 58px; height: 58px; border-radius: 50%; padding: 0; z-index: 30; display: none; }

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 272px 1fr; }
  .sidebar { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100dvh; padding: 20px 16px; background: var(--surface); border-right: 1px solid var(--border); }
  .bottom-nav, .brand-mobile, #back-btn { display: none !important; } .bn-item { display: none; }
  main#main { padding-bottom: 40px; } body.chat-open main#main { padding-bottom: 0; }
  .side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
  .nav-item { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; color: var(--text); font-weight: 600; text-decoration: none !important; }
  .nav-item .nav-ico { position: static; }
  .nav-item .nav-badge { top: 50%; right: 12px; transform: translateY(-50%); border-color: var(--surface); }
  .nav-item:hover { background: var(--surface-2); } .nav-item.active { background: var(--primary-soft); color: var(--primary-text); }
  .side-user { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; background: var(--surface-2); color: var(--text); text-decoration: none !important; }
  .side-user .who { display: flex; flex-direction: column; min-width: 0; } .side-user small { color: var(--muted); }
  .page { padding: 24px 28px; }
  .topbar { padding: 0 20px; height: 64px; } .topbar h1 { font-size: 1.35rem; }
  .fab-mobile { display: none !important; }
  .offline-banner { top: 64px; }
}
@media (max-width: 899px) { .side-new, .only-desktop, .only-desktop-block { display: none !important; } .fab-mobile { display: none; } }
@media (min-width: 900px) { .only-mobile-block { display: none !important; } }

/* ---------- Skeleton, Laden, Leer ---------- */
.skeleton { height: 110px; background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 40px; color: var(--muted); }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--primary); animation: spin .8s linear infinite; }
.empty { text-align: center; padding: 36px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-icon { width: 72px; height: 72px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-text); display: grid; place-items: center; margin-bottom: 4px; } .empty-icon .icon { width: 34px; height: 34px; }

/* ---------- Dashboard ---------- */
.hello { position: relative; overflow: hidden; padding: 18px; background: linear-gradient(135deg, var(--primary-soft), var(--surface)); }
.hello-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .18; }
.hello-text { position: relative; display: flex; align-items: center; gap: 14px; } .hello h2 { font-size: 1.4rem; }
.cta { gap: 12px; flex-direction: row; text-align: left; padding: 14px 18px; } .cta small { margin-left: auto; font-size: .8rem; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; } @media (min-width: 700px) { .tiles { grid-template-columns: repeat(4, 1fr); } } @media (min-width: 1100px) { .tiles { grid-template-columns: repeat(5, 1fr); } }
.tile { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "ico num" "label label"; gap: 4px 10px; align-items: center; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); text-decoration: none !important; transition: transform .15s, border-color .15s; }
.tile:hover { transform: translateY(-2px); border-color: var(--primary); }
.tile-ico { grid-area: ico; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); } .tile-num { grid-area: num; font-size: 1.9rem; font-weight: 800; line-height: 1; text-align: right; } .tile-label { grid-area: label; font-size: .85rem; color: var(--muted); font-weight: 600; }
.tile.hot .tile-ico { background: var(--st-open-bg); color: var(--st-open); } .tile.danger { border-color: var(--danger); } .tile.danger .tile-ico { background: var(--danger-soft); color: var(--danger); }
.section { display: flex; flex-direction: column; gap: 10px; } .section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; } .section-head h2 { font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; } @media (min-width: 700px) { .quick { grid-template-columns: repeat(4, 1fr); } }
.quick-item { display: flex; align-items: center; gap: 10px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 650; text-decoration: none !important; } .quick-item:hover { border-color: var(--primary); } .quick-item .icon { color: var(--primary-text); width: 26px; height: 26px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 36px; gap: 10px; align-items: center; font-size: .9rem; } .bar-label { display: flex; gap: 6px; align-items: center; font-weight: 600; } .bar-track { height: 12px; background: var(--surface-2); border-radius: 99px; overflow: hidden; } .bar-fill { display: block; height: 100%; border-radius: 99px; min-width: 4px; } .bar-fill.st-open { background: var(--st-open); } .bar-fill.st-read { background: var(--st-read); } .bar-fill.st-in_progress { background: var(--st-in_progress); } .bar-fill.st-waiting { background: var(--st-waiting); } .bar-fill.st-closed { background: var(--st-closed); } .bar-n { text-align: right; font-weight: 700; }
@media (max-width: 480px) { .bar-row { grid-template-columns: 1fr 36px; } .bar-track { grid-column: 1 / -1; grid-row: 2; } .bar-n { grid-row: 1; grid-column: 2; } }
.timeline-list { list-style: none; margin: 0; padding: 0; } .timeline-list li + li { border-top: 1px solid var(--border); }
.tl-item { display: flex; gap: 12px; padding: 12px 14px; color: var(--text); text-decoration: none !important; } .tl-item:hover { background: var(--surface-2); }
.tl-ico { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-text); display: grid; place-items: center; flex: none; } .tl-text { display: flex; flex-direction: column; min-width: 0; } .tl-text small { color: var(--muted); }

/* ---------- Tickets ---------- */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 99px; background: var(--surface); border: 1.5px solid var(--border); font-weight: 600; font-size: .92rem; color: var(--text); text-decoration: none !important; }
.chip[aria-pressed="true"], .chip[aria-current="page"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.filters { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; } .filters .grid-form { width: 100%; } @media (min-width: 900px) { .filters .grid-form { grid-template-columns: repeat(4, 1fr); } }
.result-count { margin-top: -6px; }
.ticket-card { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); text-decoration: none !important; transition: transform .15s, box-shadow .15s; min-width: 0; }
.ticket-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.ticket-card.prio-urgent { border-left-color: var(--danger); } .ticket-card.prio-high { border-left-color: var(--st-open); } .ticket-card.prio-normal { border-left-color: var(--primary); } .ticket-card.prio-low { border-left-color: var(--muted); }
.tc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; } .tc-badges { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.tnum { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; font-size: .85rem; color: var(--muted); } .tnum.big { font-size: 1rem; }
.tc-title { font-size: 1.05rem; overflow-wrap: anywhere; }
.tc-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: .88rem; } .tc-meta span { display: inline-flex; align-items: center; gap: 5px; } .tc-meta .icon, .tc-date .icon, .tc-assignee .icon { width: 16px; height: 16px; }
.tc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .88rem; } .tc-who { display: inline-flex; align-items: center; gap: 8px; min-width: 0; } .tc-who span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .tc-date { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); flex: none; }
.tc-assignee { display: flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; padding-top: 8px; border-top: 1px dashed var(--border); } .tc-assignee.none { color: var(--muted); font-weight: 500; } .tc-photos { margin-left: auto; display: inline-flex; gap: 4px; color: var(--muted); align-items: center; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; } .table th { text-align: left; padding: 12px; background: var(--surface-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap; position: sticky; top: 0; } .table td { padding: 10px 12px; border-top: 1px solid var(--border); vertical-align: middle; } .table tbody tr:hover { background: var(--surface-2); }
.cat-grid + * { margin-top: 0; }
.similar { background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; } .similar-head { display: flex; gap: 10px; align-items: flex-start; } .similar ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; } .similar li { display: flex; justify-content: space-between; gap: 8px; align-items: center; background: var(--surface); padding: 8px 12px; border-radius: 10px; flex-wrap: wrap; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; } .thumb { position: relative; width: 96px; height: 96px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); } .thumb img { width: 100%; height: 100%; object-fit: cover; } .thumb-x { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(0,0,0,.7); color: #fff; display: grid; place-items: center; }
.ticket-head { display: flex; flex-direction: column; gap: 12px; border-left: 6px solid var(--primary); } .ticket-head.prio-urgent { border-left-color: var(--danger); } .ticket-head.prio-high { border-left-color: var(--st-open); }
.ticket-title { font-size: 1.4rem; overflow-wrap: anywhere; } .ticket-desc { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1.02rem; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; } .photo { padding: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface-2); aspect-ratio: 4/3; } .photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; } .photo:hover img { transform: scale(1.05); }
.facts { display: grid; gap: 12px 20px; grid-template-columns: 1fr; margin: 0; } @media (min-width: 600px) { .facts { grid-template-columns: 1fr 1fr; } } .facts dt { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; display: flex; gap: 6px; align-items: center; margin-bottom: 2px; } .facts dt .icon { width: 15px; height: 15px; } .facts dd { margin: 0; overflow-wrap: anywhere; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; }
.contact-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--surface-2); padding: 10px 12px; border-radius: 10px; font-size: .9rem; }
.resolution { background: var(--success-soft); color: var(--success); padding: 12px 14px; border-radius: 12px; } .resolution strong { display: flex; gap: 6px; align-items: center; } .resolution p { color: var(--text); margin-top: 4px; white-space: pre-wrap; }
.actions .btn { flex: 1 1 auto; } .assign-row { display: flex; gap: 8px; flex-wrap: wrap; } .assign-row select { flex: 1; min-width: 180px; }
.tl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.tl-sys { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--muted); padding: 2px 4px; } .sys-dot { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; flex: none; border: 1px dashed var(--border); } .sys-dot .icon { width: 15px; height: 15px; }
.tl-comment { display: flex; gap: 10px; align-items: flex-start; } .tl-comment .bubble { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 4px 16px 16px 16px; padding: 10px 14px; box-shadow: var(--shadow); } .tl-comment.mine .bubble { background: var(--primary-soft); border-color: transparent; }
.bubble-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; } .bubble-head time { margin-left: auto; } .msg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.composer { display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
.composer-bar { display: flex; align-items: center; gap: 6px; }
.emoji-picker { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); overflow: hidden; } .emoji-tabs { display: flex; border-bottom: 1px solid var(--border); background: var(--surface-2); } .emoji-tab { flex: 1; min-height: 44px; border: 0; background: transparent; font-size: 1.3rem; } .emoji-tab[aria-selected="true"] { background: var(--surface); box-shadow: inset 0 -3px var(--primary); }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); max-height: 180px; overflow-y: auto; padding: 6px; } .emoji { min-height: 44px; border: 0; background: transparent; font-size: 1.5rem; border-radius: 10px; } .emoji:hover { background: var(--surface-2); }
.fab-mobile-hide { display: none; }

/* ---------- Nachrichten ---------- */
.msg-layout { display: grid; grid-template-columns: 1fr; height: calc(100dvh - var(--topbar-h) - var(--bottom-h) - var(--safe-b) - 4px); max-width: 1180px; margin: 0 auto; }
body.chat-open .msg-layout { height: calc(100dvh - var(--topbar-h)); }
.msg-layout.has-chat .conv-list, .msg-layout:not(.has-chat) .chat { display: none; }
.conv-list, .chat { display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.conv-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 14px 10px; gap: 8px; } .conv-items { overflow-y: auto; flex: 1; }
.conv { display: flex; gap: 12px; align-items: center; padding: 12px 14px; color: var(--text); text-decoration: none !important; border-bottom: 1px solid var(--border); min-height: 72px; } .conv:hover { background: var(--surface-2); } .conv.active { background: var(--primary-soft); }
.conv-text { flex: 1; min-width: 0; } .conv-top, .conv-bottom { display: flex; justify-content: space-between; gap: 8px; align-items: center; } .conv .preview { color: var(--muted); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv.unread .preview { color: var(--text); font-weight: 700; } .unread-badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--accent); color: #fff; font-size: .75rem; font-weight: 800; display: grid; place-items: center; flex: none; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--border); } .chat-who { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.25; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); overscroll-behavior: contain; }
.day-sep { text-align: center; margin: 8px 0; } .day-sep span { background: var(--surface-2); color: var(--muted); font-size: .78rem; font-weight: 650; padding: 3px 12px; border-radius: 99px; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 100%; } .msg.mine { justify-content: flex-end; } .msg-col { display: flex; flex-direction: column; max-width: min(78%, 520px); } .msg.mine .msg-col { align-items: flex-end; }
.msg-bubble { padding: 9px 14px; border-radius: 18px 18px 18px 4px; background: var(--surface); border: 1px solid var(--border); overflow-wrap: anywhere; } .msg.mine .msg-bubble { background: var(--primary); color: var(--on-primary); border-color: transparent; border-radius: 18px 18px 4px 18px; }
.msg-bubble .msg-text { font-size: 1.02rem; }
.msg-photo { padding: 0; border: 0; background: none; display: block; margin-top: 4px; } .msg-photo img { max-height: 260px; border-radius: 12px; }
.msg-meta { display: flex; align-items: center; gap: 4px; font-size: .75rem; color: var(--muted); padding: 2px 4px; } .msg-menu { border: 0; background: transparent; color: var(--muted); min-width: 32px; min-height: 28px; border-radius: 8px; display: inline-grid; place-items: center; } .msg-menu:hover { background: var(--surface-2); }
.msg-deleted { display: flex; gap: 6px; align-items: center; font-style: italic; opacity: .85; } .is-deleted .msg-bubble { background: transparent; border: 1px dashed var(--border); color: var(--muted); } .msg.mine.is-deleted .msg-bubble { background: transparent; color: var(--muted); }
.pending .msg-bubble { opacity: .7; } .failed .msg-bubble { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger); opacity: 1; } .msg-meta.fail { color: var(--danger); flex-wrap: wrap; justify-content: flex-end; font-weight: 600; }
.center-btn { align-self: center; }
.dm-composer { border-top: 1px solid var(--border); padding: 8px 10px calc(8px + var(--safe-b)); background: var(--surface); display: flex; flex-direction: column; gap: 8px; } .dm-row { display: flex; align-items: flex-end; gap: 4px; } .dm-row textarea { min-height: 46px; max-height: 160px; resize: none; overflow-y: auto; border-radius: 22px; padding: 11px 16px; flex: 1; } .send-btn { min-width: 48px; min-height: 48px; padding: 0; border-radius: 50%; flex: none; }
.dm-preview { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.chat-empty { display: grid; place-items: center; flex: 1; }
.people { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; max-height: 50vh; overflow-y: auto; } .person { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; border: 0; background: transparent; text-align: left; min-height: 56px; } .person:hover { background: var(--surface-2); } .person span { display: flex; flex-direction: column; }
@media (min-width: 900px) {
  .msg-layout { grid-template-columns: 340px 1fr; height: calc(100dvh - 64px - 32px); margin: 16px auto; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); width: calc(100% - 56px); }
  body.chat-open .msg-layout { height: calc(100dvh - 64px - 32px); }
  .msg-layout.has-chat .conv-list, .msg-layout:not(.has-chat) .chat { display: flex; } .conv-list { border-right: 1px solid var(--border); } .chat-back { display: none; }
  .chat-empty { background: var(--bg); }
}

/* ---------- Benachrichtigungen / Menü / Kontakte ---------- */
.notif-list { list-style: none; margin: 0; padding: 0; } .notif-list li + li { border-top: 1px solid var(--border); }
.notif { display: flex; gap: 12px; align-items: flex-start; padding: 14px; color: var(--text); text-decoration: none !important; } .notif:hover { background: var(--surface-2); } .notif.unread { background: var(--primary-soft); box-shadow: inset 4px 0 var(--primary); }
.notif-ico { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; flex: none; color: var(--primary-text); } .notif-text { display: flex; flex-direction: column; flex: 1; min-width: 0; } .new-pill { background: var(--primary); color: var(--on-primary); font-size: .7rem; font-weight: 800; padding: 2px 8px; border-radius: 99px; flex: none; }
.menu-item { display: flex; align-items: center; gap: 14px; padding: 16px; color: var(--text); font-weight: 600; text-decoration: none !important; border-top: 1px solid var(--border); min-height: 60px; } .menu-item:first-child { border-top: 0; } .menu-item:hover { background: var(--surface-2); } .menu-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-text); display: grid; place-items: center; } .menu-item .chev { margin-left: auto; color: var(--muted); } .menu-item .nav-badge + .chev { margin-left: 8px; }
.profile-card { display: flex; gap: 16px; align-items: center; color: var(--text); text-decoration: none !important; }
.contact { display: flex; flex-direction: column; gap: 12px; } .contact-top { display: flex; gap: 14px; align-items: center; } .contact-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; } .contact-list li { display: flex; gap: 10px; align-items: center; overflow-wrap: anywhere; } .contact-list a { font-weight: 600; font-size: 1.02rem; }
.person-row { padding: 12px 14px; }
.avatar-edit { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.user-row { display: flex; flex-direction: column; gap: 12px; } .user-row.inactive { opacity: .75; } @media (min-width: 900px) { .user-row { flex-direction: row; align-items: center; } }
.plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; } .plain-list li { padding: 8px 0; border-top: 1px solid var(--border); gap: 8px; } .plain-list li:first-child { border-top: 0; } li.inactive, .card.inactive { opacity: .65; }
.brand-slot { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; border-top: 1px solid var(--border); } .brand-prev { max-height: 140px; border-radius: 12px; margin-top: 8px; border: 1px solid var(--border); }
.prose h2 { font-size: 1.1rem; margin-bottom: 6px; } .prose p { white-space: pre-line; }

/* ---------- Dialog, Toast ---------- */
.backdrop { position: fixed; inset: 0; z-index: 200; background: rgba(8, 16, 26, .55); backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease; }
.modal { width: 100%; max-width: 520px; max-height: 92dvh; overflow: auto; background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg); animation: sheet .22s ease; padding-bottom: var(--safe-b); } .modal.wide { max-width: 900px; }
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 6px 20px; position: sticky; top: 0; background: var(--surface); z-index: 1; } .modal-head h2 { font-size: 1.15rem; } .modal-body { padding: 8px 20px 16px; display: flex; flex-direction: column; gap: 12px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 20px 18px; flex-wrap: wrap; } .modal-actions .btn { flex: 1 1 140px; }
@media (min-width: 640px) { .backdrop { align-items: center; padding: 20px; } .modal { border-radius: 22px; } .modal-actions .btn { flex: 0 0 auto; } }
.modal .btn-block { justify-content: flex-start; padding: 10px 16px; min-height: 56px; flex-wrap: wrap; text-align: left; } .modal .btn-block small { flex-basis: 100%; padding-left: 33px; opacity: .8; }
.lightbox-img { width: 100%; max-height: 78dvh; object-fit: contain; border-radius: 12px; }
#toasts { position: fixed; z-index: 300; left: 12px; right: 12px; bottom: calc(var(--bottom-h) + 16px + var(--safe-b)); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; } @media (min-width: 900px) { #toasts { bottom: 24px; align-items: flex-end; right: 24px; left: auto; } }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: center; background: #14202c; color: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); max-width: 440px; animation: sheet .25s ease; font-weight: 600; } .toast-error { background: #8a1c12; } .toast.out { opacity: 0; transform: translateY(10px); transition: all .3s; }

/* ---------- Anmeldung ---------- */
body.auth-mode { background: var(--bg); }
.auth { min-height: 100dvh; display: grid; grid-template-columns: 1fr; }
.auth-hero { position: relative; min-height: 230px; color: #fff; overflow: hidden; display: flex; align-items: flex-end; }
.hero-art, .hero-art img, .hero-art svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; } .hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5, 24, 44, .15), rgba(5, 24, 44, .82)); }
.hero-text { position: relative; padding: 22px 22px 26px; display: flex; flex-direction: column; gap: 8px; max-width: 520px; }
.brand-big { color: #fff; font-size: 1.7rem; } .brand-big .brand-mark { width: 48px; height: 48px; } .hero-tag { font-size: 1.1rem; opacity: .95; } .hero-place { display: flex; gap: 6px; align-items: center; font-size: .9rem; opacity: .9; } .hero-note { font-size: .75rem; opacity: .75; border-top: 1px solid rgba(255,255,255,.3); padding-top: 6px; margin-top: 4px; }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px 16px 28px; gap: 16px; position: relative; margin-top: -24px; }
.auth-tools { align-self: flex-end; display: flex; gap: 4px; position: absolute; top: -14px; right: 12px; } .auth-hero + .auth-main .auth-tools .icon-btn { background: rgba(255,255,255,.18); color: #fff; backdrop-filter: blur(6px); }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 26px 22px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 16px; } .auth-card h1 { font-size: 1.6rem; }
.auth-foot { font-size: .88rem; }
.public-page { padding: 20px 14px; } .center-btn { align-self: center; }
@media (min-width: 900px) {
  .auth { grid-template-columns: 1.1fr 1fr; } .auth-hero { min-height: 100dvh; } .hero-text { padding: 56px; } .brand-big { font-size: 2.2rem; } .hero-tag { font-size: 1.4rem; }
  .auth-main { margin-top: 0; } .auth-tools { top: 20px; right: 24px; } .auth-hero + .auth-main .auth-tools .icon-btn { background: transparent; color: var(--text); }
}
