/* KompassCS CRM – Kompass Blue Theme */
:root {
  color-scheme: dark;
  --bg: #070d1a;
  --bg2: #0c1630;
  --card: rgba(255, 255, 255, 0.04);
  --card-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #3b82f6;
  --accent2: #2563eb;
  --kompass-blue: #003399;
  --kompass-gold: #2563eb;
  --green: #34d399;
  --amber: #60a5fa;
  --rose: #fb7185;
  --radius: 16px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --field-bg: #0b1220;
  --field-text: #f8fafc;
}

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

body {
  font-family: "DM Sans", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

a { color: #eef2ff; text-decoration: none; }
a:hover { text-decoration: underline; }

.bg-glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(59, 130, 246, 0.22), transparent),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(37, 99, 235, 0.16), transparent),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(0, 51, 153, 0.15), transparent);
}

.layout {
  position: relative; z-index: 1;
  min-height: 100vh;
}
@media (min-width: 1101px) {
  .layout {
    margin-left: 260px;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    z-index: 50;
    overflow: hidden;
  }
}
.sidebar {
  border-right: 1px solid var(--border);
  padding: 1.75rem 1.25rem 0;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.brand { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; flex-shrink: 0; }
.brand-logo {
  width: 64px; height: 64px; border-radius: 12px; object-fit: contain;
  background: #fff; padding: 3px;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.25);
  border: 1px solid rgba(37, 99, 235, 0.45);
}
.brand-icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--kompass-blue), var(--accent));
  display: grid; place-items: center; font-weight: 700; font-size: 1.1rem; color: var(--kompass-gold);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
  border: 1px solid rgba(37, 99, 235, 0.45);
}
.brand h1 { font-size: 1.05rem; font-weight: 700; line-height: 1.2; }
.brand p { font-size: 0.75rem; color: var(--muted); }

.nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 0 0 0.75rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.nav li {
  display: block;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.48rem 0.85rem;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.86rem;
  line-height: 1.25;
  min-height: 2.35rem;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: 0.2s;
  border: 1px solid transparent;
}
.nav a.active {
  border-color: rgba(59, 130, 246, 0.25);
  background: rgba(59, 130, 246, 0.1);
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--accent);
  text-decoration: none;
}
@media (hover: hover) and (pointer: fine) {
  .nav a:hover { background: var(--card-hover); color: var(--text); text-decoration: none; }
}

.sidebar-foot {
  flex-shrink: 0;
  margin-top: 0;
  padding: 0.85rem 0.15rem 1.1rem;
  font-size: 0.72rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(0,0,0,0.05), rgba(0,0,0,0.28));
  position: relative;
  z-index: 2;
}
.sidebar-foot > div {
  font-size: 0.82rem;
  color: var(--text);
  margin-bottom: 0.35rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-foot a { color: var(--muted); font-size: 0.82rem; }
.sidebar-foot a:hover { color: var(--text); }

.demo-banner { display: none; }
.demo-start-banner { display: none; }
.demo-foot-bar { display: none !important; }
.demo-start-panel {
  border-color: rgba(139, 92, 246, 0.45);
  background: rgba(139, 92, 246, 0.08);
}
.sidebar-demo-toggle,
.nav-demo,
.nav-demo-btn,
.nav-demo-btn-exit,
.mobile-demo-form,
.mobile-demo-chip { display: none !important; }
.demo-active-panel {
  border-color: rgba(139, 92, 246, 0.35);
  background: rgba(34, 211, 238, 0.06);
}
.nav-demo-top { margin-bottom: 0.35rem; }
.demo-start-wrap { display: none; }
.demo-chip-form {
  position: fixed;
  top: 0.85rem;
  right: 1rem;
  z-index: 460;
  margin: 0;
}
.demo-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.85rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.88);
  color: var(--text);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}
.demo-chip.is-active {
  border-color: rgba(34, 211, 238, 0.55);
  background: rgba(34, 211, 238, 0.14);
}

.main { padding: 1.75rem 2rem 2.5rem; overflow: auto; }

