/* LymeMedia Support – ruhig, flach, werkzeugartig. Limette nur als Akzent. */
:root {
  --bg: #0b0f0c;
  --bg-elev: #0e130f;
  --panel: #0e130f;
  --panel-2: #141a15;
  --hover: #161d18;
  --border: #1f2721;
  --border-strong: #2b352d;
  --text: #e8ede8;
  --text-2: #9aa79c;
  --text-3: #6c786e;
  --accent: #a1da51;
  --accent-2: #b8e874;
  --accent-ink: #10230f;
  --accent-soft: rgba(161, 218, 81, .1);
  --brand-green: #11311e;
  --series-2: #6ea8d8;
  --green: #4cc38a;
  --green-soft: rgba(76, 195, 138, .12);
  --yellow: #e0b04a;
  --yellow-soft: rgba(224, 176, 74, .12);
  --red: #e5615c;
  --red-soft: rgba(229, 97, 92, .12);
  --blue: #6ea8d8;
  --blue-soft: rgba(110, 168, 216, .12);
  --note: rgba(224, 176, 74, .06);
  --note-border: rgba(224, 176, 74, .3);
  --radius: 8px;
  --radius-sm: 6px;
  --font: "Geist", system-ui, -apple-system, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --brand-font: "Nunito", "Geist", sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f7f4;
  --bg-elev: #ffffff;
  --panel: #ffffff;
  --panel-2: #f1f3ee;
  --hover: #eef1ea;
  --border: #e3e7df;
  --border-strong: #d2d8cd;
  --text: #151b16;
  --text-2: #56625a;
  --text-3: #808b82;
  --accent: #5e9a17;
  --accent-2: #4b7d10;
  --accent-ink: #ffffff;
  --accent-soft: rgba(94, 154, 23, .1);
  --series-2: #3f7fbf;
  --green: #2f9e66;
  --yellow: #b7861f;
  --red: #c94843;
  --blue: #3f7fbf;
  --note: rgba(224, 176, 74, .1);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 600; }
