/* Lead-Maschine Dashboard -- dunkles Design nach KIRA-Vorbild:
   fester Dark-Mode, gelbe Akzente, gruene/rote Status-Pills. */
:root {
  --bg: #0d0e11;
  --surface: #16181d;
  --surface-alt: #1c1f26;
  --border: #262a33;
  --border-strong: #333845;
  --text: #f2f3f5;
  --text-muted: #9aa0ab;
  --primary: #f5b40a;
  --primary-dark: #ffca3a;
  --primary-ink: #1c1503;
  --primary-soft: #2e2609;
  --danger: #f87171;
  --danger-soft: #3a1618;
  --success: #4ade80;
  --success-soft: #123322;
  --warning: #fbbf24;
  --warning-soft: #332608;
  --sidebar-bg: #08090b;
  --sidebar-text: #9aa0ab;
  --sidebar-border: #1c1f26;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

/* Nackte Textlinks ohne eigene Klasse fielen auf das Browser-Standardblau
   zurueck -- auf dem dunklen Grund kaum zu erkennen. Hellgrau als Grundton,
   weiss beim Ueberfahren; Klassen-Stile (Buttons, Sidebar, Tabellen)
   ueberstimmen diese Regel weiterhin. */
a { color: #d6d9de; text-decoration-color: var(--text-muted); }
a:hover { color: #ffffff; }

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

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

.sidebar {
  width: 232px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: 22px 14px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  border-right: 1px solid var(--sidebar-border);
}
.logout-form { margin-top: auto; padding-top: 12px; }
.logout-btn { background: transparent; border-color: var(--sidebar-border); color: var(--sidebar-text); width: 100%; }
.logout-btn:hover { border-color: var(--danger); color: var(--danger); background: rgba(248, 113, 113, 0.08); }

.brand {
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  color: #fff;
  margin: 6px 8px 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(245, 180, 10, 0.25);
  flex-shrink: 0;
}

.sidebar nav { display: flex; flex-direction: column; gap: 2px; }

.sidebar nav a {
  color: var(--sidebar-text);
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.87rem;
  font-weight: 500;
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
}

.sidebar nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar nav a.active { background: var(--primary); color: var(--primary-ink); }

.content { flex: 1; padding: 36px 44px; max-width: 1280px; }

h1 { margin-top: 0; font-weight: 700; letter-spacing: -0.015em; font-size: 1.5rem; }
h2 { font-weight: 650; letter-spacing: -0.01em; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 24px 0 36px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
/* Als <a> gerenderte Stat-Karten (verlinken auf die gefilterte Lead-Liste)
   sollen wie die uebrigen Karten aussehen, nur mit Zeiger-Cursor. */
a.stat-card { text-decoration: none; color: inherit; cursor: pointer; }
a.stat-card:hover .stat-value { color: var(--primary); }

.stat-label { color: var(--text-muted); font-size: 0.8rem; font-weight: 500; }
.stat-value { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; }

.data-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.data-table th, .data-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 0.87rem; }
.data-table th { background: var(--surface-alt); color: var(--text-muted); font-weight: 600; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; }
.data-table tbody tr { transition: background 0.1s var(--ease); }
.data-table tbody tr:hover { background: var(--surface-alt); }
.data-table tr:last-child td { border-bottom: none; }
.truncate { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); font-size: 0.76rem; font-weight: 600; }
.badge-ok { background: var(--success-soft); color: var(--success); }

/* Buchhaltung/Marketing: farbcodierte Status-Pills */
.badge-paid { background: var(--success-soft); color: var(--success); }
.badge-open { background: #262a33; color: var(--text-muted); }
.badge-reminder { background: var(--warning-soft); color: var(--warning); }
.badge-dunning1 { background: #3a2210; color: #f0a060; }
.badge-dunning2 { background: var(--danger-soft); color: var(--danger); }
.badge-dunning3 { background: #4a1216; color: #ffb4bb; }
.badge-cancelled { background: #262a33; color: var(--text-muted); text-decoration: line-through; }

/* Agenten-Status: leuchtender Punkt + "automatisch"-Pill */
.agent-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 4px; vertical-align: middle; }
.agent-dot-on { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft), 0 0 10px var(--success); }
.agent-dot-off { background: var(--text-muted); }
.agent-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; font-size: 0.76rem; font-weight: 600; }
.agent-pill-on { background: var(--success-soft); color: var(--success); box-shadow: 0 0 10px rgba(74, 222, 128, 0.25); }
.agent-pill-on::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 6px var(--success); }
.agent-pill-off { background: #262a33; color: var(--text-muted); }
.agent-pill-off::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); }

/* Marketing: Kanal-Karten nach KIRA-Vorbild */
.channel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 20px 0 24px; }
.channel-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.channel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.channel-row { display: flex; justify-content: space-between; align-items: center; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 0.85rem; margin-top: 8px; }