.topbar {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; margin-bottom: 1.75rem; flex-wrap: wrap;
}
.topbar h2 { font-size: 1.65rem; font-weight: 700; letter-spacing: -0.02em; }
.topbar p { color: var(--muted); font-size: 0.9rem; margin-top: 0.25rem; }
.topbar-actions { display: flex; gap: 0.65rem; flex-wrap: wrap; align-items: center; }

.live-badge {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.4rem 0.75rem; border-radius: 999px;
  background: rgba(52, 211, 153, 0.12); border: 1px solid rgba(52, 211, 153, 0.25);
  color: var(--green); font-size: 0.78rem; font-weight: 600;
}
.live-badge::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}
.stat {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.15rem 1.25rem;
  backdrop-filter: blur(8px); transition: 0.25s; animation: fadeUp 0.5s ease both;
}
.stat:hover { background: var(--card-hover); transform: translateY(-2px); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.stat-label { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stat-value { font-size: 2rem; font-weight: 700; margin: 0.35rem 0 0.15rem; line-height: 1; }
.stat-sub { font-size: 0.8rem; color: var(--muted); }
.stat-icon { float: right; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 1.1rem; }
.icon-cyan { background: rgba(139, 92, 246, 0.12); color: var(--accent); }
.icon-purple { background: rgba(167, 139, 250, 0.12); color: var(--accent2); }
.icon-green { background: rgba(52, 211, 153, 0.12); color: var(--green); }
.icon-amber { background: rgba(251, 191, 36, 0.12); color: var(--amber); }
.icon-rose { background: rgba(251, 113, 133, 0.12); color: var(--rose); }

.grid-2 { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 1.25rem; margin-bottom: 1.25rem; }

.panel {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  backdrop-filter: blur(8px); box-shadow: var(--shadow); margin-bottom: 1.25rem;
}
.panel:last-child { margin-bottom: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.panel-head h3 { font-size: 1rem; font-weight: 600; }
.panel-head span { font-size: 0.78rem; color: var(--muted); }

.company-name-cell strong {
  display: block;
  margin-bottom: 0.45rem;
}

.company-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.15rem;
}

.company-list-actions .btn-danger {
  font-weight: 700;
}

.table-wrap .company-name-cell .company-list-actions {
  margin-top: 0.5rem;
}

@media (max-width: 900px) {
  .table-wrap .company-name-cell .company-list-actions .btn {
    flex: 1 1 auto;
    min-width: 5.5rem;
    justify-content: center;
  }
  .table-wrap .company-name-cell .company-list-actions .btn-danger {
    flex: 1 1 100%;
  }
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
th {
  text-align: left; padding: 0.65rem 0.75rem; color: var(--muted);
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
td { padding: 0.75rem; border-bottom: 1px solid rgba(255, 255, 255, 0.04); vertical-align: middle; }
tr:hover td { background: rgba(255, 255, 255, 0.02); }

.form-grid { display: grid; gap: 0.85rem; max-width: 640px; }
.company-form-wrap .form-grid { max-width: none; }
.contact-formset .form-grid-2 { max-width: none; }
.contact-formset input[type="text"],
.contact-formset input[type="email"],
.contact-formset input[type="tel"],
.contact-formset select {
  width: 100%;
  background: var(--field-bg);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: var(--field-text);
  border-radius: var(--radius);
  padding: 0.45rem 0.6rem;
  font-size: 0.9rem;
  color-scheme: dark;
}
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
.form-group { display: grid; gap: 0.35rem; }
.form-group label { font-size: 0.82rem; color: var(--muted); font-weight: 500; }

input, textarea, select {
  width: 100%; padding: 0.65rem 0.85rem; border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: var(--field-bg);
  color: var(--field-text);
  font: inherit; font-size: 0.88rem; transition: 0.2s;
  color-scheme: dark;
}
textarea { min-height: 100px; resize: vertical; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: rgba(96, 165, 250, 0.65);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}
/* Native Dropdowns (Windows/Edge): heller System-Hintergrund + geerbter hellerer Text = unsichtbar */
select option,
select optgroup {
  background-color: #0f172a;
  color: #f8fafc;
}
select option:checked,
select option:hover {
  background-color: #1e3a8a;
  color: #ffffff;
}
input::placeholder,
textarea::placeholder {
  color: #94a3b8;
  opacity: 1;
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: #f8fafc;
  box-shadow: 0 0 0 1000px #0b1220 inset;
  transition: background-color 99999s ease-out;
}
.form-actions { display: flex; gap: 0.65rem; flex-wrap: wrap; margin-top: 0.5rem; }
.form-errors {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}
.field-error { color: #ef4444; font-size: 0.88rem; margin: 0.2rem 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.7rem 1rem; border: 0; border-radius: 10px; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 0.88rem;
  background: linear-gradient(135deg, var(--kompass-blue), var(--accent)); color: #fff;
  transition: 0.2s; text-decoration: none;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.25);
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); text-decoration: none; }
.btn-secondary { background: linear-gradient(135deg, var(--accent), #1d4ed8); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-danger { background: linear-gradient(135deg, var(--rose), #e11d48); color: #fff; }
.btn-sm { padding: 0.45rem 0.75rem; font-size: 0.8rem; }

.tags { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.tag, .badge {
  display: inline-flex; align-items: center;
  font-size: 0.68rem; padding: 0.2rem 0.45rem; border-radius: 6px;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
}
.tag-ok, .badge-success { background: rgba(52, 211, 153, 0.15); color: var(--green); }
.tag-warn, .badge-warning { background: rgba(251, 191, 36, 0.15); color: var(--amber); }
.tag-danger, .badge-danger { background: rgba(251, 113, 133, 0.15); color: var(--rose); }
.tag-info, .badge-info { background: rgba(139, 92, 246, 0.15); color: var(--accent); }
.tag-muted, .badge-muted { background: rgba(148, 163, 184, 0.15); color: var(--muted); }

.avatar {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 700; font-size: 0.82rem;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(167, 139, 250, 0.25));
  border: 1px solid var(--border);
}

.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.detail-item label {
  display: block; font-size: 0.72rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.25rem;
}
.detail-item p { font-size: 0.95rem; }
.empty-state { color: var(--muted); font-size: 0.88rem; padding: 2rem 1rem; text-align: center; }

.toast-wrap { position: fixed; top: 1rem; right: 1rem; z-index: 100; display: grid; gap: 0.5rem; }
.toast {
  padding: 0.85rem 1.1rem; border-radius: 12px; font-size: 0.88rem;
  backdrop-filter: blur(12px); animation: slideIn 0.35s ease;
  max-width: 360px; border: 1px solid var(--border);
}
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
.toast.success { background: rgba(52, 211, 153, 0.15); color: var(--green); border-color: rgba(52, 211, 153, 0.3); }
.toast.error, .toast.danger { background: rgba(251, 113, 133, 0.15); color: var(--rose); border-color: rgba(251, 113, 133, 0.3); }
.toast.warning { background: rgba(251, 191, 36, 0.15); color: var(--amber); border-color: rgba(251, 191, 36, 0.3); }
.toast.info { background: rgba(139, 92, 246, 0.15); color: var(--accent); border-color: rgba(34, 211, 238, 0.3); }

.error-banner {
  background: rgba(251, 113, 133, 0.12); border: 1px solid rgba(251, 113, 133, 0.3);
  color: var(--rose); padding: 1.25rem; border-radius: var(--radius); margin-bottom: 1.25rem;
}

.kanban-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; align-items: start; }
.kanban-column {
  background: rgba(0, 0, 0, 0.2); border: 1px solid var(--border);
  border-radius: var(--radius); min-height: 420px; display: flex; flex-direction: column;
}
.kanban-column-head {
  padding: 0.85rem 1rem; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.kanban-column-head h4 { font-size: 0.88rem; font-weight: 600; }
.kanban-count { font-size: 0.72rem; color: var(--muted); background: var(--card); padding: 0.15rem 0.45rem; border-radius: 999px; }
.kanban-column-body { padding: 0.75rem; display: grid; gap: 0.65rem; flex: 1; min-height: 120px; }
.kanban-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 0.85rem; cursor: grab; transition: 0.2s;
}
.kanban-card:hover { background: var(--card-hover); border-color: rgba(139, 92, 246, 0.25); }
.kanban-card:active { cursor: grabbing; }
.kanban-card-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.35rem; }
.kanban-card-meta { font-size: 0.75rem; color: var(--muted); }
.kanban-card.sortable-ghost { opacity: 0.4; }
.kanban-card.sortable-drag { box-shadow: var(--shadow); }
.kanban-card-overdue { border-color: rgba(251, 113, 133, 0.45); background: rgba(251, 113, 133, 0.06); }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login-card {
  width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); backdrop-filter: blur(12px);
}
.login-card .brand { justify-content: center; margin-bottom: 1.75rem; }
.login-card .brand-logo { width: 84px; height: 84px; }
.login-card h2 { text-align: center; font-size: 1.35rem; margin-bottom: 0.35rem; }
.login-card .subtitle { text-align: center; color: var(--muted); font-size: 0.88rem; margin-bottom: 1.5rem; }

.calendar-mini { display: grid; gap: 0.55rem; }
.calendar-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 0.75rem; border-radius: 10px;
  background: rgba(255, 255, 255, 0.02); border: 1px solid transparent; transition: 0.2s;
}
.calendar-item:hover { border-color: var(--border); background: rgba(255, 255, 255, 0.04); }
.calendar-date { width: 44px; text-align: center; flex-shrink: 0; }
.calendar-date strong { display: block; font-size: 1.1rem; line-height: 1; }
.calendar-date small { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; }
.calendar-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-blue { background: var(--accent); }
.dot-green { background: var(--green); }
.dot-red { background: var(--rose); }
.dot-yellow { background: var(--amber); }

