/* Schrift „Manrope“ (SIL Open Font License, siehe fonts/Manrope-OFL.txt) – liegt auf dem eigenen Server,
   es werden keine Daten an Google o. Ä. übertragen (DSGVO). */
@font-face { font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url("fonts/manrope-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url("fonts/manrope-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url("fonts/manrope-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url("fonts/manrope-cyrillic-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F; }
/* ==========================================================================
   Buir-Bliesheimer · IT Service Desk
   Farben nach buir-bliesheimer.info: Grün #008858, Petrol #008776
   ========================================================================== */

:root {
  --brand: #008858;
  --brand-600: #007a4f;
  --brand-700: #006a44;
  --brand-50: #e9f6f0;
  --brand-100: #d2ecdf;
  --brand-ink: #ffffff;
  --teal: #008776;

  --bg: #f3f5f4;
  --surface: #ffffff;
  --surface-2: #f7f9f8;
  --surface-3: #eef2f0;
  --border: #e1e7e4;
  --border-strong: #cfd8d3;
  --text: #15201b;
  --muted: #5a6862;
  --faint: #89958f;

  --blue: #2563c9;   --blue-bg: #e8f0fd;
  --amber: #b77900;  --amber-bg: #fdf3dc;
  --violet: #7048e8; --violet-bg: #f0ebff;
  --green: #0a8a55;  --green-bg: #e3f5ec;
  --gray: #66736d;   --gray-bg: #eef1ef;
  --red: #d03a3a;    --red-bg: #fde8e8;
  --orange: #d8640f; --orange-bg: #fdeedf;
  --note-bg: #fff8e6; --note-border: #f1dca4;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --shadow-sm: 0 1px 2px rgba(16, 28, 22, .05), 0 1px 3px rgba(16, 28, 22, .05);
  --shadow: 0 10px 28px -12px rgba(16, 28, 22, .18), 0 2px 6px rgba(16, 28, 22, .04);
  --shadow-lg: 0 28px 70px -18px rgba(10, 24, 18, .35);
  --ring: 0 0 0 3px rgba(0, 136, 88, .25);

  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --dur: 200ms;

  --sidebar-w: 252px;
  --topbar-h: 64px;
  --tabbar-h: 64px;

  --font: "Manrope", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #14a06b; --brand-600: #12925f; --brand-700: #0f7d52;
    --brand-50: rgba(20, 160, 107, .13); --brand-100: rgba(20, 160, 107, .24);
    --bg: #0d1311; --surface: #141c19; --surface-2: #18211e; --surface-3: #1e2925;
    --border: #25322d; --border-strong: #33433d;
    --text: #e5eeea; --muted: #9caba4; --faint: #73827b;
    --blue: #6d9ef5; --blue-bg: rgba(77, 132, 236, .16);
    --amber: #f0b13d; --amber-bg: rgba(240, 177, 61, .14);
    --violet: #a68bff; --violet-bg: rgba(140, 110, 255, .16);
    --green: #3ccf8e; --green-bg: rgba(60, 207, 142, .14);
    --gray: #a3b0aa; --gray-bg: rgba(163, 176, 170, .12);
    --red: #ff7070; --red-bg: rgba(255, 90, 90, .14);
    --orange: #ff9a4d; --orange-bg: rgba(255, 140, 60, .14);
    --note-bg: rgba(240, 190, 60, .09); --note-border: rgba(240, 190, 60, .3);
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 28px 70px -18px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #14a06b; --brand-600: #12925f; --brand-700: #0f7d52;
  --brand-50: rgba(20, 160, 107, .13); --brand-100: rgba(20, 160, 107, .24);
  --bg: #0d1311; --surface: #141c19; --surface-2: #18211e; --surface-3: #1e2925;
  --border: #25322d; --border-strong: #33433d;
  --text: #e5eeea; --muted: #9caba4; --faint: #73827b;
  --blue: #6d9ef5; --blue-bg: rgba(77, 132, 236, .16);
  --amber: #f0b13d; --amber-bg: rgba(240, 177, 61, .14);
  --violet: #a68bff; --violet-bg: rgba(140, 110, 255, .16);
  --green: #3ccf8e; --green-bg: rgba(60, 207, 142, .14);
  --gray: #a3b0aa; --gray-bg: rgba(163, 176, 170, .12);
  --red: #ff7070; --red-bg: rgba(255, 90, 90, .14);
  --orange: #ff9a4d; --orange-bg: rgba(255, 140, 60, .14);
  --note-bg: rgba(240, 190, 60, .09); --note-border: rgba(240, 190, 60, .3);
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 28px 70px -18px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 500 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
img, video { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 16px; height: 16px; }
.ic.lg { width: 24px; height: 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }
::selection { background: var(--brand-100); }

/* ---------- Buttons ---------- */
.btn {
  --b-bg: var(--surface); --b-fg: var(--text); --b-bd: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: 10px;
  background: var(--b-bg); color: var(--b-fg); border: 1px solid var(--b-bd);
  font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform 120ms var(--ease), box-shadow var(--dur) var(--ease);
  -webkit-tap-highlight-color: transparent; text-decoration: none !important;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.primary { --b-bg: var(--brand); --b-fg: #fff; --b-bd: var(--brand); box-shadow: 0 6px 16px -8px rgba(0, 136, 88, .7); }
.btn.primary:hover { background: var(--brand-600); }
.btn.ghost { --b-bg: transparent; --b-bd: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }
.btn.danger { --b-fg: var(--red); }
.btn.soft { --b-bg: var(--brand-50); --b-fg: var(--brand); --b-bd: transparent; }
.btn.soft:hover { background: var(--brand-100); }
.btn.sm { min-height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.lg { min-height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn.icon { padding: 0; width: 40px; }
.btn.icon.sm { width: 32px; }
.btn.block { width: 100%; }
.btn .spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 700; color: var(--muted); }
.field .hint { font-size: 12.5px; color: var(--faint); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 13px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  font-size: 15px;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.input[readonly] { background: var(--surface-2); color: var(--muted); }
.textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
.select { appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2389958f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 18px; }
.select.sm, .input.sm { min-height: 36px; padding-top: 6px; padding-bottom: 6px; font-size: 14px; border-radius: 9px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid { display: grid; gap: 16px; }
.err { color: var(--red); font-size: 13px; font-weight: 600; min-height: 1em; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; }
.switch .track { flex: none; width: 40px; height: 24px; border-radius: 99px; background: var(--border-strong); position: relative; transition: background var(--dur) var(--ease); }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform var(--dur) var(--ease-out); }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }

/* Segmented */
.seg { display: inline-flex; background: var(--surface-3); border-radius: 11px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: transparent; padding: 7px 13px; border-radius: 8px; font-weight: 700; font-size: 13.5px; color: var(--muted); cursor: pointer; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; transition: color var(--dur), background var(--dur), box-shadow var(--dur); }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg .count { font-size: 11.5px; background: var(--border); color: var(--muted); padding: 0 6px; border-radius: 99px; line-height: 18px; }
.seg button.on .count { background: var(--brand-50); color: var(--brand); }

/* ---------- Pills / badges ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 12.5px; font-weight: 700; white-space: nowrap; background: var(--gray-bg); color: var(--gray); transition: background var(--dur), color var(--dur); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-new { background: var(--blue-bg); color: var(--blue); }
.st-open { background: var(--amber-bg); color: var(--amber); }
.st-pending { background: var(--violet-bg); color: var(--violet); }
.st-resolved { background: var(--green-bg); color: var(--green); }
.st-closed { background: var(--gray-bg); color: var(--gray); }
.st-rejected { background: var(--red-bg); color: var(--red); }
.sla-paused { color: var(--violet); }

/* Profilfoto */
.av.photo { background-color: var(--surface-3); background-size: cover; background-position: center; color: transparent; }
.photo-block { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.photo-block .hint { font-size: 12.5px; color: var(--faint); }

/* KI-Assistent */
.ai-ic { width: 26px; height: 26px; border-radius: 8px; flex: none; display: inline-grid; place-items: center; color: #fff; background: linear-gradient(135deg, #7048e8, #008858); }
.btn.ai-btn { --b-bg: var(--violet-bg); --b-fg: var(--violet); --b-bd: transparent; }
.btn.ai-btn:hover { background: color-mix(in srgb, var(--violet) 18%, transparent); }
.ai-card { margin-bottom: 14px; overflow: hidden; border-color: color-mix(in srgb, var(--violet) 28%, var(--border)); animation: fadeDown .3s var(--ease-out); }
.ai-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 14px; background: linear-gradient(90deg, var(--violet-bg), transparent 70%); flex-wrap: wrap; }
.ai-head b { font-size: 14.5px; }
.ai-head .grow { flex: 1; }
.ai-head .tag { font-size: 11.5px; }
.ai-tog .ic { transition: transform var(--dur) var(--ease); }
.ai-card.collapsed .ai-tog .ic { transform: rotate(-90deg); }
.ai-card.collapsed .ai-body { display: none; }
.ai-body { padding: 4px 16px 14px; }
.ai-sum { font-size: 15px; font-weight: 600; margin: 8px 0 10px; line-height: 1.55; }
.ai-sugs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ai-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 4px 4px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; font-weight: 600; }
.ai-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.ai-cols h4 { margin: 6px 0 6px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.ai-cols p { margin: 0 0 8px; font-size: 14px; line-height: 1.55; }
.ai-cols ol, .ai-cols ul { margin: 0 0 8px; padding-left: 20px; font-size: 14px; line-height: 1.55; display: grid; gap: 4px; }
.ai-reply { margin-top: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; background: var(--surface-2); }
.ai-reply summary { cursor: pointer; font-weight: 700; font-size: 14px; display: flex; gap: 8px; align-items: center; list-style: none; }
.ai-reply summary::-webkit-details-marker { display: none; }
.ai-reply .b-text { margin: 10px 0; font-size: 14px; }
.ai-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; font-size: 12px; color: var(--faint); }
.ai-foot { flex-wrap: nowrap; align-items: flex-start; }
.ai-foot .ic { flex: none; margin-top: 1px; }
.ai-foot-t { flex: 1; min-width: 0; }
.ai-loading { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--violet); margin: 10px 0; }
.sk { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: skel 1.4s linear infinite; margin: 8px 0; }
.sk.w70 { width: 70%; } .sk.w50 { width: 50%; }
.dots { display: inline-flex; gap: 4px; align-items: center; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .3; animation: dotb 1.1s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
.dots.sm i { width: 5px; height: 5px; }
.ai-el { font-variant-numeric: tabular-nums; color: var(--faint); font-weight: 600; }
.ai-loading .btn { margin-left: auto; }
.ai-start { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0 2px; color: var(--muted); font-weight: 600; }
.ai-dl { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ai-dl-track { flex: 1; height: 8px; border-radius: 99px; background: var(--surface); overflow: hidden; }
.ai-dl-track i { display: block; height: 100%; background: var(--violet); border-radius: inherit; transition: width .3s var(--ease); }
.callout.ai-setup { margin-bottom: 14px; background: var(--violet-bg); border-color: transparent; }
.callout.ai-setup .ic { color: var(--violet); }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes dotb { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.ai-panel { position: fixed; z-index: 65; top: 12px; right: 12px; bottom: 12px; width: min(440px, calc(100vw - 24px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); transform: translateX(calc(100% + 24px)); transition: transform .3s var(--ease-out); }
.ai-panel.open { transform: none; }
.aip-head { display: flex; gap: 10px; align-items: center; padding: 14px 14px 12px; border-bottom: 1px solid var(--border); }
.aip-head b { display: block; font-size: 15px; }
.aip-head span:not(.ai-ic) { display: block; font-size: 12px; color: var(--muted); }
.aip-head .grow { flex: 1; }
.aip-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.aim { display: flex; gap: 8px; align-items: flex-start; animation: itemIn .3s var(--ease-out) both; }
.aim.user { justify-content: flex-end; }
.aib { max-width: 88%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.55; word-break: break-word; }
.aim.user .aib { background: var(--brand); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.aim.bot .aib { background: var(--surface-2); border: 1px solid var(--border); border-top-left-radius: 4px; }
.aim.bot.err .aib { background: var(--red-bg); border-color: transparent; color: var(--red); }
.aib p { margin: 0 0 6px; } .aib p:last-child { margin-bottom: 0; }
.aib ol, .aib ul { margin: 4px 0 6px; padding-left: 20px; }
.aib code { font-size: 12.5px; background: var(--surface-3); padding: 1px 5px; border-radius: 5px; }
.aim-tools { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.aip-quick { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 10px; }
.aip-quick .btn { font-weight: 600; }
.aip-input { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--border); }
.aip-input textarea { flex: 1; resize: none; min-height: 44px; max-height: 140px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 14.5px; }
.aip-input textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.aip-foot { display: flex; gap: 6px; align-items: center; padding: 0 14px 12px; font-size: 11.5px; color: var(--faint); }
.agent-opt.prov { align-items: flex-start; }
.agent-opt.prov .h-ic { width: 38px; height: 38px; border-radius: 11px; flex: none; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
.agent-opt.prov:has(input:checked) .h-ic { background: var(--brand); color: #fff; }
.agent-opt.prov .who span { display: block; margin-top: 2px; line-height: 1.45; }

/* Lautstärke */
.vol-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; max-width: 420px; }
.vol-row > span { display: inline-flex; gap: 6px; align-items: center; font-size: 13.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.vol-row input[type=range] { flex: 1; accent-color: var(--brand); height: 28px; cursor: pointer; }
.vol-row b { min-width: 46px; text-align: right; font-variant-numeric: tabular-nums; font-size: 13.5px; }

/* Profil einer Person */
.plink { color: inherit; text-decoration: none; border-bottom: 1px dashed transparent; transition: color var(--dur), border-color var(--dur); }
.plink:hover { color: var(--brand); border-bottom-color: currentColor; text-decoration: none; }
.av.xl { width: 88px; height: 88px; font-size: 28px; }
.person-hero { display: flex; gap: 22px; align-items: center; padding: 24px; margin-bottom: 16px; position: relative; overflow: hidden; }
.person-hero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: linear-gradient(90deg, var(--brand), var(--teal)); }
.ph-main { flex: 1; min-width: 0; }
.ph-main h1 { font-size: 24px; font-weight: 800; margin-bottom: 8px; word-break: break-word; }
.ph-main h1 small { font-size: 14px; color: var(--faint); font-weight: 600; }
.ph-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-box { margin-bottom: 16px; border-color: color-mix(in srgb, var(--violet) 30%, var(--border)); }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.admin-box .hint { font-size: 13px; color: var(--muted); }
.person-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.person-stats { display: grid; gap: 12px; }
.person-stats .kpi { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.person-stats .kpi .k-ic { margin: 0; }
.person-stats .kpi .k-val { font-size: 24px; min-width: 32px; }
.person-stats .kpi .k-lbl { margin: 0; }

/* Hilfe / Anleitung */
.help-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; }
.help-toc { position: sticky; top: calc(var(--topbar-h) + 8px); display: grid; gap: 12px; }
.help-toc .search-sm { position: relative; }
.help-toc .search-sm .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.help-toc .search-sm .input { padding-left: 34px; }
.help-toc nav { display: grid; gap: 2px; }
.help-toc nav button { display: flex; gap: 10px; align-items: center; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: var(--muted); cursor: pointer; transition: background var(--dur), color var(--dur); }
.help-toc nav button:hover { background: var(--surface-3); color: var(--text); }
.help-toc nav button.on { background: var(--brand-50); color: var(--brand); }
.help-toc nav .n { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 800; background: var(--surface-3); color: var(--muted); transition: background var(--dur), color var(--dur); }
.help-toc nav button.on .n { background: var(--brand); color: #fff; }
.help-body { display: grid; gap: 18px; }
.help-sec { padding: 22px 24px; scroll-margin-top: 90px; }
.help-sec-head { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.help-sec-head .h-ic { width: 44px; height: 44px; border-radius: 13px; flex: none; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
.help-sec-head .h-num { font-size: 11.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.help-sec h2 { font-size: 19px; font-weight: 800; }
.help-intro { margin: 0 0 14px; color: var(--muted); font-size: 15.5px; line-height: 1.6; max-width: 72ch; }
.help-grid { display: grid; gap: 18px; }
.help-grid.narrow-img { grid-template-columns: 230px minmax(0, 1fr); align-items: start; }
.shot { margin: 0; position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); cursor: zoom-in; box-shadow: var(--shadow); transition: transform var(--dur) var(--ease), box-shadow var(--dur); max-width: 820px; }
.shot:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.shot img { width: 100%; height: auto; }
.shot figcaption { position: absolute; right: 10px; bottom: 10px; display: inline-flex; gap: 6px; align-items: center; padding: 5px 10px; border-radius: 99px; background: rgba(10, 20, 16, .72); color: #fff; font-size: 12px; font-weight: 700; opacity: 0; transition: opacity var(--dur); }
.shot:hover figcaption, .shot:focus-visible figcaption { opacity: 1; }
.help-steps { margin: 0; padding: 0; list-style: none; counter-reset: st; display: grid; gap: 10px; max-width: 76ch; }
.help-steps li { counter-increment: st; position: relative; padding: 2px 0 2px 40px; font-size: 15.5px; line-height: 1.6; }
.help-steps li::before { content: counter(st); position: absolute; left: 0; top: 1px; width: 27px; height: 27px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 13px; font-weight: 800; display: grid; place-items: center; }
.help-steps kbd, .help-intro kbd { font-size: 12px; }
.help-sec .callout { margin-top: 14px; }

/* Teilnehmer im Ticket */
.members { display: grid; gap: 8px; }
.member { display: flex; align-items: center; gap: 10px; font-size: 14px; animation: itemIn .3s var(--ease-out) both; }
.member .m-name { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member .m-name small { color: var(--faint); font-weight: 600; }
.members .hint { font-size: 13px; color: var(--faint); }
.composer-locked { margin-top: 18px; display: flex; gap: 14px; align-items: flex-start; background: var(--surface-2); border-style: dashed; color: var(--muted); }
.composer-locked > .ic { color: var(--faint); margin-top: 2px; }
.composer-locked b { color: var(--text); display: block; margin-bottom: 2px; }
.callout.reject { background: var(--red-bg); border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.callout.reject > .ic { color: var(--red); }
.sys.rejected .s-ic { background: var(--red-bg); color: var(--red); }
.sys.rejected .reason { border-left-color: var(--red); }
.sys.join .s-ic { background: var(--brand-50); color: var(--brand); }
.nav a.sub { padding-left: 24px; font-size: 13.5px; }
.nav a.sub .ic { width: 17px; height: 17px; }
.btn.ghost.danger { color: var(--red); }
.btn.ghost.danger:hover { background: var(--red-bg); color: var(--red); }
.pr { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.pr .bars { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.pr .bars i { width: 3px; border-radius: 1px; background: var(--border-strong); }
.pr .bars i:nth-child(1) { height: 5px; } .pr .bars i:nth-child(2) { height: 8px; } .pr .bars i:nth-child(3) { height: 12px; }
.pr-low { color: var(--gray); } .pr-low .bars i:nth-child(1) { background: currentColor; }
.pr-medium { color: var(--blue); } .pr-medium .bars i:nth-child(-n+2) { background: currentColor; }
.pr-high { color: var(--orange); } .pr-high .bars i { background: currentColor; }
.pr-critical { color: var(--red); }
.pr-critical .bars { display: none; }
.pr-critical::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 rgba(208, 58, 58, .5); animation: pulse 2s infinite; }
.role { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; }
.role-admin { background: var(--violet-bg); color: var(--violet); }
.role-agent { background: var(--brand-50); color: var(--brand); }
.role-user { background: var(--gray-bg); color: var(--gray); }
.sla { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.sla-ok { color: var(--muted); } .sla-warning { color: var(--amber); } .sla-breached { color: var(--red); } .sla-done { color: var(--green); } .sla-missed { color: var(--faint); }
.tag { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.num { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--muted); font-size: 12.5px; letter-spacing: .02em; }

/* Avatars */
.av { --c: var(--brand); width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 12.5px; font-weight: 800; color: #fff; background: var(--c); letter-spacing: .02em; user-select: none; }
.av.sm { width: 26px; height: 26px; font-size: 10.5px; }
.av.lg { width: 52px; height: 52px; font-size: 17px; }
.av.av-none { background: transparent; border: 1.5px dashed var(--border-strong); color: var(--faint); }
.prop .pill { white-space: normal; height: auto; min-height: 26px; padding-top: 3px; padding-bottom: 3px; }

/* ---------- Login ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.login-brand {
  position: relative; overflow: hidden; color: #fff; padding: 48px clamp(28px, 5vw, 72px);
  background: radial-gradient(1200px 600px at 20% 110%, #00a36a 0%, transparent 60%), linear-gradient(160deg, #008858 0%, #006e48 55%, #005538 100%);
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
}
.login-brand .rows { position: absolute; inset: 0; opacity: .14; pointer-events: none;
  background: repeating-linear-gradient(115deg, transparent 0 22px, rgba(255,255,255,.55) 22px 23px);
  mask-image: linear-gradient(180deg, transparent 0%, #000 55%, #000 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 55%, #000 100%);
  animation: rows 40s linear infinite; }
.login-brand .top { display: flex; align-items: center; gap: 14px; position: relative; }
.login-brand .top b { display: block; font-size: 17px; letter-spacing: .06em; text-transform: uppercase; }
.login-brand .top span { opacity: .8; font-size: 13px; font-weight: 600; }
.login-brand h1 { font-size: clamp(30px, 4vw, 50px); font-weight: 800; text-transform: uppercase; letter-spacing: .01em; line-height: 1.04; position: relative; }
.login-brand p { max-width: 460px; opacity: .88; font-size: 16px; position: relative; margin: 14px 0 0; }
.login-brand .feats { display: flex; flex-wrap: wrap; gap: 10px; position: relative; }
.login-brand .feats span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 99px; background: rgba(255,255,255,.12); backdrop-filter: blur(6px); font-size: 13px; font-weight: 700; }
.logo-mark { width: 54px; height: 54px; flex: none; }
.logo-mark.xl { width: 84px; height: 84px; }
.logo-mark .d { fill: #fff; stroke: #008858; stroke-width: 6; }
.logo-mark .t { fill: #008858; font: 700 34px Georgia, "Times New Roman", serif; letter-spacing: -2px; }
.login-brand .logo-mark .d { stroke: #fff; stroke-width: 3; }
.login-brand .logo-mark.draw .d { stroke-dasharray: 280; stroke-dashoffset: 280; animation: draw 1.1s var(--ease-out) .1s forwards; }
.login-form-wrap { display: grid; place-items: center; padding: 32px 20px; position: relative; }
.login-card { width: 100%; max-width: 420px; animation: rise .5s var(--ease-out) both; }
.login-card h2 { font-size: 26px; font-weight: 800; }
.login-card .sub { color: var(--muted); margin: 6px 0 26px; }
.login-card .shake { animation: shake .4s; }
.login-lang { position: absolute; top: 18px; right: 18px; }
.demo { margin-top: 26px; border-top: 1px solid var(--border); padding-top: 18px; }
.demo-title { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin-bottom: 10px; display: flex; justify-content: space-between; }
.demo-list { display: grid; gap: 6px; }
.demo-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; text-align: left; transition: border-color var(--dur), transform 120ms, background var(--dur); width: 100%; }
.demo-item:hover { border-color: var(--brand); background: var(--brand-50); }
.demo-item:active { transform: scale(.98); }
.demo-item .who { flex: 1; min-width: 0; }
.demo-item .who b { display: block; font-size: 14px; }
.demo-item .who span { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Shell ---------- */
.shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); grid-template-rows: var(--topbar-h) 1fr; grid-template-areas: "side top" "side main"; }
.sidebar { grid-area: side; position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--border); padding: 16px 12px; z-index: 20; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; color: var(--text); text-decoration: none !important; }
.brand .logo-mark { width: 42px; height: 42px; }
.brand b { display: block; font-size: 13px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; line-height: 1.2; }
.brand span { display: block; font-size: 12px; color: var(--brand); font-weight: 700; }
.nav { display: grid; gap: 3px; }
.nav-label { font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--faint); text-transform: uppercase; padding: 14px 12px 6px; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 700; font-size: 14.5px; text-decoration: none; transition: color var(--dur), background var(--dur); }
.nav a:hover { background: var(--surface-3); color: var(--text); }
.nav a.on { color: var(--brand); background: var(--brand-50); }
.nav a.on::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); animation: grow .25s var(--ease-out); }
.nav a .badge { margin-left: auto; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 800; display: inline-grid; place-items: center; }
.badge.red { background: var(--red); }
.nav-cta { margin: 6px 0 4px; }
.sidebar-foot { margin-top: auto; display: grid; gap: 8px; }
.me-card { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; text-align: left; width: 100%; transition: border-color var(--dur); }
.me-card:hover { border-color: var(--border-strong); }
.me-card .who { flex: 1; min-width: 0; }
.me-card b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-card .who > span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar { grid-area: top; position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 12px; padding: 0 24px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid transparent; transition: border-color var(--dur); }
.topbar.scrolled { border-bottom-color: var(--border); }
.topbar .m-brand { display: none; }
.search { position: relative; flex: 1; max-width: 520px; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input { width: 100%; height: 42px; padding: 0 44px 0 40px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); transition: border-color var(--dur), box-shadow var(--dur); }
.search input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
kbd { font: 700 11px var(--font); padding: 2px 6px; border-radius: 5px; border: 1px solid var(--border-strong); border-bottom-width: 2px; color: var(--muted); background: var(--surface-2); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.bell { position: relative; }
.bell .badge { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; font-size: 10.5px; padding: 0 5px; border: 2px solid var(--bg); animation: pop .35s var(--ease-out); }
.bell.ring .ic { animation: ring .7s var(--ease); transform-origin: 50% 10%; }

main.main { grid-area: main; min-width: 0; padding: 8px 28px 48px; }
.view { max-width: 1280px; margin: 0 auto; animation: viewIn .28s var(--ease-out) both; }
.view.narrow { max-width: 860px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 12px 0 22px; }
.page-head h1 { font-size: 26px; font-weight: 800; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin-bottom: 6px; }

.tabbar { display: none; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.card-head .link { font-size: 13px; font-weight: 700; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { position: relative; overflow: hidden; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); cursor: pointer; text-align: left; transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur); }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.kpi .k-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 12px; }
.kpi .k-val { font-size: 30px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .k-lbl { color: var(--muted); font-size: 13px; font-weight: 700; margin-top: 6px; }
.kpi.blue .k-ic { background: var(--blue-bg); color: var(--blue); }
.kpi.amber .k-ic { background: var(--amber-bg); color: var(--amber); }
.kpi.violet .k-ic { background: var(--violet-bg); color: var(--violet); }
.kpi.red .k-ic { background: var(--red-bg); color: var(--red); }
.kpi.green .k-ic { background: var(--green-bg); color: var(--green); }
.kpi.red.hot { border-color: color-mix(in srgb, var(--red) 40%, var(--border)); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.stack { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
.stack > *, .dash-grid > *, .rep-grid > * { min-width: 0; }

/* ---------- Ticket list ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters .select { width: auto; min-width: 140px; }
.tlist { display: grid; }
.trow {
  display: grid; grid-template-columns: 92px minmax(0, 1fr) 140px 110px 150px 140px; align-items: center; gap: 14px;
  padding: 14px 20px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none !important; cursor: pointer;
  transition: background var(--dur);
}
.trow:last-child { border-bottom: 0; }
/* Lange Status-/Fristtexte umbrechen statt in die Nachbarspalte zu laufen */
.trow > * { min-width: 0; }
.trow .pill { white-space: normal; height: auto; min-height: 26px; padding-top: 4px; padding-bottom: 4px; line-height: 1.2; max-width: 100%; }
.trow .sla { white-space: normal; line-height: 1.25; max-width: 100%; }
.trow .sla > .ic { flex: none; }
.trow:hover { background: var(--surface-2); }
.trow.head { cursor: default; padding-top: 10px; padding-bottom: 10px; font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; }
.trow .subj { min-width: 0; }
.trow .subj b { display: block; font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .subj .meta { display: flex; gap: 12px; color: var(--muted); font-size: 12.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; }
.trow .who { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; font-weight: 600; }
.trow .who > span:not(.av) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow.unread .subj b::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); margin-left: 8px; vertical-align: middle; }
.stagger > * { animation: itemIn .38s var(--ease-out) both; animation-delay: calc(min(var(--i, 0), 12) * 28ms); }

.mini-list { display: grid; grid-template-columns: minmax(0, 1fr); }
.mini { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none !important; transition: background var(--dur); }
.mini:last-child { border-bottom: 0; }
.mini:hover { background: var(--surface-2); }
.mini .body { flex: 1; min-width: 0; }
.mini .body b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .body > span { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; margin-top: 3px; }

.feed { display: grid; padding: 6px 0; }
.feed-item { display: flex; gap: 12px; padding: 10px 20px; font-size: 13.5px; color: var(--muted); }
.feed-item b { color: var(--text); }
.feed-item a { color: var(--text); font-weight: 700; }
.feed-item .t { display: block; margin-top: 2px; font-size: 12px; color: var(--faint); }

.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty .e-ic { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
.empty .e-ic .ic { width: 30px; height: 30px; }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }

/* ---------- Employee home ---------- */
.hero { position: relative; overflow: hidden; border-radius: 20px; padding: 28px clamp(20px, 4vw, 36px); color: #fff;
  background: radial-gradient(800px 300px at 90% 120%, rgba(255,255,255,.18), transparent 60%), linear-gradient(135deg, #008858, #006b46); box-shadow: 0 20px 40px -24px rgba(0, 100, 64, .8); margin: 12px 0 22px; }
.hero .rows { position: absolute; inset: 0; opacity: .1; background: repeating-linear-gradient(115deg, transparent 0 18px, #fff 18px 19px); mask-image: linear-gradient(90deg, transparent 30%, #000); -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000); }
.hero h1 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; position: relative; }
.hero p { opacity: .9; margin: 8px 0 20px; max-width: 560px; position: relative; }
.hero .btn { position: relative; --b-bg: #fff; --b-fg: #006b46; --b-bd: #fff; }
.hero .btn:hover { background: #f1faf6; }
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.quick a { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 700; font-size: 14px; text-decoration: none; transition: transform var(--dur) var(--ease), border-color var(--dur), box-shadow var(--dur); }
.quick a:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: var(--shadow); }
.quick .q-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); flex: none; }

.track-card { padding: 18px 20px; border-bottom: 1px solid var(--border); display: grid; gap: 12px; color: inherit; text-decoration: none !important; transition: background var(--dur); }
.track-card:hover { background: var(--surface-2); }
.track-card:last-child { border-bottom: 0; }
.track-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.track-top b { font-size: 15px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.step { display: grid; gap: 6px; font-size: 12px; font-weight: 700; color: var(--faint); }
.step .bar { height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.step .bar i { display: block; height: 100%; width: 0; background: var(--brand); border-radius: inherit; transition: width .6s var(--ease-out); }
.step.done { color: var(--brand); } .step.done .bar i { width: 100%; }
.step.cur { color: var(--text); } .step.cur .bar i { width: 55%; animation: shimmer 2s ease-in-out infinite; }
.step.wait .bar i { background: var(--violet); }
.track-note { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }

/* ---------- Ticket detail ---------- */
.t-back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 700; font-size: 14px; margin: 8px 0 12px; }
.t-head { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
.t-head h1 { font-size: clamp(20px, 2.4vw, 26px); font-weight: 800; margin: 6px 0 10px; word-break: break-word; }
.t-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.t-head > div:first-child { flex: 1 1 420px; }
.t-head > .t-title { flex: 1 1 340px; min-width: min(340px, 100%); }
.t-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.t-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.t-side { display: grid; gap: 14px; position: sticky; top: calc(var(--topbar-h) + 8px); }
.t-side .card-pad { padding: 16px 18px; }
.side-title { font-size: 11.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.sender { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.sender b { display: block; font-size: 16px; }
.sender div > span { color: var(--muted); font-size: 13px; }
.kv { display: grid; gap: 10px; }
.kv-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 14px; }
.kv-row .ic { color: var(--faint); width: 17px; height: 17px; }
.kv-row .v { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.kv-row .v small { display: block; font-size: 11.5px; color: var(--faint); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.props { display: grid; gap: 12px; }
.prop { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; gap: 10px; font-size: 14px; }
.prop > span:first-child { color: var(--muted); font-weight: 600; font-size: 13px; }
.prop .select { min-height: 36px; padding: 5px 34px 5px 10px; font-size: 14px; font-weight: 600; }
.assignee-box { display: flex; align-items: center; gap: 8px; min-width: 0; }
.assignee-box > span:not(.av) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }

.timeline { display: grid; gap: 14px; }
.msg { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; animation: itemIn .35s var(--ease-out) both; }
.msg .av { width: 38px; height: 38px; }
.bubble { background: var(--surface); border: 1px solid var(--border); border-radius: 4px 14px 14px 14px; padding: 13px 16px; box-shadow: var(--shadow-sm); min-width: 0; }
.msg.from-it .bubble { border-color: color-mix(in srgb, var(--brand) 22%, var(--border)); }
.msg.note .bubble { background: var(--note-bg); border-color: var(--note-border); border-style: dashed; }
.msg.first .bubble { border-left: 3px solid var(--brand); }
.msg.fresh .bubble { animation: flash 1.6s var(--ease); }
.b-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; font-size: 13px; }
.b-head b { font-size: 14px; }
.b-head .when { color: var(--faint); margin-left: auto; font-size: 12.5px; }
.b-head .note-tag { display: inline-flex; align-items: center; gap: 4px; color: var(--amber); font-weight: 800; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; }
.b-text { white-space: pre-wrap; word-break: break-word; line-height: 1.6; }
.b-tools { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.tr-box { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--brand-50); border: 1px solid var(--brand-100); animation: fadeDown .3s var(--ease-out); }
.tr-box .tr-lbl { font-size: 11.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--brand); margin-bottom: 4px; display: flex; gap: 6px; align-items: center; }
.tr-box .b-text { color: var(--text); }
.tr-btn { border: 0; background: transparent; color: var(--brand); font-weight: 700; font-size: 12.5px; display: inline-flex; gap: 5px; align-items: center; cursor: pointer; padding: 4px 8px; border-radius: 7px; }
.tr-btn:hover { background: var(--brand-50); }
.sys { display: flex; align-items: center; gap: 10px; padding: 2px 0 2px 8px; font-size: 13px; color: var(--muted); animation: itemIn .35s var(--ease-out) both; flex-wrap: wrap; }
.sys > span:nth-child(2) { flex: 1 1 200px; min-width: 0; }
.sys .s-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); flex: none; }
.sys .s-ic .ic { width: 14px; height: 14px; }
.sys b { color: var(--text); }
.sys .when { color: var(--faint); font-size: 12px; }
.sys.transfer .s-ic { background: var(--violet-bg); color: var(--violet); }
.sys .reason { flex-basis: 100%; margin-left: 36px; padding: 8px 12px; border-left: 2px solid var(--violet); background: var(--surface); border-radius: 0 8px 8px 0; color: var(--text); white-space: pre-wrap; }

/* Attachments */
.atts { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 10px; }
.att { position: relative; aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; background: var(--surface-3); border: 1px solid var(--border); cursor: zoom-in; display: grid; place-items: center; transition: transform var(--dur) var(--ease), box-shadow var(--dur); padding: 0; }
.att:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.att img, .att video { width: 100%; height: 100%; object-fit: cover; }
.att .play { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(transparent, rgba(0,0,0,.35)); color: #fff; }
.att .play .ic { width: 34px; height: 34px; fill: rgba(255,255,255,.9); stroke: none; filter: drop-shadow(0 2px 6px rgba(0,0,0,.4)); }
.att .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 8px; font-size: 11px; font-weight: 700; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.55)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.att.doc { cursor: pointer; display: flex; flex-direction: column; gap: 6px; color: var(--muted); padding: 10px; }
.att.doc .cap { position: static; background: none; color: var(--text); text-align: center; white-space: normal; word-break: break-all; }

.composer { margin-top: 18px; overflow: hidden; }
.composer .c-tabs { display: flex; gap: 2px; padding: 8px 8px 0; border-bottom: 1px solid var(--border); }
.composer .c-tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 7px; align-items: center; font-size: 14px; }
.composer .c-tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
.composer .c-tabs button.on.note-tab { color: var(--amber); border-bottom-color: var(--amber); }
.composer.is-note { background: var(--note-bg); border-color: var(--note-border); }
.composer textarea { border: 0; width: 100%; min-height: 110px; max-height: 50vh; resize: none; padding: 14px 16px; background: transparent; line-height: 1.6; font-size: 15px; display: block; }
.composer textarea:focus { outline: none; }
.c-files { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px; }
.c-files:empty { display: none; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 5px 8px 5px 5px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--border); font-size: 12.5px; font-weight: 600; max-width: 240px; animation: pop .3s var(--ease-out); }
.chip .thumb { width: 34px; height: 34px; border-radius: 7px; overflow: hidden; background: var(--border); display: grid; place-items: center; flex: none; color: var(--muted); }
.chip .thumb img, .chip .thumb video { width: 100%; height: 100%; object-fit: cover; }
.chip .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .nm small { display: block; color: var(--faint); font-weight: 600; }
.chip button { border: 0; background: none; cursor: pointer; color: var(--faint); padding: 2px; border-radius: 6px; display: grid; }
.chip button:hover { color: var(--red); background: var(--red-bg); }
.c-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; flex-wrap: wrap; }
.c-bar .grow { flex: 1; }
.c-bar .select { width: auto; min-height: 36px; padding-top: 5px; padding-bottom: 5px; font-size: 13.5px; }
.c-hint { font-size: 12px; color: var(--faint); }
.dropping { position: relative; }
.dropping::after { content: attr(data-drop); position: absolute; inset: 6px; border: 2px dashed var(--brand); border-radius: 12px; background: color-mix(in srgb, var(--brand-50) 90%, transparent); display: grid; place-items: center; font-weight: 800; color: var(--brand); z-index: 2; animation: fadeIn .15s; }

.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--brand-50); border: 1px solid var(--brand-100); align-items: flex-start; }
.callout .ic { color: var(--brand); margin-top: 2px; }
.callout.warn { background: var(--amber-bg); border-color: color-mix(in srgb, var(--amber) 30%, transparent); }
.callout.warn .ic { color: var(--amber); }

/* ---------- New ticket ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cat { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; border-radius: 13px; border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; text-align: left; font-weight: 700; font-size: 14px; transition: border-color var(--dur), background var(--dur), transform 120ms var(--ease), box-shadow var(--dur); }
.cat:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.cat:active { transform: scale(.97); }
.cat .c-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); transition: background var(--dur), color var(--dur); }
.cat.on { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 1px var(--brand) inset; }
.cat.on .c-ic { background: var(--brand); color: #fff; }
.prio-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.prio { padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; text-align: left; transition: border-color var(--dur), background var(--dur); }
.prio:hover { border-color: var(--border-strong); }
.prio .pr { font-size: 14px; }
.prio small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 4px; line-height: 1.35; font-weight: 600; }
.prio.on { border-color: currentColor; }
.prio.on.p-low { border-color: var(--gray); background: var(--gray-bg); }
.prio.on.p-medium { border-color: var(--blue); background: var(--blue-bg); }
.prio.on.p-high { border-color: var(--orange); background: var(--orange-bg); }
.prio.on.p-critical { border-color: var(--red); background: var(--red-bg); }
.dropzone { border: 2px dashed var(--border-strong); border-radius: 14px; padding: 22px; text-align: center; color: var(--muted); cursor: pointer; transition: border-color var(--dur), background var(--dur); background: var(--surface-2); }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-50); color: var(--brand); }
.dropzone .ic { width: 30px; height: 30px; margin: 0 auto 6px; display: block; }
.dropzone b { color: var(--text); }
.tip { overflow: hidden; display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease-out), opacity .35s, margin .35s; opacity: 0; }
.tip > div { min-height: 0; }
.tip.show { grid-template-rows: 1fr; opacity: 1; margin-top: 12px; }
.section-title { font-size: 15px; font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.section-title .n { width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 12px; }
.sender-strip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); flex-wrap: wrap; }
.sender-strip .who { flex: 1; min-width: 180px; }
.sender-strip .who b { display: block; }
.sender-strip .who span { font-size: 13px; color: var(--muted); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }

/* ---------- Users / reports ---------- */
.m-only { display: none !important; }
.urow { display: grid; grid-template-columns: minmax(150px, 1.3fr) minmax(0, 1.3fr) 150px minmax(0, 1fr) 96px 40px; gap: 14px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--border); font-size: 14px; }
.urow:last-child { border-bottom: 0; }
.urow.head { font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); background: var(--surface-2); padding-top: 10px; padding-bottom: 10px; border-radius: var(--radius) var(--radius) 0 0; }
.urow .person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.urow .person div { min-width: 0; }
.urow .person b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.urow .person div > span, .urow .ell { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.urow.off { opacity: .55; }
.state-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; }
.state-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.state-dot.off::before { background: var(--faint); }
.bars-chart { display: grid; gap: 12px; padding: 18px 20px; }
.bc-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 40px; gap: 12px; align-items: center; font-size: 13.5px; font-weight: 600; }
.bc-row .track { height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bc-row .track i { display: block; height: 100%; border-radius: inherit; background: var(--brand); width: 0; transition: width .8s var(--ease-out); }
.bc-row b { text-align: right; font-variant-numeric: tabular-nums; }
.rep-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ---------- Dropdown / menus ---------- */
.pop { position: fixed; z-index: 60; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; transform-origin: top right; animation: popIn .18s var(--ease-out); }
.pop.closing { animation: popOut .14s var(--ease) forwards; }
.pop .item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: none; border-radius: 9px; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--text); text-align: left; text-decoration: none !important; }
.pop .item:hover { background: var(--surface-3); }
.pop .item .ic { color: var(--muted); }
.pop .sep { height: 1px; background: var(--border); margin: 6px 4px; }
.pop .p-head { padding: 10px 12px 8px; }
.pop .p-head b { display: block; } .pop .p-head span { font-size: 12.5px; color: var(--muted); }
.notif-pop { width: min(380px, calc(100vw - 24px)); padding: 0; overflow: hidden; }
.notif-pop .n-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.notif-pop .n-head > * { min-width: 0; }
.notif-list { max-height: min(440px, 65vh); overflow-y: auto; }
.notif { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background var(--dur); width: 100%; border-left: 0; border-right: 0; border-top: 0; background: none; text-align: left; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: var(--brand-50); }
.notif .n-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); flex: none; }
.notif.unread .n-ic { background: var(--brand); color: #fff; }
.notif .n-body { flex: 1; min-width: 0; font-size: 13.5px; }
.notif .n-body small { display: block; color: var(--faint); font-size: 12px; margin-top: 2px; }

/* ---------- Modal ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; }
.backdrop { position: absolute; inset: 0; background: rgba(8, 18, 14, .5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fadeIn .2s var(--ease); }
.modal { position: relative; width: 100%; max-width: 520px; max-height: calc(100dvh - 40px); overflow: auto; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); animation: modalIn .28s var(--ease-out); }
.modal.wide { max-width: 680px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 6px; }
.modal-head h3 { font-size: 19px; font-weight: 800; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.modal-body { padding: 14px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 22px 20px; flex-wrap: wrap; }
.modal-wrap.closing .backdrop { animation: fadeOut .18s forwards; }
.modal-wrap.closing .modal { animation: modalOut .18s var(--ease) forwards; }
.agent-pick { display: grid; gap: 8px; max-height: 300px; overflow: auto; padding: 2px; }
.agent-opt { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--border); cursor: pointer; transition: border-color var(--dur), background var(--dur); }
.agent-opt:hover { border-color: var(--border-strong); }
.agent-opt input { position: absolute; opacity: 0; }
.agent-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.agent-opt:has(input:focus-visible) { box-shadow: var(--ring); }
.agent-opt .who { flex: 1; min-width: 0; }
.agent-opt .who b { display: block; font-size: 14px; }
.agent-opt .who span { font-size: 12.5px; color: var(--muted); }
.load { font-size: 12px; font-weight: 700; color: var(--muted); text-align: right; }
.load .lb { width: 70px; height: 5px; border-radius: 99px; background: var(--surface-3); margin-top: 4px; overflow: hidden; }
.load .lb i { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.canned { display: grid; gap: 6px; max-height: 340px; overflow: auto; }
.canned button { text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 10px 12px; cursor: pointer; transition: border-color var(--dur), background var(--dur); }
.canned button:hover { border-color: var(--brand); background: var(--brand-50); }
.canned b { display: block; font-size: 14px; }
.canned span { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(5, 10, 8, .9); display: grid; grid-template-rows: auto 1fr; animation: fadeIn .2s; }
.lightbox .lb-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; color: #fff; }
.lightbox .lb-bar span { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox .lb-bar .btn { --b-bg: rgba(255,255,255,.1); --b-fg: #fff; --b-bd: transparent; }
.lightbox .lb-body { display: grid; place-items: center; padding: 0 16px 24px; min-height: 0; }
.lightbox img, .lightbox video { max-width: 100%; max-height: calc(100dvh - 90px); border-radius: 8px; animation: zoomIn .28s var(--ease-out); }

/* Toasts */
.toasts { position: fixed; z-index: 90; right: 20px; bottom: 20px; display: grid; gap: 10px; width: min(380px, calc(100vw - 24px)); pointer-events: none; }
.toast { pointer-events: auto; position: relative; overflow: hidden; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: toastIn .38s var(--ease-out); cursor: default; }
.toast.link { cursor: pointer; }
.toast.out { animation: toastOut .25s var(--ease) forwards; }
.toast .t-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); flex: none; }
.toast.error .t-ic { background: var(--red-bg); color: var(--red); }
.toast .t-body { flex: 1; min-width: 0; font-size: 13.5px; }
.toast .t-body b { display: block; font-size: 14px; }
.toast .t-body span { color: var(--muted); }
.toast .prog { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--brand); animation: prog linear forwards; transform-origin: left; width: 100%; }

.success-burst { display: grid; place-items: center; padding: 60px 20px; text-align: center; animation: viewIn .3s var(--ease-out); }
.success-burst .ring { width: 84px; height: 84px; border-radius: 50%; background: var(--brand); display: grid; place-items: center; color: #fff; animation: popBig .5s var(--ease-out); box-shadow: 0 0 0 0 rgba(0,136,88,.4); }
.success-burst .ring .ic { width: 42px; height: 42px; stroke-width: 2.6; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .45s var(--ease-out) .25s forwards; }
.success-burst h2 { font-size: 24px; font-weight: 800; margin-top: 20px; }
.success-burst p { color: var(--muted); }

.kbd-help { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; align-items: center; font-size: 14px; }

/* ---------- Keyframes ---------- */
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes itemIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes modalOut { to { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes popIn { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes popOut { to { opacity: 0; transform: translateY(-4px) scale(.98); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes popBig { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); box-shadow: 0 0 0 18px rgba(0,136,88,0); } }
@keyframes zoomIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }
@keyframes prog { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes shake { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(208,58,58,.45); } 70% { box-shadow: 0 0 0 7px rgba(208,58,58,0); } 100% { box-shadow: 0 0 0 0 rgba(208,58,58,0); } }
@keyframes ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(14deg); } 40% { transform: rotate(-12deg); } 60% { transform: rotate(8deg); } 80% { transform: rotate(-4deg); } }
@keyframes flash { 0% { box-shadow: 0 0 0 3px rgba(0,136,88,.35); } 100% { box-shadow: var(--shadow-sm); } }
@keyframes shimmer { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes rows { from { background-position: 0 0; } to { background-position: 400px 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .dash-grid { grid-template-columns: 1fr; }
  .trow { grid-template-columns: 84px minmax(0, 1fr) 136px 104px 130px; }
  .trow > :nth-child(6) { display: none; }
  .t-grid { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 1023px) {
  :root { --sidebar-w: 76px; }
  .sidebar { padding: 14px 10px; align-items: center; }
  .brand { padding: 4px 0 16px; }
  .brand > div, .nav-label, .nav a .lbl, .me-card .who, .nav-cta .lbl { display: none; }
  .nav a, .nav a.sub { justify-content: center; padding: 12px; }
  .nav a .badge { position: absolute; top: 3px; right: 3px; min-width: 18px; height: 18px; font-size: 10.5px; }
  .nav-cta { width: 48px; padding: 0; }
  .me-card { justify-content: center; padding: 6px; width: auto; }
  .dash-grid, .rep-grid { grid-template-columns: 1fr; }
  .t-grid { grid-template-columns: 1fr; }
  .help-layout { grid-template-columns: 1fr; }
  .help-toc { position: static; }
  .t-side { position: static; grid-row: 1; grid-template-columns: 1fr 1fr; }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .urow { grid-template-columns: minmax(150px, 1.3fr) minmax(0, 1.3fr) 150px 96px 40px; }
  .urow > :nth-child(4) { display: none; }
}
@media (max-width: 767px) {
  body { font-size: 15px; }
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; grid-template-areas: "top" "main"; }
  .sidebar { display: none; }
  .topbar { padding: 0 12px; height: 58px; gap: 8px; padding-top: env(safe-area-inset-top); height: calc(58px + env(safe-area-inset-top)); }
  .topbar .m-brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none !important; }
  .topbar .m-brand .logo-mark { width: 34px; height: 34px; }
  .topbar .m-brand b { font-size: 13px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
  .search { display: none; }
  .search.m-open { display: block; position: absolute; left: 8px; right: 8px; top: calc(8px + env(safe-area-inset-top)); max-width: none; animation: fadeIn .15s; }
  .search kbd { display: none; }
  .top-actions .hide-m { display: none; }
  main.main { padding: 4px 14px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); }
  .page-head { margin: 10px 0 16px; }
  .page-head h1 { font-size: 22px; }
  .page-head .btn.hide-m { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--border); }
  .tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--faint); font-size: 11px; font-weight: 700; text-decoration: none !important; -webkit-tap-highlight-color: transparent; }
  .tabbar a.on { color: var(--brand); }
  .tabbar a .ic { transition: transform .25s var(--ease-out); }
  .tabbar a.on .ic { transform: translateY(-1px) scale(1.08); }
  .tabbar a .badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 17px; height: 17px; font-size: 10px; padding: 0 4px; }
  .tabbar .fab { align-self: center; justify-self: center; width: 50px; height: 50px; border-radius: 16px; background: var(--brand); color: #fff; box-shadow: 0 10px 20px -8px rgba(0,136,88,.8); }
  .tabbar .fab .ic { width: 24px; height: 24px; }
  .tabbar .fab:active { transform: scale(.94); }

  .login { grid-template-columns: 1fr; }
  .login-brand { padding: 28px 22px 30px; gap: 18px; }
  .login-brand h1 { font-size: 28px; }
  .login-brand .feats, .login-brand p { display: none; }
  .login-form-wrap { padding: 26px 18px 40px; place-items: start center; }
  .login-lang { position: static; justify-self: end; margin-bottom: 10px; }
  .login-brand .top { padding-right: 90px; }

  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpis .kpi:first-child { grid-column: span 2; }
  .kpi { padding: 14px; }
  .kpi .k-val { font-size: 26px; }
  .trow.head { display: none; }
  .trow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "num st" "subj subj" "who pr"; gap: 6px 10px; padding: 14px 16px; }
  .trow > :nth-child(1) { grid-area: num; } .trow > :nth-child(2) { grid-area: subj; }
  .trow > :nth-child(3) { grid-area: st; justify-self: end; } .trow > :nth-child(4) { grid-area: pr; justify-self: end; }
  .trow > :nth-child(5) { grid-area: who; } .trow > :nth-child(6) { display: none; }
  .trow .subj b { white-space: normal; }
  .toolbar { gap: 8px; }
  .toolbar > input[type=search] { flex: 1 1 100%; max-width: none !important; }
  .filters { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .filters .select { min-width: 0; width: 100%; }
  .t-head { margin-bottom: 12px; }
  .t-actions { width: 100%; }
  .t-actions .btn { flex: 1; }
  /* Handy: erst das Gespräch, Details darunter (Absender steht ohnehin in der ersten Nachricht) */
  .t-side { grid-template-columns: 1fr; grid-row: auto; }
  .ai-cols { grid-template-columns: 1fr; gap: 4px; }
  .ai-panel { inset: 0; width: auto; border-radius: 0; border: 0; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); transform: translateY(100%); }
  .person-hero { flex-direction: column; align-items: flex-start; gap: 14px; padding: 20px 16px; }
  .person-grid { grid-template-columns: 1fr; }
  .person-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .person-stats .kpi { flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; }
  .person-stats .kpi .k-lbl { font-size: 12px; }
  .admin-actions .btn { flex: 1 1 auto; }
  /* Hilfe am Handy: Inhaltsverzeichnis als waagerechte Leiste, Bilder volle Breite */
  .help-toc nav { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 4px; scrollbar-width: none; }
  .help-toc nav::-webkit-scrollbar { display: none; }
  .help-toc nav button { white-space: nowrap; background: var(--surface); border: 1px solid var(--border); flex: none; }
  .help-sec { padding: 18px 16px; }
  .help-sec h2 { font-size: 17px; }
  .help-grid.narrow-img { grid-template-columns: 1fr; }
  .help-grid.narrow-img .shot { max-width: 260px; }
  .help-steps li { font-size: 15px; padding-left: 36px; }
  .page-head .seg { width: 100%; }
  .msg { grid-template-columns: 30px minmax(0, 1fr); gap: 8px; }
  .msg .av { width: 30px; height: 30px; font-size: 11px; }
  .bubble { padding: 11px 13px; }
  .cat-grid { grid-template-columns: 1fr 1fr; }
  .prio-grid { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .quick { grid-template-columns: 1fr 1fr; }
  .quick a { flex-direction: column; align-items: flex-start; font-size: 13px; }
  .steps { gap: 4px; } .step { font-size: 10.5px; }
  .track-top { flex-direction: column-reverse; align-items: flex-start; gap: 6px; }
  .urow.head { display: none; }
  .m-only { display: block !important; margin-top: 3px; }
  .urow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "p e" "m s"; gap: 6px 10px; }
  .urow > :nth-child(1) { grid-area: p; } .urow > :nth-child(2) { grid-area: m; }
  .urow > :nth-child(3) { display: none; } .urow > :nth-child(5) { grid-area: s; justify-self: end; } .urow > :nth-child(6) { grid-area: e; justify-self: end; }
  .bc-row { grid-template-columns: 100px minmax(0, 1fr) 32px; font-size: 12.5px; }
  .modal-wrap { place-items: end center; padding: 0; }
  .modal { max-width: none !important; border-radius: 20px 20px 0 0; max-height: 92dvh; padding-bottom: env(safe-area-inset-bottom); animation: sheetIn .32s var(--ease-out); }
  .modal-wrap.closing .modal { animation: sheetOut .2s var(--ease) forwards; }
  .modal-foot .btn { flex: 1; }
  .toasts { left: 12px; right: 12px; width: auto; bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); }
  .composer .c-bar .c-hint { display: none; }
  .form-actions .btn { flex: 1; }
}
@keyframes sheetIn { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheetOut { to { transform: translateY(100%); } }

@media (hover: none) {
  .kpi:hover, .quick a:hover, .att:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .login-brand .rows { animation: none; }
}

/* ---------- Animierte Anleitungen (Hilfe) ---------- */
.demo { position: relative; margin: 0; max-width: 860px; border-radius: 14px; cursor: zoom-in; outline: none; }
.demo:focus-visible .demo-stage { box-shadow: 0 0 0 3px var(--brand), var(--shadow); }
.demo.phone { max-width: 290px; }
.demo-stage { position: relative; width: 100%; overflow: hidden; border-radius: 14px; background: var(--surface-2) center top / cover no-repeat; border: 1px solid var(--border); box-shadow: 0 16px 40px -22px rgba(0, 0, 0, .45); isolation: isolate; transition: box-shadow var(--dur); }
.demo:hover .demo-stage { box-shadow: 0 22px 50px -22px rgba(0, 0, 0, .55); }
.demo.phone .demo-stage { border-radius: 34px; border: 9px solid #17201c; }
.demo-cam { position: absolute; left: 0; top: 0; transform-origin: 0 0; transition: transform 1s cubic-bezier(.22, .8, .2, 1); will-change: transform; }
.demo-cam iframe { display: block; border: 0; pointer-events: none; background: var(--bg); visibility: hidden; }
.demo.started .demo-cam iframe { visibility: visible; }
.demo-cursor { position: absolute; left: 0; top: 0; z-index: 5; pointer-events: none; transition: transform .6s cubic-bezier(.3, .75, .25, 1); filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .35)); }
.demo-cursor svg { display: block; width: 36px; height: 36px; transform-origin: 6px 4px; transition: transform .14s; }
.demo-cursor.down svg { transform: scale(.8); }
.demo:not(.started) .demo-cursor { opacity: 0; }
.demo-ripple { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 4; pointer-events: none; }
.demo-ripple::after { content: ''; position: absolute; left: -26px; top: -26px; width: 52px; height: 52px; border-radius: 50%; background: rgba(0, 136, 88, .25); border: 2px solid rgba(0, 136, 88, .6); opacity: 0; }
.demo-ripple.on::after { animation: demo-rip .6s ease-out; }
@keyframes demo-rip { 0% { opacity: 1; transform: scale(.2); } 100% { opacity: 0; transform: scale(1.5); } }
.demo-ring { position: absolute; left: 0; top: 0; border-radius: 12px; border: 3px solid #f5b400; opacity: 0; z-index: 3; pointer-events: none; transition: opacity .3s; }
.demo-ring.on { opacity: 1; animation: demo-ring 1.5s ease-in-out infinite; }
@keyframes demo-ring { 0%, 100% { box-shadow: 0 0 0 4px rgba(245, 180, 0, .25), 0 0 22px rgba(245, 180, 0, .45); } 50% { box-shadow: 0 0 0 10px rgba(245, 180, 0, .1), 0 0 34px rgba(245, 180, 0, .3); } }
.demo-cap { position: absolute; left: 50%; bottom: 14px; transform: translate(-50%, 8px); width: max-content; max-width: calc(100% - 28px); padding: 8px 15px; border-radius: 999px; background: rgba(14, 22, 18, .86); color: #fff; font-weight: 650; font-size: clamp(11.5px, 1.5vw, 14.5px); line-height: 1.3; text-align: center; opacity: 0; transition: opacity .3s, transform .35s var(--ease-out); z-index: 6; backdrop-filter: blur(8px); pointer-events: none; }
.demo-cap.on { opacity: 1; transform: translate(-50%, 0); }
.demo-keys { position: absolute; left: 50%; top: 40%; display: flex; gap: 10px; align-items: center; opacity: 0; z-index: 7; pointer-events: none; transform: translate(-50%, -50%) scale(.85); transition: opacity .2s, transform .3s var(--ease-out); }
.demo-keys.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.demo-keys kbd { min-width: 54px; padding: 12px 16px; font: 800 22px/1 system-ui, sans-serif; text-align: center; border-radius: 12px; background: #fff; color: #111; border: 1px solid #cfd6d2; box-shadow: 0 4px 0 #b6bfba, 0 14px 30px rgba(0, 0, 0, .35); }
.demo-keys span { color: #fff; font-weight: 800; font-size: 20px; text-shadow: 0 1px 6px rgba(0, 0, 0, .7); }
.demo-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(0, 0, 0, .07); z-index: 6; }
.demo-prog i { display: block; height: 100%; width: 0; background: var(--brand); }
.demo-cover { position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--surface) 70%, transparent); opacity: 0; transition: opacity .35s; z-index: 8; pointer-events: none; }
.demo-cover.on { opacity: 1; }
.demo.started .demo-cover.on { background: var(--surface); }
.demo-spin { width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
.demo-play { position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%; border: 0; background: rgba(14, 22, 18, .78); color: #fff; display: grid; place-items: center; z-index: 9; transition: opacity .25s, transform .2s; }
.demo-play:hover { transform: scale(1.06); }
.demo-play svg { width: 28px; height: 28px; fill: currentColor; margin-left: 4px; }
.demo.is-playing .demo-play { opacity: 0; pointer-events: none; }
.demo-lb .lb-body { place-items: center; }
.demo-big { width: min(94vw, calc((100dvh - 170px) * 1.6)); max-width: 1500px; cursor: default; }
.demo-big.phone { width: min(92vw, calc((100dvh - 170px) * .5)); }
.help-grid .demo + .help-steps { margin-top: 2px; }
@media (max-width: 767px) { .demo.phone { max-width: 250px; } .demo-cap { bottom: 10px; padding: 6px 11px; } .demo-keys kbd { min-width: 40px; padding: 8px 11px; font-size: 16px; } }
.demo.phone .demo-cap { top: 12px; bottom: auto; transform: translate(-50%, -8px); }
.demo.phone .demo-cap.on { transform: translate(-50%, 0); }

/* Untertitel und Tasten UNTER dem Video – nichts liegt mehr über der Oberfläche */
.demo-sub { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 9px 6px 0; text-align: center; }
.demo .demo-cap, .demo.phone .demo-cap { position: static; transform: translateY(4px); width: auto; max-width: 100%; padding: 0; background: none; backdrop-filter: none; border-radius: 0; color: var(--text); font-size: clamp(12.5px, 1.4vw, 14.5px); font-weight: 650; line-height: 1.35; opacity: 0; transition: opacity .3s, transform .3s var(--ease-out); }
.demo .demo-cap.on, .demo.phone .demo-cap.on { opacity: 1; transform: none; }
.demo .demo-keys { position: static; display: inline-flex; gap: 5px; transform: scale(.85); opacity: 0; width: 0; overflow: hidden; transition: opacity .2s, transform .25s var(--ease-out); }
.demo .demo-keys.on { opacity: 1; transform: none; width: auto; overflow: visible; }
.demo .demo-keys kbd { min-width: 30px; padding: 5px 9px; font: 800 14px/1 system-ui, sans-serif; border-radius: 8px; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong, #cfd6d2); box-shadow: 0 2px 0 var(--border-strong, #b6bfba); }
.demo .demo-keys span { color: var(--muted); text-shadow: none; font-size: 13px; }
.demo-lb .demo .demo-cap { color: #fff; font-size: 16px; }
.demo-lb .demo .demo-keys kbd { background: #fff; color: #111; }

/* Lange Knopftexte in Hinweisboxen umbrechen (z. B. RU am Handy) */
.callout > div { min-width: 0; }
.callout .btn { white-space: normal; height: auto; min-height: 32px; padding-top: 6px; padding-bottom: 6px; text-align: left; max-width: 100%; }

/* KI-Chat: auf breiten Bildschirmen angedockt – das Ticket rückt zur Seite statt verdeckt zu werden */
.shell { transition: padding-right .3s var(--ease-out); }
@media (min-width: 1100px) { html.ai-docked .shell { padding-right: 452px; } html.ai-docked .ai-panel { top: 0; right: 0; bottom: 0; border-radius: 0; border-width: 0 0 0 1px; box-shadow: none; width: 452px; } }
@media (min-width: 1100px) and (max-width: 1760px) { html.ai-docked .t-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Server-Version: Anmeldung ohne Passwort ---------- */
.code-input { font-size: 26px; font-weight: 800; letter-spacing: .45em; text-align: center; font-variant-numeric: tabular-nums; padding-left: .45em; }
.login-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.login-links .link { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--brand); font-weight: 700; font-size: 13.5px; cursor: pointer; padding: 4px 0; }
.login-links .link:hover { text-decoration: underline; }
.or-sep { display: flex; align-items: center; gap: 12px; margin: 16px 0 12px; color: var(--muted); font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.or-sep::before, .or-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.ms-btn { gap: 10px; background: var(--surface); border-color: var(--border-strong, #cfd6d2); color: var(--text); text-decoration: none !important; }
.ms-btn:hover { border-color: var(--text); }
.login-hint { display: flex; gap: 8px; align-items: flex-start; margin: 16px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.login-hint .ic { flex: none; margin-top: 1px; }

/* System-Karte (Einstellungen) */
.sys-info { display: grid; gap: 6px; font-size: 14px; color: var(--text); }
.sys-info > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.sys-info > div > span:first-child { color: var(--muted); }
.sys-info > div > span:last-child { text-align: right; overflow-wrap: anywhere; }
.sys-info .ok { color: var(--green, #15803d); } .sys-info .bad { color: var(--red, #dc2626); }

.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sys-info .bad-text { color: var(--red); }

/* Import-Vorschau */
.imp-out:empty { display: none; }
.imp-out { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2, transparent); }
.imp-sum { font-weight: 700; }
.imp-row { display: flex; gap: 10px; align-items: flex-start; }
.imp-row > svg { flex: none; margin-top: 3px; color: var(--muted); }
.imp-row.ok > svg { color: var(--green); } .imp-row.warn > svg { color: var(--red); }
.imp-row .hint { overflow-wrap: anywhere; }