h2 { font-size: 13.5px; font-weight: 600; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.mono, .num { font-family: var(--mono); font-size: .92em; font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- Layout */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 16px 10px;
  background: var(--bg);
  border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 10px 18px; }
.brand-mark { width: 30px; height: 30px; flex: none; display: block; }
.brand b { display: block; font-family: var(--brand-font); font-weight: 900; font-size: 17px; line-height: 1.1; color: var(--accent); }
:root[data-theme="light"] .brand b { color: var(--brand-green); }
.brand small { color: var(--text-3); font-size: 12px; }
.nav-label { font-size: 12px; color: var(--text-3); padding: 16px 10px 4px; }
.nav a {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; border-radius: var(--radius-sm);
  color: var(--text-2);
}
.nav a:hover { color: var(--text); background: var(--hover); }
.nav a.active { color: var(--text); background: var(--panel-2); }
.nav a.active::before { content: ""; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: var(--accent); }
.nav svg { width: 16px; height: 16px; flex: none; opacity: .8; }
.nav .count { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.nav a.active .count { color: var(--text-2); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding-top: 12px; border-top: 1px solid var(--border); }
.bot-status { display: flex; align-items: center; gap: 8px; padding: 4px 10px; font-size: 12.5px; color: var(--text-3); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex: none; display: inline-block; }
.dot.on { background: var(--green); }
.dot.off { background: var(--yellow); }
.me { display: flex; align-items: center; gap: 10px; padding: 4px 4px 0 10px; }
.me .who { flex: 1; min-width: 0; }
.me .who b { display: block; font-size: 13px; font-weight: 500; }
.me .who small { color: var(--text-3); font-size: 12px; }

main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 32px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.search { position: relative; flex: 1; max-width: 420px; }
.search input { width: 100%; padding: 7px 12px 7px 32px; border-radius: var(--radius-sm); background: var(--panel); border: 1px solid var(--border); outline: none; }
.search input:focus { border-color: var(--border-strong); }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; color: var(--text-3); }
.search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
kbd { font: 11px/1 var(--mono); padding: 2px 5px; border-radius: 4px; border: 1px solid var(--border-strong); color: var(--text-3); }
.topbar .spacer { flex: 1; }
.content { padding: 28px 32px 64px; max-width: 1400px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }

/* ---------- Bausteine */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); min-height: 45px; }
.card-head .muted { font-size: 12.5px; color: var(--text-3); }
.card-body { padding: 14px 16px 16px; }
.grid { display: grid; gap: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: transparent; font-weight: 500; cursor: pointer; white-space: nowrap; line-height: 1.4;
}
.btn:hover { background: var(--hover); }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-soft); }
.btn.ghost { border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { color: var(--text); }
.btn.sm { padding: 3px 9px; font-size: 13px; }
.btn.icon { padding: 5px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.input, select.input, textarea.input {
  width: 100%; padding: 7px 10px; border-radius: var(--radius-sm); background: var(--bg);
  border: 1px solid var(--border-strong); outline: none;
}
.input:focus { border-color: var(--accent); }
textarea.input { resize: vertical; min-height: 64px; line-height: 1.45; }
select.input { appearance: none; padding-right: 28px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23808b82' stroke-width='1.6'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; color: var(--text-2); }
label.field small { font-weight: 400; color: var(--text-3); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 30px; height: 18px; border-radius: 99px; background: var(--border-strong); position: relative; flex: none; transition: background .12s; }
.switch .track::after { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text); transition: transform .12s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(12px); background: var(--accent-ink); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

.avatar {
  --c: var(--accent);
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--c) 18%, var(--panel));
  color: var(--c); font-weight: 600; font-size: 12px;
}
.avatar.sm { width: 22px; height: 22px; font-size: 10.5px; }
.avatar.lg { width: 44px; height: 44px; font-size: 17px; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; color: var(--text-2); }
.badge.s-open { color: var(--green); }
.badge.s-pending { color: var(--yellow); }
.badge.s-closed { color: var(--text-3); }
.badge .dot { background: currentColor; width: 6px; height: 6px; }
.role-badge { font-size: 12px; color: var(--text-3); }
.role-badge.admin { color: var(--yellow); }
.prio { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.prio i { display: inline-flex; gap: 2px; align-items: flex-end; }
.prio i b { width: 3px; border-radius: 1px; background: var(--border-strong); }
.prio i b:nth-child(1) { height: 5px; } .prio i b:nth-child(2) { height: 8px; } .prio i b:nth-child(3) { height: 11px; }
.prio.p-low i b:nth-child(1) { background: var(--text-3); }
.prio.p-normal i b:nth-child(-n+2) { background: var(--text-2); }
.prio.p-high i b { background: var(--yellow); }
.prio.p-urgent { color: var(--red); }
.prio.p-urgent i b { background: var(--red); }
.tag { --c: var(--accent); display: inline-flex; align-items: center; padding: 0 6px; border-radius: 4px;
  font-size: 12px; color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); }
.cat { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); white-space: nowrap; }

