/* ==========================================================================
   Die Schraubendreher – Flottenmanagement
   Gestaltungsidee: eine echte Kfz-/Motorrad-Werkstatt, keine generische
   SaaS-Optik. Anleihen bei Werkstattschildern, Typenschildern, Werkzeug-
   kisten und Auftragszetteln statt austauschbarer Dashboard-Kacheln.
   ========================================================================== */

:root {
  /* Papier/Tinte statt reinem Weiß/Schwarz - wärmer, wie ein Auftragsblock */
  --fm-bg: #EDE9DF;
  --fm-surface: #FFFFFF;
  --fm-text: #201F1C;
  --fm-muted: #726A5C;
  --fm-border: #DCD5C4;

  /* Werkstatt-Blau als Hauptfarbe (Werkzeug/Metall), Bernstein als Signalfarbe */
  --fm-primary: #1F4E79;
  --fm-primary-dark: #163A5C;
  --fm-primary-rgb: 31,78,121;
  --fm-signal: #E29A3C;
  --fm-signal-rgb: 226,154,60;
  --fm-danger: #B23A2E;
  --fm-success: #3D7A4E;
  --fm-radius: 10px;

  --fm-ink: #1B1B1E;
  --fm-sidebar-avatar: #112B43;
  --fm-sidebar-bg: var(--fm-ink);
  --fm-sidebar-text: #F2EFE7;
  --fm-sidebar-text-muted: #A9A296;
  --fm-sidebar-active: rgba(226,154,60,.14);
  --fm-sidebar-width: 232px;

  --fm-font-display: 'Oswald', 'Arial Narrow', sans-serif;
  --fm-font-body: 'Work Sans', 'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--fm-primary); }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--fm-font-body);
  background: var(--fm-bg);
  color: var(--fm-text);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--fm-primary); }
h1, h2, h3 {
  font-family: var(--fm-font-display);
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.2;
}
:focus-visible { outline: 2px solid var(--fm-signal); outline-offset: 2px; }

/* ==========================================================
   SIDEBAR - schwarzes Werkzeugkisten-Blau statt Farbverlauf,
   Bernstein-Streifen oben als einmaliges Signature-Element
   ========================================================== */
.fm-shell { display: flex; min-height: 100vh; }

.fm-sidebar {
  width: var(--fm-sidebar-width); flex-shrink: 0;
  background: var(--fm-ink); color: var(--fm-sidebar-text);
  display: flex; flex-direction: column;
  border-top: 5px solid var(--fm-primary);
}
.fm-sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px 18px; border-bottom: 1px solid rgba(255,255,255,.12);
}
.fm-sidebar-brand img.fm-logo { height: 38px; }
.fm-sidebar-brand .fm-portalname {
  font-family: var(--fm-font-display); font-weight: 600; font-size: 1.1rem; line-height: 1.2;
}
.fm-sidebar-brand .fm-portalname small {
  display: block; font-family: var(--fm-font-body); font-weight: 400; font-size: .72rem;
  color: var(--fm-sidebar-text-muted); letter-spacing: .03em;
}

.fm-sidebar nav { flex: 1; padding: 14px 10px; display: flex; flex-direction: column; gap: 1px; }
.fm-sidebar nav a {
  font-family: var(--fm-font-display);
  color: var(--fm-sidebar-text); text-decoration: none; font-size: .92rem; font-weight: 500;
  padding: 10px 14px; border-left: 3px solid transparent; display: block; opacity: .78;
  transition: background .12s ease, opacity .12s ease, border-color .12s ease;
}
.fm-sidebar nav a:hover { background: rgba(255,255,255,.06); opacity: 1; }
.fm-sidebar nav a.active { background: var(--fm-sidebar-active); border-left-color: var(--fm-signal); opacity: 1; }
.fm-sidebar nav a.fm-logout { margin-top: auto; }
.fm-sidebar-foot { padding: 14px 18px 20px; border-top: 1px solid rgba(255,255,255,.12); font-size: .8rem; }
.fm-sidebar-foot a { color: var(--fm-sidebar-text-muted); }

.fm-main { flex: 1; min-width: 0; }
.fm-wrap { max-width: 1150px; margin: 28px auto; padding: 0 24px 40px; }

/* ==========================================================
   CARDS - ruhig, wie ein Klemmbrett-Blatt: dünner Rahmen,
   kein Schatten, kein einheitlicher Farbbalken auf allem
   ========================================================== */
