@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Color tokens ───────────────────────────── */
:root, [data-theme="dark"] {
  --bg:           #1a1426;
  --surface:      #29203b;
  --surface-2:    #342850;
  --surface-3:    #3e3060;
  --border:       #4d3a74;
  --border-soft:  rgba(77,58,116,0.6);
  --primary:      #7e66b8;
  --primary-h:    #6a57a0;
  --primary-dim:  rgba(126,102,184,0.18);
  --accent:       #9e86d8;
  --text:         #e8e0f5;
  --text-muted:   #9e8cbc;
  --text-faint:   #6e5f90;
  --success:      #4ade80;
  --warning:      #fbbf24;
  --danger:       #f87171;
  --info:         #60a5fa;
  --sidebar-w:    260px;
  --radius:       10px;
  --radius-sm:    6px;
  --shadow:       0 4px 28px rgba(0,0,0,0.55);
  --shadow-sm:    0 2px 10px rgba(0,0,0,0.35);
}

[data-theme="light"] {
  --bg:           #f0edf8;
  --surface:      #ffffff;
  --surface-2:    #f5f2fc;
  --surface-3:    #ece8f5;
  --border:       #d4ccea;
  --border-soft:  rgba(212,204,234,0.7);
  --primary:      #7e66b8;
  --primary-h:    #6a57a0;
  --primary-dim:  rgba(126,102,184,0.10);
  --accent:       #9e86d8;
  --text:         #1a1426;
  --text-muted:   #7060a0;
  --text-faint:   #a090c0;
  --success:      #16a34a;
  --warning:      #d97706;
  --danger:       #dc2626;
  --info:         #2563eb;
  --shadow:       0 4px 20px rgba(126,102,184,0.14);
  --shadow-sm:    0 2px 8px rgba(126,102,184,0.10);
}

/* ── Reset ──────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { color-scheme: dark; }
[data-theme="light"] html { color-scheme: light; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.25s, color 0.25s;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ── Layout ──────────────────────────────────── */
.layout { display: flex; width: 100%; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: background 0.25s, border-color 0.25s;
}

.sidebar-header {
  padding: 18px 14px 14px;
  border-bottom: 1px solid var(--border);
}

.logo { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }

.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #7e66b8, #9e86d8);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: white;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(126,102,184,0.4);
}

.logo-text {
  font-size: 17px;
  font-weight: 700;
  background: linear-gradient(135deg, #9e86d8, #7e66b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.user-card {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
}

.user-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #7e66b8, #9e86d8);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: white;
  flex-shrink: 0;
  overflow: hidden;
}

.user-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.user-name {
  font-size: 12.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.role-badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 20px;
  font-weight: 600;
  background: var(--primary-dim);
  color: var(--accent);
  border: 1px solid rgba(126,102,184,0.3);
  margin-top: 2px;
}

.role-badge.team {
  background: rgba(74,222,128,0.1);
  color: var(--success);
  border-color: rgba(74,222,128,0.3);
}

/* Nav */
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 8px; }

.nav-section { margin-bottom: 6px; }

.nav-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 8px 3px;
  display: block;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.15s;
  margin-bottom: 2px;
  border: 1px solid transparent;
}

.nav-item:hover { background: var(--surface-2); color: var(--text); }

.nav-item.active {
  background: var(--primary-dim);
  color: var(--accent);
  border-color: rgba(126,102,184,0.25);
}

.nav-item i { width: 17px; text-align: center; font-size: 13px; }

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 10px 8px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sidebar-footer-row { display: flex; gap: 6px; }

.theme-toggle-btn {
  width: 38px; height: 38px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}

.theme-toggle-btn:hover {
  background: var(--primary-dim);
  color: var(--accent);
  border-color: rgba(126,102,184,0.4);
}

.logout-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.logout-btn:hover {
  background: rgba(248,113,113,0.08);
  color: var(--danger);
  border-color: rgba(248,113,113,0.2);
}

/* ── Main ────────────────────────────────────── */
.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background 0.25s, border-color 0.25s;
}