.flash-stack { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.flash { padding: 10px 14px; border-radius: var(--radius); background: var(--panel-2); border: 1px solid var(--border-strong); max-width: 420px; }
.flash.success { border-left: 2px solid var(--green); }
.flash.error { border-left: 2px solid var(--red); }
.flash.info { border-left: 2px solid var(--blue); }

.empty { padding: 48px 20px; text-align: center; color: var(--text-3); }
.empty svg { display: none; }
.notice { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px;
  border: 1px solid var(--border-strong); color: var(--text-2); font-size: 13.5px; }

/* ---------- Kennzahlen: eine durchgehende Leiste statt Kacheln */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 16px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.kpi.card { border: 0; border-radius: 0; background: none; padding: 14px 16px; }
.kpi + .kpi { border-left: 1px solid var(--border); }
.kpi .label { font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.kpi .label svg { display: none; }
.kpi .value { font-size: 24px; font-weight: 500; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.trend { font-family: var(--mono); font-size: 11.5px; margin-right: 4px; }
.trend.up { color: var(--green); }
.trend.down { color: var(--red); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }

/* ---------- Diagramme */
.chart-wrap { display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.chart-axis { display: flex; flex-direction: column; justify-content: space-between; font: 11px var(--mono); color: var(--text-3); text-align: right; padding-bottom: 22px; }
.chart { position: relative; display: flex; align-items: flex-end; gap: 6px; height: 220px; }
.chart::before { content: ""; position: absolute; inset: 0 0 22px 0; pointer-events: none;
  background: linear-gradient(var(--border) 1px, transparent 1px) 0 0 / 100% 50%; border-bottom: 1px solid var(--border-strong); }
.chart .day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; min-width: 0; }
.chart .bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; position: relative; }
.chart .bar { max-width: 14px; border-radius: 2px 2px 0 0; min-height: 1px; }
.chart .day:hover .bars { background: var(--hover); }
.chart .day small { font: 10.5px var(--mono); color: var(--text-3); height: 16px; white-space: nowrap; }
.chart .day.today small { color: var(--text); }
.chart .tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--border-strong); color: var(--text); font-size: 12px; padding: 4px 8px; border-radius: 4px; white-space: nowrap;
  opacity: 0; pointer-events: none; z-index: 2; }
