/* ════════════════════════════════════════════════════════════════════
   getbusiness — Oberfläche im Stil von sweevo
   Farbsystem, Typografie, Abstände und Komponenten sind 1:1 aus
   sweevo/src/index.css und den dortigen UI-Bausteinen übernommen.
   ════════════════════════════════════════════════════════════════════ */

/* ── Schriften (mitgeliefert, kein CDN) ─────────────────────────────── */
@font-face {
  font-family: 'Overpass Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/overpass-latin.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Overpass Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/overpass-latin-ext.woff2') format('woff2-variations');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url('/fonts/jetbrains-mono-latin.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Farbsystem (HSL wie in sweevo) ─────────────────────────────────── */
:root {
  --background: 210 8% 96%;
  --foreground: 220 39% 11%;
  --card: 0 0% 100%;
  --primary: 171 76% 10%;
  --primary-foreground: 0 0% 100%;
  --primary-hover: 171 73% 15%;
  --muted: 220 9% 93%;
  --muted-foreground: 220 9% 42%;
  --accent: 220 9% 91%;
  --destructive: 0 72% 44%;
  --success: 152 62% 30%;
  --warning: 35 92% 40%;
  --border: 220 10% 87%;
  --input: 212 8% 56%;
  --input-flaeche: 220 20% 97%;
  --input-hover: 212 10% 44%;
  --placeholder: 218 11% 62%;
  --ring: 171 76% 10%;
  --radius: 0.625rem;

  --akzent: 96 73% 68%;
  --akzent-foreground: 171 76% 10%;
  --akzent-flaeche: 88 68% 91%;
  --akzent-kraeftig: 89 66% 85%;

  --sidebar: 171 76% 10%;
  --sidebar-foreground: 240 5% 84%;
  --sidebar-muted: 168 10% 55%;
  --sidebar-border: 171 60% 17%;
  --sidebar-accent: 171 73% 15%;
  --sidebar-active: 96 73% 68%;

  --label: 200 18% 18%;
  --status-entwurf: 240 4% 46%;
  --status-bearbeitung: 199 89% 34%;
  --status-geprueft: 258 62% 55%;
  --status-freigegeben: 152 62% 30%;
  --status-archiviert: 240 4% 55%;

  --font-sans: 'Overpass Variable', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono Variable', ui-monospace, SFMono-Regular, Menlo, monospace;

  --r-sm: calc(var(--radius) - 4px);
  --r-md: calc(var(--radius) - 2px);
  --r-lg: var(--radius);
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / .05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
}

* { box-sizing: border-box; border-color: hsl(var(--border)); }

html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; margin: 0; }

body {
  overflow: hidden;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-sans);
  font-weight: 500;          /* Grundschnitt 500 — gibt der Oberfläche Präsenz */
  font-size: 0.875rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-sans); letter-spacing: -.02em; margin: 0; }

button:not(:disabled), [role='button']:not(:disabled), a[href], label[for], summary { cursor: pointer; }
:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }

.tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.eyebrow {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin: 0;
}

code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: hsl(var(--muted));
  border-radius: 4px;
  padding: 1px 5px;
}

/* ════════ Grundgerüst ════════ */
.app { display: flex; height: 100vh; overflow: hidden; }

/* ── Seitenleiste (Dunkelgrün) ──────────────────────────────────────── */
.sidebar {
  width: 16rem;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: hsl(var(--sidebar));
  height: 100vh;
}

.sidebar-kopf {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid hsl(var(--sidebar-border));
}

.sidebar-shimmer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / .06), transparent);
  animation: sidebar-shimmer 3.5s ease-in-out infinite;
}
@keyframes sidebar-shimmer {
  0%   { transform: translateX(-100%); }
  55%, 100% { transform: translateX(100%); }
}

.sidebar-marke { position: relative; display: flex; align-items: center; gap: .75rem; }

.marke-zeichen {
  width: 2.25rem; height: 2.25rem;
  flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-lg);
  background: hsl(var(--akzent));
  color: hsl(var(--akzent-foreground));
  font-weight: 700; font-size: 13px; letter-spacing: -.03em;
}
.marke-text strong { display: block; color: #fff; font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.marke-text small  { display: block; margin-top: 1px; font-size: 11.5px; color: hsl(var(--sidebar-muted)); }

.sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem .75rem;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-gruppe {
  margin: 0 0 .5rem;
  padding: 0 .75rem;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: hsl(var(--sidebar-muted));
}
.nav-gruppe:not(:first-child) { margin-top: 1rem; }

.sidebar-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; }