.btn { display: inline-block; border: none; padding: 9px 16px; border-radius: 8px; font-weight: 600; font-size: 0.86rem; cursor: pointer; text-decoration: none; transition: background 0.12s var(--ease), border-color 0.12s var(--ease), color 0.12s var(--ease), transform 0.08s var(--ease); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 1px 2px rgba(245, 180, 10, 0.3); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #2a0a0a; }
.btn-danger:hover { background: #ff8f8f; }
.btn-sm { padding: 5px 10px; font-size: 0.78rem; }

.import-panel { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }

.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { display: inline-block; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 0.8rem; font-weight: 500; text-decoration: none; transition: all 0.12s var(--ease); }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip-active { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }

.filter-bar { display: flex; gap: 10px; margin-bottom: 18px; }
input, select, textarea {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
}
input::placeholder, textarea::placeholder { color: #6b7280; }
.filter-bar input, .filter-bar select { padding: 9px 12px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

.contact-cell { display: flex; flex-direction: column; gap: 2px; font-size: 0.82rem; max-width: 220px; }
.contact-cell a { color: var(--primary-dark); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-cell a:hover { text-decoration: underline; }
.muted { color: var(--text-muted); }

.inline-form { display: inline-flex; gap: 8px; align-items: center; }
.inline-form select, .inline-form input { padding: 6px 10px; }

.stacked-form { display: flex; flex-direction: column; gap: 14px; max-width: 560px; }
.stacked-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.stacked-form input, .stacked-form textarea { padding: 10px 12px; }

.settings-form fieldset { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 22px; margin-bottom: 18px; background: var(--surface); box-shadow: var(--shadow-sm); }
.settings-form legend { font-weight: 700; padding: 0 6px; letter-spacing: -0.01em; }
.settings-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.83rem; color: var(--text-muted); font-weight: 500; margin-bottom: 14px; }
.settings-form input { padding: 9px 12px; }

.campaign-panel {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px 22px; margin-bottom: 22px; box-shadow: var(--shadow-sm);
}
.campaign-actions { display: flex; gap: 8px; }

.question-form .question-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.question-row { display: flex; gap: 8px; }
.question-row input { padding: 8px 10px; }
.question-row input.grow { flex: 1; }

.project-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }

.hint { color: var(--text-muted); font-size: 0.86rem; }

.test-result { margin-left: 10px; font-size: 0.85rem; }
.test-ok { color: var(--success); }
.test-fail { color: var(--danger); }

.flash-container { margin-bottom: 20px; }
.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 8px; font-size: 0.88rem; font-weight: 500; border: 1px solid transparent; }
.flash-success { background: var(--success-soft); color: var(--success); border-color: rgba(74, 222, 128, 0.25); }
.flash-error { background: var(--danger-soft); color: var(--danger); border-color: rgba(248, 113, 113, 0.25); }

/* --- Lead-Detailseite (CRM) --- */
.lead-link { color: var(--primary-dark); font-weight: 600; text-decoration: none; }
.lead-link:hover { text-decoration: underline; }

.detail-header { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.detail-header h1 { margin: 0; font-size: 1.5rem; }
.back-link { color: var(--text-muted); text-decoration: none; font-size: 0.85rem; width: 100%; }
.back-link:hover { color: var(--primary); }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm); }
.card h2 { margin: 0 0 14px; font-size: 1.02rem; display: flex; align-items: center; gap: 8px; }
.card-wide { grid-column: 1 / -1; }

.count-pill { background: var(--primary-soft); color: var(--primary-dark); border-radius: 999px; padding: 1px 9px; font-size: 0.76rem; font-weight: 700; }

.data-list { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; margin: 0; }
.data-list dt { color: var(--text-muted); font-size: 0.83rem; }
.data-list dd { margin: 0; font-size: 0.88rem; }
.data-list a { color: var(--primary-dark); text-decoration: none; }

.project-info { background: var(--surface-alt); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin: 14px 0; font-size: 0.85rem; display: flex; flex-direction: column; gap: 4px; }
.project-info code { font-size: 0.82rem; }

.status-form { margin: 16px 0 12px; }
.status-form select { padding: 8px 10px; margin-left: 8px; }

.edit-grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 12px; margin: 10px 0 18px; }
.edit-grid-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.78rem; color: var(--text-muted); font-weight: 600; }
.edit-grid-form input, .edit-grid-form select { padding: 8px 10px; font-size: 0.9rem; }
.edit-grid-form-actions { grid-column: 1 / -1; }