.search-bar { display: flex; gap: 0.65rem; margin-bottom: 1.25rem; flex-wrap: wrap; align-items: stretch; }
.search-bar input[type="search"],
.search-bar input[type="text"] { flex: 1; min-width: 0; }
.search-bar select { width: auto; min-width: 8rem; flex-shrink: 0; }

.mobile-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: 2.75rem;
  padding: 0 0.65rem;
  align-items: center;
  gap: 0.5rem;
  background: rgba(11, 15, 25, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.mobile-brand {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  line-height: 1.1;
}
.mobile-brand .brand-title { font-size: 1rem; }
.mobile-brand .brand-sub { font-size: 0.68rem; font-weight: 500; color: var(--muted); }
.mobile-brand:hover { text-decoration: none; }
.mobile-search-btn {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  text-decoration: none;
  font-size: 1rem;
}
.mobile-nav-toggle {
  display: grid;
  gap: 0.28rem;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}
.mobile-nav-toggle-bar {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0, 0, 0, 0.55);
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sidebar-backdrop.is-visible {
  display: block;
}
body.nav-open { overflow: hidden; touch-action: none; }

.mobile-bottom-nav { display: none !important; }
.mobile-module-nav { display: none !important; }

@media (max-width: 1100px) {
  .layout { margin-left: 0; }
  .mobile-topbar {
    display: flex;
    top: 0;
    left: 0;
    right: 0;
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: 0.65rem;
    padding-right: 0.65rem;
    padding-bottom: 0;
    height: calc(2.75rem + env(safe-area-inset-top, 0px));
    min-height: calc(2.75rem + env(safe-area-inset-top, 0px));
    z-index: 450;
    box-sizing: border-box;
  }
  .demo-chip-form {
    top: calc(0.45rem + env(safe-area-inset-top, 0px));
    right: 3.35rem;
  }
  .main {
    position: relative;
    z-index: 10;
    /* Nur Topbar-Höhe + winziger Abstand — kein doppeltes Safe-Area */
    padding-top: calc(2.85rem + env(safe-area-inset-top, 0px));
    padding-left: 0.85rem;
    padding-right: 0.85rem;
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }
  .main a,
  .main button,
  .main .btn,
  .main input,
  .main select,
  .main label,
  .mobile-topbar a,
  .mobile-topbar button {
    touch-action: manipulation;
  }
  .sidebar-backdrop {
    z-index: 430;
  }
  .sidebar {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 86vw);
    z-index: 440;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
    padding: calc(0.65rem + env(safe-area-inset-top, 0px)) 1rem max(1rem, env(safe-area-inset-bottom));
    box-shadow: var(--shadow);
    background: rgba(11, 15, 25, 0.98);
    border-right: 1px solid var(--border);
    transform: translate3d(-105%, 0, 0);
    transition: transform 0.2s ease;
    pointer-events: none;
    visibility: visible;
  }
  .sidebar.is-open {
    transform: translate3d(0, 0, 0);
    pointer-events: auto;
  }
  .sidebar .brand { display: flex !important; margin-bottom: 0.75rem; }
  .sidebar .brand-logo { width: 40px; height: 40px; }
  .sidebar .nav a {
    min-height: 2.75rem;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 1;
  }
  .sidebar .nav a:focus,
  .sidebar .nav a:focus-visible {
    outline: none;
  }
  .topbar {
    position: relative;
    top: auto;
    z-index: 1;
    background: transparent;
    backdrop-filter: none;
    margin: 0 0 0.65rem;
    padding: 0;
    border-bottom: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
  }
  .topbar h2 { font-size: 1.2rem; margin: 0; }
  .topbar p { margin-top: 0.15rem; }
  .topbar-actions {
    width: 100%;
    gap: 0.4rem;
  }
  .topbar-actions .btn {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.82rem;
    padding: 0.45rem 0.65rem;
  }
  .grid-2, .form-grid-2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .panel { padding: 1rem; }
  .kanban-board { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 0.5rem; }
}

