/* Design-Tokens 1:1 von sdr.nrw übernommen */
:root {
  --amber: #FCB040; --amber-h: #e8971a; --amber-t: rgba(252,176,64,.11); --amber-b: rgba(252,176,64,.28);
  --sky: #94d1e7; --navy: #020122; --navy2: #050340;
  --bg: #ffffff; --bg2: #f4f5f7; --surface: #ffffff; --border: #e5e6ea; --border2: #c8cad4;
  --t-head: #0d0c20; --t-body: #3d3c52; --t-muted: #7a7990;
  --nav-bg: #ffffff; --nav-border: rgba(0,0,0,.08); --nav-act: rgba(252,176,64,.1); --nav-logo-f: none;
  --ok: #1f9d63; --ok-t: rgba(31,157,99,.12); --err: #d64545; --err-t: rgba(214,69,69,.1); --info: #2c8fb8; --info-t: rgba(148,209,231,.22);
  --sh: 0 1px 2px rgba(13,12,32,.05); --sh2: 0 8px 28px rgba(13,12,32,.12);
  --r: 10px; --rl: 14px; --rpill: 999px;
  --f: 'Poppins', system-ui, sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0e0d1e; --bg2: #161528; --surface: #1c1b2f; --border: #2a2840; --border2: #3d3b58;
  --t-head: #f0eff8; --t-body: #a8a7c0; --t-muted: #6b6a82;
  --nav-bg: #0a0919; --nav-border: rgba(255,255,255,.07); --nav-act: rgba(252,176,64,.12); --nav-logo-f: brightness(0) invert(1);
  --ok-t: rgba(31,157,99,.2); --err-t: rgba(214,69,69,.18); --info-t: rgba(148,209,231,.14);
  --sh: 0 2px 10px rgba(0,0,0,.32); --sh2: 0 8px 32px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--f); font-size: 15px; line-height: 1.6; color: var(--t-body); background: var(--bg2); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { color: var(--t-head); font-weight: 700; line-height: 1.25; margin: 0; }
