/* ============================================================
   FöbA CRM – Design-System (2026, Clean & Minimal)
   Bestehende Farben werden schrittweise auf die Tokens unten umgestellt.
   ============================================================ */

:root {
  /* Brand (sparsam einsetzen) */
  --foeba-green:        #94c122;
  --foeba-green-dark:   #7ba31a;
  --foeba-green-soft:   #eef5dc;

  /* Neutrale Grau-Skala (Linear/Notion-Style) */
  --bg:                 #fafafa;
  --bg-card:            #ffffff;
  --bg-subtle:          #f5f6f8;
  --border:             #e6e8eb;
  --border-strong:      #d4d8dd;
  --text:               #1f2328;
  --text-muted:         #5e6772;
  --text-subtle:        #8b929a;

  /* Akzente (nur fuer States, nicht fuer Deko) */
  --danger:             #cf222e;
  --danger-bg:          #fdecea;
  --danger-soft:        #f6d7d4;
  --warning:            #b58105;
  --warning-bg:         #fff8e1;
  --info:               #0969da;
  --info-bg:            #ddf4ff;

  /* Spacing-Skala (4px-Raster) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  /* Schatten (nur ganz dezent) */
  --shadow-sm: 0 1px 2px rgba(15, 18, 21, .04);
  --shadow-md: 0 2px 6px rgba(15, 18, 21, .06);
}

/* Dark-Mode: alle Tokens werden ueberschrieben, sodass jede Stelle die
   var(--xyz) verwendet automatisch mitkommt. */
body.dark-mode {
  --bg:                 #121212;
  --bg-card:            #1e1e1e;
  --bg-subtle:          #262626;
  --border:             #333333;
  --border-strong:      #4a4a4a;
  --text:               #ececec;
  --text-muted:         #b0b0b0;
  --text-subtle:        #808080;
  --foeba-green-soft:   #2a3818;
  --danger-bg:          #3a1c1c;
  --danger-soft:        #5a2a2a;
  --warning-bg:         #2a2210;
  --info-bg:            #142433;
}

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

body {
  font-family: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ---- Navbar ---- */
.navbar {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  padding: .75rem 2rem;
  gap: 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--border);
}
.nav-logo { display: flex; align-items: center; text-decoration: none; }
.nav-logo img { display: block; }
.nav-panel { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 2rem; min-width: 0; }
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); border-bottom-color: var(--foeba-green); }
.nav-badge { display:inline-flex; align-items:center; justify-content:center; min-width:17px; height:17px; background:var(--danger); color:#fff; border-radius:9px; font-size:.68rem; font-weight:700; padding:0 4px; margin-left:4px; vertical-align:middle; line-height:1; }
.nav-user { font-size: .85rem; color: var(--text-muted); white-space: nowrap; display: flex; align-items: center; gap: .75rem; }
.nav-user-name { color: var(--text-muted); }
.nav-user a { color: var(--text); text-decoration: none; font-weight: 500; position: relative; }
.nav-user a:hover { color: var(--foeba-green-dark); }
.nav-user a + a::before { content: "|"; color: var(--border); margin-right: .75rem; font-weight: 400; }

/* ---- Burger-Toggle (nur Mobile sichtbar) ---- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 22px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
  z-index: 310;
}
.nav-toggle span {
  display: block;
  height: 3px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.navbar.nav-open .nav-toggle span:nth-child(1) { transform: translateY(9.5px) rotate(45deg); }
.navbar.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.navbar.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-9.5px) rotate(-45deg); }
.nav-backdrop { display: none; }

/* ---- Nav Dropdown ---- */
.nav-dropdown { position: relative; }
.nav-dropdown-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  font-family: inherit;
}
.nav-dropdown-btn:hover,
.nav-dropdown:hover .nav-dropdown-btn { color: #1d6ae5; border-bottom-color: #1d6ae5; }
.nav-dropdown-btn.active { color: #1d6ae5; border-bottom-color: #94c122; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  min-width: 180px;
  z-index: 200;
  overflow: hidden;
  border: 1px solid #e8e8e8;
}
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
  display: block;
  padding: .65rem 1rem;
  color: #5e5e5e;
  text-decoration: none;
  font-size: .88rem;
  font-weight: 600;
  border-bottom: 1px solid #f0f0f0;
  transition: background .1s, color .1s;
}
.nav-dropdown-menu a:last-child { border-bottom: none; }
.nav-dropdown-menu a:hover { background: #f4f6f5; color: #1d6ae5; }

/* ---- Container ---- */
.container { max-width: 1400px; margin: 2rem auto; padding: 0 1.5rem; }

/* ---- Headings ---- */
h2 { color: var(--text); font-weight: 600; margin-bottom: .75rem; font-size: 1.4rem; letter-spacing: -.01em; }
h3 { color: var(--text); font-weight: 600; margin-bottom: .6rem; letter-spacing: -.005em; }

/* ---- Alerts ---- */
.alert { padding: .75rem 1rem; border-radius: var(--radius-md); margin-bottom: 1rem; font-size: .9rem; border: 1px solid; }
.alert-success { background: var(--foeba-green-soft); color: var(--foeba-green-dark); border-color: var(--foeba-green); }
.alert-error   { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-soft); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning); }
.alert-info    { background: var(--info-bg); color: var(--info); border-color: var(--info); }

/* ---- KPI Grid ---- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-3); margin: var(--space-4) 0; }
.kpi-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-4);
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.kpi-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
/* Einheitliche FoeBA-Gruene Zierlinie fuer alle KPI-Karten (Chris-Wunsch:
   weniger Farben). Status-Differenzierung passiert ueber Wert/Label, nicht ueber
   knallige Border-Farben. */
