/* ==========================================================================
   SCHRIFT: Inter (lokal unter /fonts, keine Verbindung zu Google)
   ========================================================================== */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/inter-v12-latin-regular.woff2') format('woff2'), url('fonts/inter-v12-latin-regular.woff') format('woff');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/inter-v12-latin-500.woff2') format('woff2'), url('fonts/inter-v12-latin-500.woff') format('woff');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/inter-v12-latin-600.woff2') format('woff2'), url('fonts/inter-v12-latin-600.woff') format('woff');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/inter-v12-latin-700.woff2') format('woff2'), url('fonts/inter-v12-latin-700.woff') format('woff');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('fonts/inter-v12-latin-800.woff2') format('woff2'), url('fonts/inter-v12-latin-800.woff') format('woff');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('fonts/inter-v12-latin-900.woff2') format('woff2'), url('fonts/inter-v12-latin-900.woff') format('woff');
}

/* ==========================================================================
   FARBPALETTE (zentral, gilt für Dunkel- und Hell-Modus)
   Jede Farbe der Oberfläche ist hier genau einmal definiert. Name = Farbfamilie +
   Helligkeitsstufe (10 = sehr hell … 990 = sehr dunkel; b/c… = feine Abstufung), -aXXX = Deckkraft in Promille (a080 = 8 %).
   Die Theme-Variablen (--bg-*, --text-*, --border-* …) darunter verweisen hierauf.
   ========================================================================== */
:root {
  --c-amber-440: #fbbf24;
  --c-black-a120: rgba(0, 0, 0, 0.12);
  --c-black-a250: rgba(0, 0, 0, 0.25);
  --c-black-a300: rgba(0, 0, 0, 0.3);
  --c-black-a350: rgba(0, 0, 0, 0.35);
  --c-black-a400: rgba(0, 0, 0, 0.4);
  --c-black-a450: rgba(0, 0, 0, 0.45);
  --c-black-a500: rgba(0, 0, 0, 0.5);
  --c-black-a600: rgba(0, 0, 0, 0.6);
  --c-black-a650: rgba(0, 0, 0, 0.65);
  --c-black-a700: rgba(0, 0, 0, 0.7);
  --c-black-a750: rgba(0, 0, 0, 0.75);
  --c-black-a850: rgba(0, 0, 0, 0.85);
  --c-blue-30: #f0f9ff;
  --c-blue-60: #e0f2fe;
  --c-blue-140: #bae6fd;
  --c-blue-610: #0284c7;
  --c-blue-680: #0369a1;
  --c-blue-760: #0c4a6e;
  --c-blue-840: #162a3e;
  --c-blue-890: #0f172a;
  --c-blue-890-a040: rgba(15, 23, 42, 0.04);
  --c-blue-890-a050: rgba(15, 23, 42, 0.05);
  --c-blue-890-a060: rgba(15, 23, 42, 0.06);
  --c-blue-890-a080: rgba(15, 23, 42, 0.08);
  --c-blue-890-a100: rgba(15, 23, 42, 0.1);
  --c-blue-890-a120: rgba(15, 23, 42, 0.12);
  --c-blue-890-a140: rgba(15, 23, 42, 0.14);
  --c-blue-890-a150: rgba(15, 23, 42, 0.15);
  --c-blue-890-a160: rgba(15, 23, 42, 0.16);
  --c-blue-890-a180: rgba(15, 23, 42, 0.18);
  --c-blue-890-a940: rgba(15, 23, 42, 0.94);
  --c-cyan-310: #67e8f9;
  --c-cyan-390: #5fc4d8;
  --c-cyan-400: #38bdf8;
  --c-cyan-400-a120: rgba(56, 189, 248, 0.12);
  --c-cyan-400-a350: rgba(56, 189, 248, 0.35);
  --c-cyan-470: #22d3ee;
  --c-cyan-470-a350: rgba(34, 211, 238, 0.35);
  --c-cyan-470-a400: rgba(34, 211, 238, 0.4);
  --c-cyan-470-a450: rgba(34, 211, 238, 0.45);
  --c-cyan-510: #29b6d1;
  --c-cyan-700: #0e7490;
  --c-cyan-510-a100: rgba(41, 182, 209, 0.1);
  --c-cyan-510-a120: rgba(41, 182, 209, 0.12);
  --c-cyan-510-a150: rgba(41, 182, 209, 0.15);
  --c-cyan-510-a180: rgba(41, 182, 209, 0.18);
  --c-cyan-510-a200: rgba(41, 182, 209, 0.2);
  --c-cyan-510-a220: rgba(41, 182, 209, 0.22);
  --c-cyan-510-a250: rgba(41, 182, 209, 0.25);
  --c-cyan-510-a300: rgba(41, 182, 209, 0.3);
  --c-cyan-510-a320: rgba(41, 182, 209, 0.32);
  --c-cyan-510-a350: rgba(41, 182, 209, 0.35);
  --c-cyan-570: #06b6d4;
  --c-cyan-630: #238699;
  --c-cyan-630-a100: rgba(35, 134, 153, 0.1);
  --c-cyan-630-a160: rgba(35, 134, 153, 0.16);
  --c-cyan-630-a350: rgba(35, 134, 153, 0.35);
  --c-cyan-630-a600: rgba(35, 134, 153, 0.6);
  --c-cyan-670: #008fa7;
  --c-cyan-690-a160: rgba(14, 116, 144, 0.16);
  --c-cyan-730: #00778b;
  --c-cyan-730-a080: rgba(0, 119, 139, 0.08);
  --c-cyan-730-a120: rgba(0, 119, 139, 0.12);
  --c-cyan-730-a140: rgba(0, 119, 139, 0.14);
  --c-cyan-730-a150: rgba(0, 119, 139, 0.15);
  --c-cyan-730-a180: rgba(0, 119, 139, 0.18);
  --c-cyan-730-a200: rgba(0, 119, 139, 0.2);
  --c-cyan-730-a220: rgba(0, 119, 139, 0.22);
  --c-cyan-730-a240: rgba(0, 119, 139, 0.24);
  --c-cyan-730-a250: rgba(0, 119, 139, 0.25);
  --c-cyan-730-a350: rgba(0, 119, 139, 0.35);
  --c-cyan-730-a400: rgba(0, 119, 139, 0.4);
  --c-cyan-730-a450: rgba(0, 119, 139, 0.45);
  --c-cyan-730-a500: rgba(0, 119, 139, 0.5);
  --c-cyan-730-a600: rgba(0, 119, 139, 0.6);
  --c-cyan-850: #04404a;
  --c-cyan-900: #042f2e;
  --c-cyan-910: #062128;
  --c-green-480: #34d399;
  --c-green-550: #22c55e;
  --c-green-570: #28b47e;
  --c-green-640: #16a34a;
  --c-green-720: #15803d;
  --c-green-710: #158055;
  --c-navy-650: #475569;
  --c-navy-660: #4b5563;
  --c-navy-690: #3b4d63;
  --c-navy-730: #334155;
  --c-navy-730-a500: rgba(51, 65, 85, 0.5);
  --c-navy-730b: #2f435c;
  --c-navy-740: #2d4257;
  --c-navy-750b: #2d3e54;
  --c-navy-760b: #2b3c4f;
  --c-navy-770b: #2b3a4a;
  --c-navy-770d: #26374d;
  --c-navy-780: #28374a;
  --c-navy-790: #273442;
  --c-navy-800: #243244;
  --c-navy-800b: #203248;
  --c-navy-810: #242f3d;
  --c-navy-820e: #1e2d3e;
  --c-navy-830: #1e293b;
  --c-navy-830d: #1e2a38;
  --c-navy-840b: #192737;
  --c-navy-850: #1a2432;
  --c-navy-850b: #1c2530;
  --c-navy-860c: #152232;
  --c-navy-860e: #1c242c;
  --c-navy-870: #16202c;
  --c-navy-870-a400: rgba(22, 32, 44, 0.4);
  --c-navy-870-a920: rgba(22, 32, 44, 0.92);
  --c-navy-880: #161e27;
  --c-navy-890b: #111b27;
  --c-navy-900: #111822;
  --c-navy-900-a940: rgba(17, 24, 34, 0.94);
  --c-navy-900e-a950: rgba(18, 24, 32, 0.95);
  --c-navy-910e-a700: rgba(14, 21, 30, 0.7);
  --c-navy-920: #0c141f;
  --c-navy-930: #0b0f19;
  --c-navy-940: #090e15;
  --c-navy-940-a720: rgba(9, 14, 21, 0.72);
  --c-orange-470: #f97316;
  --c-orange-500: #f59e0b;
  --c-orange-600: #c2410c;
  --c-orange-650: #b45309;
  --c-orange-500-a150: rgba(245, 158, 11, 0.15);
  --c-orange-500-a450: rgba(245, 158, 11, 0.45);
  --c-orange-620: #b86609;
  --c-red-400: #ef4444;
  --c-red-560: #dc2626;
  --c-red-530: #c82828;
  --c-red-580: #b91c1c;
  --c-red-650: #991b1b;
  --c-red-690: #7f1d1d;
  --c-slate-20: #f8fafc;
  --c-slate-40: #f1f5f9;
  --c-slate-90: #e2e8f0;
  --c-slate-160: #cbd5e1;
  --c-slate-300: #9fb1c6;
  --c-slate-350: #94a3b8;
  --c-slate-380: #8b9bb0;
  --c-slate-450: #738ca6;
  --c-slate-530: #64748b;
  --c-slate-580: #556980;
  --c-slate-610: #4d6278;
  --c-slate-630: #4a5c73;
  --c-teal-610: #10b981;
  --c-teal-760: #047857;
  --c-teal-610-a000: rgba(16, 185, 129, 0);
  --c-teal-610-a080: rgba(16, 185, 129, 0.08);
  --c-teal-610-a140: rgba(16, 185, 129, 0.14);
  --c-teal-610-a180: rgba(16, 185, 129, 0.18);
  --c-teal-610-a350: rgba(16, 185, 129, 0.35);
  --c-teal-610-a700: rgba(16, 185, 129, 0.7);
  --c-teal-700: #059669;
  --c-teal-840: #064e3b;
  --c-white: #ffffff;
  --c-white-a015: rgba(255, 255, 255, 0.015);
  --c-white-a020: rgba(255, 255, 255, 0.02);
  --c-white-a040: rgba(255, 255, 255, 0.04);
  --c-white-a050: rgba(255, 255, 255, 0.05);
  --c-white-a060: rgba(255, 255, 255, 0.06);
  --c-white-a070: rgba(255, 255, 255, 0.07);
  --c-white-a080: rgba(255, 255, 255, 0.08);
  --c-white-a100: rgba(255, 255, 255, 0.1);
  --c-white-a120: rgba(255, 255, 255, 0.12);
  --c-white-a140: rgba(255, 255, 255, 0.14);
  --c-white-a160: rgba(255, 255, 255, 0.16);
  --c-white-a200: rgba(255, 255, 255, 0.2);
  --c-white-a250: rgba(255, 255, 255, 0.25);
}