.chart .day:hover .tip { opacity: 1; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; }
.cat-row { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; padding: 7px 0; align-items: center; }
.cat-row b { font-weight: 500; font-variant-numeric: tabular-nums; }
.cat-row .meter { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--panel-2); overflow: hidden; }
.cat-row .meter i { display: block; height: 100%; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); }
.list-row:first-child { border-top: 0; padding-top: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row small { color: var(--text-3); font-size: 12px; }
a.list-row:hover .title { text-decoration: underline; text-underline-offset: 3px; }
.rank { width: 18px; text-align: right; font: 12px var(--mono); color: var(--text-3); }
.heat { display: grid; grid-template-columns: 26px repeat(24, minmax(0, 1fr)); gap: 2px; }
.heat .hh { font: 10px var(--mono); color: var(--text-3); }
.heat .hd { font-size: 11.5px; color: var(--text-3); align-self: center; }
.heat .hc { aspect-ratio: 1; border-radius: 2px; background: color-mix(in srgb, var(--accent) calc(var(--a) * 100%), var(--panel-2)); }
.heat .hc:hover { outline: 1px solid var(--text-2); }
.spark { display: inline-flex; align-items: flex-end; gap: 1px; height: 20px; width: 120px; }
.spark span { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.spark i { display: block; width: 100%; background: var(--accent); opacity: .75; }
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mini-stats div + div { border-left: 1px solid var(--border); padding-left: 14px; }
.mini-stats b { display: block; font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
.mini-stats small { color: var(--text-3); font-size: 12px; }

/* ---------- Tabs & Tabellen */
.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tabs a { padding: 6px 0 9px; color: var(--text-2); margin-bottom: -1px; border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }
.page-head .tabs { border-bottom: 0; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 14px 0; }
.filters select.input { width: auto; font-size: 13px; padding-top: 5px; padding-bottom: 5px; }
.ticket-table { width: 100%; border-collapse: collapse; }
.ticket-table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--text-3); padding: 9px 14px; border-bottom: 1px solid var(--border); }
.ticket-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ticket-table tr:last-child td { border-bottom: 0; }
.ticket-table tbody tr[data-href] { cursor: pointer; }
.ticket-table tbody tr[data-href]:hover { background: var(--hover); }
.ticket-table.data td { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ticket-table.data th:not(:first-child), .ticket-table.data td:not(:first-child) { text-align: right; }
.t-subject { display: flex; align-items: center; gap: 12px; min-width: 0; }
.t-subject .txt { min-width: 0; }
.t-subject b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 440px; }
.t-subject small { display: block; color: var(--text-3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 440px; }
.t-subject .num { color: var(--text-3); font-weight: 400; margin-right: 4px; }
.unread { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.assignee { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; white-space: nowrap; }

/* ---------- Ticketdetail */
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; height: calc(100vh - 51px); }
.convo { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--border); }
.convo-head { display: flex; align-items: center; gap: 12px; padding: 14px 28px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.convo-head h1 { font-size: 17px; }
.convo-head .meta { display: flex; gap: 12px; align-items: center; font-size: 13px; color: var(--text-2); margin-top: 2px; flex-wrap: wrap; }
.convo-head .actions { margin-left: auto; display: flex; gap: 8px; }
.messages { flex: 1; overflow-y: auto; padding: 16px 28px; display: flex; flex-direction: column; gap: 2px; }
.msg { display: flex; gap: 12px; padding: 6px 8px; border-radius: var(--radius-sm); margin: 0 -8px; }
.msg:hover { background: var(--hover); }
.msg .body { min-width: 0; flex: 1; }
.msg .head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.msg .head b { font-weight: 600; }
.msg .head time { font: 11.5px var(--mono); color: var(--text-3); }
.msg .text { white-space: pre-wrap; word-wrap: break-word; }
.msg.staff .head b { color: var(--accent); }
.msg .role { font-size: 11px; color: var(--text-3); border: 1px solid var(--border-strong); padding: 0 5px; border-radius: 4px; }
.msg.note { background: var(--note); border-left: 2px solid var(--note-border); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 4px -8px; }
.msg.note .role { color: var(--yellow); border-color: var(--note-border); }
.msg.system { justify-content: center; padding: 4px; }
.msg.system .sys { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); }
.msg.system .sys svg { width: 13px; height: 13px; }
.msg.system:hover { background: none; }
.day-sep { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12px; margin: 12px 0 4px; }
.day-sep::before, .day-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.closed-bar { padding: 12px 28px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13px; }

.side { overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 20px; }
.side-section h3 { font-size: 12px; font-weight: 500; color: var(--text-3); margin-bottom: 8px; }
.user-card { display: flex; gap: 12px; align-items: center; }
.user-card b { font-size: 15px; display: block; font-weight: 600; }
.prop { display: grid; grid-template-columns: 100px 1fr; gap: 8px; align-items: center; padding: 4px 0; font-size: 13px; }
.prop > span:first-child { color: var(--text-3); }
.answers dt { font-size: 12px; color: var(--text-3); margin-top: 10px; }
.answers dt:first-child { margin-top: 0; }
.answers dd { margin: 1px 0 0; white-space: pre-wrap; word-break: break-word; }
.tag-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.side .history a { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: var(--radius-sm); margin: 0 -8px; font-size: 13px; }
.side .history a:hover { background: var(--hover); }
.side .history .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

dialog { border: 1px solid var(--border-strong); border-radius: 10px; background: var(--panel); color: var(--text); padding: 0; width: min(480px, calc(100vw - 32px)); }
dialog:focus-visible { outline: none; }
dialog::backdrop { background: rgba(0, 0, 0, .55); }
dialog .d-head { padding: 18px 20px 0; }
dialog .d-head p { color: var(--text-2); margin: 6px 0 0; }
dialog .d-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; max-height: 70vh; overflow-y: auto; }
dialog .d-foot { padding: 12px 20px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--border); }
dialog.wide { width: min(720px, calc(100vw - 32px)); }
.chip-select { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-select label { cursor: pointer; }
.chip-select input { position: absolute; opacity: 0; }
.chip-select span { display: inline-block; padding: 3px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); font-size: 13px; color: var(--text-2); }
.chip-select input:checked + span { border-color: var(--accent); color: var(--text); }

/* ---------- Kategorien */
.cat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 500px; gap: 20px; align-items: start; }
.cat-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--panel); }
.cat-card + .cat-card { border-top: 1px solid var(--border); }
.cat-card:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.cat-card:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.cat-icon { width: 34px; height: 34px; border-radius: var(--radius-sm); display: grid; place-items: center; font-size: 17px; flex: none;
  background: var(--panel-2); box-shadow: inset 2px 0 0 var(--c); }