@media (max-width: 768px) {
  .form-grid { max-width: none; }
  .form-grid-2 { grid-template-columns: 1fr; }
  input, textarea, select { font-size: 16px; }
  a, button, .btn, input, select, label, .mobile-module-link {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  .btn { min-height: 44px; touch-action: manipulation; }
  .btn-sm { min-height: 38px; padding: 0.5rem 0.65rem; }
  .search-bar .btn { width: 100%; }
  .search-bar select { width: 100%; }
  .table-wrap { overflow-x: visible; margin: 0; }
  .table-wrap table { display: block; width: 100%; border-collapse: separate; border-spacing: 0; }
  .table-wrap thead { display: none; }
  .table-wrap tbody { display: flex; flex-direction: column; gap: 0.75rem; }
  .table-wrap tr {
    display: block;
    padding: 0.85rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
  }
  .table-wrap td {
    display: block;
    padding: 0.25rem 0;
    border: none;
    font-size: 0.88rem;
  }
  .table-wrap td:first-child {
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
  }
  .table-wrap td:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border);
  }
  .table-wrap td:last-child .btn { flex: 1 1 calc(33% - 0.25rem); min-width: calc(33% - 0.25rem); }
  .table-wrap .company-row-actions .btn-danger { flex: 1 1 100%; min-width: 100%; margin-top: 0.25rem; }
  .table-wrap .empty-state { display: block; text-align: center; }
  .topbar-actions { flex-direction: column; align-items: stretch; }
  .topbar-actions .btn { min-width: 100%; width: 100%; justify-content: center; }
  .form-actions {
    flex-direction: column;
    align-items: stretch;
    position: sticky;
    bottom: 0;
    z-index: 30;
    background: rgba(11, 15, 25, 0.96);
    padding: 0.75rem 0;
    margin-top: 1rem;
    border-top: 1px solid var(--border);
  }
  .form-actions .btn { width: 100%; justify-content: center; }
  .stats { grid-template-columns: 1fr; }
  .toast-wrap { left: 0.75rem; right: 0.75rem; top: auto; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); }
  .dash-modal { width: 100%; max-height: 95vh; border-radius: 12px; }
  .detail-grid { grid-template-columns: 1fr; }
  .panel-head { flex-direction: column; align-items: flex-start; }
}

