/* =========================================================
   DarkSMP Panel - Design
   ========================================================= */

:root {
  --bg: #0e0f17;
  --bg-2: #14162152;
  --panel: #171925;
  --panel-2: #1e2130;
  --border: #2a2e42;
  --text: #e6e8f0;
  --muted: #8e93ad;
  --accent: #8b5cf6;
  --accent-2: #a78bfa;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --sidebar-w: 268px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1000px 500px at 15% -10%, rgba(139, 92, 246, .16), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(59, 130, 246, .10), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 8px; line-height: 1.25; }
p { margin: 0 0 12px; }

/* ------------------------------------------------------- Layout */

.layout { display: flex; min-height: 100vh; position: relative; z-index: 1; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
}
.brand-logo {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  font-size: 22px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  box-shadow: 0 6px 18px rgba(139, 92, 246, .35);
}
.brand-text { display: flex; flex-direction: column; }
.brand-text strong { font-size: 15px; }
.brand-text span { font-size: 12px; color: var(--muted); }

.nav { padding: 12px 10px; flex: 1; }
.nav-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  padding: 16px 10px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  color: #c3c7db;
  font-size: 14px;
  margin-bottom: 2px;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--panel-2); color: #fff; text-decoration: none; }
.nav-item.active { background: linear-gradient(90deg, rgba(139, 92, 246, .22), transparent); color: #fff; box-shadow: inset 2px 0 0 var(--accent); }
.nav-item.danger:hover { background: rgba(239, 68, 68, .15); color: #fecaca; }
.nav-item .ic { width: 20px; text-align: center; }

.sidebar-footer { padding: 10px; border-top: 1px solid var(--border); }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 26px;
  border-bottom: 1px solid var(--border);
  background: rgba(20, 22, 33, .75);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar h1 { margin: 0; font-size: 19px; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 14px; }

.burger {
  display: none;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  font-size: 17px;
  padding: 5px 10px;
  cursor: pointer;
}

.lang-switch { display: flex; gap: 4px; }
.lang-btn {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 5px 9px;
  cursor: pointer;
  font-size: 14px;
}
.lang-btn.active { border-color: var(--accent); background: rgba(139, 92, 246, .18); }

.user-chip { display: flex; align-items: center; gap: 9px; }
.user-chip strong { display: block; font-size: 13px; }
.user-chip small { color: var(--muted); font-size: 11px; }
.user-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.page { padding: 24px 26px 60px; max-width: 1400px; width: 100%; }

/* ------------------------------------------------------- Karten */

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.card-title { font-size: 16px; margin: 0 0 14px; }
.sub-title { font-size: 14px; margin: 22px 0 10px; color: var(--muted); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head .card-title { margin-bottom: 4px; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 20px; }

/* ------------------------------------------------------- Statistik */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.stat-grid.small { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.stat-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--panel-2);
  font-size: 20px;
  flex: 0 0 auto;
}
.stat-icon.ok { background: rgba(34, 197, 94, .15); }
.stat-icon.bad { background: rgba(239, 68, 68, .15); }
.stat-label { display: block; font-size: 12px; color: var(--muted); }
.stat-value { display: block; font-size: 19px; }
.stat-card small { color: var(--muted); font-size: 11px; }

/* ------------------------------------------------------- Module */

.module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.module {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--text);
  text-align: center;
  transition: transform .12s, border-color .12s;
}
.module:hover { transform: translateY(-2px); border-color: var(--accent); text-decoration: none; }
.module-icon { font-size: 22px; }
.module-name { font-size: 13px; font-weight: 600; }
.module.off { opacity: .62; }

/* ------------------------------------------------------- Formulare */

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }

input[type="text"], input[type="password"], input[type="number"], input[type="url"],
input[type="search"], input[type="email"], select, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .18);
}
input:disabled, select:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; }
textarea { resize: vertical; min-height: 70px; }
textarea.mono, .mono { font-family: "Cascadia Code", Consolas, "Courier New", monospace; font-size: 13px; }

input[type="color"] {
  width: 56px; height: 36px; padding: 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.color-row { display: flex; align-items: center; gap: 10px; }

.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 16px; }
.grid-form .field-wide, .field-wide { grid-column: 1 / -1; }

.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form select, .inline-form input { flex: 1; min-width: 180px; }
.inline { display: inline; }

