/* ================================================================
   B2B LEASING – Custom Stylesheet
   ================================================================ */

:root {
  --sidebar-w:       260px;
  --sidebar-bg:      #0f2240;
  --sidebar-hover:   #1a3a6e;
  --sidebar-active:  #1e6fd9;
  --sidebar-text:    #c8d6ea;
  --sidebar-muted:   #6b8bb5;
  --topbar-h:        60px;
  --primary:         #1e6fd9;
  --primary-dark:    #1558b0;
  --accent:          #f0f6ff;
  --border:          #e2e8f0;
  --text-muted:      #64748b;
  --radius:          10px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-padding-top: calc(var(--topbar-h) + 12px); /* Sticky-Topbar beim Anchor-Scroll einrechnen */
}
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 0.9rem;
  background: #f4f7fb;
  color: #1e293b;
  margin: 0;
  overflow-x: hidden;
}

/* ================================================================
   SIDEBAR
   ================================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform .25s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.brand-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  color: #fff;
}
.brand-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
}

.sidebar-nav {
  padding: 12px 0 24px;
  flex: 1;
}

.nav-section {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--sidebar-muted);
  padding: 16px 20px 6px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.nav-item i { font-size: 1rem; flex-shrink: 0; }
.nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}
.nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
}
.nav-item.nav-sub { padding-left: 38px; font-size: 0.835rem; }
.nav-item.nav-logout { color: #f87171; margin-top: 4px; }
.nav-item.nav-logout:hover { background: rgba(239,68,68,.15); }

/* ================================================================
   MAIN CONTENT
   ================================================================ */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left .25s ease;
}

/* ---- TOPBAR ---- */
.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  z-index: 900;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.topbar-title {
  flex: 1;
  font-weight: 600;
  font-size: 1rem;
  color: #1e293b;
}
.topbar-right { display: flex; align-items: center; gap: 14px; }

.user-info {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
}
.user-avatar {
  width: 36px; height: 36px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem;
  flex-shrink: 0;
}
.user-name { font-weight: 600; font-size: .85rem; line-height: 1.2; }
.user-role { font-size: .72rem; color: var(--text-muted); }

/* Dropdown Arrow-Hover */
.dropdown .user-info:hover .user-avatar { background: var(--primary-dark); }
.dropdown-item { font-size: .875rem; }
.dropdown-item:hover { background: var(--accent); }

/* ---- PAGE CONTENT ---- */
.page-content {
  flex: 1;
  padding: 28px 28px 40px;
}

/* ================================================================
   CARDS
   ================================================================ */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.card-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  padding: 14px 20px;
  border-radius: var(--radius) var(--radius) 0 0 !important;
}