.page-title { font-size: 16px; font-weight: 600; }
.page-subtitle { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.content { padding: 26px 28px; flex: 1; }

/* ── Cards ───────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: background 0.25s, border-color 0.25s;
}

.card-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 13.5px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}

.card-title i { color: var(--accent); }

/* ── Stats ───────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color 0.2s, transform 0.15s, background 0.25s;
}

.stat-card:hover { border-color: var(--primary); transform: translateY(-1px); }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; flex-shrink: 0;
}

.stat-icon.purple { background: rgba(126,102,184,0.18); color: var(--accent);   }
.stat-icon.blue   { background: rgba(96,165,250,0.18);  color: var(--info);     }
.stat-icon.green  { background: rgba(74,222,128,0.18);  color: var(--success);  }
.stat-icon.orange { background: rgba(251,191,36,0.18);  color: var(--warning);  }
.stat-icon.red    { background: rgba(248,113,113,0.18); color: var(--danger);   }
.stat-icon.teal   { background: rgba(96,165,250,0.18);  color: var(--info);     }

.stat-value { font-size: 26px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* ── Tables ──────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }

table { width: 100%; border-collapse: collapse; }

thead th {
  background: var(--surface-2);
  color: var(--text-faint);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
td { padding: 11px 14px; font-size: 13.5px; vertical-align: middle; }

/* ── Badges ──────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}

.badge-open     { background: rgba(126,102,184,0.18); color: var(--accent);   border: 1px solid rgba(126,102,184,0.35); }
.badge-progress { background: rgba(251,191,36,0.15);  color: var(--warning);  border: 1px solid rgba(251,191,36,0.3);  }
.badge-closed   { background: rgba(74,222,128,0.15);  color: var(--success);  border: 1px solid rgba(74,222,128,0.3);  }
.badge-pending  { background: rgba(248,113,113,0.15); color: var(--danger);   border: 1px solid rgba(248,113,113,0.3); }
.badge-accepted { background: rgba(74,222,128,0.15);  color: var(--success);  border: 1px solid rgba(74,222,128,0.3);  }
.badge-active   { background: rgba(74,222,128,0.15);  color: var(--success);  border: 1px solid rgba(74,222,128,0.3);  }
.badge-inactive { background: rgba(158,140,188,0.12); color: var(--text-muted); border: 1px solid rgba(158,140,188,0.2); }
.badge-approved { background: rgba(74,222,128,0.15);  color: var(--success);  border: 1px solid rgba(74,222,128,0.3);  }

/* Type tags */
.type-tag {
  display: inline-block; padding: 2px 8px;
  border-radius: 4px; font-size: 11px; font-weight: 600;
}

.type-support   { background: rgba(126,102,184,0.18); color: var(--accent);   }
.type-bug       { background: rgba(248,113,113,0.15); color: var(--danger);   }
.type-report    { background: rgba(251,191,36,0.15);  color: var(--warning);  }
.type-other     { background: rgba(158,140,188,0.12); color: var(--text-muted); }
.type-team      { background: rgba(126,102,184,0.18); color: var(--accent);   }
.type-fraktion  { background: rgba(96,165,250,0.18);  color: var(--info);     }
.type-twitch    { background: rgba(145,71,255,0.15);  color: #9147ff;         }
.type-youtube   { background: rgba(248,113,113,0.15); color: var(--danger);   }
.type-tiktok    { background: rgba(96,165,250,0.18);  color: var(--info);     }

/* ── Buttons ─────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; cursor: pointer;
  border: none; transition: all 0.15s;
  text-decoration: none; font-family: inherit; white-space: nowrap;
}

.btn-primary   { background: var(--primary); color: white; box-shadow: 0 2px 8px rgba(126,102,184,0.35); }
.btn-primary:hover { background: var(--primary-h); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(126,102,184,0.45); }

.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-3); }

.btn-danger    { background: rgba(248,113,113,0.1); color: var(--danger); border: 1px solid rgba(248,113,113,0.2); }
.btn-danger:hover { background: rgba(248,113,113,0.2); }

.btn-success   { background: rgba(74,222,128,0.1); color: var(--success); border: 1px solid rgba(74,222,128,0.2); }
.btn-success:hover { background: rgba(74,222,128,0.2); }

.btn-warning   { background: rgba(251,191,36,0.1); color: var(--warning); border: 1px solid rgba(251,191,36,0.2); }
.btn-warning:hover { background: rgba(251,191,36,0.2); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

.btn-icon {
  width: 30px; height: 30px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; font-size: 12px;
  transition: all 0.15s;
}

.btn-icon:hover { color: var(--text); background: var(--surface-3); }

/* ── Forms ───────────────────────────────────── */
.form-group { margin-bottom: 14px; }

.form-label {
  display: block; font-size: 11.5px; font-weight: 600;
  color: var(--text-faint); text-transform: uppercase;
  letter-spacing: 0.05em; margin-bottom: 5px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.25s;
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

.form-input::placeholder, .form-textarea::placeholder { color: var(--text-faint); }
.form-select option { background: var(--surface-2); color: var(--text); }
.form-textarea { resize: vertical; min-height: 88px; }

.form-row   { display: grid; grid-template-columns: 1fr 1fr;     gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ── Modals ──────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(20,10,40,0.75);
  backdrop-filter: blur(5px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
  padding: 20px;
}

.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow);
  transform: scale(0.96) translateY(8px);
  transition: transform 0.2s, background 0.25s;
}

.modal-overlay.open .modal { transform: scale(1) translateY(0); }

.modal-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0;
  background: var(--surface);
  z-index: 1;
}

.modal-title { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }

.modal-close {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text-muted);
  font-size: 18px; line-height: 1;
  transition: all 0.15s;
}