.nav-eintrag {
  position: relative;
  width: 100%;
  display: flex; align-items: center; gap: .75rem;
  padding: .5rem .75rem;
  border: 0; background: none;
  border-radius: var(--r-lg);
  font: inherit; font-size: 13.5px;
  color: hsl(var(--sidebar-foreground));
  text-align: left;
  transition: all .2s;
}
.nav-eintrag:hover { background: hsl(var(--sidebar-accent) / .5); color: #fff; }
.nav-eintrag.aktiv { background: hsl(var(--sidebar-accent) / .8); color: #fff; font-weight: 600; }

.nav-balken {
  position: absolute; left: 0; top: 50%;
  height: 1.5rem; width: 3px;
  transform: translateY(-50%);
  border-radius: 0 999px 999px 0;
  background: hsl(var(--sidebar-active));
  opacity: 0;
  transition: opacity .3s;
}
.nav-eintrag.aktiv .nav-balken { opacity: 1; }

.nav-punkt {
  width: 7px; height: 7px; flex: none;
  border-radius: 50%;
  background: hsl(var(--sidebar-muted));
  transition: background .2s;
}
.nav-eintrag.aktiv .nav-punkt { background: hsl(var(--sidebar-active)); }
.nav-eintrag:hover .nav-punkt { background: #fff; }

.nav-zahl {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: hsl(var(--sidebar-muted));
}
.nav-eintrag.aktiv .nav-zahl { color: hsl(var(--sidebar-active)); }

/* Suchhistorie in der Seitenleiste */
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; }
.history .leer { padding: .25rem .75rem; font-size: 12px; color: hsl(var(--sidebar-muted)); }
.history-zeile { display: flex; align-items: center; gap: .125rem; }

/* Der Eintrag nimmt den freien Platz und darf schrumpfen (min-width: 0),
   damit der Suchbegriff gekürzt statt vom Löschknopf weggedrückt wird. */
.history-eintrag {
  flex: 1 1 auto;
  min-width: 0;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .375rem .75rem;
  border: 0; background: none;
  border-radius: var(--r-lg);
  font: inherit; font-size: 12.5px;
  color: hsl(var(--sidebar-foreground));
  text-align: left;
  transition: all .2s;
}
.history-eintrag:hover { background: hsl(var(--sidebar-accent) / .5); color: #fff; }
.history-eintrag.aktiv { background: hsl(var(--sidebar-accent) / .8); color: #fff; font-weight: 600; }

.history .term { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history .zahl { flex: none; font-family: var(--font-mono); font-size: 11px; color: hsl(var(--sidebar-muted)); }

/* Löschknopf erscheint erst beim Überfahren — er soll die Liste nicht dominieren. */
.history-weg {
  flex: none;
  width: 1.5rem; height: 1.5rem;
  padding: 0;
  display: grid; place-items: center;
  border: 0; background: none;
  border-radius: var(--r-sm);
  color: hsl(var(--sidebar-muted));
  font: inherit; font-size: 11px; line-height: 1;
  opacity: 0;
  transition: opacity .15s, background-color .15s, color .15s;
}
.history-zeile:hover .history-weg,
.history-weg:focus-visible { opacity: 1; }
.history-weg:hover { background: hsl(var(--destructive) / .25); color: #fff; }

/* Kennzahl am Fuß der Seitenleiste */
.sidebar-kennzahl { flex-shrink: 0; padding: 0 .75rem .75rem; }
.kennzahl-karte {
  border-radius: var(--r-lg);
  background: hsl(var(--sidebar-accent) / .6);
  box-shadow: inset 0 0 0 1px hsl(var(--sidebar-border));
  padding: .75rem;
}
.kennzahl-kopf { display: flex; align-items: center; gap: .5rem; }
.kennzahl-kopf p {
  margin: 0;
  font-size: 12px; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase;
  color: hsl(var(--sidebar-muted));
}
.puls { position: relative; display: flex; width: .5rem; height: .5rem; flex: none; }
.puls-welle {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: hsl(var(--akzent) / .6);
  animation: puls 1.6s cubic-bezier(0, 0, .2, 1) infinite;
}
.puls-kern { position: relative; width: .5rem; height: .5rem; border-radius: 50%; background: hsl(var(--akzent)); }
@keyframes puls { 75%, 100% { transform: scale(2); opacity: 0; } }

.kennzahl-wert {
  margin: .375rem 0 0;
  font-family: var(--font-mono);
  font-size: 15px; font-weight: 600;
  color: #fff;
}
.kennzahl-hinweis {
  margin: .125rem 0 0;
  font-size: 11px;
  color: hsl(var(--sidebar-muted));
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Hauptbereich ───────────────────────────────────────────────────── */
.haupt { display: flex; flex-direction: column; flex: 1; min-width: 0; }

.kopfleiste {
  height: 3rem;
  flex-shrink: 0;
  display: flex; align-items: center; gap: .5rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--card) / .8);
  backdrop-filter: blur(12px);
}

.kopf-suche { position: relative; display: flex; align-items: center; width: min(22rem, 100%); }
.kopf-suche svg {
  position: absolute; left: .625rem;
  width: 15px; height: 15px;
  fill: none; stroke: hsl(var(--muted-foreground)); stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  pointer-events: none;
}
.kopf-suche input { padding-left: 2rem; height: 2rem; }

.kopf-aktionen { margin-left: auto; display: flex; align-items: center; gap: .5rem; }

.inhalt { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.page {
  max-width: none;
  display: flex; flex-direction: column; gap: .75rem;
  padding: 1rem 1.25rem 1.5rem;
}

/* ── Seitenkopf ─────────────────────────────────────────────────────── */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.page-head .eyebrow { color: hsl(var(--primary) / .7); }
.page-head h1 { font-size: 19px; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; }
.page-beschreibung { margin: .125rem 0 0; font-size: 12.5px; line-height: 1.35; color: hsl(var(--muted-foreground)); }

/* ── Kennzahlkacheln ────────────────────────────────────────────────── */
.stat-reihe { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }

.stat {
  display: flex; align-items: flex-start; gap: .5rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--r-lg);
  background: hsl(var(--card));
  box-shadow: var(--shadow-sm);
  padding: .625rem .75rem;
}
.stat-symbol {
  width: 1.75rem; height: 1.75rem; flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-md);
  background: hsl(var(--akzent-flaeche));
  color: hsl(var(--primary));
  font-size: 13px;
}
.stat-text { min-width: 0; flex: 1; }
.stat-label {
  margin: 0;
  font-size: 10px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  line-height: 1.2;
  color: hsl(var(--muted-foreground));
}
.stat-wert {
  margin: .125rem 0 0;
  font-size: 17px; font-weight: 600;
  line-height: 1.2; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.stat-hinweis { margin: 0; font-size: 10px; line-height: 1.25; color: hsl(var(--muted-foreground)); }

/* ── Abschnitte ─────────────────────────────────────────────────────── */
.section {
  overflow: hidden;
  border: 1px solid hsl(var(--border));
  border-radius: var(--r-lg);
  background: hsl(var(--card));
  box-shadow: var(--shadow-sm);
}

.section-kopf {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem;
  border-bottom: 1px solid hsl(var(--border));
  padding: .5rem 1rem;
}
.section-kopf h2 { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.section-beschreibung { margin: 0; font-size: 11.5px; line-height: 1.35; color: hsl(var(--muted-foreground)); }
.section-inhalt { padding: .75rem 1rem; }

.section-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem;
  border-bottom: 1px solid hsl(var(--border));
  padding: .5rem .75rem;
}

/* ════════════════════════════════════════════════════════════════════
   Dialog — Aufbau wie sweevo/ui/dialog: zentrierte Tafel, Kopf/Body/Fuß
   durch Linien getrennt, kurze Ein- und Ausblendung.
   ════════════════════════════════════════════════════════════════════ */

.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; }
.modal[hidden] { display: none; }

.modal-hintergrund {
  position: absolute; inset: 0;
  border: 0;
  background: rgb(0 0 0 / .5);
  animation: bc-fade-in 120ms ease-out;
}
.modal.schliesst .modal-hintergrund { animation: bc-fade-out 100ms ease-in forwards; }

.modal-tafel {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: calc(100vw - 2rem);
  max-width: 34rem;
  max-height: 94vh;
  overflow: hidden;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 4px);
  background: hsl(var(--card));
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);
  animation: bc-fade-in 120ms ease-out;
}
.modal.schliesst .modal-tafel { animation: bc-fade-out 100ms ease-in forwards; }

@keyframes bc-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes bc-fade-out { from { opacity: 1; } to { opacity: 0; } }

.modal-tafel.schmal { max-width: 26rem; }
.modal-tafel form { display: contents; }

.modal-kopf {
  position: relative;
  display: flex; flex-direction: column; gap: .25rem;
  border-bottom: 1px solid hsl(var(--border));
  padding: 1rem 3rem 1rem 1.25rem;
}
.modal-kopf h2 { font-size: 16px; font-weight: 600; }
.modal-beschreibung { margin: 0; font-size: 12px; color: hsl(var(--muted-foreground)); }

.modal-schliessen {
  position: absolute; right: .75rem; top: .75rem;
  width: 1.75rem; height: 1.75rem;
  display: grid; place-items: center;
  border: 0; background: none;
  border-radius: var(--r-lg);
  color: hsl(var(--muted-foreground));
  font-size: 14px; line-height: 1;
}
.modal-schliessen:hover { background: hsl(var(--accent)); color: hsl(var(--foreground)); }

.modal-body {
  overflow-y: auto;
  scrollbar-width: thin;
  padding: 1rem 1.25rem;
  display: flex; flex-direction: column; gap: .875rem;
}

.modal-fuss {
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem;
  border-top: 1px solid hsl(var(--border));
  padding: .75rem 1.25rem;
}
.modal-fuss .links { margin-right: auto; }

/* Eingabefeld mit Aktionsknopf daneben */
.feld-mit-knopf { display: flex; gap: .5rem; align-items: stretch; }
.feld-mit-knopf input { flex: 1 1 auto; min-width: 0; }
.feld-mit-knopf .btn { flex: none; }

/* Segmentierte Auswahl — eine Zeile gleichwertiger Schalter */
.segment { display: flex; flex-wrap: wrap; gap: .375rem; }

.segment button {
  display: inline-flex; align-items: center; gap: .375rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--r-md);
  background: hsl(var(--card));
  padding: .375rem .625rem;
  font: inherit; font-size: 12.5px; font-weight: 500;
  color: hsl(var(--muted-foreground));
  transition: all .15s;
}
.segment button:hover { border-color: hsl(var(--input)); background: hsl(var(--accent)); }
.segment button.gewaehlt {
  border-color: currentColor;
  background: hsl(var(--akzent-flaeche));
  font-weight: 700;
}

/* Zusammengehörige Felder mit eigener Überschrift */
.feld-gruppe {
  display: flex; flex-direction: column; gap: .75rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--r-md);
  background: hsl(var(--muted) / .4);
  padding: .75rem;
}
.gruppe-titel {
  margin: 0;
  font-size: 11px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

/* Zustandszeile der Datenquellen im Einstellungsdialog */
.quelle-status { display: flex; flex-direction: column; gap: .375rem; }
.quelle-zeile {
  display: flex; align-items: center; gap: .5rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--r-md);
  background: hsl(var(--muted) / .5);
  padding: .5rem .625rem;
  font-size: 12.5px;
}
.quelle-zeile .punkt { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.quelle-zeile .name { font-weight: 600; }
.quelle-zeile .lage { margin-left: auto; color: hsl(var(--muted-foreground)); font-size: 12px; }

/* ── Formular ───────────────────────────────────────────────────────── */
.form-raster {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px;
  gap: .625rem .75rem;
}
.form-raster > * { min-width: 0; }

.feld { display: flex; flex-direction: column; gap: .25rem; }
.feld > span {
  font-size: 11.5px; font-weight: 600;
  color: hsl(var(--label));
}
.feld > span small { font-weight: 400; color: hsl(var(--muted-foreground)); }

.feld-hinweis { margin: .5rem 0 0; font-size: 11px; line-height: 1.4; color: hsl(var(--muted-foreground)); }
.feld-hinweis.treffer-gut      { color: hsl(var(--success));     font-weight: 600; }
.feld-hinweis.treffer-schlecht { color: hsl(var(--destructive)); font-weight: 600; }
.feld-hinweis.treffer-unklar   { color: hsl(var(--warning));     font-weight: 600; }

.schalter-reihe { display: flex; flex-wrap: wrap; gap: 1rem; }

.schalter { display: flex; align-items: center; gap: .5rem; font-size: 12.5px; color: hsl(var(--muted-foreground)); }
.schalter input { width: 15px; height: 15px; accent-color: hsl(var(--primary)); }
.schalter strong { color: hsl(var(--foreground)); font-weight: 600; }

/* Eingabefelder — gemeinsame Optik (feld-flaeche aus sweevo).
   Bewusst über Ausschluss statt Aufzählung: eine Liste einzelner Typen
   vergisst zwangsläufig welche (password, date, email …) und die fallen
   dann unformatiert auf die Browser-Darstellung zurück. */
input:not([type='checkbox']):not([type='radio']):not([type='file']):not([type='range']):not([type='color']):not([type='submit']):not([type='button']):not([type='reset']):not([type='image']):not([type='hidden']),
select, textarea {
  width: 100%;
  height: 2.25rem;
  border: 1px solid hsl(var(--input));
  border-radius: var(--r-md);
  background-color: hsl(var(--input-flaeche));
  color: hsl(var(--foreground));
  font: inherit;
  font-size: 13px;
  padding: .25rem .75rem;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
input::placeholder, textarea::placeholder { color: hsl(var(--placeholder)); }
input:hover:not(:disabled):not([type='checkbox']), select:hover:not(:disabled), textarea:hover:not(:disabled) {
  border-color: hsl(var(--input-hover));
}

/* Datumsfeld: Kalendersymbol in der Textfarbe, sonst kaum sichtbar. */
input[type='date'] { min-height: 2.25rem; }
input[type='date']::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .55; }
input[type='date']::-webkit-calendar-picker-indicator:hover { opacity: 1; }
input:focus, select:focus, textarea:focus {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / .14);
}
input[type='checkbox'] { width: auto; height: auto; padding: 0; border: 0; box-shadow: none; }

