/* ============================================================
   adami-support — Design System
   Aesthetik: warmes, einladendes Support-Desk.
   Dunkle "Espresso"-Sidebar, warme Creme-Content-Fläche,
   Orange als Markenfarbe. Charaktervolle Typografie.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Hanken+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  /* Marke (tiefes Terrakotta / Burnt Orange) */
  --brand:        #d65f30;
  --brand-600:    #bc4e22;
  --brand-700:    #8f3815;
  --brand-soft:   #f6ddcb;
  --brand-tint:   #fcf1ea;
  --on-brand:     #fff;      /* Text/Icons auf der tiefen Marke */

  /* Ink / Sidebar (warmes Espresso-Dunkel) */
  --ink:          #1a130d;
  --ink-2:        #261b12;
  --ink-line:     #3a2c20;
  --ink-text:     #d8cabb;
  --ink-muted:    #9d8c7a;

  /* Flächen (warme Creme) */
  --bg:           #f8f4ee;
  --surface:      #ffffff;
  --surface-2:    #fdf9f3;
  --line:         #ece4d9;
  --line-2:       #f3ede3;
  --text:         #211a13;
  --text-2:       #574c40;
  --muted:        #8a7d6e;

  /* Status */
  --st-offen-fg:#1d4ed8; --st-offen-bg:#e4edff;
  --st-bearb-fg:#7c3aed; --st-bearb-bg:#ede9fe;
  --st-wartet-fg:#b45309; --st-wartet-bg:#fdf0d5;
  --st-zu-fg:#15803d;    --st-zu-bg:#d9f7e3;

  /* Priorität */
  --pr-niedrig-fg:#5b6470; --pr-niedrig-bg:#edeef0;
  --pr-normal-fg:#1d4ed8;  --pr-normal-bg:#e4edff;
  --pr-hoch-fg:#c2410c;    --pr-hoch-bg:#ffe3cc;
  --pr-dringend-fg:#be123c;--pr-dringend-bg:#ffe4e6;

  /* Sonstiges */
  --danger:       #e11d48;
  --danger-bg:    #ffe4e6;
  --ok:           #15803d;
  --ok-bg:        #d9f7e3;

  --radius:       16px;
  --radius-sm:    11px;
  --radius-lg:    22px;
  --shadow-sm:    0 1px 2px rgba(40,28,16,.05), 0 1px 0 rgba(40,28,16,.02);
  --shadow:       0 8px 24px -12px rgba(40,28,16,.20), 0 2px 8px -4px rgba(40,28,16,.07);
  --shadow-lg:    0 30px 64px -24px rgba(30,20,12,.34);
  --ring:         0 0 0 4px var(--brand-tint), 0 0 0 1px var(--brand-600);

  --font-display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --font-body:    'Hanken Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  --sidebar-w:    256px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.02em; margin: 0; color: var(--text); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
svg.ic { width: 1.15em; height: 1.15em; stroke: currentColor; stroke-width: 1.9; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ===================== App-Shell ===================== */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; align-self: start;
  height: 100vh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  color: var(--ink-text); border-right: 1px solid var(--ink-line);
  padding: 18px 14px; gap: 6px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 8px 10px 16px; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(140deg, var(--brand), var(--brand-700));
  display: grid; place-items: center; color: var(--on-brand); box-shadow: 0 6px 16px -6px rgba(214,95,48,.7); }
.brand-mark svg { width: 22px; height: 22px; stroke: var(--on-brand); stroke-width: 2.1; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 17px; color: #fff; letter-spacing: -.02em; line-height: 1; }
.brand-name small { display: block; font-family: var(--font-body); font-weight: 500; font-size: 11px; color: var(--ink-muted); letter-spacing: .04em; margin-top: 3px; text-transform: uppercase; }

/* Scrollbarer Menübereich: Marke bleibt oben, Nutzer/Abmelden unten fixiert. */
.nav-scroll { display: flex; flex-direction: column; gap: 6px; flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overflow-x: hidden; margin: 0 -4px; padding: 0 4px;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; -webkit-overflow-scrolling: touch; }
.nav-scroll::-webkit-scrollbar { width: 7px; }
.nav-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 8px; }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); padding: 14px 12px 6px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; color: var(--ink-text);
  font-weight: 500; font-size: 14.5px; position: relative; transition: background .15s, color .15s; }
.nav-link svg.ic { width: 19px; height: 19px; opacity: .85; }
.nav-link:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-link.active { background: rgba(214,95,48,.16); color: #fff; }
.nav-link.active svg.ic { color: var(--brand); opacity: 1; }
.nav-link.active::before { content: ''; position: absolute; left: -14px; top: 50%; transform: translateY(-50%); width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav-count { margin-left: auto; font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; background: rgba(255,255,255,.08); color: var(--ink-text); padding: 1px 8px; border-radius: 999px; }
.nav-link.active .nav-count { background: var(--brand); color: var(--on-brand); }

.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--ink-line); }
.side-user { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 12px; }
.side-user:hover { background: rgba(255,255,255,.05); }
.side-user .who { min-width: 0; }
.side-user .who b { display: block; color: #fff; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .who span { font-size: 12px; color: var(--ink-muted); }

/* ===================== Topbar ===================== */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 14px 28px; background: rgba(248,244,238,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .page-title { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: -.02em; }
.topbar .page-title small { display: block; font-family: var(--font-body); font-weight: 500; font-size: 12.5px; color: var(--muted); letter-spacing: 0; }
.topbar .spacer { flex: 1; }
.menu-toggle { display: none; }

.searchbox { position: relative; }
.searchbox svg.ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 17px; height: 17px; }
.searchbox input { width: 260px; padding: 9px 12px 9px 36px; border: 1px solid var(--line); background: var(--surface); border-radius: 11px; font: inherit; font-size: 14px; transition: border-color .15s, box-shadow .15s; }
.searchbox input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-tint); }

