/* Support-Hub — Dark Orbit + Light Aurora */
:root, :root[data-theme="dark"] {
  --bg: oklch(0.16 0.018 260);
  --bg-2: oklch(0.13 0.02 260);
  --surface: oklch(0.22 0.018 260);
  --surface-2: oklch(0.26 0.02 260);
  --surface-3: oklch(0.30 0.022 260);
  --border: oklch(0.32 0.018 260 / 0.6);
  --border-strong: oklch(0.40 0.02 260 / 0.7);
  --fg: oklch(0.96 0.005 260);
  --fg-2: oklch(0.78 0.012 260);
  --fg-3: oklch(0.60 0.014 260);
  --fg-4: oklch(0.46 0.015 260);
  --accent: #22D3EE;
  --accent-soft: #22D3EE26;
  --accent-fg: oklch(0.18 0.02 260);
  --danger: #FF6B7A;
  --warn: #FFB454;
  --ok: #5EE6A8;
  --grid-line: oklch(1 0 0 / 0.025);
  --shadow-card: 0 1px 0 oklch(1 0 0 / 0.04);
  --radius: 10px;
  --radius-lg: 16px;
}

:root[data-theme="light"] {
  --bg: oklch(0.985 0.004 250);
  --bg-2: oklch(0.96 0.006 250);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.97 0.005 250);
  --surface-3: oklch(0.94 0.006 250);
  --border: oklch(0.88 0.008 250 / 0.9);
  --border-strong: oklch(0.80 0.012 250);
  --fg: oklch(0.22 0.02 260);
  --fg-2: oklch(0.38 0.018 260);
  --fg-3: oklch(0.52 0.016 260);
  --fg-4: oklch(0.65 0.014 260);
  --accent: #0EA5E9;
  --accent-soft: #0EA5E920;
  --accent-fg: #ffffff;
  --danger: #E11D48;
  --warn: #D97706;
  --ok: #059669;
  --grid-line: oklch(0 0 0 / 0.045);
  --shadow-card: 0 1px 2px oklch(0 0 0 / 0.04), 0 4px 16px oklch(0 0 0 / 0.04);
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button { font-family: inherit; }

/* Display font */
.hello-title, .chat-title, .modal h2, h2, .logo-name {
  font-family: "Space Grotesk", "Inter", sans-serif;
  letter-spacing: -0.01em;
}
.t-id, .tc-id, kbd, .mono, .agent-dot, .metric-val,
.field-label, .modal-eyebrow, .hello-eyebrow, .side-section-title {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-feature-settings: "ss01";
}

/* ── Background ─────────────────────────────────────────────────── */
.app {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at top, black 0%, transparent 80%);
  z-index: 0;
}
:root[data-grid="off"] .bg-grid { display: none; }
.bg-glow {
  position: fixed;
  top: -200px; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
}
.bg-glow-2 {
  top: auto; right: auto;
  bottom: -250px; left: 30%;
  background: radial-gradient(circle, #7C5CFF 0%, transparent 70%);
  opacity: 0.06;
}
:root[data-theme="light"] .bg-glow { opacity: 0.18; }
:root[data-theme="light"] .bg-glow-2 { opacity: 0.14; }

/* ── Topbar ─────────────────────────────────────────────────────── */
.topbar {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 260px 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklch, var(--bg), transparent 40%);
  backdrop-filter: blur(20px);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo-mark {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--accent);
  background: linear-gradient(135deg, var(--surface), var(--bg-2));
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.04), 0 0 24px var(--accent-soft);
}
.logo-name { font-size: 16px; font-weight: 600; letter-spacing: 0.01em; line-height: 1.1; }
.logo-sub { font-size: 10px; color: var(--fg-4); letter-spacing: 0.06em; font-family: "JetBrains Mono", monospace; }

.topbar-search {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px;
  height: 38px;
  max-width: 540px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg-3);
  transition: border-color .15s;
}
.topbar-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.topbar-search input {
  flex: 1; background: none; border: 0; outline: 0;
  color: var(--fg); font: inherit;
}
.topbar-search input::placeholder { color: var(--fg-4); }
kbd {
  font-size: 10px;
  padding: 2px 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--fg-3);
}

.topbar-right { display: flex; align-items: center; gap: 12px; }
.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--fg-2);
  cursor: pointer;
  position: relative;
  transition: all .15s;
}
.icon-btn:hover { background: var(--surface); border-color: var(--border); color: var(--fg); }
.ping {
  position: absolute; top: 8px; right: 9px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px oklch(0.16 0.018 260), 0 0 12px var(--accent);
}