.modal-close:hover { color: var(--danger); border-color: var(--danger); background: rgba(248,113,113,0.08); }

.modal-body   { padding: 18px 22px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ── Alerts ──────────────────────────────────── */
.alert {
  padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: 13px; display: flex; align-items: flex-start;
  gap: 9px; margin-bottom: 14px; line-height: 1.5;
}

.alert-info    { background: rgba(126,102,184,0.12); border: 1px solid rgba(126,102,184,0.3); color: var(--accent); }
.alert-warning { background: rgba(251,191,36,0.10);  border: 1px solid rgba(251,191,36,0.3);  color: var(--warning); }
.alert-success { background: rgba(74,222,128,0.10);  border: 1px solid rgba(74,222,128,0.3);  color: var(--success); }
.alert-danger  { background: rgba(248,113,113,0.10); border: 1px solid rgba(248,113,113,0.3); color: var(--danger);  }

/* ── Ticket cards ────────────────────────────── */
.ticket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
}

.ticket-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color 0.2s, transform 0.15s, background 0.25s;
}

.ticket-card:hover { border-color: var(--primary); transform: translateY(-1px); }

.ticket-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 6px; }
.ticket-id   { font-size: 11px; color: var(--text-faint); margin-bottom: 3px; }
.ticket-subj { font-size: 14px; font-weight: 600; margin-bottom: 6px; line-height: 1.3; }
.ticket-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.ticket-foot { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.ticket-date { font-size: 11px; color: var(--text-faint); }

/* ── Empty state ─────────────────────────────── */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state i { font-size: 34px; margin-bottom: 12px; opacity: .25; display: block; }
.empty-state p { font-size: 13.5px; }

/* ── Search bar ──────────────────────────────── */
.search-wrap { position: relative; }
.search-wrap input { padding-left: 36px; }
.search-wrap .search-icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%); color: var(--text-faint); font-size: 12px; pointer-events: none;
}

/* ── Toolbar ─────────────────────────────────── */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }

/* ── Divider ─────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 18px 0; }

/* ── Toast ───────────────────────────────────── */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 7px; }

.toast {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  min-width: 250px;
  display: flex; align-items: center; gap: 9px;
  box-shadow: var(--shadow);
  animation: toastIn 0.2s ease;
  font-size: 13px; color: var(--text);
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger);  }
.toast.info    { border-left: 3px solid var(--primary); }
.toast.warning { border-left: 3px solid var(--warning); }

@keyframes toastIn {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Custom status dropdown ──────────────────── */
.status-dd { position: relative; display: inline-block; }

.status-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text); font-size: 13px; font-weight: 500;
  font-family: inherit; cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-width: 165px; user-select: none;
}