.content { padding: 28px; flex: 1; max-width: 1180px; width: 100%; }
.content > * { animation: fade-up .5s cubic-bezier(.21,.6,.35,1) both; }
.content > *:nth-child(2){animation-delay:.04s}.content > *:nth-child(3){animation-delay:.08s}.content > *:nth-child(4){animation-delay:.12s}.content > *:nth-child(5){animation-delay:.16s}
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .content > * { animation: none; } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 29px; font-weight: 800; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; }

/* ===================== Buttons ===================== */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 1px solid transparent; border-radius: 11px;
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; transition: transform .12s, box-shadow .15s, background .15s, border-color .15s; white-space: nowrap; }
.btn svg.ic { width: 17px; height: 17px; }
.btn-primary { background: linear-gradient(135deg, #df7849, var(--brand-600) 50%, #7e3012); color: #fff; box-shadow: 0 5px 14px -6px rgba(143,56,21,.5); }
.btn-primary:hover { transform: translateY(-1px); filter: saturate(1.04); box-shadow: 0 10px 22px -8px rgba(143,56,21,.55); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-700); transform: translateY(-1px); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #f3c9d2; }
.btn-danger:hover { background: var(--danger-bg); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ===================== Cards / Stat ===================== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px 22px; }
.grid { display: grid; gap: 18px; }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2 { grid-template-columns: 1.7fr 1fr; }
@media (max-width: 1000px){ .cols-4{grid-template-columns:repeat(2,1fr)} .cols-3{grid-template-columns:1fr} .cols-2{grid-template-columns:1fr} }

.stat { padding: 20px 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); position: relative; overflow: hidden; transition: transform .18s cubic-bezier(.2,.7,.3,1), box-shadow .18s; }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat .chip { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 16px; }
.stat .chip svg.ic { width: 21px; height: 21px; }
.stat .num { font-family: var(--font-display); font-weight: 800; font-size: 33px; line-height: 1; letter-spacing: -.03em; color: var(--text); }
.stat .lbl { color: var(--muted); font-size: 13.5px; margin-top: 6px; font-weight: 500; }
.chip-offen{background:var(--st-offen-bg);color:var(--st-offen-fg)} .chip-bearb{background:var(--st-bearb-bg);color:var(--st-bearb-fg)}
.chip-wartet{background:var(--st-wartet-bg);color:var(--st-wartet-fg)} .chip-zu{background:var(--st-zu-bg);color:var(--st-zu-fg)}
.chip-brand{background:var(--brand-soft);color:var(--brand-700)} .chip-amber{background:#fdf0d5;color:#b45309} .chip-rose{background:#ffe4e6;color:#be123c}

.section-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 14px; }
.section-head h2 { font-size: 17px; }
.section-head a { color: var(--brand-700); font-weight: 600; font-size: 13.5px; }

/* ===================== Badges ===================== */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-offen{color:var(--st-offen-fg);background:var(--st-offen-bg)} .st-in_bearbeitung{color:var(--st-bearb-fg);background:var(--st-bearb-bg)}
.st-wartet{color:var(--st-wartet-fg);background:var(--st-wartet-bg)} .st-geschlossen{color:var(--st-zu-fg);background:var(--st-zu-bg)}
.pr-niedrig{color:var(--pr-niedrig-fg);background:var(--pr-niedrig-bg)} .pr-normal{color:var(--pr-normal-fg);background:var(--pr-normal-bg)}
.pr-hoch{color:var(--pr-hoch-fg);background:var(--pr-hoch-bg)} .pr-dringend{color:var(--pr-dringend-fg);background:var(--pr-dringend-bg)}
.badge-snooze{color:#6d5b13;background:#fbf2cf} .badge-snooze svg{width:13px;height:13px}
html[data-theme="dark"] .badge-snooze{color:#e8d48a;background:#3a3413}
.mention{background:var(--brand-50,rgba(214,95,48,.12));color:var(--brand-700,var(--brand-600));font-weight:600;border-radius:5px;padding:0 4px}
html[data-theme="dark"] .mention{background:rgba(214,95,48,.18)}
.badge-ok{color:var(--st-offen-fg,#0a7d5a);background:var(--st-offen-bg,#d9f3e8)}

/* Ankündigungs-Banner */
.announce-stack{display:flex;flex-direction:column;gap:8px;margin-bottom:16px}
.announce{display:flex;align-items:center;gap:10px;padding:11px 16px;border-radius:12px;font-size:13.5px;font-weight:500;border:1px solid transparent}
.announce svg{width:17px;height:17px;flex:none}
.announce-info{background:var(--st-offen-bg,#e7f1ff);color:var(--st-offen-fg,#0a558c);border-color:rgba(10,85,140,.15)}
.announce-warnung{background:var(--pr-hoch-bg,#fff3e0);color:var(--pr-hoch-fg,#b45309);border-color:rgba(180,83,9,.18)}
.announce-wartung{background:var(--pr-dringend-bg,#fde8e8);color:var(--pr-dringend-fg,#c81e1e);border-color:rgba(200,30,30,.18)}
html[data-theme="dark"] .announce-info{background:#16283d;color:#9cc4ec}
html[data-theme="dark"] .announce-warnung{background:#3a2c13;color:#e8c78a}
html[data-theme="dark"] .announce-wartung{background:#3a1717;color:#e89a9a}

/* ===================== Avatar ===================== */
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13.5px; color: #fff; flex: none; font-family: var(--font-display); letter-spacing: -.01em; }
.avatar-sm { width: 28px; height: 28px; font-size: 11.5px; }
.avatar-lg { width: 52px; height: 52px; font-size: 19px; }
.avatar.img { background-size: cover; background-position: center; background-repeat: no-repeat; }

/* ===================== Table ===================== */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th { text-align: left; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 13px 18px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
table.tbl td { padding: 14px 18px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tbody tr { transition: background .12s; }
table.tbl tbody tr:hover { background: var(--brand-tint); }
.t-subject { font-weight: 600; color: var(--text); }
.t-num { font-family: var(--font-mono); font-size: 12.5px; color: var(--brand-700); font-weight: 600; }
.t-user { display: flex; align-items: center; gap: 9px; }

/* ===================== Forms ===================== */
.field { display: block; margin-bottom: 16px; }
.field > label, label.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.input, input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
  font: inherit; font-size: 14.5px; color: var(--text); transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; min-height: 110px; }
.input:focus, input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-tint); }
select { appearance: none; background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7a76' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.check { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand-600); }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row > * { flex: 1; min-width: 160px; }

/* ===================== Filter bar ===================== */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar form { display: contents; }
.toolbar .searchbox input { width: 240px; }
.toolbar select { width: auto; padding: 9px 32px 9px 12px; font-size: 14px; border-radius: 10px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 3px; box-shadow: var(--shadow-sm); }
.seg a { padding: 7px 13px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.seg a.active { background: var(--ink); color: #fff; }

/* ===================== Auth ===================== */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.auth-aside { background: linear-gradient(160deg, var(--ink-2), var(--ink) 70%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-aside::after { content: ''; position: absolute; right: -120px; top: -120px; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle, rgba(214,95,48,.35), transparent 70%); }
.auth-aside .brand-name { font-size: 22px; }
.auth-aside h2 { color: #fff; font-size: 34px; line-height: 1.12; max-width: 13ch; }
.auth-aside p { color: var(--ink-text); max-width: 38ch; }
.auth-feat { display: flex; align-items: center; gap: 11px; color: var(--ink-text); margin-top: 12px; font-size: 14.5px; }
.auth-feat .tick { width: 26px; height: 26px; border-radius: 8px; background: rgba(214,95,48,.18); color: var(--brand); display: grid; place-items: center; }
.auth-main { display: grid; place-items: center; padding: 40px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { font-size: 27px; margin-bottom: 6px; }
.auth-card > p.sub { color: var(--muted); margin: 0 0 26px; }
.auth-card .btn-primary { width: 100%; justify-content: center; padding: 12px; margin-top: 6px; }
.auth-alt { text-align: center; margin-top: 20px; color: var(--muted); font-size: 14px; }
.auth-alt a { color: var(--brand-700); font-weight: 600; }
@media (max-width: 860px){ .auth-wrap{grid-template-columns:1fr} .auth-aside{display:none} }

/* ===================== Ticket detail ===================== */
.detail { display: grid; grid-template-columns: 1fr 300px; gap: 22px; align-items: start; }
@media (max-width: 980px){ .detail{grid-template-columns:1fr} }
.thread { display: flex; flex-direction: column; gap: 16px; }
.msg { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.msg-head { display: flex; align-items: center; gap: 11px; padding: 13px 16px; border-bottom: 1px solid var(--line-2); }
.msg-head .who { font-weight: 600; }
.msg-head time { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.msg-body { padding: 16px; color: var(--text-2); line-height: 1.6; }
.msg.staff { border-color: var(--brand-soft); }
.msg.staff .msg-head { background: var(--brand-tint); }
.msg.internal { border-color: #fbe6b8; }
.msg.internal .msg-head { background: #fef7e6; }
.tag { font-size: 11px; font-weight: 700; letter-spacing: .03em; padding: 2px 8px; border-radius: 6px; text-transform: uppercase; }
.tag-staff { background: var(--brand-600); color: var(--on-brand); }
.tag-internal { background: #d97706; color: #fff; }
.meta-card dl { margin: 0; display: grid; gap: 14px; }
.meta-card dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; margin-bottom: 5px; }
.meta-card dd { margin: 0; }
.attach-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.attach-list a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; font-weight: 500; transition: border-color .15s, background .15s; }
.attach-list a:hover { border-color: var(--brand); background: var(--brand-tint); }

/* ===================== Empty state ===================== */
.empty { text-align: center; padding: 56px 24px; }
.empty .ill { width: 76px; height: 76px; border-radius: 22px; background: var(--brand-tint); color: var(--brand-700); display: grid; place-items: center; margin: 0 auto 18px; }
.empty .ill svg { width: 36px; height: 36px; stroke-width: 1.7; }
.empty h3 { font-size: 18px; margin-bottom: 6px; }
.empty p { color: var(--muted); margin: 0 auto 18px; max-width: 36ch; }

/* ===================== Flash / Toast ===================== */
.toast { display: flex; align-items: center; gap: 11px; padding: 13px 16px; border-radius: 12px; margin-bottom: 18px; font-weight: 500; border: 1px solid; animation: fade-up .4s both; }
.toast svg.ic { width: 19px; height: 19px; flex: none; }
.toast-ok { background: var(--ok-bg); color: #0c5e2c; border-color: #b6ecc6; }
.toast-err { background: var(--danger-bg); color: #9f1239; border-color: #fbcad3; }

/* ===================== Pagination ===================== */
.pager { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; color: var(--muted); font-size: 13.5px; }
.pager .pages { display: flex; gap: 6px; }
.pager a, .pager span { padding: 7px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 13.5px; color: var(--text-2); }
.pager a:hover { border-color: var(--brand); color: var(--brand-700); }
.pager .cur { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ===================== Progress (Dashboard) ===================== */
.bar { height: 9px; border-radius: 999px; background: var(--line-2); overflow: hidden; display: flex; }
.bar > i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; }

/* ===================== Mobile ===================== */
.scrim { display: none; }
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto auto 0; width: 264px; height: 100vh; height: 100dvh; z-index: 60; transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar-foot { padding-bottom: max(4px, env(safe-area-inset-bottom)); }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(26,18,10,.5); z-index: 50; }
  .menu-toggle { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
  .topbar .searchbox { display: none; }
  .content { padding: 18px; }

  /* Topbar entzerren: weniger Abstand, Titel kürzen, Buttons behalten ihre Form. */
  .topbar { padding: 11px 14px; gap: 9px; }
  .topbar .page-title { font-size: 16.5px; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .page-title small { display: none; }
  .topbar .spacer { display: none; }
  .menu-toggle, .icon-btn, .topbar .btn { flex: 0 0 auto; }
}
@media (max-width: 640px) {
  /* „Neues Ticket" platzsparend nur als +-Icon (Platz für Titel + Icon-Buttons). */
  .topbar .topbar-new .btn-label { display: none; }
  .topbar .topbar-new { padding: 9px 11px; }
  .topbar { gap: 8px; }
}
@media (max-width: 400px) {
  .topbar { gap: 6px; padding: 10px 11px; }
}

/* ===================== Topbar-Icons / Bell ===================== */
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color .15s, color .15s; }
.icon-btn:hover { border-color: var(--brand); color: var(--brand-700); }
.icon-btn svg.ic { width: 19px; height: 19px; }
.bell-dot { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; font-family: var(--font-mono); border: 2px solid var(--bg); }

/* ===================== Tags ===================== */
.tags-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tagpill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 7px; font-size: 12px; font-weight: 600; }
.tagpill .tg-dot { width: 7px; height: 7px; border-radius: 2px; }
.tg-slate{background:#eef1ee;color:#475569}.tg-slate .tg-dot{background:#64748b}
.tg-blue{background:#e4edff;color:#1d4ed8}.tg-blue .tg-dot{background:#2563eb}
.tg-violet{background:#ede9fe;color:#6d28d9}.tg-violet .tg-dot{background:#7c3aed}
.tg-amber{background:#fdf0d5;color:#b45309}.tg-amber .tg-dot{background:#d97706}
.tg-rose{background:#ffe4e6;color:#be123c}.tg-rose .tg-dot{background:#e11d48}
.tg-brand{background:var(--brand-soft);color:var(--brand-700)}.tg-brand .tg-dot{background:var(--brand-600)}
.tag-check { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; user-select: none; }
.tag-check input { display: none; }
.tag-check:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); color: var(--brand-700); }

/* ===================== Aktivitäts-Events (Timeline) ===================== */
.event { display: flex; align-items: center; gap: 12px; padding: 4px 0; color: var(--text-2); font-size: 13.5px; }
.event .ev-dot { width: 30px; height: 30px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); flex: none; }
.event .ev-dot svg.ic { width: 15px; height: 15px; }
.event time { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.event b { color: var(--text); font-weight: 600; }

/* ===================== Sterne-Bewertung ===================== */
.stars { display: inline-flex; gap: 4px; direction: rtl; }
.stars input { display: none; }
.stars label { cursor: pointer; color: #d6dbd8; transition: color .12s, transform .12s; }
.stars label svg { width: 30px; height: 30px; fill: currentColor; stroke: none; }
.stars label:hover, .stars label:hover ~ label, .stars input:checked ~ label { color: #f59e0b; }
.stars label:hover { transform: scale(1.12); }
.stars-static { display: inline-flex; gap: 2px; color: #f59e0b; }
.stars-static svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.stars-static .empty { color: #d6dbd8; }

/* ===================== Benachrichtigungen ===================== */
.notif-list { display: flex; flex-direction: column; }
.notif { display: flex; align-items: center; gap: 13px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); transition: background .12s; }
.notif:last-child { border-bottom: 0; }
.notif:hover { background: var(--brand-tint); }
.notif.unread { background: var(--brand-tint); }
.notif .ni { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.notif .nbody { flex: 1; min-width: 0; }
.notif .nbody b { font-weight: 600; color: var(--text); display: block; }
.notif time { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

/* ===================== Mini-Charts ===================== */
.trend { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 8px; }
.trend .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; justify-content: flex-end; height: 100%; }
.trend .bar-v { width: 100%; max-width: 22px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--brand), var(--brand-700)); min-height: 3px; transition: height .3s; }
.trend .bar-v.zero { background: var(--line); }
.trend .tlabel { font-size: 10px; color: var(--muted); font-family: var(--font-mono); }
.catbar { display: flex; flex-direction: column; gap: 12px; }
.catbar .row { display: grid; grid-template-columns: 120px 1fr 36px; align-items: center; gap: 12px; font-size: 13.5px; }
.catbar .track { height: 8px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.catbar .track > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-600)); border-radius: 999px; }
.catbar .cval { font-family: var(--font-mono); font-weight: 600; text-align: right; color: var(--text-2); }

/* ===================== Dark Mode ===================== */
html[data-theme="dark"] {
  --bg: #14100b; --surface: #1f1812; --surface-2: #19130e; --line: #34291f; --line-2: #2a2018;
  --text: #f1e9df; --text-2: #c5b9aa; --muted: #948674;
  --ink: #0f0b07; --ink-2: #1a130d;
  --brand-tint: #3a2410; --brand-soft: #5c3617;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3); --shadow: 0 6px 18px -8px rgba(0,0,0,.5); --shadow-lg: 0 24px 48px -20px rgba(0,0,0,.7);
}
html[data-theme="dark"] .topbar { background: rgba(26,19,13,.85); }
html[data-theme="dark"] .btn-ghost, html[data-theme="dark"] .icon-btn, html[data-theme="dark"] select { background: var(--surface); }
html[data-theme="dark"] .badge.pr-niedrig { background:#2c2218;color:#cabfb0 }
html[data-theme="dark"] .tg-slate{background:#2c2218;color:#cabfb0}
html[data-theme="dark"] .stat .num, html[data-theme="dark"] .mono { color: var(--text); }

/* ===================== Live-Chat Widget ===================== */
.cw-launch { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: inline-flex; align-items: center; gap: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand-700)); color: var(--on-brand); border: 0; cursor: pointer;
  padding: 13px 18px; border-radius: 999px; font: inherit; font-weight: 700; box-shadow: 0 14px 30px -10px rgba(188,78,34,.7); transition: transform .15s; }
.cw-launch:hover { transform: translateY(-2px); }
.cw-launch svg { width: 20px; height: 20px; stroke: var(--on-brand); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cw-panel { position: fixed; bottom: 22px; right: 22px; z-index: 201; width: 360px; max-width: calc(100vw - 32px); height: 520px; max-height: calc(100vh - 44px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); display: none; flex-direction: column; overflow: hidden; }
.cw-panel.open { display: flex; }
.cw-head { background: linear-gradient(135deg, var(--ink-2), var(--ink)); color: #fff; padding: 16px 18px; display: flex; align-items: center; gap: 11px; }
.cw-head .cw-ava { width: 38px; height: 38px; border-radius: 11px; background: rgba(214,95,48,.2); display: grid; place-items: center; color: var(--brand); }
.cw-head b { display: block; font-family: var(--font-display); }
.cw-head small { color: var(--ink-text); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.cw-head small .live { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.25); }
.cw-head .cw-x { margin-left: auto; background: rgba(255,255,255,.12); border: 0; color: #fff; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 17px; }
.cw-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.cw-foot { padding: 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.cw-foot input { flex: 1; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.cw-foot button { background: var(--brand-600); border: 0; color: var(--on-brand); width: 42px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.cw-foot button svg { width: 18px; height: 18px; stroke: var(--on-brand); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bubble { max-width: 80%; padding: 9px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45; }
.bubble.them { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.me { align-self: flex-end; background: var(--brand-600); color: var(--on-brand); border-bottom-right-radius: 4px; }
.bubble.sys { align-self: center; background: transparent; color: var(--muted); font-size: 12.5px; text-align: center; max-width: 100%; }
.bubble .who { font-size: 11px; font-weight: 700; opacity: .7; margin-bottom: 2px; }
.cw-intro { padding: 4px; }
.cw-intro .field { margin-bottom: 12px; }
.cw-offline { text-align: center; padding: 24px 10px; color: var(--muted); }
.cw-offline .ill { width: 60px; height: 60px; border-radius: 16px; background: var(--line-2); color: var(--muted); display: grid; place-items: center; margin: 0 auto 12px; }

/* ===================== Agent-Chat ===================== */
.chat-wrap { display: grid; grid-template-columns: 300px 1fr; gap: 18px; height: calc(100vh - 220px); min-height: 460px; }
@media (max-width: 900px){ .chat-wrap{ grid-template-columns: 1fr; height: auto; } }
.chat-sessions { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-y: auto; box-shadow: var(--shadow-sm); }
.chat-sessions .cs { padding: 13px 15px; border-bottom: 1px solid var(--line-2); cursor: pointer; display: flex; gap: 11px; align-items: center; transition: background .12s; }
.chat-sessions .cs:hover { background: var(--brand-tint); }
.chat-sessions .cs.active { background: var(--brand-tint); box-shadow: inset 3px 0 0 var(--brand); }
.chat-sessions .cs .meta { min-width: 0; flex: 1; }
.chat-sessions .cs .meta b { display: block; font-size: 14px; }
.chat-sessions .cs .meta span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.chat-sessions .cs .wtag { font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 2px 7px; border-radius: 5px; background: var(--st-bearb-bg); color: var(--st-bearb-fg); }
.chat-main { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; box-shadow: var(--shadow-sm); overflow: hidden; }
.chat-main .cm-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 11px; }
.chat-main .cm-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.chat-main .cm-foot { padding: 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.chat-main .cm-foot input { flex: 1; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.chat-empty { display: grid; place-items: center; height: 100%; color: var(--muted); text-align: center; padding: 30px; }
.presence-toggle { display: inline-flex; align-items: center; gap: 9px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13.5px; }
.presence-toggle .pdot { width: 9px; height: 9px; border-radius: 50%; background: #cbd5d1; }
.presence-toggle.on { border-color: var(--brand); color: var(--brand-700); background: var(--brand-tint); }
.presence-toggle.on .pdot { background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.3); }

/* ===================== Bulk-Leiste ===================== */
.bulkbar { display: none; align-items: center; gap: 10px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; margin-bottom: 14px; box-shadow: var(--shadow); }
.bulkbar.show { display: flex; }
.bulkbar .spacer { flex: 1; }
.bulkbar b { color: var(--brand); font-family: var(--font-mono); }

/* Gespeicherte Ansichten (Filter-Chips) */
.view-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 18px; }
.view-chip { display: inline-flex; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow-sm); overflow: hidden; }
.view-chip.active { border-color: var(--brand-600); background: var(--brand-50, rgba(214,95,48,.08)); }
.view-chip a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.view-chip.active a { color: var(--brand-700, var(--brand-600)); }
.view-chip a svg { width: 14px; height: 14px; }
.view-chip form { display: inline; }
.view-chip button { border: none; background: none; cursor: pointer; color: var(--text-3, var(--text-2)); padding: 6px 10px 6px 4px; font-size: 16px; line-height: 1; }
.view-chip button:hover { color: var(--danger, #ef4444); }
.bulkbar select { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; }
.bulkbar select option { color: var(--text); }

/* ===================== Druck / PDF ===================== */
@media print {
  .sidebar, .topbar, .cw-launch, .cw-panel, .bulkbar, .seg, .toolbar, .menu-toggle,
  .no-print, form.card, .nav-link { display: none !important; }
  .app { display: block; }
  .main { display: block; }
  .content { padding: 0; max-width: 100%; }
  .detail { grid-template-columns: 1fr 260px; }
  body { background: #fff; }
  .card, .msg, .table-wrap, .stat { box-shadow: none !important; border-color: #d8ddda !important; }
  .content > * { animation: none !important; }
  a { color: inherit; text-decoration: none; }
}


/* ============================================================
   PREMIUM-POLITUR-SCHICHT
   ============================================================ */

/* Atmosphärischer Hintergrund (feine Marken-Aura) */
body {
  background:
    radial-gradient(1100px 560px at 100% -8%, rgba(214,95,48,.07), transparent 60%),
    radial-gradient(820px 460px at -8% 112%, rgba(188,78,34,.05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
html[data-theme="dark"] body {
  background:
    radial-gradient(1100px 560px at 100% -8%, rgba(214,95,48,.12), transparent 60%),
    radial-gradient(820px 460px at -8% 112%, rgba(188,78,34,.10), transparent 60%),
    var(--bg);
}

/* Sidebar: dezenter Marken-Glow + feiner Innenglanz */
.sidebar { box-shadow: inset 0 1px 0 rgba(255,255,255,.04); overflow: hidden; }
.sidebar::before { content:''; position:absolute; top:0; left:0; right:0; height:200px; pointer-events:none;
  background: radial-gradient(170px 110px at 42px 46px, rgba(214,95,48,.14), transparent 72%); }
.sidebar > * { position: relative; }
/* Aktiver Menüpunkt: ruhige, gefüllte Pille statt Doppel-Rahmen */
.nav-link.active { background: linear-gradient(90deg, rgba(214,95,48,.20), rgba(214,95,48,.10)); box-shadow: none; }
.brand-mark { box-shadow: 0 8px 20px -8px rgba(214,95,48,.55), inset 0 1px 0 rgba(255,255,255,.4); }

/* Stat-Karten: ruhiger Hover-Lift, kein Akzentstreifen mehr (Farbe trägt der Chip) */
.stat { overflow: hidden; }
.stat:hover { box-shadow: var(--shadow); transform: translateY(-3px); }

/* Karten: weiche, tiefe, warme Schatten */
.card { box-shadow: var(--shadow-sm), 0 12px 36px -22px rgba(40,28,16,.22); }
html[data-theme="dark"] .card { box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 16px 44px -24px rgba(0,0,0,.6); }

/* Primär-Button: feiner Oberglanz für Tiefe */
.btn-primary { box-shadow: 0 5px 14px -6px rgba(143,56,21,.5), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-primary:hover { box-shadow: 0 11px 24px -8px rgba(143,56,21,.55), inset 0 1px 0 rgba(255,255,255,.3); }

/* Globale Fokus-Ringe (Barrierefreiheit + Premium-Feel) */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, .tile:focus-visible, .icon-btn:focus-visible {
  outline: none; box-shadow: var(--ring);
}

/* Tabellenzeilen-Hover mit dezenter Akzentkante */
table.tbl tbody tr:hover { box-shadow: inset 2px 0 0 var(--brand); }

/* Headlines knackiger */
.page-head h1, .auth-card h1 { letter-spacing: -.035em; }

/* Topbar: feine warme Trennlinie */
.topbar { box-shadow: 0 1px 0 rgba(40,28,16,.03); }

/* Auth-Hero: Aurora + Punkteraster + schwebender Orb */
.auth-aside { background: linear-gradient(155deg, #2a1c10 0%, var(--ink-2) 45%, var(--ink) 100%); }
.auth-aside::before { content:''; position:absolute; inset:0; pointer-events:none; opacity:.45;
  background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px); background-size: 22px 22px; }
.auth-aside::after { animation: orb-float 10s ease-in-out infinite; }
@keyframes orb-float { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(-22px,24px) scale(1.08)} }
.auth-aside .brand, .auth-aside > div, .auth-aside > p { position: relative; z-index: 1; }
.auth-aside h2 { background: linear-gradient(180deg, #fff, #ffd9b8); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* Badges: Hauch von Tiefe */
.badge { box-shadow: inset 0 0 0 1px rgba(40,28,16,.05); }

@media (prefers-reduced-motion: reduce) { .auth-aside::after, .stat:hover { animation: none; } }

/* ============================================================
   RESPONSIVE-HÄRTUNG (kein horizontales Seiten-Scrollen)
   ============================================================ */
html, body { overflow-x: clip; max-width: 100%; }
* { min-width: 0; }                     /* verhindert Flex-/Grid-Überlauf durch Inhalte */

/* Tabellen scrollen innerhalb ihrer Karte statt die Seite zu sprengen */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap > table.tbl { min-width: 0; }

/* Hilfsklasse: auf kleinen Screens ausblenden */
@media (max-width: 680px) { .hide-sm { display: none !important; } }

/* Segment-Umschalter & Toolbar mobil */
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.bulkbar { flex-wrap: wrap; }

@media (max-width: 680px) {
  .content { padding: 16px 14px; }
  .page-head { gap: 12px; margin-bottom: 18px; }
  .page-head h1 { font-size: 22px; }
  table.tbl th, table.tbl td { padding: 11px 12px; }
  .toolbar { gap: 8px; }
  .toolbar > * { flex: 1 1 100%; }
  .toolbar .searchbox, .toolbar .searchbox input, .toolbar select, .toolbar .btn { width: 100%; }
  .catbar .row { grid-template-columns: 84px 1fr 28px; gap: 9px; }
  .detail { gap: 16px; }
  .meta-card dl { gap: 12px; }
  .grid { gap: 14px; }
  .cw-panel { right: 12px; bottom: 12px; left: 12px; width: auto; }
}
@media (max-width: 480px) {
  .form-row > * { min-width: 100%; }
  .grid.cols-4 { grid-template-columns: 1fr 1fr; }
  .stat .num { font-size: 26px; }
  .page-head .btn, .page-head .seg { width: 100%; }
}

/* ============================================================
   LANDING-PAGE
   ============================================================ */
.lp-nav { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: rgba(248,244,238,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
html[data-theme="dark"] .lp-nav { background: rgba(26,19,13,.85); }
.lp-hero { position: relative; overflow: hidden; padding: 80px 22px 60px; text-align: center;
  background: linear-gradient(180deg, var(--brand-tint), transparent 72%); }
.lp-hero::before { content: ''; position: absolute; top: -180px; left: 50%; transform: translateX(-50%);
  width: 780px; max-width: 130vw; height: 440px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(214,95,48,.20), transparent 70%); }
.lp-hero::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(143,56,21,.05) 1px, transparent 1px); background-size: 26px 26px; }
.lp-hero > * { position: relative; z-index: 1; }
.lp-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 22px; }
.lp-badge .live { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.25); }
.lp-badge .off { width: 8px; height: 8px; border-radius: 50%; background: #cbd5d1; }
.lp-hero h1 { font-size: clamp(31px, 6.4vw, 54px); line-height: 1.04; max-width: 17ch; margin: 0 auto; letter-spacing: -.03em;
  background: linear-gradient(180deg, var(--text) 30%, var(--brand-700)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.lp-hero p.sub { max-width: 54ch; margin: 18px auto 0; color: var(--text-2); font-size: clamp(15px, 2.4vw, 18px); line-height: 1.55; }
.lp-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.lp-cta .btn { padding: 14px 24px; font-size: 15px; }
.lp-section { max-width: 1020px; margin: 0 auto; padding: 16px 22px 52px; }
.lp-section > h2 { text-align: center; font-size: clamp(24px, 4vw, 32px); letter-spacing: -.02em; }
.lp-section > p.lead { text-align: center; color: var(--muted); max-width: 50ch; margin: 10px auto 32px; }
.lp-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 760px) { .lp-features { grid-template-columns: 1fr; } }
.lp-feature .ic-chip { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 14px; }
.lp-feature .ic-chip svg.ic { width: 24px; height: 24px; }
.lp-feature h3 { font-size: 17px; }
.lp-feature p { color: var(--muted); margin: 7px 0 0; font-size: 14px; line-height: 1.5; }
.lp-faq details { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: 10px; box-shadow: var(--shadow-sm); overflow: hidden; }
.lp-faq summary { cursor: pointer; padding: 16px 18px; font-weight: 600; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary::after { content: '+'; color: var(--brand-700); font-size: 22px; font-weight: 300; line-height: 1; }
.lp-faq details[open] summary::after { content: '\2013'; }
.lp-faq .ans { padding: 0 18px 16px; color: var(--text-2); line-height: 1.65; }
.lp-foot { text-align: center; padding: 34px 22px 52px; color: var(--muted); border-top: 1px solid var(--line); }
.lp-foot a { color: var(--brand-700); font-weight: 600; }

@media (max-width: 480px) {
  .lp-cta { flex-direction: column; }
  .lp-cta .btn { width: 100%; justify-content: center; }
  .lp-hero { padding: 56px 18px 44px; }
  .lp-section { padding: 12px 18px 40px; }
}

@media (max-width: 600px) {
  .lp-cta { flex-direction: column; align-items: stretch; }
  .lp-cta .btn { width: 100%; justify-content: center; }
}

/* ============================================================
   EDEL & KONTRASTREICH — Tiefe, Kontrast, Charakter
   ============================================================ */

/* Dunkler Hero (Begrüßung) — dramatischer Kontrast */
.hero { position: relative; overflow: hidden; display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; padding: 32px 34px; border-radius: var(--radius-lg); margin-bottom: 24px;
  background: linear-gradient(135deg, var(--ink-2) 0%, var(--ink) 72%); color: #fff;
  box-shadow: 0 26px 54px -26px rgba(26,18,10,.6), inset 0 1px 0 rgba(255,255,255,.05); }
.hero::before { content:''; position:absolute; right:-70px; top:-130px; width:440px; height:340px; pointer-events:none;
  background: radial-gradient(closest-side, rgba(214,95,48,.5), transparent 72%); opacity:.75; }
.hero::after { content:''; position:absolute; inset:0; pointer-events:none; opacity:.5;
  background-image: radial-gradient(rgba(255,255,255,.045) 1px, transparent 1px); background-size: 22px 22px; }
.hero > * { position: relative; z-index: 1; }
.hero h1 { color: #fff; font-size: 30px; font-weight: 800; letter-spacing: -.035em; }
.hero p { margin: 8px 0 0; color: var(--ink-text); font-size: 14.5px; }
.hero-btn { background: rgba(255,255,255,.10); color: #fff; border: 1px solid rgba(255,255,255,.20); }
.hero-btn:hover { background: rgba(255,255,255,.17); transform: translateY(-1px); }
@media (max-width: 680px){ .hero { padding: 24px 22px; } .hero h1 { font-size: 24px; } .hero-btn { width: 100%; justify-content: center; } }

/* Stärkerer Hintergrund-Charakter (weniger flach) */
body { background:
  radial-gradient(1200px 600px at 100% -10%, rgba(214,95,48,.11), transparent 56%),
  radial-gradient(900px 520px at -10% 112%, rgba(143,56,21,.07), transparent 58%),
  var(--bg); background-attachment: fixed; }
html[data-theme="dark"] body { background:
  radial-gradient(1200px 600px at 100% -10%, rgba(214,95,48,.16), transparent 56%),
  radial-gradient(900px 520px at -10% 112%, rgba(143,56,21,.12), transparent 58%),
  var(--bg); background-attachment: fixed; }

/* Karten: feine Verlaufs-Tiefe + oberer Glanz + klarere Kante */
.card, .stat, .table-wrap, .msg {
  background-image: linear-gradient(180deg, #ffffff, #fdf8f1);
  box-shadow: var(--shadow-sm), 0 16px 40px -26px rgba(40,28,16,.30), inset 0 1px 0 rgba(255,255,255,.7);
}
html[data-theme="dark"] .card, html[data-theme="dark"] .stat,
html[data-theme="dark"] .table-wrap, html[data-theme="dark"] .msg {
  background-image: linear-gradient(180deg, #241b12, #1b140d);
  box-shadow: 0 1px 2px rgba(0,0,0,.35), 0 20px 46px -26px rgba(0,0,0,.72), inset 0 1px 0 rgba(255,255,255,.04);
}

/* Stat-Karten: kräftigere Zahl, glänzender Chip, kontrastreicher Hover */
.stat .num { font-size: 36px; }
.stat .chip { box-shadow: inset 0 0 0 1px rgba(40,28,16,.05), 0 7px 16px -9px rgba(40,28,16,.45); }
.stat:hover { box-shadow: var(--shadow), 0 24px 46px -22px rgba(143,56,21,.35); }

/* Section-Heads & Tabellen kontrastreicher */
.section-head h2 { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
table.tbl th { background: var(--surface-2); }

/* Sidebar: feine Textur für mehr Tiefe */
.sidebar::after { content:''; position:absolute; inset:0; pointer-events:none; opacity:.45; z-index:0;
  background-image: radial-gradient(rgba(255,255,255,.025) 1px, transparent 1px); background-size: 20px 20px; }

/* Anhang-Bildvorschau */
.attach-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.attach-thumb { display: block; aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); transition: transform .15s, box-shadow .15s, border-color .15s; }
.attach-thumb:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: var(--shadow); }
.attach-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Ticket-Deflection: Hilfe-Artikel-Vorschläge unter dem Betreff-Feld */
.kb-deflect { margin: -4px 0 16px; border: 1px solid var(--brand-soft); background: var(--brand-tint);
  border-radius: 12px; padding: 12px 14px; animation: kb-fade .2s ease; }
@keyframes kb-fade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.kb-deflect-head { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700;
  color: var(--brand-700); margin-bottom: 8px; }
.kb-deflect-head .ic { width: 16px; height: 16px; }
.kb-deflect-list { display: grid; gap: 6px; }
.kb-deflect-item { display: block; padding: 9px 11px; border-radius: 9px; background: var(--surface);
  border: 1px solid var(--line); text-decoration: none; transition: border-color .14s, box-shadow .14s, transform .14s; }
.kb-deflect-item:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-1px); }
.kb-deflect-title { display: block; font-size: 14px; font-weight: 600; color: var(--text); }
.kb-deflect-cat { display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 600;
  color: var(--brand-700); background: var(--brand-soft); padding: 1px 7px; border-radius: 999px; vertical-align: middle; }
.kb-deflect-snippet { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.45; }

/* Öffentliche Status-Seite */
.status-hero { display:flex; align-items:center; gap:16px; padding:22px 24px; border-radius:16px;
  border:1px solid var(--line); background:var(--surface); box-shadow:var(--shadow); }
.status-hero h1 { font-size:24px; margin:0; letter-spacing:-.02em; }
.status-hero p { margin:4px 0 0; font-size:14px; }
.status-dot { width:18px; height:18px; border-radius:50%; flex:0 0 auto; position:relative; }
.status-dot::after { content:''; position:absolute; inset:-6px; border-radius:50%; opacity:.35; }
.status-hero[data-state="operational"] .status-dot { background:#16a34a; }
.status-hero[data-state="operational"] .status-dot::after { background:#16a34a; animation:status-pulse 2s infinite; }
.status-hero[data-state="maintenance"] .status-dot { background:#7c3aed; }
.status-hero[data-state="maintenance"] .status-dot::after { background:#7c3aed; animation:status-pulse 2s infinite; }
.status-hero[data-state="degraded"]    .status-dot { background:#e1640f; }
.status-hero[data-state="degraded"]    .status-dot::after { background:#e1640f; animation:status-pulse 1.4s infinite; }
@keyframes status-pulse { 0%{transform:scale(.7);opacity:.5} 70%{transform:scale(1.5);opacity:0} 100%{opacity:0} }

.status-line { margin-top:14px; }
.status-pill { display:inline-flex; align-items:center; gap:7px; font-size:13px; font-weight:600;
  padding:6px 12px; border-radius:999px; border:1px solid var(--line); background:var(--surface); }
.status-pill .ic { width:15px; height:15px; }
.status-pill .dot { width:8px; height:8px; border-radius:50%; }
.status-pill.is-on { color:#15803d; border-color:#bbf7d0; background:#f0fdf4; }
.status-pill.is-on .dot { background:#16a34a; }
.status-pill.is-off { color:var(--muted); }
.status-pill.is-off .dot { background:#9ca3af; }

.status-incidents { display:grid; gap:10px; }
.status-incident { border:1px solid var(--line); border-left-width:4px; border-radius:12px; padding:14px 16px; background:var(--surface); }
.status-incident-head { display:flex; align-items:center; gap:8px; font-size:13px; font-weight:700; }
.status-incident-head .ic { width:16px; height:16px; }
.status-incident-lvl { text-transform:uppercase; letter-spacing:.04em; font-size:11.5px; }
.status-incident.lvl-info    { border-left-color:#2563eb; }
.status-incident.lvl-warnung { border-left-color:#e1640f; }
.status-incident.lvl-wartung { border-left-color:#7c3aed; }

/* Agenten-Hilfe: KB-Artikel in die Antwort einfügen */
.kb-insert-panel { margin-top:8px; padding:12px; border:1px solid var(--line); border-radius:11px; background:var(--surface-2); }
.kb-insert-results { display:grid; gap:6px; }
.kb-insert-item { display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%;
  text-align:left; padding:8px 11px; border:1px solid var(--line); border-radius:9px; background:var(--surface);
  cursor:pointer; transition:border-color .14s, box-shadow .14s, transform .14s; font:inherit; }
.kb-insert-item:hover { border-color:var(--brand); box-shadow:var(--shadow); transform:translateY(-1px); }
.kbi-title { font-size:13.5px; font-weight:600; color:var(--text); }
.kbi-add { font-size:12px; font-weight:700; color:var(--brand-700); white-space:nowrap; }

/* Öffentlicher Footer (Gäste-Seiten) */
.pub-foot { max-width:880px; margin:32px auto 28px; padding:18px; text-align:center; border-top:1px solid var(--line); }
.pub-foot-links { display:flex; flex-wrap:wrap; gap:8px 18px; justify-content:center; }
.pub-foot-links a { display:inline-flex; align-items:center; gap:6px; color:var(--muted); text-decoration:none; font-size:13.5px; font-weight:600; transition:color .14s; }
.pub-foot-links a:hover { color:var(--brand-700); }
.pub-foot-links .ic { width:15px; height:15px; }
.pub-foot-copy { margin-top:12px; color:var(--muted); font-size:12.5px; }

/* Druckansicht: nur Inhalt, keine Navigation/Bedienelemente */
@media print {
  .sidebar, .scrim, .topbar, .menu-toggle, #cwLaunch, .cw-root, .chat-widget,
  .toast, .announce-stack, .btn, .icon-btn, textarea, input, select,
  .nav-link, .composer, .kb-deflect, .kb-insert, .no-print { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0 !important; max-width: 100% !important; }
  .detail { display: block !important; }            /* einspaltig drucken */
  .detail > aside { margin-top: 16px; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; }
  .msg { break-inside: avoid; }
  a { color: #000 !important; text-decoration: none !important; }
  body, .hero { background: #fff !important; color: #000 !important; }
  .page-head p, .muted { color: #444 !important; }
}