/* Benachrichtigungen */
.notif-wrap { position: relative; }
.notif-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 16px; height: 16px;
  display: grid; place-items: center;
  padding: 0 4px;
  font-size: 10px; font-weight: 700;
  color: var(--accent-fg);
  background: var(--accent);
  border-radius: 999px;
  box-shadow: 0 0 0 2px var(--bg);
}
.notif-backdrop { position: fixed; inset: 0; z-index: 90; }
.notif-panel {
  position: absolute; top: 44px; right: 0; z-index: 100;
  width: 320px; max-height: 380px; overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.35);
  padding: 6px;
}
.notif-head {
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-4); font-family: "JetBrains Mono", monospace;
  padding: 8px 10px 6px;
}
.notif-empty { padding: 16px 10px; color: var(--fg-3); font-size: 13px; text-align: center; }
.notif-item {
  display: block; width: 100%; text-align: left;
  background: transparent; border: 0; border-radius: 8px;
  padding: 9px 10px; cursor: pointer; color: inherit;
  font-family: inherit;
}
.notif-item:hover { background: var(--surface-2); }
.notif-item-title { font-size: 13px; color: var(--fg); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-item-meta { font-size: 11px; color: var(--fg-3); font-family: "JetBrains Mono", monospace; margin-top: 2px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 14px; height: 38px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-weight: 500; font-size: 13px;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
  box-shadow: 0 0 24px var(--accent-soft), inset 0 1px 0 oklch(1 0 0 / 0.2);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--fg-2);
}
.btn-ghost:hover { background: var(--surface); color: var(--fg); border-color: var(--border-strong); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 12px 4px 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.avatar {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7C5CFF);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-family: "JetBrains Mono", monospace;
}
.avatar-lg { width: 42px; height: 42px; font-size: 14px; }
.agent-avatar { background: linear-gradient(135deg, #7C5CFF, #FF6BD6); }
.user-meta { line-height: 1.2; }
.user-name { font-size: 13px; font-weight: 500; }
.user-role { font-size: 10px; color: var(--fg-3); letter-spacing: 0.04em; }

.mobile-only { display: none; }

/* ── Shell ──────────────────────────────────────────────────────── */
.shell {
  position: relative; z-index: 1;
  flex: 1;
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 0;
}
.app-rail .shell { grid-template-columns: 72px 1fr; }
.app-rail .side-label, .app-rail .side-count, .app-rail .side-section-title,
.app-rail .side-stats, .app-rail .side-footer { display: none; }
.app-rail .side-item { justify-content: center; padding: 12px; }

/* ── Sidebar ────────────────────────────────────────────────────── */
.sidebar {
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  background: color-mix(in oklch, var(--bg-2), transparent 50%);
}
.side-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-4);
  padding: 12px 10px 4px;
}
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--fg-2);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  text-align: left;
  transition: all .12s;
}
.side-item:hover { background: var(--surface); color: var(--fg); }
.side-item.active {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border-color: var(--border);
  color: var(--fg);
  box-shadow: inset 2px 0 0 var(--accent), 0 0 24px oklch(0 0 0 / 0.3);
}
.side-item.active .side-count { color: var(--accent); border-color: var(--accent-soft); }
.side-label { flex: 1; }
.side-count {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--fg-3);
  font-family: "JetBrains Mono", monospace;
}

.side-stats {
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.stat-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 6px;
  font-size: 12px;
}
.stat-label { color: var(--fg-3); }
.stat-val { color: var(--fg); font-weight: 500; display: flex; gap: 4px; align-items: center; }
.agent-dot {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  font-size: 9px;
  color: var(--fg-2);
  margin-left: -8px;
}
.agent-dot:first-of-type { margin-left: 0; }
.pill-ok { color: var(--ok); font-size: 11px; font-weight: 600; }
.referrer { color: var(--accent); font-size: 11px; font-family: "JetBrains Mono", monospace; }

/* ── Business Hours Card ───────────────────────────────────────── */
.bh-card {
  margin-top: auto;
  display: flex; gap: 14px; align-items: center;
  padding: 14px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}
