/* ==========================================================
   DeskHub – Stylesheet v2
   System-Fonts only, kein CDN, DSGVO-konform.
   ========================================================== */

:root {
  --ink:         #16202a;
  --ink-soft:    #334155;
  --bg:          #e3e9f1;
  --surface:     #ffffff;
  --primary:     #0f6f6a;
  --primary-dk:  #0b5853;
  --primary-lt:  #e6f4f3;
  --accent:      #d97706;
  --accent-lt:   #fef3c7;
  --danger:      #dc2626;
  --danger-lt:   #fef2f2;
  --success:     #16a34a;
  --success-lt:  #f0fdf4;
  --border:      #dde3ec;
  --border-soft: #edf0f5;
  --muted:       #64748b;
  --muted-lt:    #94a3b8;

  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Courier New', monospace;
  --font-display: var(--font-body);

  --radius:    8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --shadow:    0 4px 12px rgba(15,23,42,.08), 0 1px 3px rgba(15,23,42,.04);
  --shadow-lg: 0 12px 28px rgba(15,23,42,.12), 0 4px 8px rgba(15,23,42,.06);
}


/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body { display: flex; flex-direction: column; min-height: 100vh; }

h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.025em; margin-bottom: .4em; }
h2 { font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: .4em; }
h3 { font-size: 1rem; font-weight: 700; letter-spacing: -.015em; margin-bottom: .3em; }
h4 { font-size: .9rem; font-weight: 600; margin-bottom: .3em; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dk); text-decoration: underline; }

/* ── App Shell ──────────────────────────────────────────── */

.app-shell { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────── */

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar .brand {
  padding: 20px 18px 18px;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.03em;
  border-bottom: 1px solid #243040;
  flex-shrink: 0;
}
.sidebar .brand span { color: var(--accent); }

/* Top-level nav links */
.sidebar > nav { padding: 10px 0 4px; }
.sidebar > nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #a8b8c8;
  padding: 9px 18px;
  font-size: .9rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background .12s, color .12s;
}
.sidebar > nav a:hover {
  background: rgba(255,255,255,.05);
  color: #fff;
  text-decoration: none;
  border-left-color: transparent;
}
.sidebar > nav a.active {
  background: rgba(15,111,106,.18);
  color: #fff;
  border-left-color: var(--primary);
  font-weight: 600;
}

/* Admin block */
.nav-section-label {
  padding: 14px 18px 4px;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
}
.nav-section-label[role="button"] {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
.nav-section-label[role="button"]:hover { color: #f0a847; }
.nav-toggle-chevron { font-size: .75rem; }

.nav-admin-block {
  border-top: 1px solid #243040;
  border-bottom: 1px solid #243040;
  padding: 4px 0 8px;
  margin: 8px 0;
}
.nav-group-label {
  display: block;
  padding: 10px 18px 2px;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #4e6278;
}
.nav-admin-block a {
  display: block;
  color: #9aabb9;
  padding: 7px 18px 7px 22px;
  font-size: .865rem;
  font-weight: 400;
  border-left: 3px solid transparent;
  transition: background .1s, color .1s;
}
.nav-admin-block a:hover {
  background: rgba(255,255,255,.04);
  color: #dce8f0;
  text-decoration: none;
}
.nav-admin-block a.active {
  background: rgba(15,111,106,.14);
  color: #fff;
  border-left-color: var(--primary);
  font-weight: 500;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 18px;
  border-top: 1px solid #243040;
  font-size: .78rem;
  color: #4e6278;
  flex-shrink: 0;
}

/* ── Main content ───────────────────────────────────────── */

.main {
  flex: 1;
  padding: 24px 28px 60px;
  max-width: 1600px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
}

/* ── Cards ──────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid #c4cfdd;
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(15,23,42,.05), 0 6px 20px rgba(15,23,42,.10);
}

.card h3 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink);
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-soft);
}

/* Settings-Grid */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 20px;
  align-items: start;
}
.settings-grid .card { margin-bottom: 0; }
.settings-grid .settings-card-wide,
.settings-grid .card-wide { grid-column: 1 / -1; }
.settings-grid .settings-card-wide form { max-width: 660px; }
@media (max-width: 900px) { .settings-grid { grid-template-columns: 1fr; } }

/* ── Stat cards ─────────────────────────────────────────── */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 20px 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--primary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.stat-card.overdue::before { background: var(--danger); }
.stat-card.assigned::before { background: var(--accent); }
.stat-card.unassigned::before { background: var(--muted); }

.stat-card .num {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -.04em;
  margin-bottom: 6px;
}
.stat-card.overdue .num { color: var(--danger); }
.stat-card .lbl {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}

/* ── Forms ──────────────────────────────────────────────── */

label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 16px 0 5px;
}
label:first-child { margin-top: 0; }