h1 { font-size: 1.55rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; font-weight: 600; }
a { color: inherit; }
.hl { color: var(--amber); }
.muted { color: var(--t-muted); }
.small { font-size: .85rem; }
.mono { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* Topbar wie auf sdr.nrw */
.topbar { background: var(--navy); color: rgba(255,255,255,.75); font-size: .8rem; padding: 6px 24px; display: flex; gap: 22px; }
.topbar a { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.topbar a:hover { color: #fff; }
.topbar svg { width: 13px; height: 13px; color: var(--amber); }

/* Banner während der Benutzeransicht (Impersonation) */
.impersonation-bar { background: var(--amber); color: var(--navy); font-size: .85rem; padding: 8px 24px; display: flex; align-items: center; gap: 12px; }
.impersonation-bar svg { width: 18px; height: 18px; flex: none; }
.impersonation-bar span { flex: 1; }
.impersonation-bar .btn { background: var(--navy); color: #fff; }
.impersonation-bar .btn:hover { background: var(--navy2); }

/* Header */
.header { background: var(--nav-bg); border-bottom: 1px solid var(--nav-border); height: 72px; padding: 0 24px; display: flex; align-items: center; gap: 16px; position: relative; z-index: 20; }
.header .logo img { height: 44px; display: block; filter: var(--nav-logo-f); }
.header .logo { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.header .logo span { font-size: .8rem; font-weight: 600; color: var(--t-muted); border-left: 1px solid var(--border); padding-left: 14px; }
.header .spacer { flex: 1; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg2); color: var(--t-head); display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { border-color: var(--amber-b); }
.icon-btn svg { width: 18px; height: 18px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: var(--rpill); border: 1px solid var(--border); background: var(--surface); cursor: pointer; font: inherit; color: var(--t-head); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--amber); color: var(--navy); font-weight: 700; font-size: .8rem; display: grid; place-items: center; flex: none; }
.user-chip .meta { text-align: left; line-height: 1.2; padding-right: 8px; }
.user-chip .meta b { display: block; font-size: .85rem; font-weight: 600; }
.user-chip .meta small { color: var(--t-muted); font-size: .72rem; }
.menu { position: absolute; right: 24px; top: 66px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh2); padding: 6px; min-width: 210px; z-index: 30; }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 9px; border: 0; background: none; font: inherit; color: var(--t-body); cursor: pointer; text-decoration: none; }
.menu a:hover, .menu button:hover { background: var(--nav-act); color: var(--t-head); }
#nav-toggle { display: none; }

/* Layout */
/* App-Layout: Kopfzeile und Navigation fest, nur der Inhalt scrollt */
.app-shell { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.app-shell > .topbar, .app-shell > .impersonation-bar, .app-shell > .header { flex: none; }
.shell { display: grid; grid-template-columns: 290px 1fr; flex: 1; min-height: 0; }
.sidebar { background: var(--nav-bg); border-right: 1px solid var(--nav-border); padding: 24px 18px; display: flex; flex-direction: column; overflow-y: auto; }
.sidebar .sidebar-inner { display: flex; flex-direction: column; flex: 1; }
/* Fußbereich der Navigation: Firmenkarte und Hilfe */
.sidebar-foot { margin-top: auto; padding-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.org-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.org-card:hover { border-color: var(--amber-b); box-shadow: var(--sh); }
.org-logo { width: 38px; height: 38px; border-radius: 9px; background: var(--navy); color: var(--amber); font-weight: 700; font-size: .85rem; display: grid; place-items: center; flex: none; letter-spacing: .02em; }
[data-theme="dark"] .org-logo { background: var(--amber); color: var(--navy); }
.org-meta { min-width: 0; flex: 1; line-height: 1.3; }
.org-meta b { display: block; color: var(--t-head); font-size: .86rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-meta small { color: var(--t-muted); font-size: .74rem; }
.org-meta .mono { color: var(--t-head); font-weight: 600; }
.org-arrow { color: var(--t-muted); font-size: 1.2rem; line-height: 1; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 11px; color: var(--t-body); text-decoration: none; font-weight: 500; font-size: .92rem; margin-bottom: 2px; }
.sidebar nav a:hover { color: var(--t-head); background: var(--bg2); }
.sidebar nav a.active { background: var(--nav-act); color: var(--t-head); }
.sidebar nav a.active svg { color: var(--amber); }
.sidebar nav svg { width: 19px; height: 19px; flex: none; }
.sidebar nav .count { margin-left: auto; background: var(--amber); color: var(--navy); font-size: .7rem; font-weight: 700; border-radius: var(--rpill); padding: 1px 8px; }
.sidebar .section { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--t-muted); padding: 16px 14px 6px; }
/* Hilfe-Karte unten in der Navigation */
.help { padding: 18px; border-radius: var(--r); background: var(--bg2); border: 1px solid var(--border); font-size: .82rem; line-height: 1.5; }
.help-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.help-icon { width: 38px; height: 38px; border-radius: 50%; background: var(--amber-t); border: 1px solid var(--amber-b); color: var(--amber-h); display: grid; place-items: center; flex: none; }
.help-icon svg { width: 18px; height: 18px; }
.help-head b { display: block; color: var(--t-head); font-size: .9rem; font-weight: 600; line-height: 1.3; }
.help-head small { color: var(--t-muted); font-size: .75rem; }
.help p { margin: 0 0 14px; color: var(--t-body); }
.help .btn { width: 100%; }
.help .help-link { display: block; text-align: center; margin-top: 10px; color: var(--t-muted); font-weight: 500; text-decoration: none; }
.help .help-link:hover { color: var(--t-head); }
main { padding: 28px clamp(16px, 2.5vw, 40px) 60px; width: 100%; min-width: 0; overflow-y: auto; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.eyebrow { display: block; color: var(--t-muted); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--t-muted); text-decoration: none; font-size: .85rem; margin-bottom: 10px; }
.back:hover { color: var(--t-head); }
.back svg { width: 16px; height: 16px; }

/* Karten */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh); }
.card-pad { padding: 22px 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.stack > * + * { margin-top: 18px; }

.kpi { padding: 22px 24px; text-decoration: none; display: block; transition: border-color .15s, transform .15s; }
a.kpi:hover { border-color: var(--amber-b); transform: translateY(-2px); }
.kpi .label { font-size: .82rem; color: var(--t-muted); font-weight: 500; }
.kpi { border-left: 3px solid var(--amber); }
.kpi .value { font-size: 1.7rem; font-weight: 700; color: var(--t-head); line-height: 1.2; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: .82rem; }

/* Buttons wie auf sdr.nrw */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border-radius: 8px; border: 1px solid transparent; font: 600 .9rem var(--f); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .15s; }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--amber); color: var(--navy); }
.btn-primary:hover { background: var(--amber-h); }
.btn-ghost { background: var(--surface); color: var(--t-head); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--border2); }
.btn-danger { background: transparent; color: var(--err); border-color: var(--err-t); }
.btn-danger:hover { background: var(--err-t); }
.btn-sm { padding: 6px 14px; font-size: .8rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* Tabellen */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--t-muted); font-weight: 600; padding: 12px 24px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 14px 24px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover td { background: var(--bg2); }
td b { color: var(--t-head); font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: var(--rpill); font-size: .75rem; font-weight: 600; white-space: nowrap; background: var(--bg2); color: var(--t-body); border: 1px solid var(--border); }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.amber { background: var(--amber-t); color: var(--amber-h); border-color: var(--amber-b); }
.badge.ok { background: var(--ok-t); color: var(--ok); border-color: transparent; }
.badge.err { background: var(--err-t); color: var(--err); border-color: transparent; }
.badge.info { background: var(--info-t); color: var(--info); border-color: transparent; }

.tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.tabs button { border: 0; background: none; font: 500 .85rem var(--f); color: var(--t-body); padding: 6px 14px; border-radius: 6px; cursor: pointer; }
.tabs button.active { background: var(--navy); color: #fff; font-weight: 600; }
[data-theme="dark"] .tabs button.active { background: var(--amber); color: var(--navy); }

/* Formulare */
label.field { display: block; margin-bottom: 16px; }
label.field > span { display: block; font-size: .82rem; font-weight: 600; color: var(--t-head); margin-bottom: 6px; }
input, textarea, select { width: 100%; font: inherit; color: var(--t-head); background: var(--bg); border: 1px solid var(--border); border-radius: 11px; padding: 11px 14px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-t); }
textarea { min-height: 140px; resize: vertical; }
.hint { font-size: .78rem; color: var(--t-muted); margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--amber); flex: none; }

.alert { padding: 12px 16px; border-radius: 11px; font-size: .88rem; margin-bottom: 16px; }
.alert.err { background: var(--err-t); color: var(--err); }
.alert.ok { background: var(--ok-t); color: var(--ok); }
.alert.info { background: var(--info-t); color: var(--t-head); }
.copy { display: flex; gap: 8px; }
.copy input { font-size: .8rem; font-family: ui-monospace, monospace; }