.bh-visual {
  position: relative;
  width: 72px; height: 72px;
  flex-shrink: 0;
}
.bh-visual svg { position: relative; z-index: 2; }
.bh-track { fill: none; stroke: var(--border); stroke-width: 1; }
.bh-tick { stroke: var(--border-strong); stroke-width: 1; }
.bh-arc {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke .4s;
}
.bh-now {
  transition: fill .4s;
}
.bh-now-pulse {
  fill: none;
  stroke-width: 2;
  transform-origin: center;
  transform-box: fill-box;
}
.bh-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  filter: blur(14px);
  opacity: 0.5;
  z-index: 1;
  transition: background .4s, opacity .4s;
}

/* OPEN — friendly green pulse, bright arc */
.bh-open .bh-arc { stroke: var(--ok); filter: drop-shadow(0 0 4px var(--ok)); }
.bh-open .bh-now { fill: var(--ok); }
.bh-open .bh-now-pulse { stroke: var(--ok); animation: bh-pulse-open 2.2s ease-out infinite; }
.bh-open .bh-glow-open { background: radial-gradient(circle, var(--ok), transparent 65%); opacity: 0.35; animation: bh-breathe 3.4s ease-in-out infinite; }
.bh-open .bh-dot { background: var(--ok); box-shadow: 0 0 10px var(--ok); animation: bh-blink 1.8s ease-in-out infinite; }
.bh-open .bh-status { color: var(--ok); }

/* CLOSED — slower, red, fading pulse */
.bh-closed .bh-arc { stroke: var(--fg-4); opacity: 0.5; }
.bh-closed .bh-now { fill: var(--danger); animation: bh-flicker 3s ease-in-out infinite; }
.bh-closed .bh-now-pulse { stroke: var(--danger); animation: bh-pulse-closed 4s ease-in-out infinite; }
.bh-closed .bh-glow-closed { background: radial-gradient(circle, var(--danger), transparent 65%); opacity: 0.18; animation: bh-shiver 6s ease-in-out infinite; }
.bh-closed .bh-dot { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.bh-closed .bh-status { color: var(--danger); }

.bh-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bh-status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600;
}
.bh-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.bh-hours { font-size: 11px; color: var(--fg-3); font-family: "JetBrains Mono", monospace; letter-spacing: 0.04em; }
.bh-now-label { font-size: 10px; color: var(--fg-4); font-family: "JetBrains Mono", monospace; letter-spacing: 0.06em; }

@keyframes bh-pulse-open {
  0%   { stroke-opacity: 0.8; r: 4; }
  100% { stroke-opacity: 0; r: 14; }
}
@keyframes bh-pulse-closed {
  0%   { stroke-opacity: 0.35; r: 4; }
  100% { stroke-opacity: 0; r: 9; }
}
@keyframes bh-breathe {
  0%, 100% { opacity: 0.22; transform: scale(0.95); }
  50% { opacity: 0.42; transform: scale(1.05); }
}
@keyframes bh-shiver {
  0%, 100% { opacity: 0.12; }
  50% { opacity: 0.22; }
}
@keyframes bh-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
@keyframes bh-flicker {
  0%, 92%, 100% { opacity: 1; }
  94% { opacity: 0.3; }
  96% { opacity: 1; }
  98% { opacity: 0.5; }
}

/* App rail hides the BH-Card label part */
.app-rail .bh-card { display: none; }

/* ── Main / Dashboard ──────────────────────────────────────────── */
.main {
  overflow-y: auto;
  padding: 28px 32px 60px;
}
:root[data-density="compact"] .main { padding: 18px 24px 40px; }
:root[data-density="comfy"] .main { padding: 36px 40px 80px; }