.status-trigger:hover { border-color: var(--primary); }
.status-trigger:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-dim); }
.status-trigger .chevron { margin-left: auto; font-size: 10px; opacity: .5; transition: transform 0.2s; }
.status-trigger.dd-open .chevron { transform: rotate(180deg); }

.status-menu {
  position: absolute; top: calc(100% + 5px); left: 0;
  min-width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px; z-index: 300;
  box-shadow: 0 8px 28px rgba(0,0,0,0.4);
  opacity: 0; pointer-events: none;
  transform: translateY(-6px) scale(0.97);
  transition: opacity 0.15s, transform 0.15s;
  transform-origin: top left;
}

.status-menu.open { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }

.status-option {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 4px;
  cursor: pointer; font-size: 13px; font-weight: 500;
  color: var(--text); transition: background 0.1s; white-space: nowrap;
}

.status-option:hover   { background: var(--surface-3); }
.status-option.selected { background: var(--primary-dim); color: var(--accent); }

.sdot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

/* ── Chat ────────────────────────────────────── */
.chat-area {
  flex: 1; overflow-y: auto;
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 14px;
}

.chat-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--text-muted); gap: 8px; padding: 32px;
}

.chat-empty i { font-size: 28px; opacity: .25; }
.chat-empty p { font-size: 13px; }

.msg { display: flex; flex-direction: column; max-width: 78%; gap: 3px; }
.msg.team { align-self: flex-end; align-items: flex-end; }
.msg.user { align-self: flex-start; align-items: flex-start; }

.msg-meta { font-size: 11px; color: var(--text-faint); display: flex; align-items: center; gap: 6px; }

.msg-bubble {
  padding: 10px 14px; border-radius: 14px;
  font-size: 13.5px; line-height: 1.55; word-break: break-word;
}

.msg.team .msg-bubble {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(126,102,184,0.35);
}