input[type=text], input[type=email], input[type=password],
input[type=search], input[type=number], input[type=date],
input[type=time], select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: .9rem;
  background: var(--surface);
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 110px; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15,111,106,.12);
}
input::placeholder, textarea::placeholder { color: var(--muted-lt); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  padding: 9px 18px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  white-space: nowrap;
  transition: background .15s, box-shadow .15s, transform .1s;
  text-decoration: none;
}
.btn:hover {
  background: var(--primary-dk);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(15,111,106,.25);
}
.btn:active { transform: translateY(1px); }

.btn.secondary {
  background: var(--surface);
  color: var(--ink-soft);
  border-color: var(--border);
}
.btn.secondary:hover {
  background: var(--bg);
  box-shadow: none;
  color: var(--ink);
}
.btn.danger {
  background: var(--danger);
  border-color: transparent;
}
.btn.danger:hover {
  background: #b91c1c;
  box-shadow: 0 4px 10px rgba(220,38,38,.25);
}

.btn-row { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.btn-row.right { justify-content: flex-end; }

.field-row { display: flex; gap: 14px; }
.field-row > div { flex: 1; min-width: 0; }

/* Kundenformular: klare, gefuehrte Abschnitte statt einer langen Feldliste */
body .ticket-create-page {
  max-width: 900px;
  margin: 0 auto;
}

body .ticket-create-header {
  align-items: flex-end;
  margin-bottom: 30px;
  padding-bottom: 24px;
}

body .ticket-create-header h1 {
  margin-bottom: 8px;
  font-size: clamp(1.8rem, 3vw, 2.35rem);
  letter-spacing: -.035em;
}

body .ticket-create-header .muted {
  max-width: 56ch;
  line-height: 1.65;
}

body .ticket-create-card {
  padding: 0 !important;
  overflow: hidden;
}

body .ticket-create-form {
  padding: 34px 38px 30px;
}

body .ticket-form-section {
  margin-bottom: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border-soft);
}

body .ticket-section-label {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 21px;
  color: var(--ink);
  font-size: .96rem;
  font-weight: 800;
  letter-spacing: -.01em;
}

body .ticket-section-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: .76rem;
  line-height: 1;
}

body .ticket-form-section label {
  margin-top: 0;
}

body .ticket-form-section .field-row label {
  margin-top: 0;
}

body .ticket-form-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.5;
}

body .ticket-form-hint a {
  font-weight: 700;
}

body .ticket-section-optional {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 500;
}

body .ticket-attachment-section {
  margin-bottom: 22px;
  padding-bottom: 0;
  border-bottom: 0;
}

body .ticket-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 2px;
}

body .ticket-form-actions .ticket-form-hint {
  margin: 0;
}

body .ticket-required {
  color: var(--danger);
}

body .ticket-submit {
  min-width: 170px;
  justify-content: center;
  padding: 12px 24px;
  font-size: .95rem;
}

/* ── Badges ─────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 100px;
  color: #fff;
  letter-spacing: .01em;
  white-space: nowrap;
}
.badge.outline {
  background: transparent;
  border: 1.5px solid currentColor;
}

/* ── Tables ─────────────────────────────────────────────── */

table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font-size: .73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  padding: 10px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
th:first-child { border-radius: 6px 0 0 0; }
th:last-child  { border-radius: 0 6px 0 0; }

td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--border-soft);
  font-size: .88rem;
  vertical-align: middle;
  color: var(--ink-soft);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #f8fafc; }