.hello {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.hello-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.hello-time { color: var(--fg-4); letter-spacing: 0.08em; margin-left: 6px; }
.hello-title {
  font-size: 38px;
  font-weight: 500;
  margin: 0 0 8px;
  line-height: 1.1;
}
.hello-name {
  background: linear-gradient(120deg, var(--accent) 0%, #7C5CFF 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hello-sub { color: var(--fg-3); margin: 0; max-width: 560px; font-size: 14px; }
.hello-metrics { display: flex; gap: 10px; flex-shrink: 0; }
.metric {
  min-width: 96px;
  padding: 14px 18px;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: left;
  position: relative;
  overflow: hidden;
}
.metric::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.metric-warn::before { background: linear-gradient(90deg, transparent, var(--warn), transparent); }
.metric-muted::before { background: linear-gradient(90deg, transparent, var(--fg-4), transparent); }
.metric-val { font-size: 28px; font-weight: 500; line-height: 1; color: var(--fg); }
.metric-warn .metric-val { color: var(--warn); }
.metric-muted .metric-val { color: var(--fg-3); }
.metric-lbl { font-size: 10px; color: var(--fg-3); margin-top: 6px; letter-spacing: 0.12em; text-transform: uppercase; font-family: "JetBrains Mono", monospace; }

.board-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.board-title { display: flex; align-items: baseline; gap: 12px; }
.board-title h2 { font-size: 18px; font-weight: 600; margin: 0; }
.board-count { font-size: 11px; color: var(--fg-3); font-family: "JetBrains Mono", monospace; }
.board-actions { display: flex; gap: 10px; align-items: center; }
.seg-toggle {
  display: flex; gap: 2px;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
}
.seg-toggle button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  font-size: 12px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--fg-3);
  cursor: pointer;
  font-family: inherit;
}
.seg-toggle button.on { background: var(--surface-3); color: var(--fg); }

/* Grid */
.ticket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.ticket-card {
  position: relative;
  text-align: left;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  cursor: pointer;
  transition: all .18s;
  display: flex; flex-direction: column; gap: 14px;
  font-family: inherit;
  color: inherit;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.ticket-card::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 14px;
  pointer-events: none;
  background: radial-gradient(circle at top right, var(--accent-soft) 0%, transparent 40%);
  opacity: 0;
  transition: opacity .18s;
}
.ticket-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.ticket-card:hover::after { opacity: 1; }
.tc-head { display: flex; align-items: center; justify-content: space-between; }
.tc-id { font-size: 10px; color: var(--fg-4); letter-spacing: 0.08em; }
.tc-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px;
  font-weight: 500;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; box-shadow: 0 0 8px currentColor; }
.tc-title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--fg);
  text-wrap: pretty;
}
.tc-preview {
  font-size: 12px;
  color: var(--fg-3);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tc-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  margin-top: auto;
}
.tc-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px;
  padding: 3px 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--fg-2);
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.04em;
}
.tc-foot-right { display: flex; align-items: center; gap: 8px; }
.tc-agent {
  width: 24px; height: 24px;
  display: inline-grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #7C5CFF, #FF6BD6);
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  font-family: "JetBrains Mono", monospace;
}
.tc-time { font-size: 10px; color: var(--fg-4); font-family: "JetBrains Mono", monospace; }
.tc-badge {
  position: absolute; top: 12px; right: 12px;
  font-size: 10px;
  padding: 2px 8px;
  background: var(--accent);
  color: var(--accent-fg);
  border-radius: 999px;
  font-weight: 600;
  font-family: "JetBrains Mono", monospace;
}

/* List */
.ticket-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.ticket-row {
  display: grid;
  grid-template-columns: 80px 1fr 110px 90px 100px 90px 140px 32px;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  color: inherit;
  text-align: left;
  font-family: inherit;
  font-size: 13px;
  width: 100%;
  transition: background .12s;
}
.ticket-row:last-child { border-bottom: 0; }
.ticket-row:hover { background: var(--surface-2); }
.ticket-row-head {
  background: var(--bg-2);
  color: var(--fg-4);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: "JetBrains Mono", monospace;
  cursor: default;
}
.ticket-row-head:hover { background: var(--bg-2); }
.t-id { font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--fg-3); }
.t-title { color: var(--fg); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-cat, .t-prio, .t-status, .t-time, .t-agent { font-size: 11px; color: var(--fg-3); }
.t-prio { font-family: "JetBrains Mono", monospace; }
.t-status { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.t-time { font-family: "JetBrains Mono", monospace; }
.t-agent { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-unread {
  display: inline-grid; place-items: center;
  min-width: 22px; height: 22px;
  font-size: 10px;
  background: var(--accent);
  color: var(--accent-fg);
  border-radius: 999px;
  font-weight: 700;
  padding: 0 6px;
}
.ticket-row-head .t-unread { display: none; }

.empty {
  text-align: center;
  padding: 80px 20px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: var(--surface);
}
.empty-orb {
  width: 64px; height: 64px; margin: 0 auto 16px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: radial-gradient(circle, var(--accent-soft), transparent);
  position: relative;
}
.empty-orb::after {
  content: ""; position: absolute; inset: 12px;
  border: 1px dashed var(--accent);
  border-radius: 50%;
  opacity: 0.4;
}
.empty h3 { margin: 0 0 6px; font-size: 16px; font-weight: 500; }
.empty p { margin: 0; color: var(--fg-3); font-size: 13px; }

/* ── Chat View ──────────────────────────────────────────────────── */
.chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: -28px -32px -60px;
  padding: 0;
}
.chat-head {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklch, var(--bg), transparent 40%);
  backdrop-filter: blur(20px);
}
.chat-head-main { flex: 1; }
.chat-head-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  font-size: 11px;
  background: var(--bg-2);
  border: 1px solid;
  border-radius: 999px;
  font-weight: 500;
}
.chat-title { font-size: 22px; font-weight: 500; margin: 8px 0 4px; }
.chat-meta { font-size: 12px; color: var(--fg-3); }