.msg.user .msg-bubble {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-input-row {
  display: flex; gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.chat-input-row .form-input { flex: 1; }

/* ── Ticket modal layout ─────────────────────── */
.ticket-modal-body { display: flex; min-height: 500px; max-height: 70vh; }

.ticket-info-panel {
  width: 260px; flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 18px; display: flex; flex-direction: column;
  gap: 14px; overflow-y: auto;
}

.ticket-chat-panel { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

.info-row { display: flex; flex-direction: column; gap: 4px; }
.info-label { font-size: 10.5px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; }
.info-value { font-size: 13.5px; font-weight: 500; }

/* ── Action links ────────────────────────────── */
.action-link {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text);
  transition: all 0.15s;
}

.action-link:hover { border-color: var(--primary); background: var(--surface-3); }

.action-icon {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}

/* ── Grid helpers ────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.mt-16  { margin-top: 16px; }
.mt-22  { margin-top: 22px; }

/* ── Platform pills ──────────────────────────── */
.platform-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600;
}

.plat-twitch  { background: rgba(145,71,255,0.15); color: #9147ff; }
.plat-youtube { background: rgba(248,113,113,0.15); color: var(--danger); }
.plat-tiktok  { background: rgba(96,165,250,0.18);  color: var(--info); }

/* ── Login page ──────────────────────────────── */
.login-page {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 80%, rgba(126,102,184,0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 20%, rgba(158,134,216,0.12) 0%, transparent 55%);
  transition: background 0.25s;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 44px;
  width: 100%; max-width: 400px;
  text-align: center;
  box-shadow: var(--shadow);
  position: relative;
}

.login-logo {
  width: 68px; height: 68px;
  background: linear-gradient(135deg, #7e66b8, #9e86d8);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800; color: white;
  margin: 0 auto 18px;
  box-shadow: 0 4px 18px rgba(126,102,184,0.45);
}

.login-title   { font-size: 24px; font-weight: 700; margin-bottom: 5px; }
.login-subtitle { font-size: 13.5px; color: var(--text-muted); margin-bottom: 30px; line-height: 1.5; }

.discord-btn {
  width: 100%;
  background: #5865F2;
  color: white; border: none;
  border-radius: var(--radius-sm);
  padding: 13px; font-size: 14.5px; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-family: inherit; transition: all 0.2s;
  text-decoration: none; margin-bottom: 8px;
}

.discord-btn:hover {
  background: #4752C4; transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(88,101,242,0.4);
}

.dev-box {
  margin-top: 22px; padding-top: 18px;
  border-top: 1px solid var(--border);
}

.dev-label { font-size: 10.5px; color: var(--text-faint); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.06em; }
.dev-row   { display: flex; gap: 8px; }

.dev-btn {
  flex: 1; padding: 9px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 500; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-muted); font-family: inherit; transition: all 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}

.dev-btn:hover { color: var(--text); background: var(--surface-3); border-color: var(--primary); }

/* Floating theme toggle on login page */
.login-theme-btn {
  position: fixed; top: 18px; right: 18px;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer; color: var(--text-muted);
  font-size: 15px; transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.login-theme-btn:hover { color: var(--accent); border-color: var(--primary); transform: rotate(15deg); }

/* ── Category picker (ticket creation) ──────── */
.cat-list { display: flex; flex-direction: column; gap: 7px; }

.cat-card {
  display: flex; align-items: center; gap: 13px;
  padding: 11px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2);
  cursor: pointer; transition: all 0.15s; user-select: none;
}

.cat-card:hover  { border-color: var(--primary); transform: translateX(2px); }
.cat-card.active { border-color: var(--primary); background: var(--primary-dim); }

.cat-emoji {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; flex-shrink: 0;
}

.cat-name { font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.cat-desc { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.cat-check { margin-left: auto; color: var(--primary); font-size: 13px; opacity: 0; transition: opacity 0.15s; }
.cat-card.active .cat-check { opacity: 1; }

/* ── Step wizard ──────────────────────────────── */
.step-bar { display: flex; gap: 0; margin-bottom: 20px; }
.step-item {
  flex: 1; text-align: center; padding: 10px 6px;
  font-size: 12px; font-weight: 500; color: var(--text-faint);
  border-bottom: 2px solid var(--border);
  transition: all 0.2s;
}
.step-item.active { color: var(--primary); border-color: var(--primary); }
.step-item.done   { color: var(--success); border-color: var(--success); }
.step-item i { display: block; font-size: 16px; margin-bottom: 3px; }

/* ── Toggle switch ────────────────────────────── */
.toggle { position: relative; width: 38px; height: 21px; display: inline-block; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute; inset: 0;
  background: var(--border); border-radius: 11px;
  cursor: pointer; transition: background 0.2s;
}
.toggle-track::before {
  content: ''; position: absolute;
  width: 15px; height: 15px; background: white;
  border-radius: 50%; top: 3px; left: 3px;
  transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.toggle input:checked + .toggle-track { background: var(--primary); }
.toggle input:checked + .toggle-track::before { transform: translateX(17px); }

/* ── Role pill ────────────────────────────────── */
.role-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}

.role-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── Permission matrix ────────────────────────── */
.perm-matrix thead th:not(:first-child),
.perm-matrix tbody td:not(:first-child) { text-align: center; vertical-align: middle; }

.perm-matrix input[type="checkbox"] {
  width: 17px; height: 17px;
  accent-color: var(--primary);
  cursor: pointer;
}

.perm-matrix .cat-row:hover { background: var(--surface-2); }

.perm-matrix .cat-cell {
  display: flex; align-items: center; gap: 10px;
}

/* ── Color swatches (admin) ───────────────────── */
.color-grid { display: flex; gap: 7px; flex-wrap: wrap; }
.color-swatch {
  width: 28px; height: 28px; border-radius: 6px;
  cursor: pointer; border: 2px solid transparent;
  transition: all 0.15s; flex-shrink: 0;
}
.color-swatch:hover  { transform: scale(1.15); }
.color-swatch.picked { border-color: white; box-shadow: 0 0 0 2px var(--primary); }

/* ── Admin section header ─────────────────────── */
.section-head {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.section-title i { color: var(--accent); }

/* ── Bewerbung type selector ─────────────────── */
.type-select-btn {
  padding: 16px 12px; border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted); font-size: 13px; font-weight: 600;
  font-family: inherit; cursor: pointer;
  transition: all 0.15s; text-align: center;
}

.type-select-btn:hover { border-color: var(--primary); color: var(--text); }
.type-select-btn.active { border-color: var(--primary); background: var(--primary-dim); color: var(--text); }