select {
  appearance: none;
  padding-right: 1.75rem;
  background-image:
    linear-gradient(45deg, transparent 50%, hsl(var(--muted-foreground)) 50%),
    linear-gradient(135deg, hsl(var(--muted-foreground)) 50%, transparent 50%);
  background-position: calc(100% - 15px) 16px, calc(100% - 10px) 16px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
select.klein { height: 2rem; width: auto; font-size: 12.5px; background-position: calc(100% - 15px) 14px, calc(100% - 10px) 14px; }

textarea {
  height: auto;
  min-height: 5rem;
  padding: .375rem .625rem;
  resize: vertical;
  line-height: 1.5;
  box-shadow: inset 0 1px 2px rgb(0 0 0 / .045);
}
textarea:focus { box-shadow: 0 0 0 3px hsl(var(--primary) / .14), inset 0 1px 2px rgb(0 0 0 / .045); }

/* ── Schaltflächen ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  white-space: nowrap;
  height: 2.25rem;
  padding: .375rem .875rem;
  border: 0;
  border-radius: var(--r-md);
  font-family: var(--font-sans);
  font-size: 12.5px; font-weight: 600;
  text-decoration: none;
  transition: all .2s;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  box-shadow: var(--shadow-sm);
}
.btn svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.primary svg { stroke: hsl(var(--akzent)); }
.btn:hover { background: hsl(var(--sidebar-accent)); }
.btn:disabled { pointer-events: none; opacity: .5; }

.btn.ghost {
  background: transparent;
  color: hsl(var(--foreground));
  box-shadow: none;
}
.btn.ghost:hover { background: hsl(var(--accent)); }

.btn.outline {
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  box-shadow: var(--shadow-sm);
}
.btn.outline:hover { border-color: hsl(var(--input)); background: hsl(var(--accent)); }

.btn.akzent { background: hsl(var(--akzent)); color: hsl(var(--akzent-foreground)); }
.btn.akzent:hover { filter: brightness(.95); background: hsl(var(--akzent)); }
.btn.akzent svg { stroke: hsl(var(--akzent-foreground)); }

.btn.sekundaer { background: hsl(var(--akzent-flaeche)); color: hsl(var(--primary)); box-shadow: none; }
.btn.sekundaer:hover { background: hsl(var(--akzent-kraeftig)); }

.btn.gefahr { background: hsl(var(--destructive)); color: #fff; }
.btn.gefahr:hover { background: hsl(var(--destructive) / .9); }

.btn.sm { height: 2rem; padding: .25rem .75rem; }
.btn.block { width: 100%; }
.btn.icon { width: 2.25rem; padding: 0; }

/* ── Suchstatus ─────────────────────────────────────────────────────── */
.such-status {
  margin-top: .75rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--r-md);
  background: hsl(var(--muted));
  padding: .5rem .75rem;
  font-size: 12px; line-height: 1.5;
  color: hsl(var(--muted-foreground));
}
.such-status.ok   { border-color: hsl(var(--success) / .3);     background: hsl(var(--success) / .1);     color: hsl(var(--success)); }
.such-status.err  { border-color: hsl(var(--destructive) / .3); background: hsl(var(--destructive) / .1); color: hsl(var(--destructive)); }
.such-status.busy { border-color: hsl(var(--primary) / .25);    background: hsl(var(--akzent-flaeche));   color: hsl(var(--primary)); }