:root {
  /* Surfaces & Backgrounds */
  --bg-main: var(--c-navy-900);
  --bg-header: var(--c-navy-850b);
  --bg-drawer: var(--c-navy-880);
  --bg-card: var(--c-navy-850b);
  --bg-card-hover: var(--c-navy-810);
  --bg-surface: var(--c-navy-870);
  --bg-surface-dark: var(--c-navy-900);
  --bg-input: var(--c-navy-870);
  --bg-field: var(--c-navy-900);         /* Eingabefelder, Tabellen-/Formularflächen */
  --bg-raised: var(--c-navy-850);        /* Tabellenkopf, Fußleisten, Kacheln */
  --bg-button: var(--c-navy-850);        /* Sekundär-Buttons */
  --bg-hover: var(--c-navy-810);         /* Hover-Fläche */
  --bg-item-hover: var(--c-navy-800);    /* Hover-Fläche von Listeneinträgen */
  --bg-selected: var(--c-navy-860c);     /* ausgewählt / Zeilen-Hover */

  /* Borders & Dividers */
  --border-color: var(--c-white-a080);
  --border-divider: var(--c-white-a100);
  --border-subtle: var(--c-navy-780);
  --border-strong: var(--c-navy-730);
  --border-control: var(--c-navy-730);   /* Rahmen von Buttons/Eingaben */
  --border-soft: var(--c-navy-830);      /* Rahmen von Kacheln, Tabellen */
  --border-hover: var(--c-navy-690);     /* Rahmen bei Hover */
  --divider-faint: var(--c-white-a050);  /* sehr feine Trennlinien, Hover-Flächen */

  /* Typography Hierarchy */
  --text-white: var(--c-white);
  --text-main: var(--c-slate-40);
  --text-secondary: var(--c-slate-160);
  --text-muted: var(--c-slate-350);
  --text-dim: var(--c-slate-530);
  --text-strong: var(--c-slate-90);      /* fast weiße Schrift (Werte, Titel) */
  --text-bright: var(--c-slate-20);      /* sehr helle Schrift (Listen-/Kartentitel) */
  --text-soft: var(--c-slate-90);        /* helle Schrift, im Hell-Modus gedämpft */
  --text-hover: var(--c-white);          /* Schrift bei Hover/aktiv (hell: Türkis) */

  /* Brand & Accent Colors */
  --primary-teal-dark: var(--c-cyan-850);
  --primary-teal: var(--c-cyan-730);
  --primary-teal-light: var(--c-cyan-630);
  --primary-teal-glow: var(--c-cyan-730-a450);
  --accent-cyan: var(--c-cyan-510);
  --accent-cyan-light: var(--c-cyan-390);
  --accent-orange: var(--c-orange-470);
  --accent-strong: var(--c-cyan-510);    /* Akzent-Rahmen/-Text (hell: kräftiges Türkis) */

  /* Status Colors */
  --status-ok: var(--c-cyan-730);
  --status-success: var(--c-teal-610);
  --status-warning: var(--c-orange-500);
  --status-error: var(--c-red-400);
  --status-offline: var(--c-slate-530);
  --status-unknown: var(--c-cyan-570);
  --user-avatar-bg: var(--c-green-550);

  /* Radii & Shadows */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --shadow-card: 0 2px 10px var(--c-black-a250);
  --shadow-modal: 0 12px 36px var(--c-black-a700);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

html, body {
  height: 100%;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ========================================================
   TOP DEMO BANNER
   ======================================================== */
.demo-banner {
  background-color: var(--c-orange-470);
  color: var(--c-white);
  text-align: center;
  padding: 5px 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  z-index: 1001;
  text-transform: uppercase;
}
.demo-banner i {
  font-size: 13px;
}

/* ========================================================
   HEADER / TOP BAR
   ======================================================== */
header {
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hamburger-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}
.hamburger-btn:hover {
  background: var(--c-white-a080);
}

.brand-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.header-brand-logo {
  height: 28px;
  width: auto;
  max-width: 175px;
  object-fit: contain;
  display: block;
}

/* Logo je nach Modus: helles Logo im Dunkel-Modus, dunkles Logo im Hell-Modus */
.header-brand-logo.logo-on-light,
html[data-theme="light"] .header-brand-logo.logo-on-dark {
  display: none;
}
html[data-theme="light"] .header-brand-logo.logo-on-light {
  display: block;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin-left: 14px;
}

.nav-link-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--c-slate-40);
  cursor: pointer;
  padding: 6px 11px;
  border-radius: 6px;
  border: none;
  transition: all 0.15s ease;
  user-select: none;
}
/* Inter ist etwas breiter als Roboto: Hauptmenü auf mittleren Breiten minimal enger,
   damit die Kopfzeile nicht über den Rand ragt */