.cat-card .grow { flex: 1; min-width: 0; }
.cat-card .grow b { font-weight: 500; }
.cat-card .grow small { color: var(--text-3); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.cat-card.disabled { opacity: .5; }
.handle { cursor: grab; color: var(--text-3); padding: 2px; }
.handle svg { width: 15px; height: 15px; display: block; }
.cat-card.dragging { opacity: .4; }
.access-tag { font-size: 11.5px; color: var(--yellow); border: 1px solid var(--note-border); border-radius: 4px; padding: 0 5px; margin-left: 4px; }
.log-tag { font-size: 11.5px; color: var(--text-3); margin-left: 4px; }
.stat-pill { text-align: right; font-size: 12px; color: var(--text-3); white-space: nowrap; min-width: 44px; }
.stat-pill b { display: block; color: var(--text); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }

/* Discord-Vorschau (immer im dunklen Discord-Look) */
.preview-card .card-head { flex-wrap: wrap; }
.pv-tabs { margin-bottom: 12px; }
.pv-state[hidden] { display: none; }
.pv-state { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pv-state .chip-select span { padding: 4px 11px; font-size: 12.5px; }
.dc-surface { background: #1a1a1e; color: #dbdee1; border-radius: 12px; padding: 16px 14px; font: 15px/1.375 "Inter", "gg sans", sans-serif; border: 1px solid #26262c; overflow: hidden; }
.dc-surface b { color: #f2f3f5; font-weight: 600; }
.dc-channel { font-weight: 600; color: #949ba4; font-size: 13px; margin: -4px 0 12px; display: flex; gap: 8px; align-items: center; }
.dc-private { font-weight: 500; font-size: 11px; background: #2b2d31; padding: 1px 7px; border-radius: 4px; }
.dc-msg { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 14px; }
.dc-avatar { width: 40px; height: 40px; border-radius: 50%; background: #11311e; padding: 6px; grid-row: span 2; }
.dc-meta { display: flex; align-items: center; gap: 6px; }
.dc-author { font-weight: 600; color: #f2f3f5; }
.dc-app { background: #5865f2; color: #fff; font-size: 10px; font-weight: 700; padding: 0 5px; border-radius: 4px; line-height: 16px; }
.dc-time { color: #949ba4; font-size: 12px; margin-left: 2px; }
.dc-container { position: relative; margin-top: 6px; background: #232328; border: 1px solid #2e2e35; border-radius: 8px; padding: 14px 16px 14px 18px; display: flex; flex-direction: column; gap: 8px; max-width: 520px; }
.dc-container::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 4px; border-radius: 8px 0 0 8px; background: var(--accent); }
.dc-section { display: flex; gap: 14px; align-items: flex-start; }
.dc-section > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.dc-thumb { flex: none; width: 64px; height: 64px; border-radius: 8px; image-rendering: pixelated; }
.dc-section svg.dc-thumb[width="48"] { width: 48px; height: 48px; }
.dc-h2 { font-size: 20px; font-weight: 700; color: #f2f3f5; line-height: 1.25; }
.dc-h3 { font-size: 17px; font-weight: 700; color: #f2f3f5; }
.dc-text { color: #dbdee1; }
.dc-sub { font-size: 12.5px; color: #949ba4; }
.dc-sep { height: 1px; background: #34343b; margin: 4px 0; }
.dc-fields { display: flex; flex-direction: column; gap: 2px; }
.dc-fields > div { display: block; }
.dc-fields small { display: inline; font-size: 14.5px; color: #f2f3f5; font-weight: 700; }
.dc-fields small::after { content: ": "; }
.dc-fields b { font-weight: 400 !important; color: #dbdee1 !important; }
.dc-long small { display: block; font-size: 14.5px; color: #f2f3f5; font-weight: 700; }
.dc-fields b { font-size: 14.5px; }
.dc-long blockquote { margin: 3px 0 0; padding-left: 10px; border-left: 4px solid #4e5058; color: #dbdee1; }
.dc-status { background: #2b2b31; border-radius: 6px; padding: 9px 12px; font-size: 14px; }
.dc-status.ok { background: rgba(36, 128, 70, .18); }
.dc-mention { background: rgba(88, 101, 242, .3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; font-weight: 500; }
.dc-row { display: flex; gap: 8px; flex-wrap: wrap; }
.dc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 16px; height: 32px; border-radius: 8px; font-size: 14px; font-weight: 500; color: #fff; background: #4e5058; white-space: nowrap; }
.dc-btn.success { background: #248046; } .dc-btn.danger { background: #da373c; } .dc-btn.primary { background: #5865f2; }
.dc-btn.link { background: #4e5058; } .dc-btn.wide { flex: 1; height: 44px; font-size: 15px; }
.dc-select { margin-top: 2px; background: #1a1a1e; border: 1px solid #2e2e35; border-radius: 8px; padding: 10px 12px; color: #949ba4; display: flex; justify-content: space-between; }
.dc-options { background: #2b2b31; border-radius: 8px; padding: 4px; border: 1px solid #34343b; }
.dc-options div { display: flex; gap: 10px; padding: 7px 8px; border-radius: 6px; align-items: center; }
.dc-options div:hover { background: #35353c; }
.dc-options b { display: block; font-weight: 500; font-size: 14px; }
.dc-options small { color: #949ba4; font-size: 12px; }
.dc-emoji { font-size: 20px; width: 26px; text-align: center; }
.dc-modal { background: #18181c; border: 1px solid #2e2e35; border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 18px; max-width: 460px; margin: 0 auto; }
.dc-modal-head { display: flex; align-items: center; gap: 10px; }
.dc-modal-head img { width: 30px; height: 30px; border-radius: 8px; background: #11311e; padding: 4px; }
.dc-modal-head b { font-size: 20px; }
.dc-modal-head .x { margin-left: auto; color: #949ba4; font-size: 18px; }
.dc-warn { border: 1px solid #c38a2c; border-radius: 10px; padding: 10px 12px; font-size: 13.5px; background: rgba(195, 138, 44, .08); }
.dc-field { display: flex; flex-direction: column; gap: 6px; }
.dc-label { font-weight: 600; color: #f2f3f5; }
.dc-label .req { color: #f23f43; }
.dc-desc { font-size: 12.5px; color: #949ba4; margin-top: -3px; }
.dc-input { background: #111114; border: 1px solid #2e2e35; border-radius: 8px; padding: 11px 12px; color: #6d6f78; min-height: 44px; }
.dc-input.para { min-height: 76px; }
.dc-input.filled { color: #f2f3f5; }
.dc-input.select { color: #f2f3f5; display: flex; justify-content: space-between; }
.dc-input.select span { color: #949ba4; }
.dc-modal-foot { display: flex; gap: 10px; }
.dc-fields .dc-sub { display: inline; margin-left: 4px; }
.dc-file { display: flex; gap: 10px; align-items: center; background: #1a1a1e; border: 1px solid #2e2e35; border-radius: 8px; padding: 10px 12px; }
.dc-file-icon { font-size: 22px; }
.dc-file b { color: #00a8fc !important; font-weight: 500; }
.log-row { display: flex; align-items: center; gap: 16px; padding: 12px 16px; }
.log-row + .log-row { border-top: 1px solid var(--border); }
.log-row .grow { flex: 1; min-width: 0; }
.log-row .grow b { font-weight: 500; }
.log-row .grow small { display: block; color: var(--text-3); font-size: 12.5px; }
.log-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; font-size: 12px; }
.log-meta .on { color: var(--text-2); }
.log-meta .on::before { content: "✓ "; color: var(--accent); }
.log-meta .off { color: var(--text-3); text-decoration: line-through; }
.log-cats { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--text-2); text-align: right; }
.log-tabs a { padding: 2px 0 6px; font-size: 13px; }
.q-row { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border); }
.q-main { display: grid; grid-template-columns: 1fr 140px auto auto; gap: 8px; align-items: center; }
.q-row .input { padding: 7px 10px; }

/* ---------- Team */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.member { padding: 16px; }
.member-top { display: flex; align-items: center; gap: 12px; }
.member-top .grow { flex: 1; min-width: 0; }
.member-top b { font-size: 14.5px; font-weight: 600; display: block; }
.member-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.member-stats div + div { border-left: 1px solid var(--border); padding-left: 12px; }
.member-stats b { display: block; font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; }
.member-stats small { color: var(--text-3); font-size: 12px; }
.audit-row { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); font-size: 13px; }
.audit-row:first-child { border-top: 0; padding-top: 0; }

.role-list { display: inline-flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.role-chip { --c: var(--text-3); display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); }
.role-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.role-pick { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 8px; }
.perm-matrix th:not(:first-child), .perm-matrix td.mark { text-align: center; }
.perm-matrix .group-row td { font-size: 12px; color: var(--text-3); background: var(--panel-2); padding-top: 6px; padding-bottom: 6px; }
.perm-matrix .yes { color: var(--accent); }
.perm-matrix .no { color: var(--text-3); }
.role-head { background: none; border: 0; padding: 4px 6px; border-radius: var(--radius-sm); cursor: pointer; display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.role-head:hover { background: var(--hover); }
.role-head .role-chip { font-size: 13px; color: var(--text); font-weight: 500; }
.role-head small { font-weight: 400; color: var(--text-3); }
.perm-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 14px 24px; }
.perm-groups.disabled { opacity: .45; }
.perm-groups fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.perm-groups legend { font-size: 12px; color: var(--text-3); margin-bottom: 6px; padding: 0; }
.perm-groups .switch { font-size: 13.5px; align-items: flex-start; }
.perm-groups .switch .track { margin-top: 2px; }

.ban-note { margin-top: 12px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--red-soft); color: var(--red); font-size: 13px; }
.member-results { position: absolute; top: 100%; left: 0; right: 0; z-index: 5; background: var(--panel-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 4px; display: flex; flex-direction: column; }
.member-results button { text-align: left; background: none; border: 0; padding: 6px 8px; border-radius: 4px; cursor: pointer; }
.member-results button:hover { background: var(--hover); }

/* ---------- Textbausteine */
.snippet { padding: 12px 16px; display: flex; gap: 14px; align-items: flex-start; }
.snippet + .snippet { border-top: 1px solid var(--border); }
.snippet code { font: 12.5px var(--mono); color: var(--accent); white-space: nowrap; padding-top: 1px; }
.snippet .grow { flex: 1; min-width: 0; }
.snippet .grow b { font-weight: 500; }
.snippet p { margin: 2px 0 0; color: var(--text-2); white-space: pre-wrap; }

/* ---------- Einstellungen & Bot-Nachrichten */
.settings-layout { display: grid; grid-template-columns: 180px minmax(0, 760px); gap: 32px; align-items: start; }
.settings-nav { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.settings-nav a { padding: 5px 10px; border-radius: var(--radius-sm); color: var(--text-2); }
.settings-nav a:hover { color: var(--text); background: var(--hover); }
.settings-nav a.active { color: var(--text); background: var(--panel-2); }
.settings-layout.wide { grid-template-columns: 180px minmax(0, 1fr); }
.section { padding: 22px 0; border-top: 1px solid var(--border); scroll-margin-top: 70px; }
[data-settings-tabs] .section { border-top: 0; padding-top: 0; }
.section:first-child { border-top: 0; padding-top: 0; }
.section > header { margin-bottom: 14px; }
.section > header h2 { font-size: 15px; }
.section > header p { margin: 3px 0 0; color: var(--text-3); font-size: 13px; }
.section .actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 16px; font-size: 13.5px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; }
.checklist { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.checklist li { display: flex; gap: 8px; align-items: baseline; }
.checklist li::before { content: "—"; color: var(--text-3); }
.bot-state { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); margin-bottom: 18px; font-size: 13.5px; }
.bot-state .dot { margin-top: 6px; }
.bot-state .err { color: var(--yellow); margin-top: 2px; }
.secret-state { font: 12px var(--mono); color: var(--text-3); }
.text-item { padding: 12px 0; border-top: 1px solid var(--border); }
.text-item:first-of-type { border-top: 0; padding-top: 0; }
.text-item .row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.text-item label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.text-item .changed { font-size: 11.5px; color: var(--accent); margin-left: 6px; }
.text-item .placeholders { margin-top: 6px; }
.text-item .rendered { margin-top: 8px; padding: 8px 10px; border-radius: var(--radius-sm); background: #1a1a1e; color: #dbdee1; font-size: 13.5px; line-height: 1.4; border-left: 2px solid #3a3a42; }
.text-item .rendered b { color: #f2f3f5; }
.text-item .rendered .dc-mention { background: rgba(88, 101, 242, .3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; }
.text-item .rendered .unknown { color: #f0a0a0; text-decoration: underline wavy; }
.placeholders { display: flex; gap: 4px; flex-wrap: wrap; }
.placeholders button { font: 11.5px var(--mono); padding: 1px 6px; border-radius: 4px; border: 1px solid var(--border-strong); background: none; color: var(--text-2); cursor: pointer; }
.placeholders button:hover { color: var(--text); border-color: var(--text-3); }
.channel-preview { font-size: 13px; margin-top: 2px; }
.channel-preview .warn { color: var(--yellow); margin-left: 8px; font-size: 12.5px; }
.ph-copy { background: none; border: 1px solid var(--border-strong); border-radius: 4px; padding: 1px 7px; color: var(--accent); cursor: pointer; }
.ph-copy:hover { border-color: var(--accent); }
.ph-table td { vertical-align: top; }
.save-bar { position: sticky; bottom: 0; padding: 12px 0; background: var(--bg); border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: center; margin-top: 8px; }

/* ---------- Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.login-card { width: min(360px, 100%); padding: 28px; }
.login-card .brand { padding: 0 0 24px; }
.btn.discord { background: #5865f2; color: #fff; border-color: #5865f2; width: 100%; padding: 8px; }
.btn.discord:hover { background: #4752c4; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12px; margin: 16px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- Rechtliches (öffentlich) */
.legal { max-width: 760px; margin: 0 auto; padding: 32px 20px 64px; line-height: 1.65; }
.legal-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.legal-head .brand { padding: 0; }
.legal-head nav { display: flex; gap: 16px; font-size: 13.5px; }
.legal-head nav a { color: var(--text-2); }
.legal-head nav a.active, .legal-head nav a:hover { color: var(--text); }
.legal h1 { font-size: 26px; margin-bottom: 4px; }
.legal h2 { font-size: 16px; margin: 28px 0 8px; }
.legal h3 { font-size: 14px; margin: 16px 0 4px; color: var(--text-2); }
.legal ul { padding-left: 20px; margin: 6px 0; }
.legal li { margin: 3px 0; }
.legal a { text-decoration: underline; text-underline-offset: 3px; }
.legal-foot { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 12.5px; }

/* ---------- Transkript */
.transcript { max-width: 820px; margin: 0 auto; padding: 40px 24px; }

/* ---------- Responsive */
@media (max-width: 1280px) { .kpis { grid-template-columns: repeat(3, 1fr); } .kpi:nth-child(4) { border-left: 0; } .kpi:nth-child(n+4) { border-top: 1px solid var(--border); } }
@media (max-width: 1100px) {
  .dash-grid, .cat-layout, .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .ticket-layout { grid-template-columns: 1fr; height: auto; }
  .convo { border-right: 0; height: calc(100vh - 51px); }
  .side { border-top: 1px solid var(--border); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; left: 0; width: 248px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex !important; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi:nth-child(odd) { border-left: 0; } .kpi:nth-child(n+3) { border-top: 1px solid var(--border); }
  .form-grid { grid-template-columns: 1fr; }
  .hide-sm { display: none !important; }
  .messages, .convo-head { padding-left: 16px; padding-right: 16px; }
  .t-subject b, .t-subject small { max-width: 220px; }
}
.menu-btn { display: none !important; }