@media (min-width: 1101px) {
  .mobile-topbar { display: none !important; }
  .mobile-module-nav { display: none !important; }
  .sidebar-backdrop { display: none !important; }
}

.monitor-panel .panel-head span { font-size: 0.85rem; color: var(--muted); }
.monitor-watchdog {
  padding: 0 1rem 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.monitor-server.monitor-pending {
  border-color: rgba(234, 179, 8, 0.45);
}

.offer-design-intro-body { padding: 0 1rem 1rem; color: var(--muted); font-size: 0.9rem; }
.offer-design-intro-body p { margin: 0 0 0.75rem; }
.offer-design-intro-body ul { margin: 0; padding-left: 1.2rem; }
.offer-design-intro-body li { margin-bottom: 0.35rem; }
.offer-design-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.offer-design-form { padding: 0 1rem 1rem; max-width: none; }
.offer-design-form .form-hint { font-size: 0.78rem; color: var(--muted); margin: 0; }
.table-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.inline-form { display: inline; margin: 0; }
.monitor-alert-count { color: var(--rose); font-weight: 600; }
.monitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
  padding: 0 1rem 1rem;
}
.monitor-server {
  display: block;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  transition: 0.2s;
}
.monitor-server:hover {
  background: var(--card-hover);
  transform: translateY(-1px);
}
.monitor-server.monitor-critical {
  border-color: rgba(251, 113, 133, 0.55);
  background: rgba(251, 113, 133, 0.08);
  box-shadow: inset 0 0 0 1px rgba(251, 113, 133, 0.15);
}
.monitor-server-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.monitor-server-head strong { font-size: 0.95rem; flex: 1; }
.monitor-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.monitor-status-label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.65rem;
}
.monitor-status-label.is-critical { color: var(--rose); font-weight: 600; }
.monitor-metrics { display: flex; flex-direction: column; gap: 0.45rem; }
.monitor-metric-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.monitor-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.monitor-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--green);
  transition: width 0.4s ease;
}
.monitor-bar-fill.bar-warn { background: var(--amber); }
.monitor-bar-fill.bar-critical { background: var(--rose); }