.kpi-card.kpi-warn,
.kpi-card.kpi-ok,
.kpi-card.kpi-info,
.kpi-card.kpi-muted { border-top: 3px solid var(--foeba-green); }
.kpi-value { font-size: 1.8rem; font-weight: 600; color: var(--text); }
.kpi-label { font-size: .82rem; color: var(--text-muted); margin-top: .25rem; }

/* ---- Sections ---- */
.section { margin: 2rem 0; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }

/* ---- Progress bar ---- */
.progress-bar-wrap { background: #e0e0e0; border-radius: 999px; height: 18px; overflow: hidden; }
.progress-bar { background: linear-gradient(90deg, #1d6ae5, #94c122); height: 100%; transition: width .4s; }
.progress-label { margin-top: .4rem; font-size: .85rem; color: #888; }

/* ---- Table ---- */
.table-wrap { overflow-x: auto; margin-bottom: 1rem; }
.table { width: 100%; border-collapse: collapse; background: var(--bg-card); border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border); }
.table th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  padding: .65rem .9rem;
  text-align: left;
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.table td { padding: .65rem .9rem; border-bottom: 1px solid var(--border); font-size: .88rem; color: var(--text); white-space: nowrap; }
.table tr:last-child td { border-bottom: none; }
.table tr.status-storniert td { color: var(--text-subtle); }
.table tr:hover td { background: var(--bg-subtle); }
.empty { text-align: center; color: var(--text-subtle); padding: 2rem !important; }

/* ---- Badges ---- */
.badge { display: inline-block; padding: .2rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 500; }
.badge-sib { background: var(--info-bg); color: var(--info); }
.badge-bkm { background: var(--foeba-green-soft); color: var(--foeba-green-dark); }

.status-badge { display: inline-block; padding: .2rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 500; }
.status-aktiv       { background: var(--foeba-green-soft); color: var(--foeba-green-dark); }
.status-storniert   { background: var(--danger-bg); color: var(--danger); }
.status-eingereicht { background: var(--warning-bg); color: var(--warning); }
.status-wartend     { background: var(--warning-bg); color: var(--warning); }
.status-gesendet    { background: var(--info-bg); color: var(--info); }
.status-hochgeladen { background: var(--foeba-green-soft); color: var(--foeba-green-dark); }

/* ---- Forms ---- */
.form-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.form-row  { display: flex; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-4); }
.form-group { display: flex; flex-direction: column; flex: 1; min-width: 180px; }
.form-group label { font-size: .82rem; font-weight: 500; color: var(--text-muted); margin-bottom: .3rem; }
.form-group input,
.form-group select,
.form-group textarea {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: .55rem .85rem;
  font-size: .9rem;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  background: var(--bg-card);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--foeba-green);
  box-shadow: 0 0 0 3px rgba(148,193,34,.18);
}
.form-actions { display: flex; gap: .75rem; margin-top: 1.25rem; }
.filter-form { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: center; }
.filter-form select,
.filter-form input {
  padding: .45rem .75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-card);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: .55rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
  font-family: inherit;
  line-height: 1.2;
}
.btn-primary   { background: var(--foeba-green); color: #fff; border-color: var(--foeba-green); }
.btn-primary:hover { background: var(--foeba-green-dark); border-color: var(--foeba-green-dark); color: #fff; }
.btn-secondary { background: var(--bg-card); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--bg-subtle); border-color: var(--text-subtle); }
.btn-warn      { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-warn:hover { background: #a31924; border-color: #a31924; }
.btn-antrag    { background: var(--foeba-green); color: #fff; border-color: var(--foeba-green); }
.btn-antrag:hover { background: var(--foeba-green-dark); border-color: var(--foeba-green-dark); }
.btn-besucht   { background: var(--foeba-green-dark); color: #fff; border-color: var(--foeba-green-dark); }
.btn-besucht:hover { background: #648618; border-color: #648618; color: #fff; }
.btn-full { width: 100%; text-align: center; padding: .7rem; }
.btn-sm   { padding: .35rem .8rem; font-size: .82rem; }

/* ---- Tabs ---- */
.tab-bar { display: flex; gap: .5rem; margin-bottom: 1.25rem; }
.tab-btn {
  padding: .5rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-muted);
  font-family: inherit;
  transition: background .15s, color .15s, border-color .15s;
}
.tab-btn.active { background: var(--foeba-green); color: #fff; border-color: var(--foeba-green); }
.tab-btn:hover:not(.active) { background: var(--bg-subtle); color: var(--text); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- Admin nav ---- */
.admin-nav { display: flex; gap: 1rem; margin-top: 1.5rem; flex-wrap: wrap; }

/* ---- Support-Banner ---- */
.support-banner {
  background: #c0392b;
  color: #fff;
  text-align: center;
  padding: .55rem 1rem;
  font-size: .88rem;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 2000;
}

/* ---- Login ---- */
.login-box {
  max-width: 400px;
  margin: 5rem auto;
  background: #fff;
  border-radius: 14px;
  padding: 2.5rem 2rem;
  box-shadow: 0 6px 30px rgba(0,0,0,.1);
  border-top: 4px solid #1d6ae5;
}
.login-box h1 { text-align: center; margin-bottom: .25rem; color: #1d6ae5; font-size: 1.6rem; }
.login-sub { text-align: center; color: #94c122; font-size: .9rem; font-weight: 600; margin-bottom: 1.5rem; }
.login-box .form-group { margin-bottom: 1rem; }

/* ---- SIB Antrag Sections ---- */
.sib-section { margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid #e8eded; }
.sib-section:last-of-type { border-bottom: none; }
.sib-section h3 { margin-bottom: .75rem; }

/* ---- Arbeitgeber Dropdown ---- */
.ag-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #d0d8d8;
  border-radius: 0 0 8px 8px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.ag-item {
  padding: .6rem .85rem;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  font-size: .88rem;
}
.ag-item:hover { background: #f7fdf7; }
.ag-item.ag-warn { border-left: 3px solid #d6a726; }
.ag-item.ag-empty { color: #bbb; cursor: default; }
.ag-hint { color: #d6a726; font-size: .8rem; }
.ag-item small { color: #999; }

/* ---- Filialplanung ---- */
.filial-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.filial-page-header h2 { margin: 0; }
.filial-page-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.filial-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1rem;
  margin-top: .5rem;
}
@media (max-width: 900px) {
  .filial-layout { grid-template-columns: 1fr; }
  #map, #routeMap { height: 420px; }
  .filial-list { max-height: 360px; }
}
@media (max-width: 600px) {
  .filial-page-header { flex-direction: column; align-items: stretch; }
  .filial-page-actions { width: 100%; }
  .filial-page-actions .btn { flex: 1; text-align: center; }
}
#map, #routeMap {
  width: 100%;
  height: 520px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}
.filial-map-wrap { min-width: 0; position: relative; }
.filial-map-wrap.karte-vollbild { position: fixed !important; top: 0; left: 0; right: 0; bottom: 0; width: 100% !important; height: 100vh !important; z-index: 9000; border-radius: 0 !important; }
.filial-list-wrap {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.filial-filter-bar {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  align-items: center;
}
.filter-btn {
  padding: .3rem .8rem;
  border: 1px solid #1d6ae5;
  background: #fff;
  color: #1d6ae5;
  border-radius: 20px;
  cursor: pointer;
  font-size: .83rem;
}
.filter-btn.active {
  background: #1d6ae5;
  color: #fff;
}
.filial-search {
  border: 1px solid #ccc;
  border-radius: 20px;
  padding: .3rem .8rem;
  font-size: .83rem;
  margin-left: auto;
  width: 140px;
}
.filial-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  max-height: 470px;
  overflow-y: auto;
}
.filial-item {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: .7rem .9rem;
  cursor: default;
  transition: box-shadow .15s;
}
.filial-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.filial-item-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .25rem;
}
.filial-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.filial-dot-frei { background: #1d6ae5; }
.filial-dot-gesperrt { background: #94c122; }
.filial-dot-user-gesperrt { background: #9a9a9a; }
.filial-dot-gemeldet { background: #d97706; }
.filial-dot-geschlossen { background: #c03030; }
.filial-item-user-gesperrt { opacity: .7; background: #f5f5f5; }
.filial-item-geschlossen { opacity: .55; background: #fbeeee; }
.filial-schliess-badge {
  display: inline-block;
  font-size: .72rem;
  padding: .08rem .5rem;
  border-radius: 10px;
  font-weight: 500;
}
.filial-schliess-badge.warten { background: #fff1e0; color: #a0552a; }
.filial-schliess-badge.zu { background: #f5d9d9; color: #8a1f1f; }

.aktionen-overlay {
  position: fixed;
  inset: 0;
  z-index: 9700;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.aktionen-sheet {
  width: 100%;
  max-width: 560px;
  background: #fff;
  border-radius: 14px 14px 0 0;
  padding-bottom: calc(.5rem + env(safe-area-inset-bottom, 0px));
  max-height: 75vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 -6px 24px rgba(0,0,0,.2);
  animation: aktionenSlideUp .18s ease-out;
}
.aktionen-sheet-handle {
  width: 36px;
  height: 4px;
  background: #ddd;
  border-radius: 2px;
  margin: 10px auto 6px;
}
.aktionen-sheet button {
  display: block;
  width: 100%;
  padding: .9rem 1.1rem;
  background: none;
  border: none;
  border-bottom: 1px solid #f2f2f2;
  text-align: left;
  font-size: 1rem;
  cursor: pointer;
  color: #222;
}
.aktionen-sheet button:last-child { border-bottom: none; }
.aktionen-sheet button:active { background: #f0f7f8; }
.aktionen-sheet button.danger { color: #c03030; }
.aktionen-sheet button.danger:active { background: #fbeeee; }
.aktionen-sheet-divider {
  height: 6px;
  background: #f5f5f5;
}
@keyframes aktionenSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.filial-more-btn {
  padding: .25rem .55rem;
  background: #fff;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  cursor: pointer;
  font-size: .95rem;
  line-height: 1;
  color: #555;
}
.filial-more-btn:hover { background: #f0f0f0; }

.filial-besuch-edit {
  background: none;
  border: none;
  color: #1d6ae5;
  cursor: pointer;
  font-size: .72rem;
  padding: 0;
  margin-left: .3rem;
  text-decoration: underline;
}

/* Einstellungen */
.einstell-box {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.2rem 1.4rem;
}
.einstell-box h3 {
  margin: 0 0 .4rem 0;
  color: #1d6ae5;
  font-size: 1.05rem;
}
.einstell-hinweis {
  font-size: .85rem;
  color: #666;
  margin: 0 0 1rem 0;
}
.einstell-status {
  font-size: .8rem;
  color: #666;
  margin-top: .4rem;
  min-height: 1.1em;
}
.einstell-status-ok { color: #1d6ae5; }
.einstell-status-warn { color: #b06500; }
.woche-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .6rem;
}
.woche-tag {
  padding: .5rem .6rem;
  border: 1px solid #e8e8e8;
  border-radius: 5px;
}
.woche-tag-label {
  display: block;
  font-weight: 600;
  font-size: .85rem;
  color: #444;
  margin-bottom: .25rem;
}
.woche-tag input[type="time"] {
  padding: .3rem .5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: .88rem;
}

/* Kalender */
.kalender-kopf {
  display: grid;
  grid-template-columns: repeat(7, 1fr) 90px;
  gap: .25rem;
  margin-bottom: .25rem;
  font-size: .78rem;
  font-weight: 600;
  color: #666;
  text-align: center;
}
.kalender-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr) 90px;
  gap: .25rem;
}
.kalender-tag {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  padding: .3rem .35rem;
  cursor: pointer;
  min-height: 60px;
  transition: all .12s;
  text-align: center;
}
.kalender-tag:hover { background: #f0f7f8; border-color: #1d6ae5; }
.kalender-tag-fremd { background: #fafafa; color: #bbb; }
.kalender-tag-fremd:hover { background: #f0f7f8; color: #333; }
.kalender-tag-heute {
  border-color: #1d6ae5;
  border-width: 2px;
  font-weight: 600;
}
.kalender-tag-gesetzt { background: #e8f2f3; }
.kalender-tag-gesetzt:hover { background: #d0e6e8; }
.kalender-tag-zahl {
  font-size: .92rem;
  font-weight: 600;
}
.kalender-tag-zeit {
  font-size: .68rem;
  color: #1d6ae5;
  margin-top: .15rem;
  line-height: 1.1;
}
.kalender-kopier-btn {
  font-size: .68rem;
  line-height: 1.1;
  padding: .3rem .2rem;
  background: #fff;
  border: 1px dashed #bbb;
  border-radius: 5px;
  cursor: pointer;
  color: #666;
}
.kalender-kopier-btn:hover { background: #f0f7f8; border-color: #1d6ae5; color: #1d6ae5; }

@media (max-width: 700px) {
  .kalender-kopf, .kalender-grid {
    grid-template-columns: repeat(7, 1fr) 60px;
    gap: .15rem;
  }
  .kalender-tag { min-height: 48px; padding: .2rem; }
  .kalender-tag-zahl { font-size: .8rem; }
  .kalender-tag-zeit { font-size: .6rem; }
  .kalender-kopier-btn { font-size: .58rem; padding: .2rem .1rem; }
}

/* Tour-Planung */
.tour-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1rem;
  align-items: stretch;
}
@media (max-width: 900px) {
  .tour-layout { grid-template-columns: 1fr; }
}
.tour-panel {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1rem 1.2rem;
  max-height: 80vh;
  overflow-y: auto;
}
.tour-panel h3 {
  margin: 0 0 .8rem 0;
  color: #1d6ae5;
  font-size: 1rem;
}
.tour-start-opts {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .6rem;
}
.tour-start-opt {
  padding: .4rem .7rem;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 5px;
  cursor: pointer;
  font-size: .85rem;
}
.tour-start-opt.active {
  background: #1d6ae5;
  color: #fff;
  border-color: #1d6ae5;
}
.tour-stop-liste {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.tour-stop {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  position: relative;
  transition: border-color .15s, box-shadow .15s;
}
.tour-stop:hover {
  border-color: var(--border-strong);
}
.tour-stop-nummer {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: var(--bg-subtle);
  color: var(--text);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .82rem;
  font-weight: 600;
  border: 1px solid var(--border);
}
.tour-stop-name { font-weight: 600; font-size: .94rem; padding-right: 2rem; color: var(--text); }
.tour-stop-adr { font-size: .82rem; color: var(--text-muted); margin-top: 2px; }
.tour-stop-zeit {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: var(--space-2);
  font-weight: 500;
}
.tour-stop-besucht {
  opacity: .55;
}
.tour-stop-besucht .tour-stop-nummer {
  background: var(--foeba-green-soft);
  color: var(--foeba-green-dark);
  border-color: transparent;
}
.tour-map {
  min-height: 500px;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
}
.tour-info {
  background: var(--bg-subtle);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}
.filial-item-info-user {
  font-size: .78rem;
  color: #666;
  margin-bottom: .3rem;
  font-style: italic;
}
.sperr-dauer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  margin-top: .3rem;
}
.btn-dauer {
  padding: .55rem .8rem;
  border: 1px solid #d0d0d0;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: .92rem;
  transition: all .15s;
}
.btn-dauer:hover { border-color: #1d6ae5; }
.btn-dauer.active {
  background: #1d6ae5;
  color: #fff;
  border-color: #1d6ae5;
}

.filial-historie {
  margin-top: .4rem;
  padding-top: .4rem;
  border-top: 1px dashed #e0e0e0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.filial-besuch {
  font-size: .82rem;
}
.filial-besuch-head {
  color: #555;
  font-weight: 500;
}
.filial-besuch-kommentar {
  color: #333;
  margin-top: .15rem;
  padding-left: .6rem;
  border-left: 3px solid #1d6ae5;
  white-space: pre-wrap;
}
.filial-besuch-kennzahlen {
  color: #888;
  font-size: .75rem;
  margin-top: .15rem;
}
.filial-historie-toggle {
  background: none;
  border: none;
  color: #1d6ae5;
  font-size: .82rem;
  cursor: pointer;
  padding: .2rem 0;
  text-align: left;
  font-weight: 500;
}
.filial-historie-toggle:hover { text-decoration: underline; }

.poi-kandidat {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: .6rem .8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}
.poi-kandidat-info {
  flex: 1;
  min-width: 0;
}
.poi-kandidat > .btn {
  flex-shrink: 0;
}
@media (max-width: 460px) {
  .poi-kandidat { flex-direction: column; align-items: stretch; }
  .poi-kandidat > .btn { width: 100%; }
}
.poi-kandidat-name {
  font-weight: 600;
  font-size: .92rem;
}
.poi-kandidat-sub {
  font-size: .8rem;
  color: #666;
}
.poi-kandidat-distanz {
  display: inline-block;
  background: #1d6ae5;
  color: #fff;
  font-size: .7rem;
  padding: .08rem .45rem;
  border-radius: 8px;
  margin-left: .4rem;
}
.poi-kandidat-leer {
  color: #888;
  font-size: .85rem;
  padding: .5rem 0;
  text-align: center;
}

/* Lohnstellen-Autocomplete */
.ag-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #d0d0d0;
  border-top: none;
  border-radius: 0 0 6px 6px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 20;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .08);
}
.ag-item {
  padding: .5rem .7rem;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  font-size: .88rem;
}
.ag-item:hover { background: #f0f7f8; }
.ag-item.ag-warn { background: #fff4e5; }
.ag-item.ag-warn:hover { background: #ffe8cc; }
.ag-item.ag-empty { color: #999; cursor: default; text-align: center; }
.ag-hint { color: #b06500; font-size: .8rem; font-weight: 500; }

.filial-lohnstelle-badge {
  display: inline-block;
  background: #e8f2f3;
  color: #1d6ae5;
  font-size: .72rem;
  padding: .08rem .5rem;
  border-radius: 10px;
  margin-top: .2rem;
  font-weight: 500;
}
.filial-lohnstelle-badge.warn {
  background: #fff4e5;
  color: #b06500;
}
.filial-kat-badge {
  font-size: .72rem;
  background: #f0f0f0;
  color: #666;
  padding: .1rem .4rem;
  border-radius: 10px;
}
.filial-item-sub {
  font-size: .85rem;
  color: #555;
  margin-bottom: .35rem;
}
.filial-item-info {
  font-size: .78rem;
  color: #94c122;
  margin-bottom: .3rem;
}
.filial-item-actions { display: flex; gap: .4rem; margin-top: .3rem; }
.btn-sm { padding: .25rem .65rem; font-size: .8rem; }
.stop-nummer {
  background: #1d6ae5;
  color: #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 700;
  flex-shrink: 0;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 21, .55);
  z-index: 9500;
  align-items: center;
  justify-content: center;
}
.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  max-width: 480px;
  width: 94%;
  border: 1px solid var(--border);
  box-shadow: 0 16px 40px rgba(15,18,21,.18);
  color: var(--text);
}
.kpi-muted { border-left: 4px solid #aaa; }
.kpi-muted .kpi-value { color: #aaa; }

/* ============================================================
   MOBILE (≤ 900px) — Navbar als Slide-Panel + Filialplanung
   ============================================================ */
@media (max-width: 900px) {
  /* Navbar-Wrapper schlanker */
  .navbar { padding: .5rem 1rem; gap: .5rem; }
  .nav-logo img { height: 30px; }

  /* Burger-Button zeigen */
  .nav-toggle { display: flex; }

  /* Panel: Slide-In von rechts */
  .nav-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: min(320px, 85vw);
    height: 100vh;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 4.5rem 1.25rem 1.5rem;
    transform: translateX(100%);
    transition: transform .3s ease;
    z-index: 300;
    box-shadow: -4px 0 20px rgba(0,0,0,.15);
    overflow-y: auto;
    gap: .75rem;
  }
  .navbar.nav-open .nav-panel { transform: translateX(0); }

  /* Backdrop hinter Panel */
  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
    z-index: 250;
  }
  .navbar.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
  body.nav-menu-open { overflow: hidden; }

  /* Nav-Links als Stack */
  .nav-links {
    flex-direction: column;
    gap: 0;
    width: 100%;
    align-items: stretch;
  }
  .nav-links > a,
  .nav-dropdown-btn {
    padding: .9rem .25rem;
    border-bottom: 1px solid #f0f0f0;
    width: 100%;
    text-align: left;
    font-size: 1rem;
    line-height: 1.4;
  }
  .nav-dropdown { width: 100%; border-bottom: 1px solid #f0f0f0; }
  .nav-dropdown-btn { border-bottom: none; }
  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    border-radius: 0;
    min-width: auto;
    background: #f7fafa;
    display: none;
  }
  .nav-dropdown:hover .nav-dropdown-menu { display: none; }
  .nav-dropdown.nav-dropdown-open .nav-dropdown-menu { display: block; }
  .nav-dropdown-menu a { padding: .75rem 1.25rem; font-size: .95rem; }

  /* User-Block direkt nach den Nav-Links */
  .nav-user {
    flex-direction: column;
    align-items: stretch;
    gap: .4rem;
    padding-top: 1rem;
    border-top: 2px solid #94c122;
    margin-top: 1.5rem;
    white-space: normal;
  }
  .nav-user-name { font-weight: 700; font-size: 1rem; color: #1d6ae5; }
  .nav-user a { padding: .6rem 0; font-size: .95rem; }
  .nav-user a + a::before { content: none; margin: 0; }

  /* Container etwas luftiger */
  .container { margin: 1rem auto; padding: 0 .9rem; }

  /* Headings kompakter */
  h2 { font-size: 1.25rem; }
}

/* ============================================================
   MOBILE (≤ 600px) — Filialplanung-Feinschliff
   ============================================================ */
@media (max-width: 600px) {
  /* Karten-Höhe fluid, ~45% vom Viewport */
  #map, #routeMap { height: 45vh; min-height: 280px; max-height: 420px; }

  /* Layout stapelt schon (via filial-layout unter 900px) — hier List-Scroll aufheben */
  .filial-list { max-height: none; overflow-y: visible; }

  /* Filter-Bar: Buttons in eigener Zeile, Suche full-width drunter */
  .filial-filter-bar { gap: .35rem; }
  .filter-btn { padding: .5rem .9rem; font-size: .85rem; flex: 0 0 auto; }
  .filial-search { width: 100%; margin-left: 0; padding: .6rem .9rem; font-size: .95rem; order: 99; }

  /* Filial-Items: mehr Touch-Raum */
  .filial-item { padding: .9rem 1rem; }
  .filial-item-header { flex-wrap: wrap; gap: .4rem; }
  .filial-item-header strong { font-size: .98rem; }
  .filial-item-sub { font-size: .88rem; }
  .filial-kat-badge { font-size: .7rem; }

  /* Buttons min. 44px Touch-Höhe */
  .filial-item-actions { gap: .5rem; margin-top: .6rem; }
  .filial-item-actions .btn-sm {
    min-height: 40px;
    padding: .5rem 1rem;
    font-size: .88rem;
    flex: 1;
  }

  /* KPI-Cards kompakter auf Mobile */
  .kpi-grid { gap: .6rem; margin: .75rem 0; }
  .kpi-card { padding: .9rem .75rem; }
  .kpi-value { font-size: 1.4rem; }
  .kpi-label { font-size: .78rem; }

  /* Seiten-Header über Karte: Aktionen stapeln */
  .filial-layout ~ * > button,
  .filial-layout { margin-top: .5rem; }

  /* Modal: mehr Platz, weniger Rand */
  .modal-box {
    padding: 1.25rem 1rem;
    width: 96%;
    max-height: 90vh;
    overflow-y: auto;
  }
  .modal-box .form-row { gap: .5rem; }
  .modal-box .btn { width: 100%; padding: .75rem; }
  .modal-box > div[style*="display:flex"]:last-child {
    flex-direction: column;
    gap: .5rem !important;
  }

  /* Form-Inputs größer für Touch */
  .form-group input,
  .form-group select,
  .form-group textarea { padding: .7rem .85rem; font-size: 1rem; }

  /* Allgemeine Buttons: min. 44px auf Touch */
  .btn { padding: .7rem 1.2rem; font-size: .95rem; }
  .btn-sm { padding: .5rem .9rem; font-size: .85rem; }
}

/* ============================================================
   MOBILE (≤ 680px) — App-weiter Feinschliff
   (Forms, Tabellen, Grids, Seitenheader, Admin)
   ============================================================ */
@media (max-width: 680px) {
  /* Seiten-Header: Titel + Aktionen stapeln */
  h2 { font-size: 1.2rem; line-height: 1.3; }
  h3 { font-size: 1.05rem; }

  /* Container-Padding enger */
  .container { padding: 0 .8rem; }

  /* Form-Cards weniger Polster, nicht mehr so luftig */
  .form-card { padding: 1rem .9rem; margin-bottom: 1rem; }

  /* Form-Rows stapeln vertikal — das zieht sich durch fast alle Forms */
  .form-row { flex-direction: column; gap: .6rem; margin-bottom: .8rem; }
  .form-group { min-width: 0; width: 100%; }

  /* form-actions: Buttons full-width untereinander */
  .form-actions { display: flex; flex-direction: column; gap: .5rem; }
  .form-actions .btn { width: 100%; justify-content: center; }

  /* Filter-Form (Auswertung, Kopfzeilen) */
  .filter-form { flex-wrap: wrap; gap: .4rem !important; }
  .filter-form input,
  .filter-form select,
  .filter-form button,
  .filter-form a { width: 100% !important; max-width: none !important; min-height: 40px; }

  /* Tabellen: horizontaler Scroll, wenn kein Wrap drum ist.
     .table-wrap uebernimmt das bereits, hier Fallback fuer direkt platzierte .table */
  .table { font-size: .82rem; min-width: 480px; }
  .table th, .table td { padding: .5rem .6rem; }
  .table-wrap { -webkit-overflow-scrolling: touch; border-radius: 10px; }

  /* Inline-Styles in Templates, die 1fr 1fr Grids bauen, stacken wir via Override.
     Diese Selector-Gruppe ist spezifisch genug, greift aber nur fuer 2-Spalten-Grids. */
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1fr 1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  /* Sektion-Header stapeln */
  .section-header { flex-direction: column; align-items: stretch; gap: .5rem; }

  /* Admin-Overview Cards */
  .admin-overview-grid { grid-template-columns: 1fr !important; }

  /* Login/Profil Forms kompakter */
  .login-box { padding: 1.5rem 1.2rem; }

  /* Alert-Boxen schlanker */
  .alert { padding: .7rem .9rem; font-size: .88rem; }

  /* Flex-Kopfzeilen in den Seiten (h2 + Buttons rechts) stapeln */
  .page-head { flex-direction: column; align-items: stretch; gap: .6rem; }
  .page-head .btn { width: 100%; text-align: center; }

  /* Modal-Box schon bei 600px geregelt – hier nur Overflow-Safety */
  .modal-overlay { padding: .5rem; }

  /* Inline-Buttons in Tabellen-Zellen kleiner lassen, aber tappable */
  .table .btn, .table .btn-sm { min-height: 36px; }

  /* Textarea auf Mobile etwas hoeher */
  textarea { min-height: 80px; }
}

/* ============================================================
   Ganz schmale Geraete (iPhone SE 320px)
   ============================================================ */
@media (max-width: 360px) {
  body { font-size: 14px; }
  h2 { font-size: 1.1rem; }
  .kpi-value { font-size: 1.3rem; }
  .kpi-label { font-size: .72rem; }
  .btn { padding: .6rem 1rem; font-size: .9rem; }
  .container { padding: 0 .6rem; }
}


/* ============================================================
   Tutorial-Video-Bar
   ============================================================ */
.tutorial-video-bar {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e8edf5;
  text-align: center;
}
.tutorial-video-link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .84rem;
  color: #888;
  text-decoration: none;
  transition: color .15s;
}
.tutorial-video-link:hover {
  color: #1d6ae5;
}

/* ---- Dark Mode Toggle Button ---- */
.dark-mode-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  padding: .2rem .3rem;
  display: flex;
  align-items: center;
  transition: color .15s;
}
.dark-mode-toggle:hover { color: #1d6ae5; }
.dm-icon-sun { display: none; }
body.dark-mode .dm-icon-moon { display: none; }
body.dark-mode .dm-icon-sun  { display: block; }

/* ---- Dark Mode ---- */
body.dark-mode {
  background: #121212;
  color: #d0d0d0;
}
body.dark-mode .navbar {
  background: #1e1e1e;
  box-shadow: 0 2px 10px rgba(0,0,0,.5);
  border-bottom-color: #94c122;
}
body.dark-mode .nav-links a { color: #bbb; }
body.dark-mode .nav-links a:hover { color: #6ba3f0; border-bottom-color: #6ba3f0; }
body.dark-mode .nav-links a.active { color: #6ba3f0; border-bottom-color: #94c122; }
body.dark-mode .nav-dropdown-btn { color: #bbb; }
body.dark-mode .nav-dropdown-btn:hover,
body.dark-mode .nav-dropdown:hover .nav-dropdown-btn { color: #6ba3f0; }
body.dark-mode .nav-dropdown-menu { background: #2a2a2a; border-color: #444; }
body.dark-mode .nav-dropdown-menu a { color: #bbb; border-bottom-color: #333; }
body.dark-mode .nav-dropdown-menu a:hover { background: #333; color: #6ba3f0; }
body.dark-mode .nav-user { color: #888; }
body.dark-mode .nav-user a { color: #6ba3f0; }
body.dark-mode h2 { color: #6ba3f0; }
body.dark-mode h3 { color: #94c122; }
body.dark-mode .kpi-card { background: #1e1e1e; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
body.dark-mode .kpi-value { color: #6ba3f0; }
body.dark-mode .kpi-label { color: #888; }
body.dark-mode .table { background: #1e1e1e; }
body.dark-mode .table td { color: #ccc; border-bottom-color: #333; }
body.dark-mode .table tr:hover td { background: #252525; }
body.dark-mode .table tr.status-storniert td { color: #555; }
body.dark-mode .form-card { background: #1e1e1e; }
body.dark-mode .form-group label { color: #6ba3f0; }
body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .form-group textarea {
  background: #2a2a2a;
  border-color: #444;
  color: #d0d0d0;
}
body.dark-mode .filter-form select,
body.dark-mode .filter-form input {
  background: #2a2a2a;
  border-color: #444;
  color: #d0d0d0;
}
body.dark-mode .btn-secondary { background: #2a2a2a; color: #6ba3f0; }
body.dark-mode .btn-secondary:hover { background: #d6a726; color: #fff; }
body.dark-mode .tab-btn { background: #1e1e1e; color: #6ba3f0; border-color: #6ba3f0; }
body.dark-mode .tab-btn.active { background: #1d6ae5; color: #fff; }
body.dark-mode .tab-btn:hover:not(.active) { background: #252525; }
body.dark-mode .einstell-box { background: #1e1e1e; border-color: #333; }
body.dark-mode .einstell-box h3 { color: #6ba3f0; }
body.dark-mode .einstell-hinweis { color: #888; }
body.dark-mode .einstell-status { color: #888; }
body.dark-mode .alert-success { background: #1a2e1a; color: #90c878; border-color: #94c122; }
body.dark-mode .alert-error   { background: #2e1a1a; color: #e08080; border-color: #e74c3c; }
body.dark-mode .alert-warning { background: #2e2a1a; color: #d6a726; border-color: #d6a726; }
body.dark-mode .modal-overlay { background: rgba(0,0,0,.85); }
body.dark-mode .modal-box { background: #1e1e1e; border-color: #444; color: #d0d0d0; }
body.dark-mode .login-box { background: #1e1e1e; }
body.dark-mode .progress-bar-wrap { background: #333; }
body.dark-mode .admin-nav a { color: #6ba3f0; }
body.dark-mode .admin-tile { background: #1e1e1e; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
body.dark-mode .admin-tile-title { color: #6ba3f0; }
body.dark-mode .admin-tile-desc { color: #888; }
body.dark-mode .section-header h2 { color: #6ba3f0; }
body.dark-mode .nav-logo img { filter: invert(1) hue-rotate(180deg); }
body.dark-mode .nav-backdrop { background: rgba(0,0,0,.7); }
body.dark-mode .nav-panel { background: #1e1e1e; }
body.dark-mode .nav-links > a,
body.dark-mode .nav-dropdown-btn { border-bottom-color: #333; }
body.dark-mode .nav-user { border-top-color: #333; }
body.dark-mode .nav-toggle span { background: #aaa; }
body.dark-mode .tutorial-video-bar { border-top-color: #333; }
body.dark-mode .tutorial-video-link { color: #888; }
body.dark-mode .tutorial-video-link:hover { color: #6ba3f0; }

/* Filialplanung-Liste */
body.dark-mode .filial-list-wrap { background: #181818; }
body.dark-mode .filial-filter-bar { background: #1e1e1e; border-bottom-color: #333; }
body.dark-mode .filter-btn { background: #2a2a2a; color: #6ba3f0; border-color: #444; }
body.dark-mode .filter-btn.active { background: #1d6ae5; color: #fff; border-color: #1d6ae5; }
body.dark-mode .filial-search { background: #2a2a2a; color: #d0d0d0; border-color: #444; }
body.dark-mode .filial-search::placeholder { color: #666; }
body.dark-mode .filial-item { background: #1e1e1e; border-bottom-color: #2e2e2e; color: #d0d0d0; }
body.dark-mode .filial-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,.4); }
body.dark-mode .filial-item-user-gesperrt { background: #252525; }
body.dark-mode .filial-item-geschlossen { background: #221a1a; }
body.dark-mode .filial-item-sub { color: #888; }
body.dark-mode .filial-item-info { color: #888; }
body.dark-mode .filial-item-info-user { color: #666; }
body.dark-mode .filial-kat-badge { background: #2a2a2a; color: #888; }
body.dark-mode .filial-schliess-badge.warten { background: #2e2310; color: #d6a726; }
body.dark-mode .filial-schliess-badge.zu { background: #2e1a1a; color: #e08080; }
body.dark-mode .filial-lohnstelle-badge { background: #1a2535; color: #6ba3f0; border-color: #1d6ae5; }
body.dark-mode .filial-lohnstelle-badge.warn { background: #2e2310; color: #d6a726; border-color: #d6a726; }
body.dark-mode .aktionen-sheet { background: #2a2a2a; box-shadow: 0 -4px 20px rgba(0,0,0,.6); }
body.dark-mode .aktionen-sheet-handle { background: #555; }
body.dark-mode .aktionen-sheet button { color: #d0d0d0; border-bottom-color: #333; }
body.dark-mode .aktionen-sheet button:active { background: #333; }
body.dark-mode .aktionen-sheet button.danger { color: #e08080; }
body.dark-mode .aktionen-sheet button.danger:active { background: #2e1a1a; }
body.dark-mode .aktionen-sheet-divider { background: #333; }
body.dark-mode .filial-more-btn { color: #888; }
body.dark-mode .filial-more-btn:hover { background: #2a2a2a; }
body.dark-mode .filial-historie-toggle { color: #6ba3f0; }
body.dark-mode .filial-besuch { border-bottom-color: #2e2e2e; }
body.dark-mode .filial-besuch-head { color: #888; }
body.dark-mode .filial-besuch-kommentar { color: #aaa; }
body.dark-mode .filial-besuch-kennzahlen { color: #666; }
body.dark-mode .filial-besuch-edit { color: #6ba3f0; }

/* Tour-Besuch-Zeilen (Heutige Tour) */
.tour-besuch-historie { border-top: 1px solid #e5eaea; margin-top: .5rem; padding-top: .4rem; }
.tour-besuch-zeile { font-size: .8rem; padding: .3rem 0; border-bottom: 1px dashed #eee; color: #555; }
.tour-besuch-zeile .besuch-notiz { color: #444; margin-top: .15rem; }
.tour-besuch-zeile .besuch-kz { color: #666; margin-top: .1rem; }
.frueher-besucht-karte { background: #f5f7fa; border-left: 3px solid #94c122; }

/* Tour-Stops (Heutige Tour + Routenplanung) */
body.dark-mode .tour-stop { background: #1e1e1e; border-color: #333; }
body.dark-mode .tour-stop-adr { color: #888; }
body.dark-mode .tour-stop-besucht { background: #1a2a1a; }
body.dark-mode .tour-stop-toggle { border-color: #444; color: #6ba3f0; }
body.dark-mode .tour-stop-toggle:hover { background: #252525; }
body.dark-mode .tour-info { background: #1a2535; color: #6ba3f0; }
body.dark-mode .tour-start-opt { background: #2a2a2a; color: #d0d0d0; border-color: #444; }
body.dark-mode .tour-mitnahmen { background: #1a2a1a; border-left-color: #94c122; }
body.dark-mode .tour-mitnahme + .tour-mitnahme { border-top-color: #2e2e2e; }
body.dark-mode .tour-mitnahme-name { color: #d0d0d0; }
body.dark-mode .tour-mitnahme-meta { color: #888; }
body.dark-mode .tour-mitnahme.besucht .tour-mitnahme-name { color: #555; }
/* Naechster-Stopp-Box + Frueherer-Besucht-Sektion */
body.dark-mode #naechsterTitel { color: #888; }
body.dark-mode #tourInfo { background: #1a2535; color: #6ba3f0; }
body.dark-mode #fruehererBesuchSektion .btn-secondary { background: #2a2a2a; }
/* Routenplanung Vorschau-Liste */
body.dark-mode .tour-stop-klickbar { background: #1e1e1e; border-color: #333; }
body.dark-mode .tour-stop-klickbar:hover { background: #252525; }
/* Tour-Besuch-Zeilen (Heutige Tour) */
body.dark-mode .tour-besuch-zeile { border-bottom-color: #2e2e2e; color: #888; }
body.dark-mode .tour-besuch-zeile .besuch-notiz { color: #aaa; }
body.dark-mode .tour-besuch-zeile .besuch-kz { color: #666; }
body.dark-mode .tour-besuch-historie { border-top-color: #2e2e2e; }
/* Frueherer-Besuch-Karte */
body.dark-mode .frueher-besucht-karte { background: #1a2a1a; border-left-color: #94c122; }