@media (min-width: 1025px) and (max-width: 1366px) {
  .nav-link-item {
    padding: 6px 9px;
  }
}

.nav-link-item:hover {
  color: var(--text-hover);
  background: var(--c-white-a080);
}
.nav-link-item.disabled {
  color: var(--c-slate-300);
  cursor: default;
  pointer-events: none;
}
.nav-link-item.disabled i,
.nav-link-item.disabled .material-icons {
  color: var(--c-slate-300);
}
.nav-link-item.disabled:hover {
  background: transparent;
  color: var(--c-slate-300);
}
.nav-link-item i,
.nav-link-item .material-icons {
  font-size: 19px;
  color: var(--c-white);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav-link-item .chevron {
  font-size: 10px;
  color: var(--c-slate-350);
  margin-left: 2px;
}

.has-dropdown {
  position: relative;
}
.nav-link-item.active-nav {
  color: var(--text-hover) !important;
  font-weight: 600;
  background: transparent;
  border: none;
  border-radius: 6px;
}
.nav-link-item.active-nav a {
  color: var(--text-hover) !important;
}
.nav-link-item.active-nav i,
.nav-link-item.active-nav .material-icons {
  color: var(--c-cyan-510) !important;
}
.nav-link-item.has-dropdown:hover {
  background: transparent;
  border: none;
  color: var(--text-hover);
}
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--bg-input);
  border: 1px solid var(--c-navy-770b);
  border-radius: 6px;
  width: 230px;
  box-shadow: 0 12px 32px var(--c-black-a750);
  display: none;
  flex-direction: column;
  padding: 6px 0;
  z-index: 1005;
}
.has-dropdown::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 8px;
}
.has-dropdown:hover .nav-dropdown-menu {
  display: flex;
}
.dropdown-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 400;
  transition: all 0.15s;
}
.dropdown-link:hover, .dropdown-link.active {
  background: var(--bg-hover);
  color: var(--text-hover);
  font-weight: 500;
}
.dropdown-link.disabled {
  color: var(--c-navy-650) !important;
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  user-select: none;
}
.dropdown-link.disabled:hover {
  background: transparent !important;
  color: var(--c-navy-650) !important;
}
.dropdown-link i,
.dropdown-link .material-icons {
  color: var(--c-cyan-390);
  width: 20px;
  text-align: center;
  font-size: 19px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dropdown-link.disabled i,
.dropdown-link.disabled .material-icons {
  color: var(--c-navy-730) !important;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 17px;
  padding: 6px;
  border-radius: 50%;
  position: relative;
  transition: color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover {
  color: var(--c-white);
  background: var(--c-white-a080);
}
.icon-btn .badge-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  background-color: var(--accent-orange);
  border-radius: 50%;
}

.desktop-tenant-select {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-control);
  color: var(--text-strong);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.desktop-user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--user-avatar-bg);
  color: var(--c-teal-840);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-circle i {
  font-size: 13px;
  line-height: 1;
}
.user-fullname {
  font-size: 13px;
  color: var(--text-main);
  font-weight: 500;
}



/* ========================================================
   MOBILE DRAWER
   ======================================================== */
.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--c-black-a650);
  backdrop-filter: blur(2px);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.drawer-backdrop.active,
.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 290px;
  max-width: 85vw;
  height: 100vh;
  background: var(--bg-drawer);
  z-index: 2001;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 25px var(--c-black-a600);
  overflow-y: auto;
}
.mobile-drawer.active,
.mobile-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 18px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-divider);
}

.drawer-close-btn {
  background: transparent;
  border: none;
  color: var(--c-cyan-630);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-menu-list {
  list-style: none;
  padding: 8px 0;
}

.drawer-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
  border-left: 3px solid transparent;
}
.drawer-menu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 13px 18px;
  color: inherit;
  text-decoration: none;
}
.tenant-chevron {
  font-size: 10px;
  margin-left: 2px;
}
.drawer-menu-item:hover, .drawer-menu-item.active {
  background: var(--divider-faint);
  color: var(--text-hover);
  border-left-color: var(--c-cyan-630);
}
.drawer-menu-item-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.drawer-menu-item-left i {
  font-size: 16px;
  color: var(--c-cyan-630);
  width: 20px;
  text-align: center;
}
.drawer-menu-item .chevron {
  font-size: 12px;
  color: var(--c-cyan-630);
}

.drawer-divider {
  height: 1px;
  background-color: var(--border-divider);
  margin: 10px 16px;
}

.drawer-account-box {
  padding: 12px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.drawer-tenant-pill {
  background: var(--c-navy-800);
  border: 1px solid var(--border-control);
  border-radius: 6px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-strong);
  font-size: 13px;
  cursor: pointer;
}
.drawer-tenant-pill .left-part {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.drawer-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
}
.drawer-user-info .avatar-circle {
  width: 38px;
  height: 38px;
  font-size: 13px;
}
.drawer-user-info .user-name-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-white);
}

/* ========================================================
   MAIN DASHBOARD
   ======================================================== */
main {
  flex: 1;
  padding: 14px 20px 16px;
  max-width: 1920px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.dashboard-split-layout {
  flex: 1;
  min-height: 540px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}

@media (max-width: 1280px) {
  .dashboard-split-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }
}

.right-dashboard-panel,
.card.right-dashboard-panel {
  display: flex;
  flex-direction: column;
  padding: 12px 20px 16px 20px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 8px 32px var(--c-black-a600), 0 2px 8px var(--c-black-a400);
}

.panel-header-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.panel-header-top {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

/* Bereich 1 (Links): Titel & Werte direkt nebeneinander */
.panel-header-titles {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
  flex: 1 1 auto;
}

.panel-main-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-bright);
  white-space: nowrap;
  flex-shrink: 0;
}

.panel-header-divider {
  color: var(--c-slate-530);
  font-weight: 300;
  font-size: 12px;
  opacity: 0.75;
  user-select: none;
  margin: 0 1px;
  flex-shrink: 0;
}

.panel-sub-title {
  font-size: 13px;
  font-weight: 400; /* doch nicht fett */
  color: var(--text-muted);   /* exakt das Grau wie bei den Geräten & Standorten in der Liste */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}

/* Bereich 3 (Rechts): Filter-Badges im rechten Container */
.status-badge-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: nowrap;
  z-index: 2;
  margin-left: auto;
  flex-shrink: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 3.5px;
  padding: 1.5px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  color: var(--c-white);
  box-shadow: 0 1px 4px var(--c-black-a250);
  user-select: none;
  white-space: nowrap;
  height: 20px;
}
.status-pill strong {
  font-weight: 800;
}

.pill-error {
  background-color: var(--c-red-400);
}
.pill-warning {
  background-color: var(--c-orange-500);
}
.pill-offline {
  background-color: var(--c-slate-530);
}
.pill-unknown {
  background-color: var(--c-cyan-570);
}
.pill-ok {
  background-color: var(--c-teal-610);
}

/* Zeile 2: 3 Buttons (2 linksbündig etwas schmaler, Zurück-Button rechtsbündig) */
.panel-action-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  gap: 8px;
}

.panel-action-left-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1 1 auto;
}

.panel-action-btn {
  background: var(--c-navy-860e);
  border: 1px solid var(--c-slate-610);
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  height: 28px;
  flex: 0 1 auto;
}
.panel-action-btn:hover {
  background: var(--bg-hover);
  border-color: var(--c-cyan-470);
  color: var(--text-bright);
  box-shadow: 0 2px 8px var(--c-cyan-730-a350);
}