/* ================================================================
   STAT CARDS (Dashboard)
   ================================================================ */
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.stat-icon.blue   { background: #eff6ff; color: #1e6fd9; }
.stat-icon.green  { background: #f0fdf4; color: #16a34a; }
.stat-icon.yellow { background: #fefce8; color: #ca8a04; }
.stat-icon.red    { background: #fef2f2; color: #dc2626; }
.stat-icon.gray   { background: #f8fafc; color: #475569; }
.stat-icon.purple { background: #faf5ff; color: #7c3aed; }

.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .78rem; color: var(--text-muted); margin-top: 3px; }

/* ================================================================
   TABLES
   ================================================================ */
.table-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.table-card .table { margin: 0; }
.table thead th {
  background: #f8fafc;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 2px solid var(--border);
  padding: 11px 16px;
}
.table tbody td { padding: 12px 16px; vertical-align: middle; }
.table tbody tr:hover { background: var(--accent); }
.table-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.table-header h6 { margin: 0; font-weight: 600; }

/* ================================================================
   TICKET / ANFRAGE DETAIL
   ================================================================ */
.ticket-header {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
}
.ticket-number {
  font-size: .8rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.ticket-title { font-size: 1.3rem; font-weight: 700; margin: 4px 0 12px; }

.notes-list { list-style: none; padding: 0; margin: 0; }
.note-item {
  display: flex; gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.note-item:last-child { border-bottom: none; }
.note-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem; flex-shrink: 0;
}
.note-avatar.internal { background: #7c3aed; }
.note-meta { font-size: .75rem; color: var(--text-muted); margin-bottom: 4px; }
.note-body { font-size: .875rem; white-space: pre-wrap; }

/* ================================================================
   BADGES
   ================================================================ */
.badge { font-size: .72rem; font-weight: 600; padding: .35em .65em; }

/* ================================================================
   BUTTONS
   ================================================================ */
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

/* ================================================================
   CALCULATOR PLACEHOLDER
   ================================================================ */
.calc-placeholder {
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 2px dashed #93c5fd;
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
}
.calc-placeholder i { font-size: 3rem; color: #93c5fd; }

/* ================================================================
   LOGIN PAGE
   ================================================================ */
.auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f2240 0%, #1e6fd9 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.auth-card {
  background: #fff;
  border-radius: 16px;
  padding: 44px 40px;
  width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo .logo-icon {
  width: 56px; height: 56px;
  background: var(--primary);
  border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.6rem; color: #fff;
  margin-bottom: 12px;
}
.auth-logo h4 { font-weight: 700; margin: 0; }
.auth-logo p  { color: var(--text-muted); font-size: .85rem; margin: 0; }

/* ================================================================
   MOBILE
   ================================================================ */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 999;
}

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .main-content { margin-left: 0; }
}

@media (max-width: 575.98px) {
  .page-content { padding: 16px; }
  .auth-card { padding: 32px 24px; }
}

/* ================================================================
   MISC
   ================================================================ */
.section-title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header h4 { margin: 0; font-weight: 700; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 3rem; margin-bottom: 12px; display: block; }

.form-label { font-weight: 500; font-size: .875rem; }
.form-control, .form-select {
  border-color: #c8d3e0;
  border-width: 1.5px;
  font-size: .875rem;
  background-color: #f8fafc;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  border-width: 1.5px;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(30,111,217,.18);
}
.input-group-text {
  border-color: #c8d3e0;
  border-width: 1.5px;
  background-color: #f1f5f9;
}
.input-group .form-control:focus ~ .input-group-text,
.input-group:focus-within .input-group-text {
  border-color: var(--primary);
}

.status-timeline { padding: 0; list-style: none; }
.status-timeline li {
  padding: 8px 0;
  border-left: 2px solid var(--border);
  margin-left: 12px;
  padding-left: 18px;
  position: relative;
  font-size: .85rem;
}
.status-timeline li::before {
  content: '';
  width: 10px; height: 10px;
  background: var(--primary);
  border-radius: 50%;
  position: absolute;
  left: -6px; top: 12px;
}

.file-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: .85rem;
}
.file-item i { font-size: 1.3rem; color: var(--primary); }
.file-item .file-name { flex: 1; font-weight: 500; }
.file-item .file-size { color: var(--text-muted); font-size: .78rem; }

/* ── Footer-Leiste ── */
/* ── Footer-Leiste ── */
.footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 24px;
  font-size: .78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--bg);
  flex-wrap: wrap;
  gap: 8px;
}
.footer-copy {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .76rem;
  color: var(--text-muted);
}
.footer-links {
  display: flex;
  gap: 6px;
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .74rem;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid var(--border);
  background: transparent;
  transition: all .18s;
}
.footer-links a:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(67,97,238,.06);
}
.footer-links a i {
  font-size: .8rem;
  opacity: .7;
}

/* ── Sidebar Legal Links ── */
.sidebar-legal {
  margin-top: auto;
  padding: 10px 14px 10px;
  display: flex;
  gap: 6px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-legal a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .7rem;
  color: rgba(255,255,255,.4);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.1);
  transition: all .18s;
}
.sidebar-legal a:hover {
  color: rgba(255,255,255,.85);
  border-color: rgba(255,255,255,.3);
  background: rgba(255,255,255,.07);
}

/* ── Auth-Felder (Login / Forgot / Reset) ── */
.auth-field label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}
.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.auth-input-wrap input {
  width: 100%;
  padding: 11px 42px;
  font-size: .95rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #1e293b;
  transition: border-color .18s, box-shadow .18s, background .18s;
  outline: none;
  -webkit-appearance: none;
}
.auth-input-wrap input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(67,97,238,.12);
}
.auth-input-wrap input::placeholder {
  color: #a0aec0;
  font-weight: 400;
}
.auth-input-icon {
  position: absolute;
  left: 13px;
  font-size: 1rem;
  color: #94a3b8;
  pointer-events: none;
  z-index: 1;
}
.auth-pw-toggle {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  padding: 4px 6px;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  border-radius: 6px;
  transition: color .15s;
}
.auth-pw-toggle:hover { color: var(--primary); }

