/* ══ Apex Design – WolffV Bugtracker ═══════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ── Variables ───────────────────────────────────────── */
:root {
  --bg:           #06060b;
  --surface:      rgba(255,255,255,.025);
  --surface2:     rgba(255,255,255,.04);
  --surface3:     rgba(255,255,255,.06);
  --border:       rgba(255,255,255,.05);
  --border-h:     rgba(255,255,255,.1);
  --text:         #e2e8f0;
  --text-muted:   #94a3b8;
  --text-dim:     #64748b;
  --accent:       #dc2626;
  --accent-h:     #b91c1c;
  --accent-glow:  rgba(220,38,38,.15);

  --prio-low:     #4ade80;
  --prio-mid:     #fbbf24;
  --prio-high:    #f87171;

  --s-open:       #f87171;
  --s-wip:        #fb923c;
  --s-wait:       #fbbf24;
  --s-done:       #4ade80;
  --s-reject:     #f87171;

  --radius:       14px;
  --radius-sm:    8px;
  --shadow:       0 8px 30px rgba(0,0,0,.25);
}

/* ── Reset ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: #f87171; text-decoration: none; }
a:hover { color: #fca5a5; }
img { max-width: 100%; }

/* ── Background effects ─────────────────────────────── */
body::before {
  display: none;
}
body::after {
  content: '';
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 40%;
  background: linear-gradient(180deg, transparent, var(--bg));
  pointer-events: none;
  z-index: 0;
}