.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.quick-form { margin-bottom: 12px; }

/* Schalter */
.switch-row { display: flex; align-items: center; gap: 12px; cursor: pointer; margin-bottom: 14px; }
.switch-row input { display: none; }
.switch {
  width: 44px; height: 25px;
  background: #3a3f57;
  border-radius: 999px;
  position: relative;
  flex: 0 0 auto;
  transition: background .18s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 19px; height: 19px;
  background: #fff;
  border-radius: 50%;
  transition: transform .18s;
}
.switch-row input:checked + .switch { background: var(--accent); }
.switch-row input:checked + .switch::after { transform: translateX(19px); }
.switch-row input:disabled + .switch { opacity: .5; }
.switch-text strong { display: block; font-size: 14px; font-weight: 600; }
.switch-text small { display: block; color: var(--muted); font-size: 12px; }
.switch-row.compact { margin: 22px 0 14px; }

/* Einstellungen */
.settings-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tab {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
}
.tab:hover { color: var(--text); text-decoration: none; border-color: var(--accent); }
.tab.active { background: rgba(139, 92, 246, .18); border-color: var(--accent); color: #fff; }

.settings-form .setting {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.settings-form .setting:last-of-type { border-bottom: none; }
.setting-label { display: block; margin-bottom: 7px; }
.setting-label strong { display: block; font-size: 14px; }
.setting-label small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.setting-bool { padding: 12px 0; }
.setting-bool .switch-row { margin-bottom: 0; }

/* Zeilen-Editor (z.B. Ticket-Gruende) */
.rows-editor {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  padding: 14px;
}

.rows-head {
  display: flex;
  gap: 10px;
  /* Ausrichtung auf die Eingabefelder:
     links  = Zeilen-Innenabstand (10px) + Nummer (22px) + Abstand (10px)
     rechts = Loeschen-Knopf (32px) + Abstand (10px) + Innenabstand (10px) */
  padding: 0 52px 9px 42px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
}
.rows-remove-space { display: none; }

.rows-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  counter-reset: rowindex;   /* nummeriert die Zeilen ganz ohne JavaScript */
}

.rows-row {
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 9px;
  transition: border-color .15s, background .15s;
}
.rows-row:hover { border-color: #3a3f57; }
.rows-row:focus-within { border-color: var(--accent); background: rgba(139, 92, 246, .06); }

.rows-row::before {
  counter-increment: rowindex;
  content: counter(rowindex);
  flex: 0 0 22px;
  text-align: center;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  user-select: none;
}

.rows-row input {
  min-width: 0;
  background: var(--bg);
  padding: 8px 10px;
  font-size: 13.5px;
}
.rows-row input[data-col="id"] {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12.5px;
  color: var(--accent-2);
}
.rows-row input::placeholder { color: #5b6076; }

.rows-remove {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
  align-items: center;
  font-size: 17px;
  line-height: 1;
  border-radius: 8px;
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.rows-row:hover .rows-remove { color: #fca5a5; }
.rows-remove:hover { background: rgba(239, 68, 68, .16); border-color: rgba(239, 68, 68, .4); }
.rows-remove:disabled { opacity: .25; cursor: not-allowed; background: transparent; border-color: transparent; }
.rows-row:hover .rows-remove:disabled { color: var(--muted); }

.rows-add {
  width: 100%;
  justify-content: center;
  margin-top: 10px;
  border-style: dashed;
  background: transparent;
  color: var(--muted);
}
.rows-add:hover { border-color: var(--accent); color: var(--text); background: rgba(139, 92, 246, .08); }

@media (max-width: 820px) {
  .rows-head { display: none; }
  .rows-row {
    display: grid;
    grid-template-columns: 22px 1fr 32px;
    grid-template-areas:
      "num  label  del"
      ".    id     ."
      ".    desc   .";
    gap: 7px 9px;
    padding: 10px;
  }
  .rows-row::before { grid-area: num; align-self: center; }
  .rows-row input { flex: none !important; width: 100%; }
  .rows-row input[data-col="label"] { grid-area: label; }
  .rows-row input[data-col="id"] { grid-area: id; }
  .rows-row input[data-col="description"] { grid-area: desc; }
  .rows-remove { grid-area: del; }
}

/* Mehrfachauswahl */
.picker { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
.picker-tools { display: flex; gap: 8px; align-items: center; padding: 8px; border-bottom: 1px solid var(--border); }
.picker-search { flex: 1; }
.picker-count { font-size: 12px; padding: 0 6px; }
.picker-list { max-height: 230px; overflow-y: auto; padding: 6px; }
.picker-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 14px;
}
.picker-item:hover { background: var(--panel-2); }
.picker-item input { accent-color: var(--accent); width: 15px; height: 15px; }
.picker-item .hash { color: var(--muted); }
.role-dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; }

/* ------------------------------------------------------- Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: filter .15s, border-color .15s;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.15); text-decoration: none; }
.btn-primary { background: linear-gradient(135deg, var(--accent), #6d28d9); border-color: transparent; color: #fff; }
.btn-secondary { background: var(--panel-2); }
.btn-danger { background: rgba(239, 68, 68, .16); border-color: rgba(239, 68, 68, .4); color: #fca5a5; }
.btn-small { padding: 5px 10px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; }

/* ------------------------------------------------------- Tabellen */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 11px 10px; border-bottom: 1px solid rgba(42, 46, 66, .55); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: rgba(255, 255, 255, .02); }
.row-muted { opacity: .55; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.truncate { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.small { font-size: 12.5px; }
.muted { color: var(--muted); }

/* ------------------------------------------------------- Badges */

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}
.badge-success { background: rgba(34, 197, 94, .16); color: #86efac; }
.badge-warning { background: rgba(245, 158, 11, .16); color: #fcd34d; }
.badge-danger { background: rgba(239, 68, 68, .16); color: #fca5a5; }
.badge-muted { background: rgba(142, 147, 173, .16); color: var(--muted); }

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--muted);
  font-family: "Cascadia Code", Consolas, monospace;
}

.rank-pill {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--rank, var(--accent));
  background: color-mix(in srgb, var(--rank, var(--accent)) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--rank, var(--accent)) 45%, transparent);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
}
.chip:hover { color: var(--text); text-decoration: none; }
.chip.active { background: rgba(139, 92, 246, .18); border-color: var(--accent); color: #fff; }
.chip-count { background: rgba(255, 255, 255, .1); border-radius: 999px; padding: 0 7px; font-size: 11.5px; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }

/* ------------------------------------------------------- Meldungen */

.alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 14px;
  border: 1px solid transparent;
}
.alert-success { background: rgba(34, 197, 94, .12); border-color: rgba(34, 197, 94, .35); color: #bbf7d0; }
.alert-error { background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .35); color: #fecaca; }
.alert-warning { background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .35); color: #fde68a; }
.alert-info { background: rgba(59, 130, 246, .12); border-color: rgba(59, 130, 246, .35); color: #bfdbfe; }
.alert-close { background: none; border: none; color: inherit; font-size: 19px; cursor: pointer; line-height: 1; }

/* ------------------------------------------------------- Details */

.detail-list { margin: 0; display: grid; gap: 10px; }
.detail-list > div { display: grid; grid-template-columns: 190px 1fr; gap: 12px; align-items: baseline; }
.detail-list dt { color: var(--muted); font-size: 13px; }
.detail-list dd { margin: 0; }

.quote {
  background: var(--bg);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 16px;
  white-space: pre-wrap;
  word-break: break-word;
}
.transcript {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  max-height: 460px;
  overflow: auto;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12.5px;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

/* ------------------------------------------------------- Raenge */

.rank-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.rank-card {
  border: 1px solid var(--border);
  border-left: 3px solid var(--rank, var(--accent));
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  padding: 15px;
}
.rank-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.rank-meta { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.rank-actions { display: flex; gap: 7px; }

.perm-toolbar { display: flex; justify-content: space-between; align-items: center; margin: 12px 0 10px; gap: 10px; flex-wrap: wrap; }
.perm-toolbar span { display: flex; gap: 6px; }
.perm-group { margin-bottom: 14px; }
.perm-group h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 7px; }
.perm-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 5px; }
.perm-item {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  font-size: 13px;
}
.perm-item:hover { border-color: var(--accent); }
.perm-item input { accent-color: var(--accent); margin-top: 2px; width: 15px; height: 15px; }
.perm-item strong { display: block; font-weight: 600; }
.perm-item small { display: block; color: var(--muted); font-size: 11.5px; }
.perm-chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ------------------------------------------------------- Modal */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 12, .72);
  backdrop-filter: blur(3px);
  z-index: 100;
  padding: 26px 16px;
  overflow-y: auto;
}
.modal.open { display: block; }
.modal-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 560px;
  margin: 0 auto;
  padding: 20px;
  box-shadow: var(--shadow);
}
.modal-box.wide { max-width: 900px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 24px; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--text); }

/* ------------------------------------------------------- Anmeldung */

.auth-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 1;
}
.auth-card h1 { font-size: 22px; margin-bottom: 4px; }
.auth-sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.auth-card .field { text-align: left; }
.auth-logo {
  width: 62px; height: 62px;
  margin: 0 auto 16px;
  display: grid; place-items: center;
  font-size: 30px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  box-shadow: 0 10px 26px rgba(139, 92, 246, .4);
}
.auth-lang { display: flex; gap: 8px; justify-content: center; margin-top: 20px; }