.monitor-alert-panel {
  border-color: rgba(251, 113, 133, 0.45);
  background: rgba(251, 113, 133, 0.06);
}
.monitor-alert-list { padding: 0 1rem 1rem; display: flex; flex-direction: column; gap: 0.65rem; }
.monitor-alert-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(251, 113, 133, 0.25);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.15);
}
.monitor-alert-body p { margin: 0.25rem 0; font-size: 0.88rem; }
.monitor-alert-body small { color: var(--muted); font-size: 0.75rem; }
.notify-watchdog {
  padding: 0 1rem 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.notify-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem 1rem;
}
.notify-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  cursor: pointer;
}
.notify-check input { width: auto; margin: 0; }

.server-form { max-width: 720px; padding: 1rem; }
.form-section {
  grid-column: 1 / -1;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1rem 0.75rem;
  margin: 0;
}
.form-section legend {
  padding: 0 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}
.form-hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 0.65rem;
}

.monitor-row-critical { background: rgba(251, 113, 133, 0.08); }
.monitor-row-warning { background: rgba(251, 191, 36, 0.06); }

.form-group-full { grid-column: 1 / -1; }

.dashboard-overdue-panel {
  border-color: rgba(251, 113, 133, 0.35);
  background: rgba(251, 113, 133, 0.06);
}
.dashboard-task-overdue {
  border-left: 3px solid var(--rose);
  padding-left: 0.5rem;
  background: rgba(251, 113, 133, 0.04);
  border-radius: 8px;
}
.task-row-overdue {
  background: rgba(251, 113, 133, 0.08);
}
.task-row-overdue td:first-child {
  border-left: 3px solid var(--rose);
}
.task-row-high-win {
  background: rgba(52, 211, 153, 0.08);
}
.task-row-high-win td:first-child {
  border-left: 3px solid var(--green);
}
.kanban-card-high-win {
  border-color: rgba(52, 211, 153, 0.45);
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.12);
}
.badge.win-prob-high {
  font-weight: 600;
}
.dashboard-task-healthy {
  border-left: 3px solid var(--green);
  padding-left: 0.5rem;
  background: rgba(52, 211, 153, 0.04);
  border-radius: 8px;
}
.dashboard-task-stale {
  border-left: 3px solid var(--amber);
  padding-left: 0.5rem;
  background: rgba(96, 165, 250, 0.04);
  border-radius: 8px;
}
.dot-amber {
  background: var(--amber);
}