.fm-card {
  background: var(--fm-surface); border: 1px solid var(--fm-border); border-radius: var(--fm-radius);
  padding: 22px; margin-bottom: 18px;
}
.fm-card h2 { margin-top: 0; font-size: 1.2rem; color: var(--fm-ink); }

table.fm-table { width: 100%; border-collapse: collapse; }
table.fm-table th, table.fm-table td { text-align: left; padding: 10px 12px; font-size: .92rem; }
table.fm-table th {
  color: var(--fm-ink); font-family: var(--fm-font-display); font-weight: 500; font-size: .84rem;
  border-bottom: 2px solid var(--fm-ink);
}
table.fm-table td { border-bottom: 1px solid var(--fm-border); }
table.fm-table tr:hover td { background: rgba(var(--fm-primary-rgb), .04); }

.fm-btn {
  display: inline-block; background: var(--fm-primary); color: #fff; border: none; padding: 10px 18px;
  border-radius: 6px; cursor: pointer; font-family: var(--fm-font-display); font-weight: 500;
  font-size: .92rem; letter-spacing: .01em; text-decoration: none;
  transition: background .12s ease, transform .08s ease;
}
.fm-btn:hover { background: var(--fm-primary-dark); transform: translateY(-1px); }
.fm-btn.fm-danger { background: var(--fm-danger); }
.fm-btn.fm-secondary { background: #55504A; }

.fm-form label { display: block; font-weight: 600; margin: 12px 0 5px; font-size: .86rem; color: var(--fm-ink); }
.fm-form input, .fm-form select, .fm-form textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--fm-border); border-radius: 7px;
  font-size: .92rem; font-family: var(--fm-font-body); background: var(--fm-surface); color: var(--fm-text);
  transition: border-color .12s ease;
}
.fm-form input:focus, .fm-form select:focus, .fm-form textarea:focus {
  outline: none; border-color: var(--fm-primary);
}