/* ── Filterpillen ───────────────────────────────────────────────────── */
.filter-reihe { display: flex; flex-wrap: wrap; gap: .375rem; }

.pille {
  display: inline-flex; align-items: center; gap: .375rem;
  height: 1.75rem;
  padding: 0 .625rem;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  background: hsl(var(--card));
  font: inherit; font-size: 12px; font-weight: 600;
  color: hsl(var(--muted-foreground));
  transition: all .15s;
}
.pille:hover { border-color: hsl(var(--input)); background: hsl(var(--accent)); }
.pille.aktiv { border-color: transparent; background: hsl(var(--akzent-flaeche)); color: hsl(var(--primary)); }
.pille .punkt { width: 7px; height: 7px; border-radius: 50%; }
.pille .zahl { font-family: var(--font-mono); font-size: 11px; font-weight: 500; opacity: .8; }

/* ── Tabelle ────────────────────────────────────────────────────────── */
/* Eigener Scrollbereich, damit der Tabellenkopf beim Blättern stehen bleibt. */
.tabelle-huelle { width: 100%; overflow: auto; max-height: calc(100vh - 21rem); scrollbar-width: thin; }

table.tabelle {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12.5px;
}

.tabelle thead th {
  position: sticky; top: 0; z-index: 2;
  height: 2rem;
  padding: 0 .625rem;
  text-align: left;
  vertical-align: middle;
  font-size: 11px; font-weight: 600;
  letter-spacing: .025em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  background-color: hsl(var(--muted));
  box-shadow: inset 0 -1px 0 hsl(var(--border));
  white-space: nowrap;
}