.company-list-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  padding: 0.65rem 1rem;
  margin-bottom: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 0.82rem;
  color: var(--muted);
}
.company-list-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.legend-swatch {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 3px;
  flex-shrink: 0;
}
.legend-swatch-hot { background: var(--green); box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.5); }
.legend-swatch-ok { background: rgba(52, 211, 153, 0.5); }
.legend-swatch-warn { background: #fbbf24; }
.legend-swatch-alert { background: var(--rose); }

.company-row-hot td {
  background: rgba(52, 211, 153, 0.12) !important;
  box-shadow: inset 4px 0 0 var(--green);
}
.company-list-legend-sort {
  color: var(--text);
  margin-right: 0.35rem;
}

.company-row-ok td {
  background: rgba(52, 211, 153, 0.06) !important;
  box-shadow: inset 4px 0 0 var(--green);
}

.company-row-stale td {
  background: rgba(251, 191, 36, 0.1) !important;
  box-shadow: inset 4px 0 0 #fbbf24;
}

.company-row-alert td {
  background: rgba(251, 113, 133, 0.12) !important;
  box-shadow: inset 4px 0 0 var(--rose);
}

/* Gelb klar als Warnung (nicht Blau) */
.badge-warning,
.tag-warn {
  background: rgba(251, 191, 36, 0.2) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

/* Buttons in Kunden-/Unternehmensliste: Schrift immer lesbar */
.company-list-panel .btn,
.company-hub .btn,
.company-hub-actions .btn,
.topbar-actions .btn {
  font-weight: 700;
  -webkit-text-fill-color: currentColor;
}

.company-list-panel .btn-ghost,
.company-hub .btn-ghost,
.company-hub-actions .btn-ghost,
.topbar-actions .btn-ghost,
.company-row-actions .btn-ghost {
  background: #ffffff !important;
  border: 1px solid #94a3b8 !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}

.company-list-panel .btn-ghost:hover,
.company-hub .btn-ghost:hover,
.company-row-actions .btn-ghost:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}

.company-list-panel .btn-secondary,
.company-hub .btn-secondary,
.company-hub-actions .btn-secondary,
.company-row-actions .btn-secondary {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border: 1px solid transparent;
}

.company-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  white-space: nowrap;
}
.company-inline-signal {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  vertical-align: middle;
}
.company-inline-signal-hot { color: var(--green); }
.company-inline-signal-alert { color: var(--rose); }

.badge-danger {
  background: rgba(251, 113, 133, 0.2);
  color: var(--rose);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
}

.dash-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}
.dash-modal-backdrop.is-open { display: flex; }
body.dash-modal-open {
  overflow: hidden;
  touch-action: none;
}
body.dash-modal-open .mobile-bottom-nav,
body.dash-modal-open .demo-foot-bar {
  pointer-events: none;
}
.dash-modal {
  width: min(520px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.dash-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.dash-modal-head h3 { font-size: 1.05rem; }
.dash-modal-body { padding: 1.25rem; }
.dash-modal-body .form-group { margin-bottom: 1rem; }
.dash-modal-body label { display: block; margin-bottom: 0.35rem; font-size: 0.88rem; color: var(--muted); }
.dash-modal-body textarea,
.dash-modal-body input[type="file"] {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 0.65rem 0.75rem;
}
.dash-modal-body textarea { min-height: 120px; resize: vertical; max-height: 40vh; }
.dash-modal-foot {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 0 1.25rem 1.25rem;
}
.dash-modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
}

@media (min-width: 1101px) {
  .sidebar { transform: none !important; }
}

/* Mehrfach-Zuständige (Checkboxen) */
.cal-assignee-checks div,
.cal-assignee-checks {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.cal-assignee-checks label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 400;
  cursor: pointer;
}
.cal-assignee-checks input[type="checkbox"] {
  width: auto;
  margin: 0;
}