.auth-btn {
  padding: 11px;
  font-size: .97rem;
  font-weight: 600;
  border-radius: 10px;
  letter-spacing: .01em;
}
.auth-forgot-link {
  font-size: .78rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  opacity: .8;
  transition: opacity .15s;
}
.auth-forgot-link:hover { opacity: 1; text-decoration: underline; }

.auth-divider {
  margin: 24px 0;
  border-top: 1px solid #e9edf3;
}

/* Erfolgs-/Info-Box (forgot/reset) */
.auth-success-box {
  text-align: center;
  padding: 20px 16px;
  background: var(--auth-success-bg, #f0fdf4);
  border-radius: 12px;
  margin-bottom: 4px;
}
.auth-success-icon {
  width: 52px; height: 52px;
  background: var(--auth-success-color, #dcfce7);
  color: var(--auth-success-color, #16a34a);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 12px;
}
.auth-success-box h6 { font-weight: 700; color: #1e293b; }
.auth-success-box p  { font-size: .85rem; color: #64748b; }

.auth-back-link {
  display: block;
  text-align: center;
  font-size: .84rem;
  color: #64748b;
  text-decoration: none;
  margin-top: 16px;
  transition: color .15s;
}
.auth-back-link:hover { color: var(--primary); }

/* Sticky table headers entfernt – verursachte Überlappung der ersten Datenzeile */

/* ================================================================
   COPY BUTTON  (#5)
   ================================================================ */
.btn-copy {
  border: none;
  background: transparent;
  padding: 0 4px;
  color: #94a3b8;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
  transition: color .15s;
  font-size: .8rem;
  vertical-align: middle;
}
.btn-copy:hover { color: var(--primary); }

/* ================================================================
   STATUS-STEPPER  (#5 view.php)
   ================================================================ */
.status-stepper {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 4px 0;
}
.status-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  padding-bottom: 16px;
}
.status-step:last-child { padding-bottom: 0; }
.status-step:last-child .step-line { display: none; }
.step-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.step-dot.done  { background: #16a34a; border-color: #16a34a; color: #fff; }
.step-dot.active{ background: var(--primary); border-color: var(--primary); color: #fff; }
.step-dot.failed{ background: #dc2626; border-color: #dc2626; color: #fff; }
.step-line {
  position: absolute;
  left: 10px; top: 22px;
  width: 2px;
  height: calc(100% - 6px);
  background: var(--border);
  z-index: 0;
}
.step-line.done { background: #86efac; }
.step-label {
  font-size: .8rem;
  padding-top: 2px;
  font-weight: 500;
  color: #64748b;
}
.step-label.active { color: var(--primary); font-weight: 700; }
.step-label.done   { color: #1e293b; }
.step-label.failed { color: #dc2626; font-weight: 600; }

/* ── Kalkulator Rate-Karten (create.php) ── */
.cr-rate-card {
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.cr-rate-card:hover {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(30,111,217,.12);
}
.cr-rate-card.selected {
  border-color: var(--primary) !important;
  background: #eff6ff !important;
}

/* ================================================================
   SUPPORT-CHATBOT WIDGET
   ================================================================ */
#chatbot-toggle {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  z-index: 1200;
  box-shadow: 0 4px 18px rgba(30,111,217,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  transition: background .2s, transform .2s, box-shadow .2s;
}
#chatbot-toggle:hover {
  background: var(--primary-dark);
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(30,111,217,.55);
}
#chatbot-toggle .cb-icon-open,
#chatbot-toggle .cb-icon-close { transition: opacity .2s; }
#chatbot-toggle .cb-icon-close { display: none; }
#chatbot-toggle.open .cb-icon-open  { display: none; }
#chatbot-toggle.open .cb-icon-close { display: inline; }

/* Badge */
#chatbot-badge {
  position: absolute;
  top: -4px; right: -4px;
  width: 18px; height: 18px;
  background: #ef4444;
  color: #fff;
  border-radius: 50%;
  font-size: .65rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}
#chatbot-badge.show { display: flex; }

/* Chat Window */
#chatbot-window {
  position: fixed;
  bottom: 96px;
  right: 28px;
  width: 360px;
  max-height: 560px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(15,34,64,.18);
  display: flex;
  flex-direction: column;
  z-index: 1199;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(.97);
  transition: opacity .22s ease, transform .22s ease;
}
#chatbot-window.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Header */
.cb-header {
  background: linear-gradient(135deg, #0f2240 0%, #1e6fd9 100%);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.cb-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.cb-header-info { flex: 1; min-width: 0; }
.cb-header-name  { font-weight: 700; font-size: .9rem; }
.cb-header-status { font-size: .75rem; opacity: .8; }
.cb-header-close {
  background: none; border: none; color: rgba(255,255,255,.7);
  cursor: pointer; font-size: 1.1rem; padding: 0 2px;
  transition: color .15s;
}
.cb-header-close:hover { color: #fff; }

/* Messages */
.cb-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.cb-messages::-webkit-scrollbar { width: 4px; }
.cb-messages::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }

/* Bubbles */
.cb-bubble {
  max-width: 85%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: .83rem;
  line-height: 1.5;
  word-break: break-word;
}
.cb-bubble.bot {
  background: #f1f5f9;
  color: #1e293b;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.cb-bubble.user {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.cb-bubble.bot strong { color: #0f2240; }
.cb-bubble.bot ul { padding-left: 1.1em; margin: 4px 0 0; }
.cb-bubble.bot p  { margin: 0 0 4px; }
.cb-bubble.bot p:last-child { margin: 0; }

/* Typing indicator */
.cb-typing {
  align-self: flex-start;
  display: flex; gap: 4px;
  padding: 10px 14px;
  background: #f1f5f9;
  border-radius: 14px 14px 14px 4px;
}
.cb-typing span {
  width: 7px; height: 7px;
  background: #94a3b8;
  border-radius: 50%;
  animation: cbDot .9s infinite ease-in-out;
}
.cb-typing span:nth-child(2) { animation-delay: .15s; }
.cb-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes cbDot {
  0%, 80%, 100% { transform: scale(.6); opacity: .5; }
  40%           { transform: scale(1);  opacity: 1; }
}

/* Quick replies */
.cb-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 10px;
}
.cb-quick-btn {
  background: #eff6ff;
  color: var(--primary);
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: .78rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.cb-quick-btn:hover {
  background: #dbeafe;
  border-color: var(--primary);
}

/* Input area */
.cb-input-area {
  padding: 10px 12px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: flex-end;
}
#chatbot-input {
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: .83rem;
  resize: none;
  max-height: 80px;
  min-height: 36px;
  outline: none;
  transition: border-color .15s;
  font-family: inherit;
  line-height: 1.4;
}
#chatbot-input:focus { border-color: var(--primary); }
#chatbot-send {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
  transition: background .15s;
  flex-shrink: 0;
}
#chatbot-send:hover  { background: var(--primary-dark); }
#chatbot-send:disabled { background: #94a3b8; cursor: not-allowed; }

/* Mobile */
@media (max-width: 480px) {
  #chatbot-window {
    right: 12px; left: 12px; width: auto;
    bottom: 84px;
  }
  #chatbot-toggle { right: 16px; bottom: 16px; }
}

/* ================================================================
   DARK MODE  (Bootstrap 5.3 data-bs-theme="dark")
   ================================================================ */
[data-bs-theme="dark"] {
  --border:     #2d3748;
  --text-muted: #94a3b8;
  --accent:     #1e2d45;
  color-scheme: dark;
}

/* Basis */
[data-bs-theme="dark"] body        { background: #0d1117; color: #e2e8f0; }
[data-bs-theme="dark"] .page-header h4 { color: #f1f5f9; }
[data-bs-theme="dark"] .section-title  { color: #94a3b8; }
[data-bs-theme="dark"] .empty-state    { color: #64748b; }

/* Topbar */
[data-bs-theme="dark"] .topbar {
  background: #161b27;
  border-bottom-color: #2d3748;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
[data-bs-theme="dark"] .topbar-title { color: #f1f5f9; }
[data-bs-theme="dark"] .user-name    { color: #f1f5f9; }
[data-bs-theme="dark"] .user-role    { color: #94a3b8; }

/* Cards */
[data-bs-theme="dark"] .card         { background: #161b27; border-color: #2d3748; }
[data-bs-theme="dark"] .card-header  { background: #161b27; border-bottom-color: #2d3748; color: #f1f5f9; }
[data-bs-theme="dark"] .card-body    { color: #cbd5e1; }

/* Stat Cards */
[data-bs-theme="dark"] .stat-card    { background: #161b27; border-color: #2d3748; }
[data-bs-theme="dark"] .stat-value   { color: #f1f5f9; }
[data-bs-theme="dark"] .stat-label   { color: #94a3b8; }
[data-bs-theme="dark"] .stat-icon.blue   { background: #1e3a5f; color: #60a5fa; }
[data-bs-theme="dark"] .stat-icon.green  { background: #14532d; color: #4ade80; }
[data-bs-theme="dark"] .stat-icon.yellow { background: #451a03; color: #fbbf24; }
[data-bs-theme="dark"] .stat-icon.red    { background: #450a0a; color: #f87171; }
[data-bs-theme="dark"] .stat-icon.gray   { background: #1e293b; color: #94a3b8; }
[data-bs-theme="dark"] .stat-icon.purple { background: #2e1065; color: #c084fc; }

/* Tables */
[data-bs-theme="dark"] .table-card               { background: #161b27; border-color: #2d3748; }
[data-bs-theme="dark"] .table-header             { border-bottom-color: #2d3748; }
[data-bs-theme="dark"] .table-header h6          { color: #f1f5f9; }
[data-bs-theme="dark"] .table                    { color: #cbd5e1; }
[data-bs-theme="dark"] .table thead th           { background: #0d1117; color: #94a3b8; border-bottom-color: #2d3748; }
[data-bs-theme="dark"] .table tbody td           { border-color: #2d3748; }
[data-bs-theme="dark"] .table tbody tr:hover     { background: #1e2d45; }
[data-bs-theme="dark"] .table-bordered > :not(caption) > * > * { border-color: #2d3748; }
[data-bs-theme="dark"] .table-light              { --bs-table-bg: #0d1117; color: #94a3b8; }
[data-bs-theme="dark"] .table-sm td,
[data-bs-theme="dark"] .table-sm th              { border-color: #2d3748; color: #cbd5e1; }

/* Ticket / Anfrage */
[data-bs-theme="dark"] .ticket-header { background: #161b27; border-color: #2d3748; }
[data-bs-theme="dark"] .ticket-number { color: #94a3b8; }
[data-bs-theme="dark"] .ticket-title  { color: #f1f5f9; }

/* Notizen */
[data-bs-theme="dark"] .note-item   { border-bottom-color: #2d3748; }
[data-bs-theme="dark"] .note-meta   { color: #94a3b8; }
[data-bs-theme="dark"] .note-body   { color: #e2e8f0; }

/* Status Stepper */
[data-bs-theme="dark"] .step-dot    { background: #161b27; border-color: #3d4f6b; }
[data-bs-theme="dark"] .step-line   { background: #2d3748; }
[data-bs-theme="dark"] .step-label  { color: #94a3b8; }
[data-bs-theme="dark"] .step-label.done { color: #e2e8f0; }

/* Formulare */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background: #0d1117;
  border-color: #3d4f6b;
  color: #e2e8f0;
}
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  background: #161b27;
  border-color: var(--primary);
}
[data-bs-theme="dark"] .form-control::placeholder { color: #4b5563; }
[data-bs-theme="dark"] .form-control:disabled,
[data-bs-theme="dark"] .form-select:disabled { background: #1e293b; color: #64748b; }
[data-bs-theme="dark"] .form-text  { color: #64748b; }
[data-bs-theme="dark"] .form-label { color: #cbd5e1; }
[data-bs-theme="dark"] .form-check-label { color: #cbd5e1; }
[data-bs-theme="dark"] .input-group-text {
  background: #1e293b;
  border-color: #3d4f6b;
  color: #94a3b8;
}

/* Datei-Items */
[data-bs-theme="dark"] .file-item {
  background: #0d1117;
  border-color: #2d3748;
  color: #cbd5e1;
}

/* Kalkulator */
[data-bs-theme="dark"] .calc-placeholder {
  background: linear-gradient(135deg, #1e3a5f 0%, #14532d 100%);
  border-color: #1d4ed8;
}
[data-bs-theme="dark"] .cr-rate-card { border-color: #2d3748 !important; background: #161b27; }
[data-bs-theme="dark"] .cr-rate-card:hover { box-shadow: 0 0 0 3px rgba(30,111,217,.25); }
[data-bs-theme="dark"] .cr-rate-card.selected { background: #1e3a5f !important; }

/* Dropdown */
[data-bs-theme="dark"] .dropdown-menu    { background: #1e293b; border-color: #2d3748; }
[data-bs-theme="dark"] .dropdown-item   { color: #e2e8f0; }
[data-bs-theme="dark"] .dropdown-item:hover { background: #2d3748; color: #f1f5f9; }
[data-bs-theme="dark"] .dropdown-divider { border-color: #2d3748; }
[data-bs-theme="dark"] .dropdown-header { color: #94a3b8; }

/* Modals */
[data-bs-theme="dark"] .modal-content   { background: #161b27; border-color: #2d3748; }
[data-bs-theme="dark"] .modal-header    { border-bottom-color: #2d3748; }
[data-bs-theme="dark"] .modal-footer    { border-top-color: #2d3748; }

/* Alerts */
[data-bs-theme="dark"] .alert-info    { background: #1e3a5f; border-color: #1d4ed8; color: #93c5fd; }
[data-bs-theme="dark"] .alert-success { background: #14532d; border-color: #166534; color: #86efac; }
[data-bs-theme="dark"] .alert-warning { background: #451a03; border-color: #92400e; color: #fde68a; }
[data-bs-theme="dark"] .alert-danger  { background: #450a0a; border-color: #991b1b; color: #fca5a5; }
[data-bs-theme="dark"] .alert-info  a,
[data-bs-theme="dark"] .alert-success a,
[data-bs-theme="dark"] .alert-warning a { color: inherit; text-decoration: underline; }

/* Footer */
[data-bs-theme="dark"] .footer-bar      { background: #161b27; border-top-color: #2d3748; }
[data-bs-theme="dark"] .footer-links a  { color: #64748b; border-color: #2d3748; }
[data-bs-theme="dark"] .footer-links a:hover { color: #60a5fa; border-color: #60a5fa; }

/* Chatbot */
[data-bs-theme="dark"] #chatbot-window  { background: #161b27; box-shadow: 0 8px 40px rgba(0,0,0,.5); }
[data-bs-theme="dark"] .cb-bubble.bot  { background: #1e293b; color: #e2e8f0; }
[data-bs-theme="dark"] .cb-bubble.bot strong { color: #93c5fd; }
[data-bs-theme="dark"] .cb-bubble.bot ul { color: #cbd5e1; }
[data-bs-theme="dark"] .cb-typing      { background: #1e293b; }
[data-bs-theme="dark"] .cb-typing span { background: #4b5563; }
[data-bs-theme="dark"] .cb-input-area  { border-top-color: #2d3748; background: #161b27; }
[data-bs-theme="dark"] #chatbot-input  { background: #0d1117; border-color: #3d4f6b; color: #e2e8f0; }
[data-bs-theme="dark"] #chatbot-input:focus { border-color: var(--primary); }
[data-bs-theme="dark"] .cb-quick-btn  {
  background: #1e3a5f; color: #93c5fd;
  border-color: #1d4ed8;
}
[data-bs-theme="dark"] .cb-quick-btn:hover { background: #1d4ed8; color: #fff; }
[data-bs-theme="dark"] .cb-messages::-webkit-scrollbar-thumb { background: #3d4f6b; }

/* Misc */
[data-bs-theme="dark"] hr { border-color: #2d3748; }
[data-bs-theme="dark"] .border        { border-color: #2d3748 !important; }
[data-bs-theme="dark"] .border-bottom { border-bottom-color: #2d3748 !important; }
[data-bs-theme="dark"] .border-top    { border-top-color: #2d3748 !important; }
[data-bs-theme="dark"] .bg-light      { background: #1e293b !important; }
[data-bs-theme="dark"] .text-dark     { color: #f1f5f9 !important; }
[data-bs-theme="dark"] code           { color: #93c5fd; background: #1e293b; }
[data-bs-theme="dark"] .small,
[data-bs-theme="dark"] small          { color: inherit; }