.chat-stream {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.chat-day-sep {
  display: flex; align-items: center; gap: 12px;
  color: var(--fg-4);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: "JetBrains Mono", monospace;
}
.chat-day-sep::before, .chat-day-sep::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.msg {
  display: flex; gap: 12px;
  max-width: 720px;
}
.msg-agent { align-self: flex-start; }
.msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.msg-avatar {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7C5CFF);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  flex-shrink: 0;
}
.msg-user .msg-avatar { background: linear-gradient(135deg, var(--accent), #5EE6A8); }
.msg-agent .msg-avatar { background: linear-gradient(135deg, #7C5CFF, #FF6BD6); }
.msg-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.msg-user .msg-body { align-items: flex-end; }
.msg-meta { display: flex; gap: 8px; font-size: 11px; padding: 0 4px; }
.msg-name { color: var(--fg-2); font-weight: 500; }
.msg-time { color: var(--fg-4); font-family: "JetBrains Mono", monospace; }
.msg-bubble {
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  border-top-left-radius: 4px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--fg);
  text-wrap: pretty;
}
.msg-user .msg-bubble {
  /* Dezenter Grünverlauf (Mint wie der DU-Avatar), als leichte Tönung über --surface.
     Mischung in sRGB statt oklch — sonst dreht der Farbton beim Mix mit --surface
     (oklch(1 0 0), Hue 0) Richtung Rot. */
  background: linear-gradient(135deg,
      color-mix(in srgb, #5EE6A8 22%, var(--surface)),
      color-mix(in srgb, #5EE6A8 9%, var(--surface)));
  border-color: color-mix(in srgb, #5EE6A8 45%, var(--surface));
  border-top-left-radius: 14px;
  border-top-right-radius: 4px;
}
.msg-attach {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px;
  padding: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
}
.msg-attach-thumb {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--surface-2);
  border-radius: 6px;
  color: var(--fg-3);
}
.msg-attach-name { color: var(--fg); font-weight: 500; font-size: 12px; }
.msg-attach-size { color: var(--fg-4); font-size: 10px; font-family: "JetBrains Mono", monospace; }
.msg-attach-preview {
  display: block; padding: 0; overflow: hidden;
  max-width: 280px;
}
.msg-attach-preview img { display: block; width: 100%; height: auto; }

.typing {
  display: flex; align-items: center; gap: 12px;
  align-self: flex-start;
  color: var(--fg-3);
  font-size: 11px;
}
.typing-dots {
  display: flex; gap: 4px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.typing-dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--fg-3);
  animation: bounce 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.30s; }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}
.typing-text { font-family: "JetBrains Mono", monospace; letter-spacing: 0.04em; }

.composer {
  padding: 16px 32px 20px;
  border-top: 1px solid var(--border);
  background: color-mix(in oklch, var(--bg), transparent 30%);
  backdrop-filter: blur(20px);
}
.composer-attach {
  position: relative;
  display: inline-block;
  margin-bottom: 10px;
}
.composer-attach img { max-width: 140px; max-height: 100px; border-radius: 8px; border: 1px solid var(--border); display: block; }
.composer-attach .icon-btn {
  position: absolute; top: -6px; right: -6px;
  width: 22px; height: 22px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
}
.composer-row {
  display: flex; align-items: flex-end; gap: 10px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color .15s;
}
.composer-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer textarea {
  flex: 1;
  background: none;
  border: 0;
  outline: 0;
  color: var(--fg);
  font: inherit;
  font-size: 13.5px;
  resize: none;
  padding: 7px 4px;
  max-height: 140px;
  min-height: 22px;
  line-height: 1.5;
}
.composer textarea::placeholder { color: var(--fg-4); }
.btn-send { height: 34px; }

/* Rich-Text Composer */
.composer-toolbar { display: flex; gap: 4px; margin-bottom: 8px; }
.fmt-btn {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--fg-2);
  font-size: 13px;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.fmt-btn:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--fg); }
.composer-editor {
  flex: 1;
  background: none;
  border: 0;
  outline: 0;
  color: var(--fg);
  font: inherit;
  font-size: 13.5px;
  padding: 7px 4px;
  max-height: 140px;
  min-height: 22px;
  overflow-y: auto;
  line-height: 1.5;
}
.composer-editor:empty:before {
  content: attr(data-placeholder);
  color: var(--fg-4);
  pointer-events: none;
}
.modal-editor {
  min-height: 110px;
  max-height: 240px;
  overflow-y: auto;
  line-height: 1.5;
  cursor: text;
}
.modal-editor:empty:before {
  content: attr(data-placeholder);
  color: var(--fg-4);
  pointer-events: none;
}
.composer-foot {
  display: flex; gap: 8px;
  margin-top: 8px;
  font-size: 10px;
  color: var(--fg-4);
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.04em;
}
.dot-sep { opacity: 0.5; }

/* ── Modal ──────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: color-mix(in oklch, var(--bg-2), transparent 30%);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: grid; place-items: center;
  padding: 24px;
  animation: fadeIn .15s;
}
.modal {
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  box-shadow: 0 20px 80px oklch(0 0 0 / 0.6), inset 0 1px 0 oklch(1 0 0 / 0.04);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: rise .2s;
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.18em;
  margin-bottom: 6px;
}
.modal h2 { font-size: 20px; font-weight: 500; margin: 0; }
.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex; flex-direction: column; gap: 16px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-label {
  font-size: 10px;
  color: var(--fg-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.input {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 12px;
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: all .15s;
  font-family: inherit;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { resize: vertical; line-height: 1.5; min-height: 100px; }
select.input { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%237A8499' d='M0 0h10L5 6z'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

.prio-seg {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px;
  padding: 4px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 9px;
}
.prio-seg button {
  padding: 6px 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--fg-3);
  font-size: 11px;
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.04em;
}
.prio-seg button.on {
  background: var(--surface);
}

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 28px 16px;
  background: var(--bg-2);
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  gap: 4px;
}
.dropzone:hover { border-color: var(--accent); background: var(--surface); }
.dropzone-filled {
  cursor: default; padding: 12px; align-items: stretch;
}
.dropzone-filled:hover { border-color: var(--border-strong); background: var(--bg-2); }
.dropzone-icon { color: var(--fg-3); margin-bottom: 4px; }
.dropzone-label { font-size: 13px; color: var(--fg-2); font-weight: 500; }
.dropzone-hint { font-size: 11px; color: var(--fg-4); font-family: "JetBrains Mono", monospace; letter-spacing: 0.04em; }
.dropzone-preview { display: flex; gap: 14px; align-items: center; }
.dropzone-preview img { max-width: 80px; max-height: 80px; border-radius: 8px; border: 1px solid var(--border); }
.dropzone-info { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--fg-2); }

.modal-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: color-mix(in oklch, var(--surface-2), transparent 30%);
}
.modal-foot-meta { font-size: 11px; color: var(--fg-3); display: inline-flex; align-items: center; gap: 6px; font-family: "JetBrains Mono", monospace; letter-spacing: 0.04em; }
.modal-foot-actions { display: flex; gap: 8px; }

/* ── Scrollbars ────────────────────────────────────────────────── */
.main::-webkit-scrollbar, .chat-stream::-webkit-scrollbar,
.sidebar::-webkit-scrollbar, .modal-body::-webkit-scrollbar { width: 10px; }
.main::-webkit-scrollbar-thumb, .chat-stream::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb, .modal-body::-webkit-scrollbar-thumb {
  background: var(--surface-2); border-radius: 999px; border: 3px solid var(--bg);
}
.main::-webkit-scrollbar-track { background: transparent; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .topbar { grid-template-columns: auto 1fr auto; gap: 12px; padding: 12px 16px; }
  .topbar-search { display: none; }
  .user-chip .user-meta { display: none; }
  .user-chip { padding: 4px; }
  .mobile-only { display: grid; }
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 64px; bottom: 0;
    width: 280px; z-index: 50;
    transform: translateX(-100%);
    transition: transform .2s;
    background: var(--bg);
  }
  .sidebar-open { transform: translateX(0); }
  .main, .chat { padding: 18px 18px 40px; margin: 0; }
  .chat-head, .chat-stream, .composer { padding-left: 18px; padding-right: 18px; }
  .hello { flex-direction: column; gap: 18px; }
  .hello-title { font-size: 28px; }
  .field-row { grid-template-columns: 1fr; }
}