.fm-flash { padding: 11px 15px; border-radius: 7px; margin-bottom: 16px; font-size: .9rem; font-weight: 500; border-left: 4px solid transparent; }
.fm-flash.success { background: #E4EFE6; color: var(--fm-success); border-left-color: var(--fm-success); }
.fm-flash.error { background: #F6E4E1; color: var(--fm-danger); border-left-color: var(--fm-danger); }

/* Badges als kleine Typenschild-Tags statt runder SaaS-Pills */
.fm-badge {
  display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: .74rem; font-weight: 700;
  font-family: var(--fm-font-display); letter-spacing: .02em;
}
.fm-badge.ok { background: #E4EFE6; color: var(--fm-success); }
.fm-badge.warn { background: #FBECD6; color: #9A6117; }
.fm-badge.danger { background: #F6E4E1; color: var(--fm-danger); }

.fm-auth-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--fm-ink); padding: 20px; position: relative; overflow: hidden; }
.fm-auth-bg { position: fixed; inset: 0; z-index: 0; display: flex; align-items: center; justify-content: center; }
.fm-auth-bg img {
  max-width: 100vw; max-height: 100vh; width: auto; height: auto; display: block;
}
.fm-auth-card { position: relative; z-index: 1; }
.fm-auth-brand { position: relative; z-index: 1; text-align: center; margin-bottom: 22px; }
.fm-auth-brand img.fm-logo-big { max-height: 110px; max-width: 260px; display: block; margin: 0 auto 14px; filter: drop-shadow(0 8px 20px rgba(0,0,0,.35)); }
.fm-auth-brand h1 { font-family: var(--fm-font-display); color: #fff; font-size: 1.5rem; margin: 0; }
.fm-auth-brand p { color: var(--fm-sidebar-text-muted); font-size: .82rem; letter-spacing: .06em; margin: 4px 0 0; }
.fm-auth-card {
  background: var(--fm-surface); border-radius: 10px; padding: 34px; width: 100%; max-width: 420px;
  box-shadow: 0 24px 70px rgba(0,0,0,.45); border-top: 4px solid var(--fm-signal);
}
.fm-auth-card img.fm-logo { max-height: 56px; display:block; margin: 0 auto 6px; }
.fm-auth-card h1 { text-align: center; font-size: 1.3rem; margin-top: 4px; }
.fm-captcha-row { display: flex; align-items: center; gap: 10px; }
.fm-captcha-row img { border-radius: 6px; border: 1px solid var(--fm-border); }

/* ==========================================================
   THEMES - gleiche Struktur, andere Werkstoff-/Farbwelt
   ========================================================== */
/* --- Neon-Varianten: Blau, Grün, Rot --- */
body.theme-neon-blau {
  --fm-bg: #070B14; --fm-surface: #101827; --fm-text: #E4ECFB; --fm-muted: #94A3C0; --fm-border: #1E2A42;
  --fm-primary: #0A84FF; --fm-primary-dark: #0864C7; --fm-primary-rgb: 10,132,255; --fm-ink: #04070D;
  --fm-signal: #00E5FF; --fm-signal-rgb: 0,229,255;
  --fm-sidebar-avatar: #06498C;
}
body.theme-neon-gruen {
  --fm-bg: #06120B; --fm-surface: #0F1F16; --fm-text: #E3FBEC; --fm-muted: #8FBFA0; --fm-border: #1B3324;
  --fm-primary: #00E676; --fm-primary-dark: #00B85E; --fm-primary-rgb: 0,230,118; --fm-ink: #030B06;
  --fm-signal: #39FF88; --fm-signal-rgb: 57,255,136;
  --fm-sidebar-avatar: #007F41;
}
body.theme-neon-rot {
  --fm-bg: #150707; --fm-surface: #241010; --fm-text: #FBE6E6; --fm-muted: #C79797; --fm-border: #3A1A1A;
  --fm-primary: #FF3B3B; --fm-primary-dark: #C4102F; --fm-primary-rgb: 255,59,59; --fm-ink: #0C0404;
  --fm-signal: #FF7A5C; --fm-signal-rgb: 255,122,92;
  --fm-sidebar-avatar: #8C2020;
}
/* Neon-Glow: gemeinsame Regeln für alle drei Neon-Themes (Buttons, aktive Navigation,
   Auth-Card) - ein Effekt, gezielt an wenigen Stellen, nicht auf der ganzen Seite verteilt */
body.theme-neon-blau .fm-btn,
body.theme-neon-gruen .fm-btn,
body.theme-neon-rot .fm-btn {
  box-shadow: 0 0 16px rgba(var(--fm-primary-rgb), .55);
}
body.theme-neon-blau .fm-sidebar nav a.active,
body.theme-neon-gruen .fm-sidebar nav a.active,
body.theme-neon-rot .fm-sidebar nav a.active {
  text-shadow: 0 0 10px var(--fm-signal);
}
body.theme-neon-blau .fm-auth-card,
body.theme-neon-gruen .fm-auth-card,
body.theme-neon-rot .fm-auth-card {
  box-shadow: 0 0 50px rgba(var(--fm-signal-rgb), .35), 0 24px 70px rgba(0,0,0,.45);
}
body.theme-neon-blau .fm-sidebar,
body.theme-neon-gruen .fm-sidebar,
body.theme-neon-rot .fm-sidebar {
  box-shadow: inset -1px 0 0 rgba(var(--fm-primary-rgb), .25);
}
body.theme-neon-blau .fm-service-card,
body.theme-neon-gruen .fm-service-card,
body.theme-neon-rot .fm-service-card {
  border-left-color: var(--fm-signal);
}

/* ==========================================================
   WERKSTATT PRO FAMILIE - Glasoptik (Glassmorphism) in drei
   Farbwelten: Blau, Grau, Army Grün. Gleiche Glas-Struktur,
   nur die Palette + Verlaufsfarben ändern sich pro Variante.
   ========================================================== */
body.theme-werkstatt-pro {
  --fm-bg: #EAF2FC; --fm-surface: rgba(255,255,255,.72); --fm-text: #0B1D33; --fm-muted: #5B7396; --fm-border: rgba(255,255,255,.55);
  --fm-primary: #0B63CE; --fm-primary-dark: #084A9E; --fm-primary-rgb: 11,99,206; --fm-ink: #0B1220;
  --fm-signal: #45B6FE; --fm-signal-rgb: 69,182,254;
  --fm-sidebar-avatar: #063671;
}
body.theme-werkstatt-pro-grau {
  --fm-bg: #EEF0F2; --fm-surface: rgba(255,255,255,.72); --fm-text: #1E2226; --fm-muted: #63696F; --fm-border: rgba(255,255,255,.55);
  --fm-primary: #5B6570; --fm-primary-dark: #454D56; --fm-primary-rgb: 91,101,112; --fm-ink: #14171A;
  --fm-signal: #8A94A0; --fm-signal-rgb: 138,148,160;
  --fm-sidebar-avatar: #32383E;
}
body.theme-werkstatt-pro-army {
  --fm-bg: #EFF3E7; --fm-surface: rgba(255,255,255,.72); --fm-text: #1E2416; --fm-muted: #66714F; --fm-border: rgba(255,255,255,.55);
  --fm-primary: #5C7A3B; --fm-primary-dark: #4A6230; --fm-primary-rgb: 92,122,59; --fm-ink: #171C10;
  --fm-signal: #8FAE5C; --fm-signal-rgb: 143,174,92;
  --fm-sidebar-avatar: #334320;
}

/* Weicher Verlauf + unscharfe Farbflächen im Hintergrund, damit die Glas-Cards
   tatsächlich etwas zum "Durchschimmern" haben - sonst wirkt Glasoptik flach.
   Pro Variante eigene Farben, da Verlauf/Blobs keine CSS-Variablen sein können. */
body.theme-werkstatt-pro { background: linear-gradient(160deg, #EAF2FC 0%, #DCEAFB 45%, #EFF6FF 100%); position: relative; }
body.theme-werkstatt-pro-grau { background: linear-gradient(160deg, #EEF0F2 0%, #E2E5E8 45%, #F3F5F7 100%); position: relative; }
body.theme-werkstatt-pro-army { background: linear-gradient(160deg, #EFF3E7 0%, #E4EBD7 45%, #F4F7EE 100%); position: relative; }

body.theme-werkstatt-pro::before, body.theme-werkstatt-pro::after,
body.theme-werkstatt-pro-grau::before, body.theme-werkstatt-pro-grau::after,
body.theme-werkstatt-pro-army::before, body.theme-werkstatt-pro-army::after {
  content: ""; position: fixed; border-radius: 50%; z-index: 0; pointer-events: none; filter: blur(70px);
}
body.theme-werkstatt-pro::before { width: 420px; height: 420px; top: -120px; right: -100px; background: rgba(11,99,206,.22); }
body.theme-werkstatt-pro::after { width: 360px; height: 360px; bottom: -80px; left: 20%; background: rgba(69,182,254,.18); }
body.theme-werkstatt-pro-grau::before { width: 420px; height: 420px; top: -120px; right: -100px; background: rgba(91,101,112,.20); }
body.theme-werkstatt-pro-grau::after { width: 360px; height: 360px; bottom: -80px; left: 20%; background: rgba(138,148,160,.18); }
body.theme-werkstatt-pro-army::before { width: 420px; height: 420px; top: -120px; right: -100px; background: rgba(92,122,59,.20); }
body.theme-werkstatt-pro-army::after { width: 360px; height: 360px; bottom: -80px; left: 20%; background: rgba(143,174,92,.18); }

/* Gemeinsame Glas-Struktur für alle drei Varianten. WICHTIG: der Z-Index
   sitzt gezielt auf .fm-main (Inhalt), nicht auf .fm-shell selbst - sonst
   entsteht ein Stacking-Context, der auf Mobile die fest positionierte
   Sidebar (z-index:160) mit einschließt und sie unter das Abdunkel-Overlay
   (z-index:150) rutschen lässt, was dort jeden Klick blockiert. */
body.theme-werkstatt-pro .fm-main,
body.theme-werkstatt-pro-grau .fm-main,
body.theme-werkstatt-pro-army .fm-main { position: relative; z-index: 1; }

body.theme-werkstatt-pro .fm-card,
body.theme-werkstatt-pro-grau .fm-card,
body.theme-werkstatt-pro-army .fm-card {
  background: var(--fm-surface); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--fm-border); box-shadow: 0 8px 32px rgba(11,29,51,.08);
}

body.theme-werkstatt-pro .fm-sidebar { background: linear-gradient(180deg, rgba(11,49,98,.92) 0%, rgba(11,18,32,.92) 70%); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
body.theme-werkstatt-pro-grau .fm-sidebar { background: linear-gradient(180deg, rgba(30,34,38,.92) 0%, rgba(20,23,26,.92) 70%); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
body.theme-werkstatt-pro-army .fm-sidebar { background: linear-gradient(180deg, rgba(35,43,20,.92) 0%, rgba(23,28,16,.92) 70%); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
/* Sidebar direkt (nicht über einen Wrapper) über die Hintergrund-Blobs heben -
   nur auf Desktop-Breite: auf Mobile braucht die Sidebar zwingend ihre eigene
   fixed-Positionierung mit hohem z-index (siehe Media Query weiter unten) -
   diese Regel darf die dort NICHT überstimmen (hätte sonst wegen höherer
   Selektor-Spezifität Vorrang und würde das Drawer-Menü wieder kaputt machen). */
@media (min-width: 861px) {
  body.theme-werkstatt-pro .fm-sidebar,
  body.theme-werkstatt-pro-grau .fm-sidebar,
  body.theme-werkstatt-pro-army .fm-sidebar { position: relative; z-index: 1; }
}

body.theme-werkstatt-pro .fm-sidebar nav a.active,
body.theme-werkstatt-pro-grau .fm-sidebar nav a.active,
body.theme-werkstatt-pro-army .fm-sidebar nav a.active {
  background: var(--fm-primary); box-shadow: 0 0 0 1px rgba(255,255,255,.15), 0 4px 18px rgba(var(--fm-primary-rgb),.55);
  border-left-color: transparent;
}

body.theme-werkstatt-pro .fm-auth-card,
body.theme-werkstatt-pro-grau .fm-auth-card,
body.theme-werkstatt-pro-army .fm-auth-card {
  background: var(--fm-surface); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--fm-border);
}

body.theme-werkstatt-pro .fm-modal, body.theme-werkstatt-pro .fm-dp-popup, body.theme-werkstatt-pro .fm-consent-card,
body.theme-werkstatt-pro-grau .fm-modal, body.theme-werkstatt-pro-grau .fm-dp-popup, body.theme-werkstatt-pro-grau .fm-consent-card,
body.theme-werkstatt-pro-army .fm-modal, body.theme-werkstatt-pro-army .fm-dp-popup, body.theme-werkstatt-pro-army .fm-consent-card {
  background: rgba(255,255,255,.85); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}

body.theme-werkstatt-pro .fm-mobile-topbar, body.theme-werkstatt-pro .fm-bottom-tabbar {
  background: linear-gradient(180deg, rgba(11,49,98,.92) 0%, rgba(11,18,32,.92) 100%); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
body.theme-werkstatt-pro-grau .fm-mobile-topbar, body.theme-werkstatt-pro-grau .fm-bottom-tabbar {
  background: linear-gradient(180deg, rgba(30,34,38,.92) 0%, rgba(20,23,26,.92) 100%); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
body.theme-werkstatt-pro-army .fm-mobile-topbar, body.theme-werkstatt-pro-army .fm-bottom-tabbar {
  background: linear-gradient(180deg, rgba(35,43,20,.92) 0%, rgba(23,28,16,.92) 100%); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}

body.theme-werkstatt-pro table.fm-table th,
body.theme-werkstatt-pro-grau table.fm-table th,
body.theme-werkstatt-pro-army table.fm-table th { border-bottom-color: var(--fm-primary); }

body.theme-werkstatt-pro .fm-form input, body.theme-werkstatt-pro .fm-form select, body.theme-werkstatt-pro .fm-form textarea,
body.theme-werkstatt-pro-grau .fm-form input, body.theme-werkstatt-pro-grau .fm-form select, body.theme-werkstatt-pro-grau .fm-form textarea,
body.theme-werkstatt-pro-army .fm-form input, body.theme-werkstatt-pro-army .fm-form select, body.theme-werkstatt-pro-army .fm-form textarea {
  background: rgba(255,255,255,.9);
}

/* Schlichte Kopfzeile für öffentliche Seiten ohne Sidebar (Impressum, Datenschutz, QR-Upload) */
.fm-public-header {
  display: flex; align-items: center; gap: 12px;
  background: var(--fm-ink); color: #fff;
  padding: 16px 24px; border-bottom: 4px solid var(--fm-signal);
}
.fm-public-header img.fm-logo { height: 38px; }
.fm-public-header .fm-portalname { font-family: var(--fm-font-display); font-weight: 600; font-size: 1.1rem; }

/* DSGVO-Consent-Popup: zentrales Modal, muss aktiv bestätigt werden */
.fm-consent-overlay {
  position: fixed; inset: 0; z-index: 999; background: rgba(10,10,14,.6);
  align-items: center; justify-content: center; padding: 20px;
}
.fm-consent-card {
  background: var(--fm-surface); border-radius: 14px; max-width: 440px; width: 100%;
  padding: 30px 28px 24px; text-align: center; box-shadow: 0 30px 90px rgba(0,0,0,.4);
  border-top: 4px solid var(--fm-primary);
}
.fm-consent-icon {
  width: 52px; height: 52px; border-radius: 50%; background: var(--fm-primary); color: #fff;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 14px;
}
.fm-consent-card h2 { margin: 0 0 6px; font-size: 1.25rem; }
.fm-consent-intro { color: var(--fm-muted); font-size: .88rem; margin: 0 0 18px; }
.fm-consent-check {
  display: flex; align-items: flex-start; gap: 10px; text-align: left;
  border: 1px solid var(--fm-border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px;
}
.fm-consent-check input { width: auto; margin-top: 3px; accent-color: var(--fm-primary); }
.fm-consent-check strong { display: block; font-size: .88rem; }
.fm-consent-check small { display: block; color: var(--fm-muted); font-size: .78rem; margin-top: 2px; line-height: 1.4; }
.fm-consent-badges {
  display: flex; justify-content: center; gap: 18px; margin: 16px 0; flex-wrap: wrap;
  border-top: 1px solid var(--fm-border); border-bottom: 1px solid var(--fm-border); padding: 12px 0;
}
.fm-consent-badges span { display: flex; align-items: center; gap: 5px; font-size: .74rem; color: var(--fm-muted); font-weight: 600; }
.fm-consent-accept { width: 100%; }
.fm-consent-accept:disabled { opacity: .45; cursor: not-allowed; }
.fm-consent-accept:disabled:hover { background: var(--fm-primary); transform: none; }
.fm-consent-check input[type="checkbox"] { accent-color: var(--fm-primary); cursor: pointer; }
.fm-consent-footer { margin-top: 16px; font-size: .76rem; color: var(--fm-muted); }
.fm-consent-footer a { color: var(--fm-muted); }

.fm-icon { vertical-align: -3px; flex-shrink: 0; }
.fm-sidebar nav a { display: flex; align-items: center; gap: 10px; }
.fm-sidebar-brand-icon {
  width: 38px; height: 38px; border-radius: 6px; background: rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--fm-signal);
}
.fm-stat-icon {
  width: 34px; height: 34px; border-radius: 8px; background: rgba(var(--fm-primary-rgb), .10);
  color: var(--fm-primary); display: flex; align-items: center; justify-content: center; margin: 0 auto 8px;
}
.fm-stat-card { border-top: 3px solid var(--stat-color, var(--fm-primary)); }
.fm-stat-card .fm-stat-icon {
  background: rgba(var(--fm-primary-rgb), .15);
  background: color-mix(in srgb, var(--stat-color, var(--fm-primary)) 15%, transparent);
  color: var(--stat-color, var(--fm-primary));
}
.fm-btn .fm-icon { margin-right: 5px; }

/* ==========================================================
   MODAL / POPUP (z.B. "Neuen Kunden anlegen")
   ========================================================== */
.fm-modal-overlay {
  position: fixed; inset: 0; background: rgba(20,19,17,.6); z-index: 200;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.fm-modal-overlay.open { display: flex; }
.fm-modal {
  background: var(--fm-surface); border-radius: 10px; width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 30px 80px rgba(0,0,0,.4);
  border-top: 4px solid var(--fm-signal);
}
.fm-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 0; }
.fm-modal-head h2 { margin: 0; font-size: 1.15rem; }
.fm-modal-close { background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--fm-muted); line-height: 1; }
.fm-modal-close:hover { color: var(--fm-text); }
.fm-modal-body { padding: 18px 24px 24px; }
.fm-modal-hint { background: var(--fm-bg); border-radius: 7px; padding: 12px 14px; font-size: .84rem; color: var(--fm-muted); margin-bottom: 4px; }
.fm-modal-section-label {
  font-family: var(--fm-font-display); display: flex; align-items: center; gap: 6px; font-weight: 600;
  font-size: .84rem; color: var(--fm-primary); margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--fm-border);
}
.fm-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ==========================================================
   TOAST-BENACHRICHTIGUNGEN (z.B. neue Terminanfrage)
   ========================================================== */
.fm-toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; max-width: 340px; }
.fm-toast {
  background: var(--fm-ink); color: #F2EFE7; border-radius: 8px; padding: 14px 16px;
  box-shadow: 0 12px 34px rgba(0,0,0,.3); border-left: 4px solid var(--fm-signal);
  cursor: pointer; animation: fm-toast-in .25s ease;
}
.fm-toast strong { display: block; font-family: var(--fm-font-display); font-size: .92rem; margin-bottom: 2px; }
.fm-toast span { font-size: .82rem; color: #B9B4A8; }
@keyframes fm-toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ==========================================================
   LEISTUNGSKATALOG (Cards im Werkstattzettel-Stil)
   ========================================================== */
.fm-service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.fm-service-card {
  background: var(--fm-surface); border: 1px solid var(--fm-border); border-radius: 8px; padding: 16px 18px;
  position: relative; border-left: 3px solid var(--fm-primary);
}
.fm-service-card h3 { margin: 0 0 4px; font-size: 1.02rem; color: var(--fm-ink); }
.fm-service-card p { margin: 0; color: var(--fm-muted); font-size: .86rem; }
.fm-service-card .fm-service-duration { margin-top: 10px; font-size: .8rem; color: var(--fm-primary); font-weight: 600; font-family: var(--fm-font-display); }
.fm-service-actions { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; }
.fm-service-actions button {
  background: var(--fm-bg); border: 1px solid var(--fm-border); border-radius: 6px; width: 30px; height: 30px;
  cursor: pointer; font-size: .95rem; line-height: 1;
}
.fm-service-actions button.fm-icon-danger:hover { background: #F6E4E1; }
.fm-service-actions button.fm-icon-edit:hover { background: #E4ECF3; }

/* ==========================================================
   TERMINPLANER-KALENDER (Datepicker mit Feiertags-/Wochenendsperre)
   ========================================================== */
.fm-datepicker { position: relative; }
.fm-dp-display { cursor: pointer; background: var(--fm-surface); }
.fm-dp-popup {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 50;
  background: var(--fm-surface); border: 1px solid var(--fm-border); border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0,0,0,.18); padding: 14px; width: min(300px, 90vw);
}
.fm-dp-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.fm-dp-title { font-family: var(--fm-font-display); font-weight: 600; font-size: .94rem; }
.fm-dp-nav {
  background: var(--fm-bg); border: 1px solid var(--fm-border); border-radius: 6px; width: 30px; height: 30px;
  cursor: pointer; font-size: 1.1rem; color: var(--fm-text); line-height: 1;
}
.fm-dp-nav:hover { background: var(--fm-primary); color: #fff; }
.fm-dp-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; color: var(--fm-muted); font-size: .74rem; font-weight: 700; margin-bottom: 4px; }
.fm-dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.fm-dp-cell {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 6px; font-size: .86rem; cursor: default; color: var(--fm-text);
}
.fm-dp-cell.empty { visibility: hidden; }
.fm-dp-cell[data-selectable] { cursor: pointer; }
.fm-dp-cell[data-selectable]:hover { background: rgba(var(--fm-primary-rgb), .15); }
.fm-dp-cell.blocked { color: var(--fm-muted); text-decoration: line-through; opacity: .5; cursor: not-allowed; }
.fm-dp-cell.holiday:not(.blocked) { background: #FBECD6; color: #9A6117; font-weight: 700; }
.fm-dp-cell.holiday.blocked { background: #F6E4E1; color: var(--fm-danger); }
.fm-dp-cell.selected { background: var(--fm-primary) !important; color: #fff !important; font-weight: 700; text-decoration: none; opacity: 1; }
.fm-dp-legend { display: flex; gap: 14px; margin-top: 10px; font-size: .74rem; color: var(--fm-muted); }
.fm-dp-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; }
.fm-dp-dot.holiday { background: #FBECD6; border: 1px solid #9A6117; }
.fm-dp-dot.blocked { background: #eee; border: 1px solid #999; }

/* ==========================================================
   GROSSER MONATSKALENDER (admin/calendar.php)
   ========================================================== */
.fm-cal-layout { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; }
.fm-cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.fm-cal-title { font-family: var(--fm-font-display); font-weight: 600; font-size: 1.15rem; }

.fm-month-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; color: var(--fm-muted); font-size: .78rem; font-weight: 700; margin-bottom: 6px; }
.fm-month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.fm-month-cell {
  min-height: 84px; border: 1px solid var(--fm-border); border-radius: 8px; padding: 6px;
  display: flex; flex-direction: column; gap: 4px; background: var(--fm-surface);
}
.fm-month-cell.empty { visibility: hidden; }
.fm-month-cell.today { border: 2px solid var(--fm-primary); }
.fm-month-cell.holiday-cell { background: rgba(var(--fm-signal-rgb), .1); }
.fm-month-daynum { font-family: var(--fm-font-display); font-weight: 600; font-size: .88rem; }
.fm-month-holiday-label { font-size: .66rem; color: #9A6117; line-height: 1.2; }
.fm-month-badges { display: flex; flex-direction: column; gap: 3px; margin-top: auto; }
.fm-cal-badge {
  display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: .68rem; font-weight: 700;
  font-family: var(--fm-font-display); width: fit-content;
}
.fm-cal-badge.ok { background: #E4EFE6; color: var(--fm-success); }
.fm-cal-badge.warn { background: #FBECD6; color: #9A6117; }

.fm-upcoming-list { display: flex; flex-direction: column; gap: 8px; }
.fm-upcoming-item {
  display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--fm-text);
  padding: 8px; border-radius: 8px; border: 1px solid var(--fm-border);
}
.fm-upcoming-item:hover { background: var(--fm-bg); }
.fm-upcoming-date {
  flex-shrink: 0; width: 52px; text-align: center; padding: 6px 4px; border-radius: 6px;
  font-family: var(--fm-font-display); font-weight: 700; font-size: .84rem;
}
.fm-upcoming-date.ok { background: #E4EFE6; color: var(--fm-success); }
.fm-upcoming-date.warn { background: #FBECD6; color: #9A6117; }

/* ==========================================================
   MOBILE TOPBAR + HAMBURGER + BACKDROP + BOTTOM-TABBAR
   (nur sichtbar unter 860px, siehe Media Query unten)
   ========================================================== */
.fm-mobile-topbar { display: none; }
.fm-hamburger-btn { background: none; border: none; color: var(--fm-sidebar-text); cursor: pointer; padding: 6px; }
.fm-mobile-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(10,10,14,.55); z-index: 150; opacity: 0; transition: opacity .2s ease;
}
.fm-mobile-backdrop.open { display: block; opacity: 1; }
.fm-bottom-tabbar { display: none; }
.fm-sidebar-user {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,.12);
}
.fm-sidebar-user-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--fm-sidebar-avatar);
  color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--fm-font-display);
  font-weight: 700; font-size: .82rem; flex-shrink: 0; border: 2px solid var(--fm-signal);
}
.fm-sidebar-user-info strong { display: block; font-size: .86rem; color: var(--fm-sidebar-text); }
.fm-sidebar-user-info span { font-size: .68rem; letter-spacing: .06em; color: var(--fm-sidebar-text-muted); text-transform: uppercase; }

@media (max-width: 860px) {
  .fm-shell { flex-direction: column; }

  .fm-mobile-topbar {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 90;
    background: var(--fm-sidebar-bg); padding: 10px 14px; border-bottom: 4px solid var(--fm-signal);
  }
  .fm-mobile-topbar .fm-portalname { font-family: var(--fm-font-display); font-weight: 600; color: var(--fm-sidebar-text); font-size: 1rem; }
  .fm-mobile-topbar img.fm-logo { height: 30px; }

  .fm-sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; width: 280px; max-width: 82vw;
    transform: translateX(-100%); transition: transform .25s ease; z-index: 160;
    flex-direction: column; border-top: none; box-shadow: 10px 0 40px rgba(0,0,0,.35);
    overflow-y: auto; -webkit-overflow-scrolling: touch;
  }
  .fm-sidebar.open { transform: translateX(0); }
  .fm-sidebar-brand { border-bottom: 1px solid rgba(255,255,255,.12); }
  .fm-sidebar nav { flex-direction: column; padding: 14px 10px; }
  .fm-sidebar nav a { white-space: normal; border-bottom: none; }
  .fm-sidebar nav a.active { border-bottom: none; }
  .fm-sidebar-foot { display: block; }

  .fm-bottom-tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
    background: var(--fm-sidebar-bg); border-top: 1px solid rgba(255,255,255,.12);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .fm-bottom-tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    color: var(--fm-sidebar-text-muted); text-decoration: none; font-size: .66rem; padding: 4px 2px; opacity: .8;
  }
  .fm-bottom-tabbar a .fm-icon { margin: 0; }
  .fm-bottom-tabbar a.active { color: var(--fm-signal); opacity: 1; }
  .fm-main { padding-bottom: 64px; }

  .fm-wrap { padding: 0 16px 30px; margin: 20px auto; }
  table.fm-table { display: block; overflow-x: auto; white-space: nowrap; }
  .fm-cal-layout { grid-template-columns: 1fr; }
  .fm-month-cell { min-height: 60px; }
}