/* ------------------------------------------------- Embed-Vorschau */

.discord-preview { background: #313338; border-radius: var(--radius-sm); padding: 16px; }
.dp-content { margin-bottom: 8px; white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.dp-embed {
  display: flex;
  gap: 14px;
  background: #2b2d31;
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  padding: 13px 16px;
  max-width: 520px;
}
.dp-body { flex: 1; min-width: 0; }
.dp-author { font-size: 13px; font-weight: 600; margin-bottom: 6px; display: flex; align-items: center; gap: 7px; }
.dp-title { font-weight: 700; color: #fff; margin-bottom: 6px; word-break: break-word; }
.dp-description { font-size: 14px; color: #dbdee1; white-space: pre-wrap; word-break: break-word; }
.dp-footer { font-size: 12px; color: #b5bac1; margin-top: 9px; display: flex; align-items: center; gap: 7px; }
.dp-image { max-width: 100%; border-radius: 4px; margin-top: 12px; display: none; }
.dp-thumb { width: 78px; height: 78px; object-fit: cover; border-radius: 4px; display: none; flex: 0 0 auto; }
.dp-image.show, .dp-thumb.show { display: block; }

/* Vollstaendige Nachricht inkl. Absender */
.dp-message { display: flex; gap: 12px; align-items: flex-start; }
.dp-avatar { width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto; background: #1e2130; }
.dp-main { flex: 1; min-width: 0; }
.dp-head { display: flex; align-items: center; gap: 7px; margin-bottom: 3px; flex-wrap: wrap; }
.dp-name { color: #fff; font-weight: 600; font-size: 14.5px; }
.dp-badge {
  background: var(--accent); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 3px; padding: 1px 4px; letter-spacing: .02em;
}
.dp-time { color: #949ba4; font-size: 11.5px; }
.dp-author-icon { width: 22px; height: 22px; border-radius: 50%; }
.dp-footer-icon { width: 18px; height: 18px; border-radius: 50%; }

.dp-fields { display: flex; flex-wrap: wrap; gap: 9px 16px; margin-top: 9px; }
.dp-field { min-width: 0; flex: 1 1 100%; }
.dp-field.inline { flex: 1 1 28%; }
.dp-field-name { font-size: 12.5px; font-weight: 700; color: #fff; margin-bottom: 2px; }
.dp-field-value { font-size: 13.5px; color: #dbdee1; word-break: break-word; }

.dp-mention { background: rgba(139, 92, 246, .28); color: #c9b8fd; border-radius: 3px; padding: 0 2px; font-weight: 500; }
.dp-code { background: #1e1f22; border-radius: 3px; padding: 1px 4px; font-family: Consolas, monospace; font-size: 12.5px; }
.dp-codeblock { display: block; background: #1e1f22; border-radius: 4px; padding: 8px 10px; margin: 5px 0; font-family: Consolas, monospace; font-size: 12.5px; white-space: pre-wrap; }
.dp-quote { display: block; border-left: 4px solid #4e5058; padding-left: 10px; margin: 2px 0; }
.dp-h1 { display: block; font-size: 21px; font-weight: 700; color: #fff; margin: 6px 0 2px; }
.dp-h2 { display: block; font-size: 17px; font-weight: 700; color: #fff; margin: 6px 0 2px; }
.dp-h3 { display: block; font-size: 15px; font-weight: 700; color: #fff; margin: 6px 0 2px; }
.dp-spoiler { background: #1e1f22; border-radius: 3px; color: transparent; }
.dp-spoiler:hover { color: inherit; }

/* ------------------------------------------------ Willkommens-Vorlagen */

.tpl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 16px; }
.tpl-card {
  display: block;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  padding: 14px;
  cursor: pointer;
  transition: border-color .15s, transform .12s;
}
.tpl-card:hover { border-color: var(--accent-2); transform: translateY(-2px); }
.tpl-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139, 92, 246, .18); }
.tpl-head { display: flex; align-items: center; gap: 9px; margin-bottom: 4px; }
.tpl-head input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; }
.tpl-icon { font-size: 17px; }
.tpl-name { font-weight: 600; font-size: 14.5px; flex: 1; }
.tpl-check { color: var(--accent); font-weight: 700; opacity: 0; }
.tpl-card.selected .tpl-check { opacity: 1; }
.tpl-desc { color: var(--muted); font-size: 12.5px; margin: 0 0 11px; }
.tpl-preview {
  background: #313338;
  border-radius: var(--radius-sm);
  padding: 13px;
  margin-bottom: 11px;
  overflow-x: auto;
}
.tpl-apply { width: 100%; justify-content: center; }

.separator-hint { display: block; line-height: 1.6; }
.separator-hint code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12.5px;
  color: var(--accent-2);
}

/* Unterkategorien eines Ticket-Grundes */
.sub-block {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.sub-block:last-of-type { border-bottom: none; }
.sub-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
  font-size: 14.5px;
}

/* Fragen einer Unterkategorie - eingerueckt unter ihrer Kategorie */
.question-sub {
  position: relative;
  margin: 14px 0 0 0;
  padding: 12px 0 0 16px;
  border-left: 2px solid var(--accent);
}
.question-sub .setting-label strong { font-size: 13.5px; }
.question-sub .question-id { top: 12px; }

.question-block {
  position: relative;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.question-block:last-of-type { border-bottom: none; }
.question-block textarea { font-size: 13.5px; }
.question-id {
  position: absolute;
  top: 14px;
  right: 0;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 11.5px;
  color: var(--accent-2);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 7px;
}

.action-card { border-color: var(--accent); }
.action-card .card-title { margin-bottom: 6px; }
.action-card code { background: var(--bg); padding: 2px 6px; border-radius: 5px; font-size: 12.5px; }

.placeholder-help { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; }
.tag-btn { cursor: pointer; font-family: inherit; transition: border-color .15s, color .15s; }
.tag-btn:hover { border-color: var(--accent); color: var(--text); }

.sticky-actions {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, var(--bg) 60%, transparent);
  padding: 14px 0;
  margin-top: -6px;
}

/* ------------------------------------------------------- Responsive */

@media (max-width: 980px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    transform: translateX(-100%);
    transition: transform .22s ease;
    z-index: 60;
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow); }
  .burger { display: block; }
  .page { padding: 18px 15px 50px; }
  .topbar { padding: 13px 15px; }
  .detail-list > div { grid-template-columns: 1fr; gap: 2px; }
  .truncate { max-width: 160px; }
}

/* ------------------------------------------------- Team-Verwaltung */

.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.team-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
}
.team-avatar { width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto; background: var(--bg); }
.team-info { min-width: 0; }
.team-info strong { display: block; font-size: 14px; }
.team-info small { font-size: 11px; }
.team-roles { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.team-roles .rank-pill { font-size: 11.5px; padding: 2px 9px; }

/* ------------------------------------------------- Logo statt Emoji */

/* Traegt das Feld ein Bild, faellt der Farbverlauf weg - das Logo
   bringt seine eigene Form und seinen eigenen Rand mit. */
.brand-logo.image,
.auth-logo.image {
  background: none;
  box-shadow: none;
  padding: 0;
}
.brand-logo.image img,
.auth-logo.image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.auth-logo.image {
  width: 96px;
  height: 96px;
  filter: drop-shadow(0 8px 20px rgba(139, 92, 246, .35));
}

/* Zeichenzaehler der normalen Nachricht */
#zaehler { float: right; font-size: 11.5px; font-variant-numeric: tabular-nums; }
#zaehler.zaehler-voll { color: var(--warning); font-weight: 600; }