/* ── Top Navigation ─────────────────────────────────── */
.topbar {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6,6,11,.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.topbar-inner {
  display: flex;
  align-items: center;
  padding: .6rem 2.5rem;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: #eee;
  text-decoration: none;
}
.topbar-brand:hover { color: #fff; }
.topbar-brand strong { color: #f87171; }
.topbar-brand-icon {
  width: 28px; height: 28px; border-radius: 7px;
  background: linear-gradient(135deg, #dc2626, #f97316);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .65rem; color: #fff;
  box-shadow: 0 3px 10px rgba(220,38,38,.25);
}
.topbar-logo {
  width: 32px; height: 32px;
  object-fit: contain;
  border-radius: 6px;
}
.topbar-sep {
  width: 1px; height: 18px;
  background: rgba(255,255,255,.08);
  margin: 0 1rem;
}
.topbar-links {
  display: flex;
  gap: .15rem;
  flex: 1;
  justify-content: center;
}
.topbar-link {
  padding: .45rem .85rem;
  border-radius: 7px;
  font-size: .9rem;
  font-weight: 500;
  color: #94a3b8;
  cursor: pointer;
  transition: all .2s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .4rem;
  position: relative;
}
.topbar-link:hover { color: #fff; background: rgba(255,255,255,.06); box-shadow: 0 0 12px rgba(255,255,255,.04); }
.topbar-link.active { color: #fff; }
.topbar-link svg { width: 16px; height: 16px; opacity: .6; }
.topbar-badge {
  font-size: .7rem;
  padding: .15rem .45rem;
  border-radius: 6px;
  background: rgba(220,38,38,.15);
  color: #f87171;
  font-weight: 600;
}
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .88rem;
  font-weight: 500;
  color: #94a3b8;
  text-decoration: none;
  padding: .35rem .7rem;
  border-radius: 7px;
  transition: all .2s ease;
}
.topbar-user:hover { color: #fff; background: rgba(255,255,255,.06); }
.topbar-user.active { color: #fff; }
.topbar-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #dc2626, #f97316);
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; font-weight: 700; color: #fff;
}

/* ── App layout ─────────────────────────────────────── */
.app { position: relative; z-index: 1; }
.main {
  padding: 2rem 2.5rem;
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 50px);
}

/* ── Page header ────────────────────────────────────── */
.page-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -.03em;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  color: #f5f5f5;
}
.page-title svg { width: 22px; height: 22px; color: #f87171; }

/* ── Public layout ───────────────────────────────────── */
.public-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  z-index: 1;
}
.public-header {
  text-align: center;
  margin-bottom: 2rem;
}
.public-header .logo {
  font-size: 1.6rem;
  font-weight: 800;
  color: #eee;
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
}
.logo-img {
  width: 44px; height: 44px;
  object-fit: contain;
}
.login-card .logo-img {
  width: 64px; height: 64px;
  display: block;
  margin: 0 auto;
}
.public-header .logo span { color: #f87171; }
.public-header p { color: var(--text-muted); margin-top: .3rem; }
.public-nav { margin-top: .8rem; display: flex; gap: .5rem; justify-content: center; }
.public-nav a {
  font-size: .82rem;
  color: var(--text-muted);
  padding: .35rem .85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: all .15s;
}
.public-nav a:hover, .public-nav a.active {
  color: #f87171;
  border-color: rgba(220,38,38,.3);
  background: rgba(220,38,38,.06);
}

/* ── Cards (general) ────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow);
  transition: all .25s;
  position: relative;
  z-index: 1;
}
.card:hover {
  border-color: var(--border-h);
}
.card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  color: #eee;
}

/* ── Forms ───────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: .4rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.form-control {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: .6rem .85rem;
  font-size: .92rem;
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
select.form-control {
  background-color: #0e0e14;
  color: var(--text);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  padding-right: 2rem;
}
select.form-control option {
  background: #0e0e14;
  color: var(--text);
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  font-size: .92rem;
  padding: .4rem .6rem;
}
select.form-control optgroup {
  background: #0e0e14;
  color: #94a3b8;
  font-style: normal;
  font-size: .85rem;
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
}
.filter-select {
  background-color: #0e0e14 !important;
  color: var(--text) !important;
}
.filter-select option {
  background: #0e0e14;
  color: var(--text);
}
.form-control:focus {
  border-color: rgba(220,38,38,.4);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }
.form-control::placeholder { color: var(--text-dim); }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: #94a3b8;
  transition: all .25s ease;
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
}
.btn:hover { color: #e2e8f0; border-color: var(--border-h); box-shadow: 0 0 10px rgba(255,255,255,.04); }
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, #dc2626, #ea580c);
  color: #fff;
  border: none;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(220,38,38,.25);
}
.btn-primary:hover { box-shadow: 0 4px 24px rgba(220,38,38,.4), 0 0 12px rgba(220,38,38,.2); color: #fff; transform: translateY(-1px); }
.btn-secondary { background: var(--surface2); color: #94a3b8; border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface3); color: #e2e8f0; box-shadow: 0 0 8px rgba(255,255,255,.03); }
.btn-danger { background: rgba(239,68,68,.1); color: var(--prio-high); border: 1px solid rgba(239,68,68,.2); }
.btn-danger:hover { background: rgba(239,68,68,.18); }
.btn-success { background: rgba(34,197,94,.1); color: var(--prio-low); border: 1px solid rgba(34,197,94,.2); }
.btn-success:hover { background: rgba(34,197,94,.18); }
.btn-discord {
  background: #5865F2; color: #fff; border: none;
  display: flex; align-items: center; justify-content: center;
  gap: .5rem; font-size: .92rem; padding: .7rem 1rem;
  box-shadow: 0 2px 12px rgba(88,101,242,.25);
}
.btn-discord:hover { background: #4752C4; color: #fff; }
.btn-sm { padding: .35rem .7rem; font-size: .82rem; }
.btn svg { width: 14px; height: 14px; }

/* ── Badges ──────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .55rem;
  border-radius: 5px;
  font-size: .8rem;
  font-weight: 600;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.prio-low    { background: rgba(34,197,94,.1);  color: var(--prio-low); }
.prio-mittel { background: rgba(245,158,11,.1); color: var(--prio-mid); }
.prio-dringend { background: rgba(239,68,68,.1); color: var(--prio-high); }

.s-eingegangen { background: rgba(248,113,113,.1);  color: var(--s-open); }
.s-in-arbeit   { background: rgba(251,146,60,.1);   color: var(--s-wip); }
.s-warten      { background: rgba(251,191,36,.1);   color: var(--s-wait); }
.s-erledigt    { background: rgba(74,222,128,.1);   color: var(--s-done); }
.s-abgelehnt   { background: rgba(248,113,113,.1);  color: var(--s-reject); }

/* ── Stat cards ──────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .85rem;
  margin-bottom: 2rem;
  justify-items: stretch;
  align-items: stretch;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem;
  transition: all .3s ease;
  position: relative;
  overflow: hidden;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.stat-card:hover {
  border-color: var(--border-h);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,.3), 0 0 15px rgba(220,38,38,.08);
}
.stat-label { font-size: .78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.stat-value { font-size: 1.8rem; font-weight: 800; margin-top: .2rem; line-height: 1; letter-spacing: -.03em; }
.stat-sub   { font-size: .78rem; color: var(--text-dim); margin-top: .25rem; }

/* ── Table ───────────────────────────────────────────── */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all .25s;
}
.table-wrap:hover { border-color: var(--border-h); }
.table-header {
  padding: .85rem 1.2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.table-header h3 { font-size: .95rem; font-weight: 700; color: #eee; }
.table-filters { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.filter-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: .4rem .75rem;
  font-size: .85rem;
  cursor: pointer;
  outline: none;
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: border-color .15s;
}
.filter-select:focus { border-color: rgba(220,38,38,.4); }

table { width: 100%; border-collapse: collapse; font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
thead th {
  padding: .65rem 1rem;
  text-align: left;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.015);
}
tbody tr {
  border-bottom: 1px solid rgba(255,255,255,.03);
  transition: background .12s;
  cursor: pointer;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px rgba(255,255,255,.03); }
td { padding: .65rem 1rem; font-size: .88rem; vertical-align: middle; }
.td-code { font-family: 'JetBrains Mono', monospace; font-size: .85rem; color: #f87171; font-weight: 600; }
.td-desc { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #94a3b8; }
.td-assigned { font-size: .85rem; color: var(--text-muted); }

/* ── Ticket detail ───────────────────────────────────── */
.ticket-layout { display: grid; grid-template-columns: 1fr 320px; gap: 1.25rem; }
@media (max-width: 900px) { .ticket-layout { grid-template-columns: 1fr; } }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all .3s ease;
}
.panel:hover { border-color: var(--border-h); box-shadow: 0 4px 20px rgba(0,0,0,.15); }
.panel-head {
  padding: .85rem 1.2rem;
  border-bottom: 1px solid var(--border);
  font-size: .88rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.panel-body { padding: 1.2rem; }

.ticket-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.ticket-desc {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-size: .95rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  color: #cbd5e1;
}

/* History / notes */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  display: flex; gap: .75rem;
  padding: .65rem 0;
  border-bottom: 1px solid rgba(255,255,255,.03);
  font-size: .88rem;
}
.timeline-item:last-child { border-bottom: none; }
.timeline-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  margin-top: .4rem;
  flex-shrink: 0;
}
.timeline-dot.status { background: #f87171; }
.timeline-dot.note   { background: #fbbf24; }
.timeline-content { flex: 1; min-width: 0; }
.timeline-meta { font-size: .82rem; color: var(--text-muted); margin-top: .15rem; }
.note-internal { border-left: 2px solid var(--prio-mid); padding-left: .75rem; }
.note-public   { border-left: 2px solid #f87171; padding-left: .75rem; }

.images-grid {
  display: flex; flex-wrap: wrap;
  gap: .5rem; margin-top: .75rem;
}
.images-grid a img {
  width: 80px; height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: opacity .2s;
}
.images-grid a:hover img { opacity: .8; }

/* ── Login page ──────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  z-index: 1;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow);
}
.login-card .brand { text-align: center; margin-bottom: 2rem; }
.login-card .brand h1 { font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; }
.login-card .brand h1 span { color: #f87171; }
.login-card .brand p { font-size: .88rem; color: var(--text-muted); margin-top: .25rem; }

/* ── Alert ───────────────────────────────────────────── */
.alert {
  padding: .7rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  margin-bottom: 1rem;
}
.alert-error   { background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.2); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,.08); border: 1px solid rgba(34,197,94,.2); color: #86efac; }
.alert-info    { background: rgba(220,38,38,.08); border: 1px solid rgba(220,38,38,.2); color: #fca5a5; }

/* ── Ticket code result ──────────────────────────────── */
.code-result { text-align: center; padding: 2rem; }
.code-result .code-box {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  background: var(--surface2);
  border: 2px solid rgba(220,38,38,.3);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  font-size: 1.6rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: #f87171;
  letter-spacing: .1em;
  margin: 1rem 0;
}
.code-result p { color: var(--text-muted); font-size: .88rem; }

/* ── Upload zone ─────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  color: var(--text-muted);
  font-size: .88rem;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: rgba(220,38,38,.4);
  background: var(--accent-glow);
  color: var(--text);
}
.drop-zone input[type=file] { display: none; }

/* ── Team table ──────────────────────────────────────── */
.role-admin { color: var(--prio-high); font-weight: 600; }
.role-developer { color: #fb923c; }
.role-car-developer { color: #60a5fa; font-weight: 600; }

/* ── Modal ───────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 999;
  padding: 1rem;
  backdrop-filter: blur(4px);
}
.modal-backdrop.hidden { display: none; }
.modal {
  background: #0e0e14;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow);
}
.modal h3 { font-size: 1rem; font-weight: 700; margin-bottom: 1.2rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.2rem; }

/* ── Misc ────────────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.text-dim   { color: var(--text-dim); }
.font-mono  { font-family: 'JetBrains Mono', monospace; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.flex { display: flex; }
.gap-2 { gap: .5rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state p { margin-top: .5rem; font-size: .92rem; }

.page-back {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .88rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  transition: color .15s;
}
.page-back:hover { color: var(--text); }

/* ── Scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.06); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.1); }

/* ── Pagination ─────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: .7rem 1rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap; gap: .5rem;
}
.pagination-info { font-size: .84rem; color: var(--text-muted); }
.pagination-controls { display: flex; gap: .25rem; align-items: center; }
.pagination-ellipsis { padding: .2rem .4rem; color: var(--text-dim); font-size: .88rem; }
.btn.active {
  background: linear-gradient(135deg, #dc2626, #ea580c);
  color: #fff;
  border-color: transparent;
}
.btn.disabled { opacity: .3; pointer-events: none; }

/* ── Chat ───────────────────────────────────────────── */
.chat-messages {
  display: flex; flex-direction: column; gap: .5rem;
  max-height: 360px; overflow-y: auto; padding: .25rem 0;
}
.chat-empty { font-size: .92rem; color: var(--text-muted); }
.chat-msg { display: flex; flex-direction: column; max-width: 80%; }
.chat-received { align-self: flex-start; }
.chat-sent { align-self: flex-end; }
.chat-bubble {
  padding: .55rem .8rem; border-radius: 10px;
  font-size: .88rem; line-height: 1.5; word-break: break-word;
}
.chat-received .chat-bubble {
  background: var(--surface2); color: var(--text);
  border-bottom-left-radius: 3px;
}
.chat-sent .chat-bubble {
  background: linear-gradient(135deg, #dc2626, #ea580c); color: #fff;
  border-bottom-right-radius: 3px;
}
.chat-meta { font-size: .82rem; color: var(--text-muted); margin-top: .15rem; }
.chat-sent .chat-meta { text-align: right; }
.chat-file { margin-bottom: .25rem; }
.chat-file-img {
  max-width: 240px; max-height: 180px;
  border-radius: 8px; border: 1px solid var(--border); display: block;
}
.chat-file-link {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .4rem .7rem;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; font-size: .85rem;
  color: var(--text); text-decoration: none;
  transition: all .15s; word-break: break-all;
}
.chat-file-link:hover { border-color: rgba(220,38,38,.3); color: var(--text); }

/* ── Ticket Card (public overview) ───────────────────── */
.ticket-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  color: var(--text);
  transition: all .3s ease;
  text-decoration: none;
}
.ticket-card:hover {
  border-color: rgba(220,38,38,.3);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.25), 0 0 10px rgba(220,38,38,.06);
  color: var(--text);
  background: rgba(255,255,255,.035);
}

/* ── Urgent Badge ────────────────────────────────────── */
.badge-urgent {
  display: inline-block;
  background: #ef4444;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  padding: .1rem .35rem;
  border-radius: 10px;
  margin-left: .25rem;
  line-height: 1.4;
  vertical-align: middle;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  .topbar-inner { padding: .5rem 1rem; }
  .topbar-sep { display: none; }
  .topbar-links { gap: 0; flex-wrap: wrap; }
  .topbar-link span, .topbar-user span { display: none; }
  .main { padding: 1rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .ticket-layout { grid-template-columns: 1fr; }
  .table-filters { flex-wrap: wrap; }
}

/* ── Bell / Notification Inbox ──────────────────────── */
.bell-wrap { position: relative; display: inline-flex; }
.bell-btn {
  position: relative; background: transparent; border: 1px solid transparent;
  color: var(--text-muted); width: 34px; height: 34px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: all .15s;
}
.bell-btn:hover { color: var(--text); background: rgba(255,255,255,.04); border-color: var(--border); }
.bell-badge {
  position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 4px;
  background: #dc2626; color: #fff; border-radius: 8px; font-size: .65rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
  box-shadow: 0 0 0 2px var(--bg);
}
.bell-panel {
  position: absolute; top: calc(100% + .5rem); right: 0; width: 340px; max-height: 420px;
  background: #0e0e14; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,.5); z-index: 100; overflow: hidden;
  display: none; flex-direction: column;
}
.bell-panel.open { display: flex; }
.bell-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem; border-bottom: 1px solid var(--border);
  font-size: .85rem; font-weight: 600; color: var(--text);
}
.bell-clear {
  background: transparent; border: none; color: var(--text-muted); cursor: pointer;
  font-size: .75rem; padding: .25rem .5rem; border-radius: 4px;
}
.bell-clear:hover { color: var(--text); background: rgba(255,255,255,.05); }
.bell-list { overflow-y: auto; flex: 1; }
.bell-empty { padding: 1.5rem 1rem; text-align: center; color: var(--text-dim); font-size: .85rem; }
.bell-item {
  display: block; padding: .7rem 1rem; border-bottom: 1px solid var(--border);
  color: var(--text); text-decoration: none; transition: background .15s;
}
.bell-item:hover { background: rgba(255,255,255,.03); }
.bell-item.unread { background: rgba(88,101,242,.06); border-left: 2px solid #5865f2; }
.bell-item-top {
  display: flex; justify-content: space-between; align-items: baseline; gap: .5rem;
  font-size: .78rem; margin-bottom: .2rem;
}
.bell-item-top strong { color: var(--accent); }
.bell-item-top span { color: var(--text-dim); font-size: .7rem; }
.bell-item-msg { font-size: .8rem; color: var(--text-muted); line-height: 1.3; word-break: break-word; }

/* ── Notification Toast ──────────────────────────────── */
.notification-toast {
  position: fixed;
  top: 70px;
  right: 1.5rem;
  z-index: 9999;
  background: #0e0e14;
  border: 1px solid rgba(220,38,38,.3);
  border-radius: var(--radius);
  padding: .85rem 1.1rem;
  box-shadow: 0 8px 30px rgba(0,0,0,.4), 0 0 15px rgba(220,38,38,.1);
  display: flex;
  align-items: center;
  gap: .65rem;
  min-width: 280px;
  max-width: 400px;
  cursor: pointer;
  animation: toastIn .4s ease;
  transition: all .3s ease;
}
.notification-toast:hover {
  border-color: rgba(220,38,38,.5);
  box-shadow: 0 8px 30px rgba(0,0,0,.5), 0 0 20px rgba(220,38,38,.15);
}
.notification-toast.toast-out {
  animation: toastOut .3s ease forwards;
}
.notification-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #dc2626;
  flex-shrink: 0;
  animation: pulse 2s ease infinite;
}
.notification-body { flex: 1; min-width: 0; }
.notification-title {
  font-size: .88rem;
  font-weight: 600;
  color: #e2e8f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notification-sub {
  font-size: .82rem;
  color: var(--text-muted);
  margin-top: .1rem;
}
.notification-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0;
  line-height: 1;
  transition: color .15s;
}
.notification-close:hover { color: #fff; }

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(100%); opacity: 0; }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,.4); }
  50%      { box-shadow: 0 0 0 6px rgba(220,38,38,0); }
}

/* ── Chat bubble sizes ──────────────────────────────── */
.chat-bubble {
  font-size: .92rem;
}

/* ── Last writer badge ──────────────────────────────── */
.last-writer {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .8rem;
  font-weight: 500;
  padding: .15rem .5rem;
  border-radius: 5px;
  background: rgba(220,38,38,.08);
  color: #fca5a5;
}

/* ── Activity search ────────────────────────────────── */
.search-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: .45rem .75rem;
  font-size: .88rem;
  outline: none;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
  min-width: 200px;
}
.search-input:focus {
  border-color: rgba(220,38,38,.4);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-input::placeholder { color: var(--text-dim); }

/* ── Legacy sidebar support (hidden) ─────────────────── */
.sidebar { display: none; }
.sidebar-brand, .sidebar-nav, .sidebar-user, .nav-divider { display: none; }