.empty { padding: 48px 24px; text-align: center; color: var(--t-muted); }
.loading { padding: 48px; text-align: center; color: var(--t-muted); }
.loading::before { content: ''; display: block; width: 28px; height: 28px; margin: 0 auto 12px; border: 3px solid var(--amber-t); border-top-color: var(--amber); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Angebot */
.totals { margin-left: auto; width: min(340px, 100%); padding: 18px 24px; }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals .sum { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; font-weight: 700; color: var(--t-head); font-size: 1.1rem; }
.accept-box { background: var(--navy); color: rgba(255,255,255,.8); border-radius: var(--r); padding: 24px 28px; display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.accept-box h3 { color: #fff; margin-bottom: 4px; }

/* Ticket-Verlauf */
.thread { display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 82%; padding: 14px 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); }
.msg.mine { align-self: flex-end; background: var(--amber-t); border-color: var(--amber-b); }
.msg .who { display: flex; justify-content: space-between; gap: 18px; font-size: .78rem; color: var(--t-muted); margin-bottom: 6px; }
.msg .who b { color: var(--t-head); font-weight: 600; }
.msg .body { white-space: pre-wrap; word-wrap: break-word; color: var(--t-body); }
.msg .body p { margin: 0 0 .6em; }
.msg .files { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(2,1,34,.55); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); border-radius: var(--rl); box-shadow: var(--sh2); width: min(520px, 100%); padding: 28px; }
.modal h2 { margin-bottom: 8px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* Login */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--navy); color: rgba(255,255,255,.75); padding: 48px clamp(24px, 5vw, 72px); display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.auth-side::after { content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%; right: -180px; bottom: -200px; background: radial-gradient(circle, rgba(252,176,64,.22), transparent 65%); }
.auth-side h1 { color: #fff; font-size: 2.4rem; margin: 18px 0 14px; }
.auth-side ul { padding: 0; list-style: none; margin: 22px 0 0; }
.auth-side li { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.auth-side li svg { color: var(--amber); width: 18px; height: 18px; flex: none; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.auth-form .inner { width: min(400px, 100%); }
.auth-form img { height: 52px; margin-bottom: 28px; filter: var(--nav-logo-f); }
.auth-form h2 { font-size: 1.5rem; margin-bottom: 6px; }
.auth-form .btn { width: 100%; margin-top: 6px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 22px; border-radius: var(--rpill); box-shadow: var(--sh2); font-size: .9rem; z-index: 60; }
.toast.err { background: var(--err); }

@media (max-width: 960px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
@media (max-width: 820px) {
  .topbar { display: none; }
  .header { padding: 0 16px; height: 64px; }
  .header .logo span, .user-chip .meta { display: none; }
  #nav-toggle { display: grid; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 64px; left: 0; bottom: 0; width: 270px; z-index: 15; transform: translateX(-100%); transition: transform .2s; overflow-y: auto; }
  .sidebar.open { transform: none; box-shadow: var(--sh2); }
  main { padding: 22px 16px 48px; }
  h1 { font-size: 1.5rem; }
  .form-row { grid-template-columns: 1fr; }
  th, td { padding: 12px 14px; }
  .hide-sm { display: none; }
  .msg { max-width: 100%; }
  .menu { right: 16px; top: 60px; }
}

/* Unternavigation (Reiter) auf Detailseiten */
.subnav { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: -6px 0 20px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.subnav a { padding: 10px 16px; color: var(--t-muted); text-decoration: none; font-weight: 500; font-size: .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.subnav a:hover { color: var(--t-head); }
.subnav a.active { color: var(--t-head); border-bottom-color: var(--amber); font-weight: 600; }
.subnav .count { background: var(--bg2); border: 1px solid var(--border); color: var(--t-muted); font-size: .72rem; font-weight: 600; border-radius: var(--rpill); padding: 0 8px; }

.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }

/* Asset-Formular und Verlauf */
.asset-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
.form-section + .form-section { border-top: 1px solid var(--border); padding-top: 18px; margin-top: 4px; }
.form-section h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--t-muted); margin-bottom: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.timeline { list-style: none; margin: 22px 0 0; padding: 0; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 18px 18px; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border2); }
.timeline li.status::before { background: var(--amber); border-color: var(--amber); }
.timeline .meta { display: flex; justify-content: space-between; gap: 12px; font-size: .75rem; color: var(--t-muted); }
.timeline .meta b { color: var(--t-head); font-weight: 600; }
.timeline .text { white-space: pre-wrap; font-size: .88rem; margin-top: 2px; }
.timeline li.status .text { color: var(--t-muted); }

@media (max-width: 1100px) { .asset-layout { grid-template-columns: 1fr; } }
@media (max-width: 820px) { .form-grid, .form-grid.three { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: auto; } }

/* Stammdaten und Gerätedetails als Faktenliste */
.facts { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 10px 18px; margin: 0; font-size: .9rem; }
.facts dt { color: var(--t-muted); }
.facts dd { margin: 0; color: var(--t-head); word-break: break-word; }
.facts a { color: var(--t-head); text-decoration-color: var(--amber); text-underline-offset: 3px; }
.address-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; font-size: .9rem; color: var(--t-head); }
@media (max-width: 820px) { .facts { grid-template-columns: 1fr; gap: 2px; } .facts dd { margin-bottom: 10px; } }

/* 2FA-Einrichtung */
.steps { margin: 0 0 16px; padding-left: 20px; }
.steps li { margin-bottom: 12px; }
.qr { margin: 12px 0 8px; padding: 10px; background: #fff; border: 1px solid var(--border); border-radius: var(--r); display: inline-block; }
.qr img { display: block; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 14px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r); }
.codes span { text-align: center; font-weight: 600; color: var(--t-head); letter-spacing: .06em; }

/* Ankündigungen oben im Inhalt */
.announcements { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.announcement { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--info); border-radius: var(--r); box-shadow: var(--sh); font-size: .9rem; }
.announcement.wartung { border-left-color: var(--amber); }
.announcement.stoerung { border-left-color: var(--err); background: var(--err-t); }
.announcement .ann-text { flex: 1; min-width: 0; }
.announcement .ann-text b { color: var(--t-head); }
.icon-close { border: 0; background: none; color: var(--t-muted); font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 4px; }
.icon-close:hover { color: var(--t-head); }

/* Bezahlen-Dialog */
.modal { width: min(640px, 100%); }
.pay { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.pay .qr { margin: 0; }
.pay .facts { flex: 1; min-width: 240px; }
.link-btn { border: 0; background: none; color: var(--amber-h); font: 600 .75rem var(--f); cursor: pointer; padding: 0 0 0 6px; }

/* Zeitnachweise */
.month-nav { display: flex; align-items: center; gap: 12px; }
.month-nav b { color: var(--t-head); min-width: 150px; text-align: center; }
.meter { height: 6px; border-radius: 99px; background: var(--bg2); border: 1px solid var(--border); margin-top: 8px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--ok); }
.meter.warn span { background: var(--amber); }
.meter.over span { background: var(--err); }

/* Ticket-Bewertung */
.stars { display: inline-flex; gap: 2px; }
.stars button { border: 0; background: none; font-size: 1.6rem; line-height: 1; color: var(--border2); cursor: pointer; padding: 0 2px; }
.stars button.on { color: var(--amber); }
.stars.static { color: var(--amber); font-size: 1.1rem; letter-spacing: 2px; }

/* Wissensdatenbank */
.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 18px; align-items: start; }
.kb-items { list-style: none; margin: 0; padding: 6px 0; }
.kb-items li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 24px; border-bottom: 1px solid var(--border); }
.kb-items li:last-child { border-bottom: 0; }
.kb-items a { color: var(--t-head); font-weight: 500; text-decoration: none; }
.kb-items a:hover { text-decoration: underline; text-decoration-color: var(--amber); }
.kb-article { color: var(--t-body); line-height: 1.7; max-width: 900px; }
.kb-article h1, .kb-article h2, .kb-article h3 { margin: 1.2em 0 .5em; }
.kb-article a { color: var(--t-head); text-decoration-color: var(--amber); }
.kb-article img { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--r); }
.kb-article pre, .kb-article code { background: var(--bg2); border-radius: 6px; padding: 2px 6px; font-size: .88em; }
.kb-article pre { padding: 12px 14px; overflow-x: auto; }
.kb-article table { border: 1px solid var(--border); margin: 12px 0; }
.kb-article td, .kb-article th { padding: 8px 12px; }
@media (max-width: 820px) { .kb-grid { grid-template-columns: 1fr; } }

/* ---------- Zammad-Chat (unten rechts) ---------- */
body .zammad-chat { font-family: var(--f); right: 24px; box-shadow: var(--sh2); border-radius: var(--rl) var(--rl) 0 0; }
body .zammad-chat-header { background: var(--navy); color: #fff; border-radius: var(--rl) var(--rl) 0 0; }
body .zammad-chat-header-icon { color: var(--amber); }
body .zammad-chat-message--customer .zammad-chat-message-body { background: var(--amber); color: var(--navy); }
body .zammad-chat-send { background: var(--amber); color: var(--navy); }

/* ---------- Schalter ---------- */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; vertical-align: middle; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; background: var(--border2); border-radius: var(--rpill); transition: background .15s; pointer-events: none; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; box-shadow: var(--sh); transition: transform .15s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--amber); outline-offset: 2px; }
.switch input:disabled + span { opacity: .5; }