.panel-action-btn.active {
  background: var(--c-cyan-730) !important;
  border-color: var(--c-cyan-310) !important;
  color: var(--c-white) !important;
  box-shadow: 0 0 12px var(--c-cyan-470-a450);
}

.panel-action-btn.active i {
  color: var(--c-white);
}

.panel-back-btn {
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  flex-shrink: 0;
  white-space: nowrap;
  height: 28px;
  user-select: none;
  cursor: pointer;
  margin-top: 0;
}

/* Deaktivierter Zustand (in der Gesamtbersicht) */
.panel-back-btn:disabled,
.panel-back-btn.disabled {
  background: var(--c-navy-880);
  border: 1px solid var(--c-navy-790);
  color: var(--c-navy-660);
  cursor: default;
  pointer-events: none;
  box-shadow: none;
}

/* Aktiver Zustand (beim Klick auf ein Land oder Cluster) */
.panel-back-btn:not(:disabled) {
  background: var(--c-cyan-730-a200);
  border: 1px solid var(--c-cyan-730);
  color: var(--c-cyan-470);
  cursor: pointer;
  box-shadow: 0 1px 4px var(--c-black-a300);
}

.panel-back-btn:not(:disabled):hover {
  background: var(--c-cyan-730);
  color: var(--c-white);
  border-color: var(--c-cyan-470);
  box-shadow: 0 2px 10px var(--c-cyan-730-a500);
}

/* Scrollable List */
.panel-list-container {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 4px 10px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 5px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: var(--c-navy-770b);
  border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--c-cyan-730);
}

/* List Item Card */
.panel-list-item {
  display: flex;
  flex-direction: column;
  gap: 0px;
  padding: 4px 10px 5px 10px;
  border-radius: 6px;
  background: var(--c-white-a015);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}
.panel-list-item:hover {
  background: var(--c-white-a040);
  border-color: var(--c-white-a080);
}
.panel-list-item.active {
  background: var(--c-cyan-730-a150);
  border-color: var(--c-cyan-730);
}

.item-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 16px;
  line-height: 1.25;
  margin-bottom: 1px;
}

.item-title {
  font-size: 13px;
  color: var(--c-slate-20);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px 6px;
  flex: 1;
  min-width: 0;
}

.item-name {
  color: var(--text-bright);
  font-weight: 500; /* nicht so fett */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
}

.item-divider {
  color: var(--c-slate-530);
  font-weight: 300;
  font-size: 11px;
  opacity: 0.75;
  user-select: none;
  flex-shrink: 0;
  margin: 0 1px;
}

.item-meta-inline {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 400;
  white-space: nowrap;
  flex-shrink: 0;
}

.item-status-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Länder-Flaggen-Badge (abgerundete Ecken, feiner Rahmen, vor dem Ländernamen in Liste & auf Karte) */
.country-flag-badge {
  width: 22px;
  height: 15px;
  border-radius: 4px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--c-white-a250);
  background: var(--c-blue-890);
  box-shadow: 0 1px 4px var(--c-black-a450);
  flex-shrink: 0;
  position: relative;
  top: -1px;
  transition: all 0.2s ease;
}

.country-flag-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.panel-list-item:hover .country-flag-badge,
.country-macro-marker:hover .country-flag-badge {
  border-color: var(--c-cyan-470);
  box-shadow: 0 2px 8px var(--c-cyan-470-a450);
}

.macro-flag-badge {
  width: 20px;
  height: 14px;
  border-radius: 3.5px;
}
.text-error { color: var(--c-red-400); font-weight: 600; }
.text-warning { color: var(--c-orange-500); font-weight: 600; }
.text-ok { color: var(--c-teal-610); font-weight: 600; }

.item-arrow {
  font-size: 11px;
  color: var(--c-slate-530);
  transition: transform 0.2s;
}
.panel-list-item:hover .item-arrow {
  color: var(--c-cyan-470);
  transform: translateX(3px);
}

/* Horizontal Multi-Segment Progress Bar */
.item-progress-bar {
  width: 100%;
  height: 5px;
  background: var(--c-navy-880);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  margin-top: 4px; /* 4px weiter nach unten zur Zeile darber */
}

/* Blauer Kreis-Bubble fr Gruppen/Cluster in der rechten Liste (entspricht exakt Karten-Cluster) */
.group-bubble-pill {
  width: 18px;
  height: 18px;
  background: var(--c-cyan-730);
  color: var(--c-white);
  border: 1.8px solid var(--c-white);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  box-shadow: 0 1px 4px var(--c-black-a400);
  flex-shrink: 0;
  line-height: 1;
}

/* Grner & Teal Ortspfeil fr finale Standorte in der Liste */
.site-pin-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.site-pin-icon.pin-green {
  color: var(--c-teal-610);
}
.item-target-icon {
  font-size: 11px;
  color: var(--c-slate-530);
  opacity: 0.7;
  transition: all 0.2s;
}
.panel-list-item:hover .item-target-icon {
  color: var(--c-teal-610);
  opacity: 1;
  transform: scale(1.15);
}

.bar-segment {
  height: 100%;
  transition: width 0.3s ease;
}

/* Footer Section */
.panel-footer-section {
  flex-shrink: 0;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-status-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.footer-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.footer-status-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-bright);
}

.footer-status-divider {
  color: var(--c-slate-530);
  font-weight: 300;
  font-size: 11.5px;
  opacity: 0.75;
  user-select: none;
  margin: 0 1px;
}

.footer-status-total {
  font-size: 11.5px;
  color: var(--c-slate-350);
  font-weight: 400;
}

.multi-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--c-navy-880);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
}

.footer-status-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  color: var(--c-slate-350);
  flex-wrap: wrap;
}

.legend-metric {
  display: flex;
  align-items: center;
  gap: 5px;
}
.legend-metric strong, .legend-metric span {
  color: var(--text-strong);
}

.metric-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.dot-error { background: var(--c-red-400); }
.dot-warning { background: var(--c-orange-500); }
.dot-ok { background: var(--c-teal-610); }

/* --- COUNTRY MACRO MARKER (Übersichts-Pins DE & NL auf der Karte) --- */
.country-macro-marker {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
  user-select: none;
}
.country-macro-marker:hover {
  transform: translate(-50%, -50%) scale(1.08);
  z-index: 5;
}
.country-macro-marker .macro-label {
  font-size: 11.5px;
  font-weight: 400; /* einfach in normal und nicht in fett */
  color: var(--c-slate-40);
  background: var(--c-navy-900-a940);
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid var(--c-white-a160);
  white-space: nowrap;
  box-shadow: 0 3px 10px var(--c-black-a500);
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}
.country-macro-marker:hover .macro-label {
  background: var(--c-cyan-730);
  border-color: var(--c-cyan-470);
  color: var(--c-white);
  box-shadow: 0 4px 16px var(--c-cyan-730-a600), 0 0 10px var(--c-cyan-470-a400);
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 18px;
  position: relative;
  box-shadow: 0 8px 32px var(--c-black-a600), 0 2px 8px var(--c-black-a400);
  display: flex;
  flex-direction: column;
}
.toggle-pill-group {
  background: var(--c-navy-870);
  border: 1px solid var(--border-control);
  border-radius: 6px;
  display: flex;
  padding: 2px;
  gap: 2px;
}
.toggle-pill {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.toggle-pill.active {
  background: var(--c-cyan-730);
  color: var(--c-white);
  box-shadow: 0 1px 4px var(--c-black-a300);
}
.toggle-pill:hover:not(.active) {
  color: var(--text-white);
  background: var(--c-white-a050);
}

/* ========================================================
   MAP SECTION & BADGES & FACTORY PINS
   ======================================================== */
.map-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px var(--c-black-a600), 0 2px 8px var(--c-black-a400);
  height: 100%;
  min-height: 0;
  container-type: inline-size;
}