.task-form { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.task-form input[type=text] { flex: 1 1 180px; padding: 8px 10px; }
.task-form input[type=date] { padding: 8px 10px; }
.task-form select { padding: 8px 10px; }
.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.task-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-alt); }
.task-title { font-size: 0.88rem; font-weight: 600; }
.task-due { display: block; color: var(--text-muted); font-size: 0.76rem; margin-top: 2px; }

.note-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.note-form textarea { padding: 10px 12px; resize: vertical; }
.note-form button { align-self: flex-start; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline-item { position: relative; padding: 0 0 18px 26px; }
.timeline-item:not(:last-child)::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 2px; background: var(--border); }
.timeline-dot { position: absolute; left: 0; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--primary); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border); }
.timeline-dot[data-typ="Statuswechsel"] { background: #a78bfa; }
.timeline-dot[data-typ="Notiz"] { background: #94a3b8; }
.timeline-dot[data-typ="Antwort erhalten"] { background: var(--success); }
.timeline-dot[data-typ="Anruf"] { background: var(--warning); }
.timeline-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.timeline-date { color: var(--text-muted); font-size: 0.76rem; white-space: nowrap; }
.timeline-subject { font-size: 0.87rem; margin-top: 2px; font-weight: 500; }
.timeline-note { font-size: 0.84rem; color: var(--text-muted); margin-top: 3px; white-space: pre-wrap; }

@media (max-width: 860px) { .detail-grid { grid-template-columns: 1fr; } }

/* --- Pipelines/Analytics: gelbe Fortschrittsbalken (KIRA-Stil) --- */
.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel-row { display: grid; grid-template-columns: 220px 1fr 90px; align-items: center; gap: 14px; }
.funnel-label { font-size: 0.85rem; color: var(--text); font-weight: 500; }
.funnel-track { background: var(--surface-alt); border-radius: 8px; height: 30px; overflow: hidden; border: 1px solid var(--border); }
.funnel-bar { background: linear-gradient(90deg, var(--primary), #d99a06); height: 100%; min-width: 34px; display: flex; align-items: center; justify-content: flex-end; padding-right: 10px; border-radius: 7px; transition: width 0.5s var(--ease); }
.funnel-bar-alt { background: linear-gradient(90deg, #a78bfa, #7c5cd6); }
.funnel-count { color: #1c1503; font-weight: 700; font-size: 0.8rem; }
.funnel-bar-alt .funnel-count { color: #14092e; }
.funnel-conv { text-align: right; font-size: 0.8rem; color: var(--success); font-weight: 600; }
.funnel-footnote { margin-top: 12px; font-size: 0.82rem; }
@media (max-width: 760px) { .funnel-row { grid-template-columns: 120px 1fr 64px; gap: 8px; } .funnel-label { font-size: 0.78rem; } }

/* --- Login / Ersteinrichtung --- */
.login-body {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, rgba(245, 180, 10, 0.08), transparent 45%),
              radial-gradient(circle at 80% 80%, rgba(167, 139, 250, 0.06), transparent 45%),
              var(--bg);
  margin: 0; font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
}
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 34px; width: 100%; max-width: 360px; box-shadow: var(--shadow-lg); }
.login-brand { color: var(--text); margin-bottom: 18px; font-weight: 700; letter-spacing: -0.01em; }
.login-card h1 { font-size: 1.3rem; margin: 0 0 8px; letter-spacing: -0.015em; }
.login-form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.login-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.login-form input { padding: 10px 12px; font-size: 0.95rem; }
.login-form button { margin-top: 4px; }
.logout-form { display: inline; }

/* --- Pipeline-Job-Historie --- */
.job-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.job-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-alt); }
.job-status { flex-shrink: 0; padding: 3px 10px; border-radius: 999px; font-size: 0.73rem; font-weight: 700; text-transform: capitalize; }
.job-status-success { background: var(--success-soft); color: var(--success); }
.job-status-failed { background: var(--danger-soft); color: var(--danger); }
.job-status-running { background: var(--warning-soft); color: var(--warning); }
.job-status-queued { background: #262a33; color: var(--text-muted); }
.job-body { flex: 1; min-width: 0; }
.job-step { font-size: 0.87rem; font-weight: 600; }
.job-date { color: var(--text-muted); font-size: 0.76rem; margin-left: 8px; }
.job-error { color: var(--danger); font-size: 0.82rem; margin-top: 4px; word-break: break-word; }

/* --- Anruf protokollieren --- */
.call-form { display: flex; flex-direction: column; gap: 8px; }
.call-form select, .call-form textarea { padding: 9px 12px; }
.call-form button { align-self: flex-start; }

/* --- User-Verwaltung --- */
.role-choice { display: flex; gap: 16px; }
.role-option { display: flex; align-items: center; gap: 6px; font-size: 0.88rem; color: var(--text); font-weight: 500; }

/* Nur fuer Screenreader sichtbar -- Beschriftungen, die visuell aus dem
   Tabellenkopf hervorgehen, ohne Label aber unbeschriftet blieben. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.filter-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Restaurant: Tagesumsatz-Diagramm ---------- */
.tages-diagramm {
  display: flex; align-items: flex-end; gap: 6px;
  height: 160px; padding-top: 8px;
}
.tages-saeule {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: flex-end; height: 100%; min-width: 0;
}
.tages-balken {
  width: 100%; border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #e2571e, #b8410f);
  transition: opacity 150ms ease;
}
.tages-saeule:hover .tages-balken { opacity: .78; }

/* Fortschrittsbalken fuer laufende Hintergrundarbeit (z.B. Produktbilder).
   Bewusst kein <progress>: das laesst sich quer durch die Browser nicht
   verlaesslich auf die Dashboard-Farben bringen. */
.fortschritt {
  height: 10px; border-radius: 999px; overflow: hidden;
  background: rgba(255, 255, 255, .12);
}
.fortschritt-balken {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #e2571e, #f59e0b);
  transition: width 400ms ease;
}

/* ---------- Gefuehrter Einrichtungsprozess ---------- */
/* Abgeschlossene Einrichtung: nur noch eine Zeile, aufklappbar. Die Schritte
   sind dann einmalig erledigt -- Bestellungen und Reservierungen brauchen den
   Platz oben taeglich. */
.einrichtung-fertig { padding: 12px 16px; margin-bottom: 18px; }
.einrichtung-fertig > summary {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  cursor: pointer; list-style: none; user-select: none;
}
.einrichtung-fertig > summary::-webkit-details-marker { display: none; }
.einrichtung-fertig > summary::after {
  content: "▾"; margin-left: auto; color: var(--text-muted);
  transition: transform 0.15s var(--ease);
}
.einrichtung-fertig[open] > summary::after { transform: rotate(180deg); }
.einrichtung-fertig > summary:hover { color: var(--primary); }

/* Einstellungen in thematische Bloecke gegliedert -- ein einziges langes
   Formular war kaum noch ueberschaubar. */
.einstell-block {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 18px 18px; margin: 0 0 16px; background: var(--surface);
}
.einstell-block > legend {
  padding: 0 8px; font-size: 0.9rem; font-weight: 700;
  letter-spacing: 0.02em; color: var(--primary);
}
.einstell-untertitel {
  margin: 18px 0 0; font-size: 0.88rem; font-weight: 700;
  padding-top: 14px; border-top: 1px solid var(--border);
}
/* Zwei Spalten per CSS-columns: die Bloecke sind unterschiedlich hoch, ein
   Grid liesse dabei sichtbare Luecken stehen. */
.einstell-spalten { columns: 2; column-gap: 18px; }
.einstell-spalten > .einstell-block {
  break-inside: avoid; -webkit-column-break-inside: avoid;
  display: inline-block; width: 100%;
}
/* Unter ~860px Fensterbreite bleibt je Spalte zu wenig fuer die Eingabefelder
   -- dann lieber wieder einspaltig. */
@media (max-width: 860px) { .einstell-spalten { columns: 1; } }

/* Bestellansicht als geschlossener Kasten -- Filter, Druckauswahl und Liste
   gehoeren zusammen. */
.bestell-box { padding: 16px 18px 18px; margin-bottom: 18px; }

/* Kalender-Vorschau: der laufende Monat auf einen Blick, klickbar in die
   Reservierungsverwaltung. */
.kalender-vorschau {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); padding: 14px 16px; margin: 0 0 16px;
  max-width: 420px; transition: border-color 0.15s var(--ease);
}
.kalender-vorschau:hover { border-color: var(--primary); }
.kalender-vorschau-kopf {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
}
.kalender-vorschau-gitter {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px;
  font-variant-numeric: tabular-nums;
}
.kv-wochentag {
  text-align: center; font-size: 0.68rem; font-weight: 700;
  color: var(--text-muted); padding-bottom: 4px;
}
.kv-leer { visibility: hidden; }
.kv-tag {
  position: relative; text-align: center; font-size: 0.75rem;
  padding: 5px 0 7px; border-radius: 5px; color: var(--text-muted);
}
.kv-belegt { background: var(--surface-alt); color: var(--text); font-weight: 700; }
.kv-heute { outline: 1px solid var(--primary); color: var(--primary); }
.kv-punkt {
  position: absolute; left: 50%; bottom: 3px; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--primary);
}

/* Reservierungen zweispaltig: links der Monat, rechts die naechsten fuenf
   Buchungen. */
.reservier-spalten {
  display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: 18px; align-items: start; margin: 0 0 16px;
}
.reservier-spalten > .kalender-vorschau { margin: 0; max-width: none; }
@media (max-width: 860px) { .reservier-spalten { grid-template-columns: 1fr; } }
.reservier-naechste { padding: 14px 16px 16px; margin: 0; }
.res-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.res-eintrag {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 12px; align-items: center; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-alt); font-size: 0.85rem;
}
.res-eintrag .res-datum { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.res-eintrag .res-personen { color: var(--text-muted); white-space: nowrap; }
.res-eintrag .res-gast { min-width: 0; }
.res-eintrag .res-gast .hint { display: block; }
@media (max-width: 600px) {
  .res-eintrag { grid-template-columns: auto minmax(0, 1fr); }
}

.prozess { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; }
.prozess-schritt {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface-alt);
}
/* Der naechste offene Schritt wird hervorgehoben -- er ist die einzige
   Stelle, an der gerade etwas zu tun ist. */
.prozess-dran { border-color: var(--primary); background: var(--primary-soft); }
.prozess-fertig { opacity: .62; }
.prozess-nummer {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  background: var(--border-strong); color: var(--text);
}
.prozess-fertig .prozess-nummer { background: var(--success); color: #06210f; }
.prozess-dran .prozess-nummer { background: var(--primary); color: var(--primary-ink); }
.prozess-text { flex: 1; min-width: 0; }
.prozess-offen { margin-top: 4px; font-size: 13px; color: var(--warning, #fbbf24); }
.prozess-schritt .btn { flex-shrink: 0; align-self: center; }

/* ---------- Kundeninformationen (zweispaltig) ---------- */
.kunden-spalten {
  display: grid; gap: 10px 32px; margin-top: 14px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.kunden-titel {
  margin: 0 0 8px; font-size: 13px; text-transform: uppercase;
  letter-spacing: .7px; color: var(--text-muted);
}
/* Zweispaltig je Eintrag: Bezeichnung schmal, Wert daneben -- so stehen die
   Werte untereinander auf einer Kante. */
.kunden-liste {
  margin: 0; display: grid; grid-template-columns: 130px 1fr;
  gap: 6px 12px; align-items: baseline;
}
.kunden-liste dt { color: var(--text-muted); font-size: 13px; }
.kunden-liste dd { margin: 0; overflow-wrap: anywhere; }
.tages-marke {
  font-size: 11px; color: var(--muted, #6b625b); margin-top: 5px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