tr.is-overdue td { background: var(--danger-lt); }
tr.is-overdue:hover td { background: #fde8e8; }

/* ── Flash messages ─────────────────────────────────────── */

.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  font-size: .875rem;
  font-weight: 500;
  border: 1px solid;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.flash::before { flex-shrink: 0; margin-top: 1px; font-size: 1rem; }
.flash.error   { background: var(--danger-lt); color: #991b1b; border-color: #fecaca; }
.flash.error::before { content: '✕'; }
.flash.success { background: var(--success-lt); color: #14532d; border-color: #bbf7d0; }
.flash.success::before { content: '✓'; }
.flash.info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.flash.info::before { content: 'ℹ'; }

/* ── Ticket number chip ──────────────────────────────────── */

.ticket-no {
  font-family: var(--font-mono);
  font-size: .78em;
  background: var(--primary-lt);
  color: var(--primary-dk);
  padding: .2em .55em;
  border-radius: 5px;
  font-weight: 600;
  letter-spacing: .02em;
}

/* ── Filters bar ─────────────────────────────────────────── */

.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.filters label { margin: 0 0 5px 0; font-size: .73rem; }
.filters > div { min-width: 140px; }
.filters input, .filters select { font-size: .85rem; padding: 7px 10px; }

/* ── Ticket thread ───────────────────────────────────────── */

.thread-msg {
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  background: #fff;
}
.thread-msg .meta {
  background: #f0f4f8;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}
.thread-msg.from-staff { border-left: 4px solid var(--primary); }
.thread-msg.from-staff .meta { background: var(--primary-lt); }
.thread-msg.is-note { border-left: 4px solid #f59e0b; }
.thread-msg.is-note .meta { background: #fffbeb; }
.thread-msg .body {
  padding: 18px 22px;
  font-size: .95rem;
  line-height: 1.8;
  color: #1e293b;
  word-break: break-word;
  overflow-wrap: break-word;
}
.thread-msg .body a { color: var(--primary); }
.thread-msg .body ul, .thread-msg .body ol { margin: 4px 0 8px 1.4em; }
.thread-msg .body p { margin: 0 0 12px; }
.thread-msg .body p:last-child { margin-bottom: 0; }
.thread-msg .body br + br { display: block; margin-top: 8px; }


.note-flag {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .05em;
  background: var(--accent-lt);
  padding: 1px 6px;
  border-radius: 4px;
}

/* ── Misc ────────────────────────────────────────────────── */

.muted { color: var(--muted); }
.empty-state { text-align: center; padding: 52px 20px; color: var(--muted); }
.divider { border: none; border-top: 1px solid var(--border-soft); margin: 22px 0; }

/* Auth card */
.auth-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 40px 20px;
  flex: 1 0 auto;
  background-color: #16202a;
  background-size: cover;
  background-position: center;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-top: -32px;
  margin-bottom: 0;
}
.auth-wrap::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
}
.auth-wrap.has-image::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(15,21,28,.80) 0%, rgba(15,21,28,.95) 100%);
  z-index: 0;
}
.auth-wrap .auth-card { z-index: 1; }
.auth-card {
  position: relative; z-index: 1;
  background: #fff;
  border: none;
  border-radius: 20px;
  padding: 44px 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 60px rgba(0,0,0,.35), 0 4px 16px rgba(0,0,0,.2);
}
/* Markenblock in Auth-Karten (themefähig) */
.brand-block { text-align: center; margin-bottom: 18px; }
.brand-block img { max-height: 42px; max-width: 220px; }
.brand-block-text {
  font-family: Georgia, ui-serif, serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
}
.brand-block-text span { color: var(--accent); }
.brand-block-lg { margin-bottom: 20px; }
.brand-block-lg img { max-height: 52px; max-width: 200px; }
.brand-block-lg .brand-block-text { font-size: 1.5rem; }

.auth-card h1 { font-size: 1.55rem; font-weight: 700; margin-bottom: 6px; color: #0f1923; }.auth-card .sub { color: #64748b; font-size: .875rem; margin-bottom: 26px; line-height: 1.5; }
.auth-card label { color: #374151; font-size: .83rem; font-weight: 600; }
.auth-card input[type=email],
.auth-card input[type=password],
.auth-card input[type=text] {
  background: #f8fafc; border-color: #e2e8f0; color: #0f1923;
}
.auth-card input:focus { background: #fff; border-color: var(--primary); }
.auth-card a { color: var(--primary); }
.auth-card .staff-link { color: #475569; font-size: .78rem; }
.auth-card .staff-link:hover { color: var(--primary); }

/* Login-Seite: Theme-Dateien koennen die markierten Flaechen individuell
   gestalten, waehrend Layout und Abstaende zentral konsistent bleiben. */
body .login-screen {
  display: flex;
  flex: 1 0 auto;
  align-items: center;
  justify-content: center;
  padding: 56px 20px;
  background-size: cover;
  background-position: center;
}

body .login-screen .login-card {
  width: 100%;
  max-width: 430px;
}

body .login-screen .login-submit {
  width: 100%;
  justify-content: center;
}

body .login-screen .login-forgot {
  display: inline-block;
  font-size: .82rem;
}

body .login-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
  font-size: .84rem;
  text-align: center;
}

body .login-guest-links {
  color: var(--muted-lt);
}

body .login-staff-link {
  margin-top: 4px;
  color: var(--muted) !important;
  font-size: .78rem;
}

/* ── Login Split-Layout ─────────────────────────────────── */
.login-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 48px;
  position: relative;
  z-index: 1;
}
.login-left-inner {
  max-width: 420px;
}
.login-brand-title {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 14px;
  line-height: 1.2;
}
.login-brand-sub {
  color: rgba(255,255,255,.72);
  font-size: .95rem;
  line-height: 1.7;
  margin-bottom: 36px;
}
.login-features {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.login-feature {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 14px 18px;
  backdrop-filter: blur(4px);
}
.login-feature-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}
.login-feature strong {
  display: block;
  color: #fff;
  font-size: .88rem;
  font-weight: 600;
}
.login-feature span {
  color: rgba(255,255,255,.6);
  font-size: .8rem;
}
.login-right {
  width: 440px;
  flex-shrink: 0;
  background: #fff !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  position: relative;
  z-index: 2;
  border-radius: 0;
}
.login-form-wrap {
  width: 100%;
  max-width: 360px;
  padding: 52px 40px;
}
@media (max-width: 700px) {
  .auth-wrap { flex-direction: column; }
  .login-left { display: none; }
  .login-right { width: 100%; min-height: 100%; }
  .login-form-wrap { padding: 40px 28px; }
}


/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 820px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .main { padding: 20px 16px 48px; }
  .field-row { flex-direction: column; gap: 0; }
  .settings-grid { grid-template-columns: 1fr; }
  body .ticket-create-page { max-width: none; }
  body .ticket-create-header { align-items: flex-start; }
  body .ticket-create-form { padding: 26px 22px 24px; }
}

/* ================================================================
   KUNDENPORTAL – horizontale Top-Navigation
   ================================================================ */

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header .topbar-thin {
  background: var(--ink);
  color: #c4cdd6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 28px;
  font-size: .82rem;
  flex-wrap: wrap; gap: 10px;
}
.site-header .topbar-thin .welcome { color: #fff; font-weight: 600; }
.site-header .topbar-thin nav { display: flex; gap: 20px; flex-wrap: wrap; }
.site-header .topbar-thin nav a { color: #c4cdd6; }
.site-header .topbar-thin nav a:hover,
.site-header .topbar-thin nav a.active { color: #fff; text-decoration: none; }
.site-header .logo-row { padding: 16px 28px; display: flex; align-items: center; }
.site-header .logo-row img { max-height: 52px; max-width: 240px; display: block; }
.site-header .logo-row .text-brand {
  font-size: 1.6rem; font-weight: 800; color: var(--ink); letter-spacing: -.03em;
}
.site-header .logo-row .text-brand span { color: var(--accent); }

/* Hero */
.hero-search {
  position: relative;
  background-color: rgba(15,21,28,.72);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
  padding: 68px 28px 60px;
  text-align: center;
  overflow: hidden;
}
.hero-search::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
}
.hero-search.has-image::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,21,28,.75) 0%, rgba(15,21,28,.75) 70%, rgba(15,21,28,.98) 100%);
  z-index: 1;
}
.hero-search .hero-inner { position: relative; z-index: 2; max-width: 620px; margin: 0 auto; }
.hero-search .eyebrow {
  display: inline-block;
  font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 16px;
}
.hero-search h1 { font-size: 2.15rem; color: #fff; margin-bottom: 12px; }
.hero-search .sub { color: #c4cdd6; font-size: .98rem; margin-bottom: 30px; }
.hero-search .search-form {
  display: flex;
  background: #fff;
  border-radius: 999px;
  padding: 6px 6px 6px 22px;
  box-shadow: 0 16px 34px rgba(0,0,0,.28);
}
.hero-search .search-form input {
  flex: 1; border: none; outline: none; font-size: .95rem;
  background: transparent; color: var(--ink); font-family: var(--font-body);
}
.hero-search .search-form button {
  background: var(--accent); color: #fff; border: none; border-radius: 999px;
  padding: 11px 24px; font-weight: 600; cursor: pointer;
  font-family: var(--font-body); font-size: .88rem; white-space: nowrap;
}
.hero-search .search-form button:hover { background: #b85f08; }
.hero-search .quick-links { margin-top: 18px; font-size: .82rem; color: #9aa7b2; }
.hero-search .quick-links a { color: #d7dee4; }
.hero-search .quick-links a:hover { color: #fff; }

.page-content {
  flex: 1 0 auto; width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 28px 60px;
}

/* CTA cards */
.cta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin: 36px 0 28px; }
.cta-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 26px;
  text-align: center;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.cta-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.cta-card .icon-badge {
  width: 54px; height: 54px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.cta-card .icon-badge svg { width: 26px; height: 26px; }
.cta-card.primary .icon-badge { background: rgba(15,111,106,.1); }
.cta-card.primary .icon-badge svg { stroke: var(--primary); }
.cta-card.secondary .icon-badge { background: rgba(217,119,6,.1); }
.cta-card.secondary .icon-badge svg { stroke: var(--accent); }
.cta-card h3 { margin-bottom: 8px; }
.cta-card p { color: var(--muted); font-size: .88rem; margin-bottom: 18px; min-height: 44px; }

/* KB */
.kb-search { max-width: 480px; margin: 0 auto 30px; }
.kb-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px; margin-bottom: 20px;
}
.kb-category-card { margin-bottom: 0; }
.kb-category-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.kb-category-head .icon-badge {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15,111,106,.1);
}
.kb-category-head .icon-badge svg { width: 22px; height: 22px; stroke: var(--primary); }
.kb-article-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-top: 1px solid var(--border);
  color: var(--ink); font-size: .9rem;
}
.kb-article-link:hover { color: var(--primary); text-decoration: none; }
.kb-article-link .arrow { color: var(--muted); transition: transform .15s; }
.kb-article-link:hover .arrow { transform: translateX(3px); color: var(--primary); }
.kb-result-card:hover { box-shadow: var(--shadow); }
.popular-articles .article-row {
  display: flex; align-items: baseline; gap: 16px;
  padding: 14px 2px; border-bottom: 1px solid var(--border);
}
.popular-articles .article-row:last-child { border-bottom: none; }
.popular-articles .rank {
  font-weight: 800; color: var(--accent); font-size: 1.1rem; width: 22px; flex-shrink: 0;
}
.popular-articles .article-title { font-weight: 600; }
.popular-articles .article-meta { color: var(--muted); font-size: .78rem; margin-top: 2px; }

/* Steps */
.steps-list { display: flex; flex-direction: column; gap: 16px; }
.steps-list .step { display: flex; gap: 12px; align-items: flex-start; font-size: .85rem; }
.steps-list .step-num {
  flex-shrink: 0; width: 24px; height: 24px;
  border-radius: 50%; background: rgba(15,111,106,.1);
  color: var(--primary); font-weight: 800; font-size: .78rem;
  display: flex; align-items: center; justify-content: center;
}

footer.public-footer {
  text-align: center;
  background: var(--ink);
  color: #4e6278;
  font-size: .78rem;
  padding: 18px 0;
  margin-top: auto;
  width: 100%;
}
body:has(.auth-wrap) footer.public-footer { margin-top: 0; flex-shrink: 0; }

/* Auth-Seiten: Die Karte soll die volle Resthöhe füllen, statt eine leere
   Fläche zwischen Karte und Footer zu lassen. */
body:has(.auth-wrap) .page-content {
  display: flex;
  flex-direction: column;
  max-width: none;
  padding: 0;
}
body:has(.auth-wrap) .page-content > .auth-wrap {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  margin-top: 0;
}


/* ── Rich-Text-Editor ───────────────────────────────────────── */
.richtext-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.richtext-toolbar {
  display: flex; gap: 2px; padding: 6px 8px;
  background: var(--bg-soft); border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.richtext-toolbar button {
  background: none; border: 1px solid transparent; border-radius: 4px;
  padding: 3px 8px; font-size: .82rem; font-weight: 700; cursor: pointer;
  color: var(--ink-soft); line-height: 1.4; transition: all .15s;
}
.richtext-toolbar button:hover { background: var(--border); border-color: var(--border); color: var(--ink); }
.richtext-toolbar button.active { background: var(--primary-lt); border-color: var(--primary); color: var(--primary); }
.richtext-editable {
  min-height: 120px; padding: 10px 12px; outline: none;
  font-size: .88rem; line-height: 1.6; color: var(--ink);
  cursor: text;
}
.richtext-editable:empty::before { content: attr(data-placeholder); color: var(--muted-lt); pointer-events: none; }
.richtext-editable ul, .richtext-editable ol { padding-left: 20px; margin: 6px 0; }
.richtext-editable a { color: var(--primary); }

@media (max-width: 800px) {
  .site-header .topbar-thin { flex-direction: column; align-items: flex-start; }
  .cta-grid { grid-template-columns: 1fr; }
  .hero-search { padding: 48px 18px 42px; }
  .hero-search h1 { font-size: 1.6rem; }
  .hero-search .search-form { flex-direction: column; border-radius: 16px; padding: 14px; gap: 10px; }
  .hero-search .search-form input { text-align: center; }
  .page-content { padding: 24px 18px 50px; }
}

/* ── Details/Summary (Weitere Aktionen) ─────────────────── */
details > summary { outline: none; }
details > summary::-webkit-details-marker { display: none; }
details[open] > summary span:last-child { transform: rotate(180deg); display:inline-block; }

/* Anmeldeseite der Mitarbeiter: Kopf- und Fußzeile, Hintergrund. Themes setzen --staff-login-* oder überschreiben die Klassen. */
body.staff-login-page {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--staff-login-bg, #16202a);
}
.staff-login-header {
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
  height: 56px; padding: 0 28px;
  background: var(--staff-login-chrome, rgba(14,26,34,.95));
  border-bottom: var(--staff-login-line, 1px solid rgba(255,255,255,.08));
}
.staff-login-brand { display: flex; align-items: center; gap: 12px; }
.staff-login-brand img { height: 32px; width: auto; }
.staff-login-brand-name { color: var(--staff-login-chrome-ink, #fff); font-weight: 700; font-size: .95rem; }
.staff-login-back { color: var(--staff-login-chrome-muted, rgba(255,255,255,.5)); font-size: .8rem; text-decoration: none; }
.staff-login-back:hover { color: var(--staff-login-chrome-ink, #fff); }
.staff-login-footer {
  flex-shrink: 0; padding: 12px 28px; text-align: center;
  background: var(--staff-login-chrome, rgba(14,26,34,.95));
  border-top: var(--staff-login-line, 1px solid rgba(255,255,255,.08));
}
.staff-login-footer span { color: var(--staff-login-chrome-faint, rgba(255,255,255,.3)); font-size: .75rem; }
.staff-login-title { font-size: 1.4rem; font-weight: 700; margin: 0 0 4px; color: #0f1923; }

/* ── Seitenleiste ein-/ausklappen (eingeklappt bleibt eine Iconleiste) ─────────── */
.sidebar-toggle {
  border: 0; cursor: pointer; font: inherit; line-height: 1;
  color: #a8b8c8; background: rgba(255,255,255,.07);
  width: 30px; height: 30px; border-radius: 8px; font-size: 1.1rem;
  transition: background .12s, color .12s;
}
.sidebar-toggle:hover { background: rgba(255,255,255,.16); color: #fff; }
.sidebar-toggle-close { position: absolute; top: 16px; right: 12px; z-index: 2; }
.sidebar-toggle-open { display: none; }
.sidebar .nav-ico { display: none; }
.sidebar .nav-ico svg { display: block; }

@media (min-width: 821px) {
  html.sidebar-closed .sidebar { width: 64px; overflow-x: hidden; }
  html.sidebar-closed .sidebar .brand { height: 62px; padding: 0; font-size: 0; overflow: hidden; }
  html.sidebar-closed .sidebar .brand > * { display: none; }
  html.sidebar-closed .sidebar .sidebar-toggle-close { right: 17px; }
  html.sidebar-closed .sidebar nav a { justify-content: center; padding: 11px 0; gap: 0; }
  html.sidebar-closed .sidebar .nav-ico { display: flex; }
  html.sidebar-closed .sidebar .nav-label { display: none; }
  html.sidebar-closed .sidebar .nav-section-label { display: none; }
  html.sidebar-closed .sidebar .nav-admin-block { display: block !important; border-top: 1px solid #243040; margin-top: 6px; padding-top: 6px; }
  html.sidebar-closed .sidebar .nav-group-label { display: block; height: 1px; padding: 0; margin: 8px 14px; background: #243040; font-size: 0; overflow: hidden; }
  html.sidebar-closed .sidebar .sidebar-footer { padding: 10px 0; }
  html.sidebar-closed .sidebar .sidebar-footer > div { flex-direction: column; justify-content: center; align-items: center; gap: 12px !important; margin-bottom: 10px !important; }
  html.sidebar-closed .sidebar .sidebar-footer > div:first-child > div:last-child { display: none; }
  html.sidebar-closed .sidebar .sidebar-footer a { display: flex; }
  html.sidebar-closed .sidebar .sidebar-footer .nav-ico { display: flex; }
  html.sidebar-closed .sidebar .sidebar-footer .nav-label { display: none; }
}
@media (max-width: 820px) {
  .sidebar { position: relative; }
  .sidebar-toggle-close { top: 14px; }
  .sidebar-toggle-open { position: fixed; top: 12px; left: 12px; z-index: 9998; background: var(--ink); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
  html.sidebar-closed .sidebar { display: none; }
  html.sidebar-closed .sidebar-toggle-open { display: block; }
  html.sidebar-closed .main { padding-top: 56px; }
}

/* Das Logo darf nicht unter den Einklappen-Knopf rutschen */
.sidebar .brand { padding-right: 52px; }
.sidebar .brand img { max-width: 100% !important; height: auto; }

/* Sprachwechsler: in der schmalen Iconleiste nicht anzeigen */
@media (min-width: 821px) {
  html.sidebar-closed .sidebar .lang-row { display: none; }
}

/* ── Seitenleiste unten: Benutzerkarte, Symbolleiste, Sprache ───────────── */
.sidebar-footer .sf-user { display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.sidebar-footer .sf-avatar { width:38px; height:38px; border-radius:50%; object-fit:cover; flex-shrink:0; border:2px solid #2a3744; }
.sidebar-footer .sf-avatar-letter { display:flex; align-items:center; justify-content:center; background:rgba(15,111,106,.3); color:#8bc4c2; font-weight:700; font-size:1rem; }
.sidebar-footer .sf-who { min-width:0; display:flex; flex-direction:column; gap:1px; align-items:flex-start; }
.sidebar-footer .sf-name { font-size:.86rem; font-weight:700; color:#fff; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sidebar-footer .sf-role { font-size:.72rem; color:#7c8da0; }
.sidebar-footer .sf-vac { margin-top:3px; font-size:.68rem; font-weight:600; color:#fbbf24; background:rgba(251,191,36,.14); border-radius:10px; padding:1px 8px; }
.sidebar-footer .sf-actions { display:grid; grid-template-columns:repeat(4, 1fr); gap:6px; margin-bottom:10px; }
.sidebar-footer .sf-btn { position:relative; display:flex; align-items:center; justify-content:center; height:34px; border-radius:9px; background:rgba(255,255,255,.06); color:#a9b6c3; text-decoration:none; transition:background .15s, color .15s; }
.sidebar-footer .sf-btn:hover { background:rgba(255,255,255,.14); color:#fff; }
.sidebar-footer .sf-btn-out:hover { background:rgba(220,38,38,.28); color:#fecaca; }
.sidebar-footer .sf-btn:focus-visible { outline:2px solid #8bc4c2; outline-offset:1px; }
.sidebar-footer .sf-badge { position:absolute; top:-5px; right:-4px; min-width:16px; height:16px; padding:0 4px; border-radius:8px; background:#dc2626; color:#fff; font-size:.62rem; font-weight:700; display:flex; align-items:center; justify-content:center; line-height:1; box-shadow:0 0 0 2px #1b2733; }
.sidebar-footer .lang-row { display:flex; justify-content:center; }
.sidebar-footer .lang-row .lang-switch { gap:4px !important; padding:3px; background:rgba(255,255,255,.05); border-radius:9px; }
.sidebar-footer .lang-row .lang-switch a { padding:2px !important; border-radius:6px !important; outline-offset:0 !important; }
.sidebar-footer .lang-row .lang-switch img { width:22px !important; height:15px !important; }
html.sidebar-closed .sidebar .sidebar-footer .sf-actions { grid-template-columns:1fr; }
html.sidebar-closed .sidebar .sidebar-footer .sf-btn { width:34px; margin:0 auto; }
html.sidebar-closed .sidebar .sidebar-footer .sf-user { justify-content:center; }