/* ZEILE 1: Header Top Row (Titel, Standorte, Geräte) */
.map-header-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px 4px 16px;
  box-sizing: border-box;
  min-height: 28px;
}

.country-count-full,
.badge-label-full,
.btn-text-full {
  display: inline;
}
.country-count-short,
.badge-label-short,
.btn-text-short {
  display: none;
}

@media (max-width: 800px) {
  .country-count-full {
    display: none;
  }
  .country-count-short {
    display: inline;
  }
}

.map-title-area {
  display: flex;
  align-items: center;
  min-height: 28px;
  gap: 6px;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}
.map-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-bright);
  white-space: nowrap;
  flex-shrink: 0;
}
.map-header-divider {
  color: var(--c-slate-530);
  font-weight: 300;
  font-size: 12px;
  opacity: 0.75;
  user-select: none;
  margin: 0 1px;
  flex-shrink: 0;
}
.map-sub-title {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}
.icon-only-pill {
  padding: 5px 9px;
  font-size: 12.5px;
  min-width: 28px;
  justify-content: center;
}
.icon-only-pill i {
  position: relative;
  top: 1px;
}

/* ZEILE 2: Toolbar (Links: Radius, Mitte: Checkboxen, Rechts: Action-Icons) */
.map-header-toolbar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 16px 10px 16px;
  border-bottom: 1px solid var(--border-color);
  gap: 12px;
  box-sizing: border-box;
}

.map-cluster-radius-bar {
  display: flex;
  align-items: center;
  min-height: 28px;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}

.cluster-radius-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--c-slate-350);
  display: flex;
  align-items: center;
  gap: 5px;
  user-select: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.cluster-radius-label i {
  color: var(--c-cyan-730);
  font-size: 11.5px;
}

.radius-toggle-group .toggle-pill {
  font-size: 11px;
  padding: 4px 10px;
  font-weight: 500;
}

/* MITTE: Zentrierte Checkboxen */
.map-header-center-toggles {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
}

.map-header-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  line-height: 1.2;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
  white-space: nowrap;
}

.map-header-checkbox-label:hover {
  color: var(--c-slate-20);
}

/* CUSTOM CHECKBOX: Heller als Hintergrund (#0f172a), aber deutlich dunkler als Weiß */
.map-custom-checkbox {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  width: 15px;
  height: 15px;
  border-radius: 3px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-strong);
  display: inline-grid;
  place-content: center;
  margin: 0;
  padding: 0;
  vertical-align: middle;
  transition: all 0.15s ease;
  flex-shrink: 0;
  position: relative;
  outline: none;
}

.map-custom-checkbox:hover {
  background-color: var(--c-navy-730b);
  border-color: var(--c-cyan-730);
}

.map-custom-checkbox:checked {
  background-color: var(--c-cyan-730);
  border-color: var(--c-cyan-470);
  box-shadow: 0 0 6px var(--c-cyan-470-a350);
}

.map-custom-checkbox:checked::after {
  content: "";
  width: 4px;
  height: 8px;
  border: solid var(--c-white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

/* RECHTS: Action Icons */
.map-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* RESPONSIVE VERHALTEN */
/* Stufe 1: Bei kleineren Auflösungen / Containerbreiten rücken die beiden Checkboxen als erstes übereinander */
@container (max-width: 900px) {
  .map-header-center-toggles {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 3px;
    flex: 0 0 auto;
    margin: 0 auto;
  }
}

@media (max-width: 1720px) {
  .map-header-center-toggles {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 3px;
    flex: 0 0 auto;
    margin: 0 auto;
  }
}

/* Stufe 2: Erst bei noch kleineren Auflösungen (unter 1150px) bricht die gesamte Toolbar um */
@media (max-width: 1150px) {
  .map-header-toolbar-row {
    flex-wrap: wrap;
    gap: 8px;
  }
  .map-header-center-toggles {
    order: 3;
    width: 100%;
    align-items: flex-start;
    margin: 0;
    padding-top: 4px;
    border-top: 1px dashed var(--c-navy-730-a500);
  }
}

@media (max-width: 800px) {
  .cluster-radius-label {
    display: none;
  }

  .map-header-toolbar-row {
    flex-direction: column !important;
    align-items: center;
    justify-content: center;
    gap: 8px !important;
    padding: 6px 12px 10px !important;
  }

  /* Zeile 1: Fein / Standard / Weit horizontal zentriert */
  .map-cluster-radius-bar {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
  }

  .map-cluster-radius-bar .radius-toggle-group {
    margin: 0 auto;
  }

  /* Zeile 2: Alle Karten- und Aktions-Icons horizontal zentriert */
  .map-header-right {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap !important;
    gap: 6px;
    margin: 0;
  }

  /* Zeile 3: Checkboxen-Block horizontal zentriert */
  .map-header-center-toggles {
    order: 3 !important;
    width: 100%;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center !important;
    gap: 4px;
    margin: 0 !important;
    padding-top: 6px !important;
    border-top: 1px dashed var(--c-navy-730-a500) !important;
  }

  .panel-header-top {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px;
  }

  .panel-header-titles {
    width: 100%;
  }

  /* Badges alle in EINER Zeile (Kürzel für Warn., Offl., Unbek.) */
  .status-badge-row {
    flex-wrap: nowrap !important;
    gap: 4px !important;
    width: 100% !important;
    justify-content: flex-start !important;
    margin-left: 0 !important;
  }

  .badge-label-full {
    display: none;
  }
  .badge-label-short {
    display: inline;
  }

  .status-pill {
    padding: 1.5px 5px !important;
    font-size: 10px !important;
    flex-shrink: 0 !important;
  }

  /* Aktions-Buttons: die 2 Buttons nebeneinander in einer Zeile */
  .panel-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
  }

  .panel-action-left-group {
    display: flex;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    gap: 6px !important;
  }

  .btn-text-full {
    display: none;
  }
  .btn-text-short {
    display: inline !important;
  }

  .panel-action-left-group .panel-action-btn {
    flex: 1 1 0;
    min-width: 0 !important;
    padding: 5px 6px !important;
    font-size: 11px !important;
    justify-content: center !important;
    white-space: nowrap;
  }

  .panel-action-left-group .panel-action-btn span {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  /* Zurück-Button mobil rechtsbündig */
  .panel-back-btn {
    align-self: flex-end !important;
    margin-left: auto !important;
    flex-shrink: 0 !important;
  }
}

.map-action-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}
.map-icon-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-control);
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.map-icon-btn i {
  position: relative;
  top: 1px;
}
.map-icon-btn:hover, .map-icon-btn.active {
  background: var(--c-cyan-730);
  color: white;
  border-color: var(--c-cyan-730);
}

#map {
  flex: 1;
  min-height: 350px;
  height: 100%;
  width: 100%;
  background-color: var(--c-navy-930);
}

/* --- MODERN AI CLUSTER CAPSULES --- */

/* --- GRÜNER GERÄTE-STANDORT PIN (Exakt wie im Screenshot: Werk/Fabrik-Icon + Rotes Geräte-Badge) --- */

/* Kreativer High-Tech Patch am Marker mit Geräteanzahl (Oval / Pill) */