.tabelle tbody tr { transition: background-color .15s; }
.zebra tbody tr:nth-child(even) { background-color: hsl(215 16% 97%); }
.tabelle tbody tr:hover { background-color: hsl(var(--accent)); }
.tabelle tbody tr.gewaehlt { background-color: hsl(var(--akzent-flaeche) / .6); }

.tabelle td { padding: .25rem .625rem; vertical-align: middle; }

.c-name  { width: 26%; }
.c-phone { width: 15%; }
.c-addr  { width: 24%; }
.c-rating{ width: 10%; }
.c-hours { width: 16%; }
.c-status{ width: 9%; }

.zeile-name { font-weight: 600; line-height: 1.3; }
.zeile-unter { font-size: 11px; color: hsl(var(--muted-foreground)); line-height: 1.3; }
.zelle-kurz { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gedimmt { color: hsl(var(--muted-foreground)); }

.bewertung { display: inline-flex; align-items: center; gap: .25rem; font-variant-numeric: tabular-nums; }
.bewertung .stern { color: hsl(var(--warning)); }
.bewertung .anzahl { font-size: 11px; color: hsl(var(--muted-foreground)); }

/* ── Abzeichen (Badge aus sweevo) ───────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: .125rem .625rem;
  font-size: 11.5px; font-weight: 600;
  white-space: nowrap;
}
.badge.default     { background: hsl(var(--akzent-flaeche)); color: hsl(var(--primary)); }
.badge.neutral     { border-color: hsl(var(--border)); background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.badge.success     { background: hsl(var(--success) / .12); color: hsl(var(--success)); }
.badge.warning     { background: hsl(var(--warning) / .15); color: hsl(var(--warning)); }
.badge.destructive { background: hsl(var(--destructive) / .12); color: hsl(var(--destructive)); }
.badge.bearbeitung { background: hsl(var(--status-bearbeitung) / .12); color: hsl(var(--status-bearbeitung)); }
.badge.geprueft    { background: hsl(var(--status-geprueft) / .12); color: hsl(var(--status-geprueft)); }
/* Gewonnener Kunde — gefüllt statt blass, das ist der Endzustand. */
.badge.kunde       { background: hsl(var(--primary)); color: #fff; }

/* Wiedervorlage unter dem Statusabzeichen */
.wv-zeile { margin-top: 2px; font-size: 11px; color: hsl(var(--muted-foreground)); white-space: nowrap; }
.wv-zeile.dringend { color: hsl(var(--warning)); font-weight: 600; }

/* Offene Wiedervorlagen in der Seitenleiste hervorheben */
.nav-eintrag.dringend .nav-zahl { color: hsl(var(--akzent)); font-weight: 700; }

/* Statusfläche für die Schaltflächen im Detailbereich */
.status-raster .btn.gewaehlt { box-shadow: inset 0 0 0 1px currentColor; }

.tabellen-zahl { font-size: 12px; font-weight: 600; color: hsl(var(--muted-foreground)); }

/* ── Leerzustand ────────────────────────────────────────────────────── */
.leer-zustand { padding: 3rem 1.25rem; text-align: center; color: hsl(var(--muted-foreground)); }
.leer-zustand p { margin: .25rem 0; font-size: 12.5px; }
.leer-zustand .leer-titel { font-size: 14px; font-weight: 600; color: hsl(var(--foreground)); }

/* ════════════════════════════════════════════════════════════════════
   Detail-Drawer — Aufbau und Bewegung wie in reinplan (KundenDetail):
   Overlay über der ganzen Seite, breite Tafel gleitet von rechts herein,
   Reiter im Kopf, scrollender Inhalt.
   ════════════════════════════════════════════════════════════════════ */

.overlay { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: flex-end; }
/* Wichtig: `display:flex` würde sonst das hidden-Attribut aushebeln. */
.overlay[hidden] { display: none; }

.overlay-hintergrund {
  position: absolute; inset: 0;
  background: rgb(9 9 11 / .4);
  backdrop-filter: blur(2px);
  border: 0;
  animation: overlay-in .3s ease-out;
}
.overlay.schliesst .overlay-hintergrund { animation: overlay-out .25s ease-out forwards; }

/* Alle Strichzeichnungen im Drawer einheitlich: nie gefüllt, immer 16 px. */
.drawer svg {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

.drawer {
  position: relative;
  display: flex; flex-direction: column;
  height: 100%;
  width: 100%;
  max-width: min(960px, 92vw);
  background: hsl(var(--card));
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);
  animation: slide-in-right .3s cubic-bezier(.32, .72, 0, 1);
}
.overlay.schliesst .drawer { animation: slide-out-right .25s cubic-bezier(.32, .72, 0, 1) forwards; }

@keyframes slide-in-right  { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes slide-out-right { from { transform: translateX(0); } to { transform: translateX(100%); } }
@keyframes overlay-in      { from { opacity: 0; } to { opacity: 1; } }
@keyframes overlay-out     { from { opacity: 1; } to { opacity: 0; } }

/* ── Kopf ── */
.drawer-kopf {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  border-bottom: 1px solid hsl(var(--border));
  padding: 1.25rem 1.5rem;
}
.drawer-kopf .eyebrow { font-size: 12px; letter-spacing: .08em; color: hsl(var(--primary)); }
.drawer-kopf h2 {
  margin-top: .125rem;
  font-size: 19px; font-weight: 600; letter-spacing: -.02em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.drawer-kopf .kopf-zeile { margin: .125rem 0 0; font-size: 13px; color: hsl(var(--muted-foreground)); }
.drawer-kopf-aktionen { display: flex; align-items: center; gap: .25rem; flex: none; }

.schliessen {
  width: 2.25rem; height: 2.25rem; flex: none;
  display: grid; place-items: center;
  border: 0; background: none;
  border-radius: var(--r-lg);
  color: hsl(var(--muted-foreground));
  font-size: 16px; line-height: 1;
  transition: background-color .15s, color .15s;
}
.schliessen:hover { background: hsl(var(--accent)); color: hsl(var(--foreground)); }

/* ── Reiter ── */
.drawer-tabs {
  display: flex; gap: .25rem;
  overflow-x: auto;
  border-bottom: 1px solid hsl(var(--border));
  padding: 0 1rem;
  scrollbar-width: none;
}
.drawer-tabs::-webkit-scrollbar { display: none; }

.tab {
  position: relative;
  display: flex; align-items: center; gap: .375rem;
  border: 0; background: none;
  padding: .75rem;
  font: inherit; font-size: 13px; font-weight: 500;
  white-space: nowrap;
  color: hsl(var(--muted-foreground));
  transition: color .15s;
}
.tab:hover { color: hsl(var(--foreground)); }
.tab.aktiv { color: hsl(var(--foreground)); font-weight: 600; }
.tab.aktiv::after {
  content: '';
  position: absolute; left: .5rem; right: .5rem; bottom: -1px;
  height: 2px; border-radius: 999px;
  background: hsl(var(--primary));
}
.tab-zahl {
  margin-left: .125rem;
  border-radius: 999px;
  background: hsl(var(--muted));
  padding: 1px .375rem;
  font-size: 11px; font-weight: 500;
  color: hsl(var(--muted-foreground));
}

/* ── Inhalt ── */
.drawer-inhalt { flex: 1; min-height: 0; overflow-y: auto; padding: 1.25rem 1.5rem; scrollbar-width: thin; }
.tab-panel { display: flex; flex-direction: column; gap: 1.5rem; }
.tab-panel[hidden] { display: none; }

.block-titel {
  margin: 0 0 .5rem;
  font-size: 11px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

/* Angaben mit Symbol (InfoItem) */
.info-gitter { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.info-gitter.eins { grid-template-columns: 1fr; }

.info-item { display: flex; align-items: flex-start; gap: .75rem; min-width: 0; }
.info-symbol {
  width: 2.25rem; height: 2.25rem; flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-lg);
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}
.info-text { min-width: 0; }
.info-label {
  margin: 0;
  font-size: 11px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}
.info-wert { margin: 0; font-size: 13.5px; font-weight: 500; word-break: break-word; line-height: 1.4; }
.info-wert a { color: hsl(var(--primary)); font-weight: 600; text-decoration: none; }
.info-wert a:hover { text-decoration: underline; }
.info-sub { margin: 0; font-size: 12px; color: hsl(var(--muted-foreground)); overflow: hidden; text-overflow: ellipsis; }

/* Domain und ihre Verfügbarkeit stehen auf einer Zeile nebeneinander. */
.domain-zeile { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }

/* Kennzahlen im Drawer (MiniStat) */
.mini-reihe { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.mini-stat {
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 4px);
  background: hsl(var(--muted) / .6);
  padding: 1rem;
}
.mini-kopf { display: flex; align-items: center; gap: .5rem; color: hsl(var(--muted-foreground)); }
.mini-kopf span { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.mini-wert { margin: .375rem 0 0; font-size: 18px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* Listen im Drawer */
.liste { list-style: none; margin: 0; padding: 0; border: 1px solid hsl(var(--border)); border-radius: var(--r-lg); overflow: hidden; }
.liste li { display: flex; align-items: center; gap: 1rem; padding: .875rem 1rem; }
.liste li + li { border-top: 1px solid hsl(var(--border) / .6); }
.liste-symbol {
  width: 2.25rem; height: 2.25rem; flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-lg);
  font-size: 13px;
}
.liste-text { min-width: 0; flex: 1; }
.liste-text .titel { margin: 0; font-size: 14px; font-weight: 500; }
.liste-text .unter { margin: 0; font-size: 12px; color: hsl(var(--muted-foreground)); }
.liste .leer-zeile { justify-content: center; padding: 2.5rem 1rem; font-size: 13px; color: hsl(var(--muted-foreground)); }

/* Löschknopf je Zeile — zurückhaltend, erscheint beim Überfahren. */
.zeilen-weg {
  flex: none;
  width: 1.75rem; height: 1.75rem;
  padding: 0;
  display: grid; place-items: center;
  border: 0; background: none;
  border-radius: var(--r-sm);
  color: hsl(var(--muted-foreground));
  font: inherit; font-size: 12px; line-height: 1;
  opacity: 0;
  transition: opacity .15s, background-color .15s, color .15s;
}
.liste li:hover .zeilen-weg,
.zeilen-weg:focus-visible { opacity: 1; }
.zeilen-weg:hover { background: hsl(var(--destructive) / .12); color: hsl(var(--destructive)); }

.zeiten { display: flex; flex-direction: column; gap: 1px; }
.zeiten span { font-size: 13px; }

.status-raster { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.status-raster .btn { justify-content: flex-start; }
.status-raster .btn.gewaehlt { box-shadow: inset 0 0 0 2px currentColor; }

.gespeichert { font-size: 11px; font-weight: 600; color: hsl(var(--success)); opacity: 0; transition: opacity .2s; text-transform: none; letter-spacing: 0; }
.gespeichert.zeigen { opacity: 1; }

.drawer-fuss { border-top: 1px solid hsl(var(--border)); padding-top: 1rem; }

/* ── Toast ──────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 1.25rem; left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  border-radius: var(--r-lg);
  background: hsl(var(--primary));
  color: #fff;
  padding: .5rem 1.125rem;
  font-size: 12.5px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toast-auf .18s ease-out;
}
.toast.err { background: hsl(var(--destructive)); }
@keyframes toast-auf { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ── Ladeanzeige ────────────────────────────────────────────────────── */
.spinner {
  width: 13px; height: 13px; flex: none;
  display: inline-block;
  border: 2px solid rgb(255 255 255 / .35);
  border-top-color: hsl(var(--akzent));
  border-radius: 50%;
  animation: dreh .7s linear infinite;
}
@keyframes dreh { to { transform: rotate(360deg); } }

/* ════════════════════════════════════════════════════════════════════
   Anmeldeseite
   ════════════════════════════════════════════════════════════════════ */

body.anmelde-seite { overflow: auto; background: hsl(var(--sidebar)); }

.anmelde-buehne {
  position: relative;
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 2rem 1rem;
  overflow: hidden;
}

/* Derselbe wandernde Lichtschimmer wie im Kopf der Seitenleiste. */
.anmelde-schimmer {
  position: absolute; inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / .05), transparent);
  animation: sidebar-shimmer 5s ease-in-out infinite;
}

.anmelde-karte {
  position: relative;
  width: 100%;
  max-width: 24rem;
  border-radius: calc(var(--radius) + 6px);
  background: hsl(var(--card));
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / .45);
  padding: 1.75rem;
}

.anmelde-marke { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.5rem; }
.anmelde-marke .marke-zeichen { width: 2.25rem; height: 2.25rem; font-size: 13px; }
.anmelde-marke strong { display: block; font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.anmelde-marke small { display: block; margin-top: 1px; font-size: 11.5px; color: hsl(var(--muted-foreground)); }

.anmelde-karte h1 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.anmelde-text { margin: .25rem 0 1.25rem; font-size: 13px; color: hsl(var(--muted-foreground)); }

.anmelde-karte .feld { margin-bottom: .875rem; }
.anmelde-karte .btn.block { margin-top: 1.125rem; height: 2.5rem; font-size: 13.5px; }
.anmelde-karte .such-status { margin-top: .75rem; }

.passwort-feld { position: relative; display: block; }
.passwort-feld input { padding-right: 5rem; }
.passwort-zeigen {
  position: absolute; right: .375rem; top: 50%;
  transform: translateY(-50%);
  border: 0; background: none;
  border-radius: var(--r-sm);
  padding: .25rem .5rem;
  font: inherit; font-size: 11.5px; font-weight: 600;
  color: hsl(var(--muted-foreground));
}
.passwort-zeigen:hover { background: hsl(var(--accent)); color: hsl(var(--foreground)); }

.anmelde-fuss {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: 11.5px;
  color: hsl(var(--muted-foreground));
}

/* Abmelden im Kopf der Anwendung */
.benutzer-chip {
  display: inline-flex; align-items: center; gap: .5rem;
  border-left: 1px solid hsl(var(--border));
  margin-left: .25rem;
  padding-left: .75rem;
  font-size: 12.5px;
  color: hsl(var(--muted-foreground));
}
.benutzer-chip b { color: hsl(var(--foreground)); font-weight: 600; }

/* ── Bildlaufleisten ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: hsl(var(--border)); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: hsl(var(--input)); background-clip: padding-box; }

/* ── Schmale Ansichten ──────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .stat-reihe { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-raster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .c-hours { display: none; }
}
@media (max-width: 760px) {
  .info-gitter, .mini-reihe { grid-template-columns: 1fr; }
  .drawer-kopf, .drawer-inhalt { padding-left: 1rem; padding-right: 1rem; }
}
@media (max-width: 900px) {
  .sidebar { display: none; }
}