/* --- DEMAS STANDORT-POPUP (Exakt wie in Vorlage Screenshot 2) --- */
.mapboxgl-popup-content,
.demas-site-popup .mapboxgl-popup-content {
  background: var(--bg-input) !important;
  color: var(--text-bright) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 8px !important;
  padding: 16px 18px !important;
  box-shadow: 0 16px 36px var(--c-black-a750) !important;
  min-width: 290px;
}
.mapboxgl-popup-close-button,
.demas-site-popup .mapboxgl-popup-close-button {
  color: var(--c-slate-160) !important;
  font-size: 18px !important;
  padding: 6px 10px !important;
  top: 8px !important;
  right: 8px !important;
}
.mapboxgl-popup-close-button:hover,
.demas-site-popup .mapboxgl-popup-close-button:hover {
  color: var(--c-white) !important;
  background: transparent !important;
}
.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip,
.demas-site-popup.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip {
  border-top-color: var(--c-navy-870) !important;
}
.mapboxgl-popup-anchor-top .mapboxgl-popup-tip,
.demas-site-popup.mapboxgl-popup-anchor-top .mapboxgl-popup-tip {
  border-bottom-color: var(--c-navy-870) !important;
}
.mapboxgl-popup-anchor-left .mapboxgl-popup-tip,
.demas-site-popup.mapboxgl-popup-anchor-left .mapboxgl-popup-tip {
  border-right-color: var(--c-navy-870) !important;
}
.mapboxgl-popup-anchor-right .mapboxgl-popup-tip,
.demas-site-popup.mapboxgl-popup-anchor-right .mapboxgl-popup-tip {
  border-left-color: var(--c-navy-870) !important;
}

.site-popup-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.site-popup-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-white);
  line-height: 1.35;
  padding-right: 14px;
}
.site-popup-address {
  font-size: 13px;
  color: var(--c-slate-350);
  margin-top: -2px;
}
.site-popup-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  width: fit-content;
  margin: 3px 0 2px 0;
}
.site-popup-badge.badge-has-devices {
  background: var(--c-teal-610);
  color: var(--c-cyan-910);
}
.site-popup-badge.badge-no-devices {
  background: var(--c-cyan-730-a250);
  border: 1px solid var(--c-cyan-730);
  color: var(--c-cyan-470);
}
.site-popup-darkbox {
  background: var(--c-navy-900);
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 2px 0 4px 0;
}
.site-popup-coords-row {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-secondary);
  font-family: monospace;
  font-weight: 600;
}
.site-popup-hash-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--c-cyan-470);
  font-size: 11.5px;
  font-family: monospace;
  cursor: pointer;
}
.site-popup-hash-text {
  color: var(--c-cyan-470);
  text-decoration: none;
  word-break: break-all;
}
.site-popup-btn {
  background: var(--c-cyan-730);
  color: var(--c-white);
  border: none;
  border-radius: 6px;
  padding: 9px 14px;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 4px;
  width: 100%;
}
.site-popup-btn:hover {
  background: var(--c-cyan-630);
}

/* Mapbox Controls Dark */
.mapboxgl-ctrl-group {
  background: var(--c-navy-830);
  border: 1px solid var(--c-navy-730);
}
.mapboxgl-ctrl-group button {
  border-bottom: 1px solid var(--c-navy-730) !important;
}
.mapboxgl-ctrl-group button:hover {
  background-color: var(--c-navy-730) !important;
}
.mapboxgl-ctrl-icon {
  filter: invert(0.85);
}

/* ========================================================
   CREATIVE MORPHING LEGENDE BOX (Pfeil nach links unten)
   ======================================================== */
.map-legend-overlay {
  position: absolute;
  bottom: 24px;
  left: 20px;
  background: var(--c-navy-900e-a950);
  backdrop-filter: blur(10px);
  border: 1px solid var(--c-white-a140);
  border-radius: 10px;
  padding: 14px 44px 14px 16px;
  z-index: 100;
  width: auto;
  max-width: 440px;
  box-shadow: 0 8px 32px var(--c-black-a650), 0 0 0 1px var(--c-cyan-730-a150);
  transform-origin: bottom left;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.map-legend-overlay.collapsed {
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 0;
  border-radius: 50%;
  background: var(--c-navy-870);
  border: 1.5px solid var(--c-cyan-730);
  box-shadow: 0 4px 20px var(--c-black-a700), 0 0 14px var(--c-cyan-730-a400);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.map-legend-overlay.collapsed:hover {
  transform: scale(1.12);
  background: var(--c-cyan-730);
  border-color: var(--c-white);
  box-shadow: 0 6px 24px var(--c-cyan-730-a600);
}

.legend-trigger-icon {
  display: none;
  color: var(--c-white);
  font-size: 16px;
  pointer-events: none;
}
.map-legend-overlay.collapsed .legend-trigger-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-legend-overlay.collapsed .collapse-pill,
.map-legend-overlay.collapsed .legend-overlay-content {
  display: none !important;
}

.collapse-pill {
  position: absolute;
  top: 13px;
  right: 12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--c-white-a080);
  border: 1px solid var(--c-white-a120);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--c-cyan-630);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
}
.collapse-pill:hover {
  background: var(--c-cyan-730);
  color: var(--c-white);
  border-color: var(--c-cyan-630);
  transform: translate(-2px, 2px) scale(1.1);
  box-shadow: 0 0 10px var(--c-cyan-730-a500);
}

.legend-overlay-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 12px;
  color: var(--c-slate-90);
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 16px;
  white-space: nowrap;
}

.legend-icon-sample {
  width: 34px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* FAB Floating Help Button */
.fab-help {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--c-cyan-730);
  color: var(--c-white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px var(--c-cyan-730-a400);
  cursor: pointer;
  font-size: 20px;
  border: none;
  z-index: 1000;
  transition: transform 0.2s, background-color 0.2s;
}
.fab-help:hover {
  background: var(--c-cyan-850);
  color: white;
  transform: scale(1.06);
}

/* ========================================================
   RESPONSIVE DESIGN
   ======================================================== */
/* Kopfzeile: volle Menüleiste ab 1200 px, darunter Menü-Schublade (Hamburger).
   Zwischen 1200 und 1279 px nur der Avatar ohne Namen, damit nichts über den Rand ragt. */
@media (min-width: 1200px) {
  .hamburger-btn {
    display: none;
  }
}

@media (min-width: 1200px) and (max-width: 1279px) {
  .user-fullname {
    display: none;
  }
}

@media (max-width: 1199px) {
  .desktop-nav {
    display: none;
  }
  .desktop-tenant-select, .desktop-user-badge {
    display: none;
  }
  .hamburger-btn {
    display: flex;
  }
}

@media (max-width: 1024px) {
  #map {
    height: 440px;
  }
}

@media (max-width: 640px) {
  main {
    padding: 12px 14px 28px;
  }
  .card {
    padding: 14px;
  }
  #map {
    height: 380px;
  }
  .map-legend-overlay:not(.collapsed) {
    bottom: 12px;
    left: 12px;
    right: 12px;
    max-width: unset;
    width: auto;
  }
  .legend-row {
    white-space: normal;
  }
  .fab-help {
    bottom: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    font-size: 18px;
  }
}

/* --- DEMAS HOVER-TOOLTIP FÜR EINZELSTANDORTE --- */
.demas-hover-tooltip {
  pointer-events: none !important;
  z-index: 1000 !important;
}

.demas-hover-tooltip .mapboxgl-popup-content {
  background: var(--c-blue-890-a940) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--c-slate-20) !important;
  border: 1px solid var(--c-cyan-400-a350) !important;
  border-radius: 6px !important;
  padding: 6px 10px !important;
  box-shadow: 0 4px 16px var(--c-black-a600) !important;
  min-width: unset !important;
  max-width: 320px !important;
  pointer-events: none !important;
}

.demas-hover-tooltip.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip {
  border-top-color: var(--c-blue-890-a940) !important;
}
.demas-hover-tooltip.mapboxgl-popup-anchor-top .mapboxgl-popup-tip {
  border-bottom-color: var(--c-blue-890-a940) !important;
}
.demas-hover-tooltip.mapboxgl-popup-anchor-left .mapboxgl-popup-tip {
  border-right-color: var(--c-blue-890-a940) !important;
}
.demas-hover-tooltip.mapboxgl-popup-anchor-right .mapboxgl-popup-tip {
  border-left-color: var(--c-blue-890-a940) !important;
}

.hover-tooltip-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: none;
}

.hover-tooltip-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--c-slate-20);
  line-height: 1.25;
  white-space: normal;
}

.hover-tooltip-sub {
  font-size: 10.5px;
  color: var(--c-slate-350);
  display: flex;
  align-items: center;
  gap: 4px;
}

.hover-tooltip-zip {
  color: var(--c-cyan-400);
  font-weight: 600;
}

.hover-tooltip-sep {
  color: var(--c-slate-530);
  margin: 0 1px;
  font-weight: 700;
}

.hover-tooltip-dev-label {
  color: var(--c-white);
  font-weight: 500;
}

.hover-tooltip-counts {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.hover-tooltip-counts .num-err {
  color: var(--c-red-400);
}

.hover-tooltip-counts .num-warn {
  color: var(--c-orange-500);
}

.hover-tooltip-counts .num-ok {
  color: var(--c-teal-610);
}


/* Nav item link helper */
.nav-link-item a.nav-item-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  width: 100%;
  height: 100%;
}

/* Shared Map Legend Marker Previews */
.legend-pin-svg {
  overflow: visible;
  filter: drop-shadow(0 2px 4px var(--c-black-a500));
}


/* ========================================================
   THEME SWITCH BUTTON (HEADER & MOBILE DRAWER)
   ======================================================== */
.theme-switch-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 30px;
  padding: 0 9px;
  background: var(--bg-hover);
  border: 1px solid var(--c-navy-730);
  border-radius: 999px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.theme-switch-btn:hover {
  border-color: var(--accent-strong);
  background: var(--c-navy-770b);
}

.theme-switch-btn .theme-icon-sun,
.theme-switch-btn .theme-icon-moon {
  font-size: 12px;
  transition: color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

/* Dark Mode active state (default): Moon highlighted */
.theme-switch-btn .theme-icon-sun {
  color: var(--c-slate-530);
  opacity: 0.65;
}

.theme-switch-btn .theme-icon-moon {
  color: var(--c-cyan-510);
  opacity: 1;
}

/* Light Mode active state: Sun highlighted */
html[data-theme="light"] .theme-switch-btn {
  background: var(--c-slate-40);
  border-color: var(--c-slate-160);
}

html[data-theme="light"] .theme-switch-btn:hover {
  background: var(--c-slate-90);
  border-color: var(--c-cyan-730);
}

html[data-theme="light"] .theme-switch-btn .theme-icon-sun {
  color: var(--c-orange-500);
  opacity: 1;
  transform: scale(1.1);
}

html[data-theme="light"] .theme-switch-btn .theme-icon-moon {
  color: var(--c-slate-350);
  opacity: 0.55;
}

/* Mobile Drawer Theme Switch */
.drawer-theme-switch-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  margin-bottom: 10px;
  background: var(--c-navy-800);
  border: 1px solid var(--c-navy-730);
  border-radius: 6px;
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.drawer-theme-switch-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.drawer-theme-switch-btn .theme-icon-sun {
  display: none;
  color: var(--c-orange-500);
}

.drawer-theme-switch-btn .theme-icon-moon {
  color: var(--c-cyan-510);
}

.drawer-theme-pill {
  width: 34px;
  height: 18px;
  background: var(--c-navy-870);
  border: 1px solid var(--c-navy-650);
  border-radius: 999px;
  position: relative;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.drawer-theme-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-strong);
  transition: transform 0.2s ease, background 0.2s ease;
}

html[data-theme="light"] .drawer-theme-switch-btn {
  background: var(--c-slate-20);
  border-color: var(--c-slate-160);
}

html[data-theme="light"] .drawer-theme-switch-btn .theme-icon-sun {
  display: inline-block;
}

html[data-theme="light"] .drawer-theme-switch-btn .theme-icon-moon {
  display: none;
}

html[data-theme="light"] .drawer-theme-pill {
  background: var(--c-blue-60);
  border-color: var(--c-cyan-730);
}

html[data-theme="light"] .drawer-theme-knob {
  transform: translateX(16px);
}


/* ========================================================
   LIGHT MODE DESIGN TOKENS & GLOBAL STYLES (style.css)
   ======================================================== */
html[data-theme="light"] {
  --bg-main: var(--c-slate-40);
  --bg-header: var(--c-white);
  --bg-drawer: var(--c-white);
  --bg-card: var(--c-white);
  --bg-card-hover: var(--c-slate-20);
  --bg-surface: var(--c-slate-20);
  --bg-surface-dark: var(--c-slate-40);
  --bg-input: var(--c-white);
  --bg-field: var(--c-white);
  --bg-raised: var(--c-slate-20);
  --bg-button: var(--c-white);
  --bg-hover: var(--c-slate-40);
  --bg-item-hover: var(--c-slate-40);
  --bg-selected: var(--c-blue-30);

  --border-color: var(--c-slate-90);
  --border-divider: var(--c-slate-90);
  --border-subtle: var(--c-slate-160);
  --border-strong: var(--c-slate-350);
  --border-control: var(--c-slate-160);
  --border-soft: var(--c-slate-90);
  --border-hover: var(--c-slate-350);
  --divider-faint: var(--c-slate-40);

  --text-white: var(--c-blue-890);
  --text-main: var(--c-blue-890);
  --text-secondary: var(--c-navy-730);
  --text-muted: var(--c-slate-530);
  --text-dim: var(--c-slate-350);
  --text-strong: var(--c-blue-890);
  --text-bright: var(--c-blue-890);
  --text-soft: var(--c-navy-730);
  --text-hover: var(--c-cyan-730);
  --accent-strong: var(--c-cyan-730);

  --shadow-card: 0 1px 4px var(--c-blue-890-a060), 0 1px 2px var(--c-blue-890-a040);
  --shadow-modal: 0 16px 40px var(--c-blue-890-a160);
}

/* Header & Navigation in Light Mode */
html[data-theme="light"] header {
  background-color: var(--c-white);
  box-shadow: 0 1px 3px var(--c-blue-890-a050);
}

html[data-theme="light"] .hamburger-btn,
html[data-theme="light"] .icon-btn {
  color: var(--c-navy-730);
}

html[data-theme="light"] .hamburger-btn:hover,
html[data-theme="light"] .icon-btn:hover {
  color: var(--c-blue-890);
  background: var(--c-slate-40);
}

html[data-theme="light"] .nav-link-item {
  color: var(--c-navy-730);
}

html[data-theme="light"] .nav-link-item i,
html[data-theme="light"] .nav-link-item .material-icons {
  color: var(--c-navy-650);
}

html[data-theme="light"] .nav-link-item:hover,
html[data-theme="light"] .nav-link-item.has-dropdown:hover {
  color: var(--c-cyan-730);
  background: var(--c-slate-40);
}

html[data-theme="light"] .nav-link-item.active-nav,
html[data-theme="light"] .nav-link-item.active-nav a,
html[data-theme="light"] .nav-link-item.active-nav .material-icons {
  color: var(--c-cyan-730) !important;
}

html[data-theme="light"] .nav-dropdown-menu {
  border: 1px solid var(--c-slate-160);
  box-shadow: 0 10px 25px var(--c-blue-890-a120);
}

html[data-theme="light"] .dropdown-link {
  color: var(--c-navy-730);
}

html[data-theme="light"] .dropdown-link:hover,
html[data-theme="light"] .dropdown-link.active {
  background: var(--c-slate-40);
  color: var(--c-cyan-730);
}

/* Mobile Drawer in Light Mode */
html[data-theme="light"] .mobile-drawer {
  background: var(--c-white);
  box-shadow: 4px 0 25px var(--c-blue-890-a150);
}

html[data-theme="light"] .drawer-close-btn {
  color: var(--c-navy-650);
}

html[data-theme="light"] .drawer-menu-item {
  color: var(--c-navy-730);
}

html[data-theme="light"] .drawer-menu-item:hover,
html[data-theme="light"] .drawer-menu-item.active {
  background: var(--c-slate-40);
  color: var(--c-cyan-730);
  border-left-color: var(--c-cyan-730);
}

html[data-theme="light"] .drawer-tenant-pill {
  background: var(--c-slate-20);
}

/* Dashboard Cards, Panels & Controls in Light Mode */

html[data-theme="light"] .card,
html[data-theme="light"] .right-dashboard-panel,
html[data-theme="light"] .card.right-dashboard-panel,
html[data-theme="light"] .map-card {
  border: 1px solid var(--c-slate-90);
  box-shadow: 0 1px 4px var(--c-blue-890-a060), 0 1px 2px var(--c-blue-890-a040);
}

html[data-theme="light"] .panel-action-btn {
  background: var(--c-white);
  border: 1px solid var(--c-slate-160);
  color: var(--c-navy-730);
}

html[data-theme="light"] .panel-action-btn:hover {
  background: var(--c-slate-40);
  border-color: var(--c-cyan-730);
  color: var(--c-blue-890);
}

html[data-theme="light"] .panel-back-btn:disabled,
html[data-theme="light"] .panel-back-btn.disabled {
  background: var(--c-slate-20);
  border: 1px solid var(--c-slate-90);
  color: var(--c-slate-350);
}

html[data-theme="light"] .panel-back-btn:not(:disabled) {
  background: var(--c-cyan-730-a080);
  border: 1px solid var(--c-cyan-730);
  color: var(--c-cyan-730);
}

html[data-theme="light"] .panel-list-item {
  border-bottom: 1px solid var(--c-slate-40);
}

html[data-theme="light"] .panel-list-item:hover {
  background: var(--c-slate-20);
}

html[data-theme="light"] .item-progress-bar,
html[data-theme="light"] .multi-progress-bar {
  background: var(--c-slate-90);
}

html[data-theme="light"] .country-flag-badge {
  background: var(--c-white);
  border: 1px solid var(--c-slate-160);
  box-shadow: 0 1px 2px var(--c-blue-890-a080);
}

html[data-theme="light"] .legend-metric strong,
html[data-theme="light"] .legend-metric span {
  color: var(--c-blue-890);
}

html[data-theme="light"] .map-header-checkbox-label {
  color: var(--c-navy-730);
}

html[data-theme="light"] .map-custom-checkbox {
  background-color: var(--c-white);
  border: 1px solid var(--c-slate-350);
}

html[data-theme="light"] .toggle-pill-group {
  background: var(--c-slate-40);
}

html[data-theme="light"] .toggle-pill {
  color: var(--c-slate-530);
}

/* Aktiver Schalter (türkis hinterlegt): Text & Symbol weiß */
html[data-theme="light"] .toggle-pill.active,
html[data-theme="light"] .toggle-pill.active i {
  color: var(--c-white);
}

/* Gedämpfte Beschriftungen auf weißem Grund (vorher Hellgrau, schlecht lesbar) */
html[data-theme="light"] .cluster-radius-label,
html[data-theme="light"] .footer-status-total,
html[data-theme="light"] .legend-metric,
html[data-theme="light"] .pagination-size-wrap span,
html[data-theme="light"] .pagination-range-wrap span,
html[data-theme="light"] .pagination-range-wrap strong,
html[data-theme="light"] .pagination-controls span,
html[data-theme="light"] .cell-id-truncate,
html[data-theme="light"] .comm-inline-label,
html[data-theme="light"] .port-card-device,
html[data-theme="light"] .port-led-item span,
html[data-theme="light"] #commJobStatusText,
html[data-theme="light"] .comm-view-switcher button:not(.active) {
  color: var(--c-navy-650);
}

html[data-theme="light"] .toggle-pill:hover:not(.active) {
  color: var(--c-blue-890);
  background: var(--c-blue-890-a040);
}

html[data-theme="light"] .map-icon-btn {
  background: var(--c-white);
  border: 1px solid var(--c-slate-160);
  color: var(--c-navy-730);
}

html[data-theme="light"] .mapboxgl-popup-content,
html[data-theme="light"] .demas-site-popup .mapboxgl-popup-content {
  background: var(--c-white) !important;
  color: var(--c-blue-890) !important;
  border: 1px solid var(--c-slate-160) !important;
  box-shadow: 0 10px 25px var(--c-blue-890-a150) !important;
}

html[data-theme="light"] .mapboxgl-popup-close-button,
html[data-theme="light"] .demas-site-popup .mapboxgl-popup-close-button {
  color: var(--c-slate-530) !important;
}

html[data-theme="light"] .site-popup-darkbox {
  background: var(--c-slate-20);
  border: 1px solid var(--c-slate-90);
}

html[data-theme="light"] .custom-scrollbar::-webkit-scrollbar-thumb {
  background: var(--c-slate-160);
}

/* ==========================================================================
   HELL-MODUS: Akzentfarben mit ausreichendem Kontrast auf hellem Grund
   Die Akzentfarben werden nur im Hell-Modus abgedunkelt (Text, Badges,
   Status-Pills, Buttons). Der Dunkel-Modus behält die Originalfarben.
   Die Karte und ihre Bedienelemente bleiben bewusst dunkel.
   ========================================================================== */
html[data-theme="light"] {
  --c-cyan-510: var(--c-cyan-700);   /* Türkis-Text, Links, Badges */
  --c-cyan-390: var(--c-cyan-700);
  --c-cyan-570: var(--c-cyan-700);   /* Status "Unbekannt" */
  --c-orange-500: var(--c-orange-650); /* Warnung */
  --c-orange-470: var(--c-orange-600); /* DEMO-Banner */
  --c-teal-610: var(--c-teal-760);   /* OK / Erfolg */
  --c-red-400: var(--c-red-560);     /* Fehler */
  --c-green-640: var(--c-green-720); /* Grüne Badges */
  --c-blue-610: var(--c-blue-680);   /* Blaue Badges (z. B. Plugin "RTU") */
}

/* Nicht aktive Umschalter/Reiter etwas dunkler (vorher knapp unter 4,5:1) */
html[data-theme="light"] .toggle-pill:not(.active),
html[data-theme="light"] .tree-mode-pill:not(.active),
html[data-theme="light"] .tab-btn:not(.active) {
  color: var(--c-navy-650);
}

/* Bewusst dunkle Bereiche (Terminal-Log, Karten-Legende, Karten-Bedienelemente)
   behalten im Hell-Modus die hellen Original-Akzentfarben */
html[data-theme="light"] .comm-terminal-box,
html[data-theme="light"] .map-legend-overlay,
html[data-theme="light"] .mapboxgl-ctrl-group,
html[data-theme="light"] .new-loc-map-mode-toggle {
  --c-cyan-510: #29b6d1;
  --c-cyan-390: #5fc4d8;
  --c-cyan-570: #06b6d4;
  --c-orange-500: #f59e0b;
  --c-teal-610: #10b981;
  --c-red-400: #ef4444;
  --c-green-640: #16a34a;
}

/* Aktiver Umschalter im Baum (türkis hinterlegt): Text weiß */
html[data-theme="light"] .tree-mode-pill.active {
  color: var(--c-white);
}

/* Auswahlfelder Commissioning (Instanz / Gerätetyp) */
html[data-theme="light"] .comm-select-input {
  background: var(--c-white);
  border-color: var(--c-slate-160);
  color: var(--c-blue-890);
}

/* ==========================================================================
   BARRIEREFREIHEIT: sichtbarer Fokus nur bei Tastaturbedienung
   ========================================================================== */
[aria-modal="true"]:focus {
  outline: none;
}

button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible,
input[type="checkbox"]:focus-visible,
select:focus-visible {
  outline: 2px solid var(--c-cyan-510) !important;
  outline-offset: 2px;
}
