:root {
  --bg: #0c0c0c;             /* fast schwarz */
  --surface: #181818;        /* Karten */
  --surface-2: #232323;      /* Hover / Sekundär */
  --border: #2c2c2c;
  --text: #ececec;
  --text-muted: #8e8e8e;
  --primary: #b5c71b;        /* Oliv-Grün (DELUXE) — neue Hauptfarbe */
  --primary-hover: #c9dc2a;
  --primary-soft: rgba(181, 199, 27, 0.15);
  --accent: #f58a82;         /* Salmon — als Akzent */
  --accent-hover: #f7a39d;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 6px 24px rgba(0, 0, 0, 0.4);
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--text); background: var(--bg); }

/* TOPBAR mit Logo */
.topbar {
  background: #000;
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}
.topbar-logo {
  height: 64px;
  width: auto;
  display: block;
}

/* SIDEBAR TOGGLE */
.sidebar-toggle {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s, border-color 0.15s;
}
.sidebar-toggle:hover { background: var(--surface-2); border-color: var(--primary); }
.sidebar-toggle .hamburger,
.sidebar-toggle .hamburger::before,
.sidebar-toggle .hamburger::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  position: relative;
}
.sidebar-toggle .hamburger::before,
.sidebar-toggle .hamburger::after {
  content: "";
  position: absolute;
  left: 0;
}
.sidebar-toggle .hamburger::before { top: -6px; }
.sidebar-toggle .hamburger::after { top: 6px; }

.app { display: flex; min-height: calc(100vh - 96px); }

/* SIDEBAR */
.sidebar {
  width: 260px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex-shrink: 0;
  transition: width 0.2s ease, padding 0.2s ease;
}
.brand { padding: 0 8px; transition: opacity 0.15s; }
.brand-title { font-weight: 700; font-size: 15px; white-space: nowrap; }
.brand-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  background: transparent; border: none;
  text-align: left;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s;
  white-space: nowrap;
  overflow: hidden;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--primary); color: #1a1a1a; }

/* SIDEBAR EINGEKLAPPT (schmal mit Icons) */
.app.sidebar-collapsed .sidebar {
  width: 64px;
  padding: 24px 8px;
}
.app.sidebar-collapsed .sidebar .brand,
.app.sidebar-collapsed .sidebar .status-box {
  display: none;
}
.app.sidebar-collapsed .sidebar .nav-item {
  text-align: center;
  padding: 12px 6px;
  font-size: 18px;
  line-height: 1;
}
.app.sidebar-collapsed .sidebar .nav-item .nav-label {
  display: none;
}
.app.sidebar-collapsed .sidebar .nav-item .nav-icon {
  display: inline-block;
}
.nav-item .nav-icon { display: none; }

.status-box {
  margin-top: auto;
  background: var(--surface-2);
  padding: 12px;
  border-radius: 8px;
  font-size: 12px;
}
.status-line { display: flex; align-items: center; gap: 8px; margin: 4px 0; color: var(--text-muted); }
.status-line.storage-info { display: block; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.dot.ok { background: var(--success); }
.dot.warn { background: var(--warning); }

/* MAIN */
.content { flex: 1; padding: 32px 40px; overflow-x: auto; }
.tab { display: none; }
.tab.active { display: block; }
.tab-header h1 { margin: 0 0 4px; font-size: 28px; }
.tab-header .muted { margin: 0 0 24px; }
.muted { color: var(--text-muted); font-size: 14px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 16px; font-size: 18px; }
.card h3 { margin: 24px 0 12px; font-size: 15px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.row label { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.checkbox { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-muted); }

input[type="text"], input[type="date"], input[type="number"], select {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
input:focus, select:focus { border-color: var(--primary); }
input[type="file"] { font-size: 13px; }

.btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--primary); color: #1a1a1a; border-color: var(--primary); }
.btn.primary:hover { color: #1a1a1a; }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger { color: var(--danger); border-color: rgba(248, 113, 113, 0.4); }
.btn.danger:hover { background: rgba(248, 113, 113, 0.12); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.result { margin-top: 12px; font-size: 14px; }
.result.ok { color: var(--success); }
.result.err { color: var(--danger); }

/* SUMMARY */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.summary-tile { background: var(--surface-2); border-radius: 8px; padding: 14px; }
.summary-tile .label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.summary-tile .value { font-size: 20px; font-weight: 700; margin-top: 4px; }

/* TABLE */
.table-wrap { overflow-x: auto; max-height: 400px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: var(--surface-2); font-weight: 600; position: sticky; top: 0; }

/* FEATURES */
.feature-group { margin-top: 16px; }
.feature-group h4 { margin: 0 0 8px; font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.feature-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.feature-item:hover { border-color: var(--border); }
.feature-item input[type="checkbox"] { margin: 0; }
.feature-item.selected { background: var(--primary-soft); border-color: var(--primary); }
.feature-meta { color: var(--text-muted); font-size: 11px; margin-left: auto; }

/* METRICS */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.metric {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
}
.metric .label { font-size: 11px; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.05em; }
.metric .value { font-size: 22px; font-weight: 700; margin-top: 4px; }
.metric .sub { font-size: 11px; color: var(--text-muted); }

/* CHART */
.chart-wrap { background: var(--surface); padding: 8px; border-radius: 8px; }
canvas { width: 100% !important; height: 320px !important; }

/* PREDICTION */
.big-number {
  font-size: 48px;
  font-weight: 800;
  text-align: center;
  color: var(--primary);
  margin: 8px 0;
}
.input-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.input-row .name { font-weight: 500; }
.input-row .source { color: var(--text-muted); font-size: 12px; }

.override-row {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
}

/* IMPORTANCE BARS */
.imp-row { display: flex; align-items: center; gap: 12px; padding: 4px 0; font-size: 13px; }
.imp-name { width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-bar-wrap { flex: 1; background: var(--surface-2); border-radius: 4px; height: 8px; overflow: hidden; }
.imp-bar { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.imp-val { width: 50px; text-align: right; color: var(--text-muted); }

/* MODELS LIST */
.model-card {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
}
.model-card.active { border-color: var(--primary); background: var(--primary-soft); }
.model-badge {
  background: var(--surface-2);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.model-badge.active { background: var(--primary); color: #1a1a1a; }

/* TOAST */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  background: #1a1a1a;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.25s;
  pointer-events: none;
  z-index: 1000;
  max-width: 380px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.err { background: var(--danger); color: #1a1a1a; border-color: var(--danger); }
.toast.ok { background: var(--success); color: #1a1a1a; border-color: var(--success); }

/* NAV GROUP HEADER (klickbar zum Ein-/Ausklappen) */
.nav-section { display: flex; flex-direction: column; }
.nav-section-items { display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.nav-section.collapsed .nav-section-items { display: none; }

.nav-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 14px 4px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.nav-group:hover { color: var(--text); background: var(--surface-2); }
.nav-section:first-child .nav-group { padding-top: 0; }
.nav-group-chevron {
  font-size: 12px;
  transition: transform 0.2s;
  opacity: 0.7;
}
.nav-section.collapsed .nav-group-chevron { transform: rotate(-90deg); }

/* Im eingeklappten Sidebar-Modus: Chevron verstecken, Header zentriert */
.app.sidebar-collapsed .sidebar .nav-group {
  justify-content: center;
  padding: 8px 0 4px;
}
.app.sidebar-collapsed .sidebar .nav-group-chevron { display: none; }
.app.sidebar-collapsed .sidebar .nav-group-label {
  font-size: 9px;
  letter-spacing: 0.04em;
}

/* MITARBEITER NEU ANLEGEN */
.emp-new-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.emp-new-row input[type="text"] { min-width: 180px; }
.emp-new-row input[type="color"] { width: 40px; height: 36px; padding: 2px; cursor: pointer; }
.emp-new-row .inline-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}
.emp-new-row .inline-label input { width: 80px; }

/* VERFÜGBARKEITS-MATRIX */
.availability-matrix-wrap { overflow-x: auto; margin-top: 8px; }
.avail-matrix { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.avail-matrix th, .avail-matrix td {
  border: 1px solid var(--border);
  padding: 8px;
  vertical-align: middle;
  background: var(--surface);
}
.avail-matrix th { background: var(--surface-2); font-weight: 600; }
.avail-matrix th.day-col, .avail-matrix td.day-col {
  text-align: left;
  min-width: 100px;
  background: var(--surface-2);
  font-weight: 600;
  position: sticky; left: 0; z-index: 1;
}

.emp-col-header { min-width: 170px; }
.emp-head { display: flex; align-items: center; gap: 8px; }
.emp-head .dot-color { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.emp-head .emp-name { flex: 1; cursor: pointer; }
.emp-head .emp-name:hover { color: var(--primary); text-decoration: underline; }
.emp-head .btn-x {
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
}
.emp-head .btn-x:hover { color: var(--danger); }
.emp-head-meta { margin-top: 4px; display: flex; gap: 4px; }
.emp-head-meta .hours-tag {
  font-size: 11px;
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.avail-cell { text-align: center; padding: 6px; min-width: 170px; }
.avail-cell .avail-select {
  width: 100%;
  font-size: 13px;
  padding: 4px 6px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
}
.avail-cell .avail-select:hover, .avail-cell .avail-select:focus {
  background: var(--surface);
  border-color: var(--border);
}
.avail-cell .avail-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.avail-cell.slot-off { background: var(--surface-2); }
.avail-cell.slot-early { background: rgba(251, 191, 36, 0.18); }
.avail-cell.slot-late { background: rgba(59, 130, 246, 0.18); }
.avail-cell.slot-full { background: rgba(52, 211, 153, 0.18); }
.avail-cell.slot-custom { background: rgba(168, 85, 247, 0.18); }

.slot-config {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.slot-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
}

.modal-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.modal-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

/* MITARBEITER (alt) */
.employee-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-top: 12px;
  background: var(--surface);
}
.employee-card.inactive { opacity: 0.55; }
.employee-card h3 { margin: 0 0 8px; font-size: 16px; color: var(--text); text-transform: none; letter-spacing: 0; }
.employee-card .header-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.employee-card .badges { display: flex; gap: 6px; font-size: 12px; }
.employee-card .badge { background: var(--surface-2); padding: 2px 8px; border-radius: 4px; }
.employee-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.employee-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-muted); }
.employee-form input, .employee-form select { font-size: 14px; }
.availability-grid {
  display: grid;
  grid-template-columns: 50px 1fr 1fr 50px;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  margin-top: 8px;
}
.availability-grid > div { padding: 4px 0; }

/* SCHICHTEN */
.shift-type-row {
  display: grid;
  grid-template-columns: 60px 1fr 110px 110px 40px;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
}
.color-swatch { width: 32px; height: 32px; border-radius: 6px; cursor: pointer; }


/* PLANUNG GRID */
.planning-wrap { overflow-x: auto; margin-top: 12px; }
.planning-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.planning-table th, .planning-table td {
  border: 1px solid var(--border);
  padding: 4px;
  vertical-align: top;
  background: var(--surface);
  min-width: 130px;
  height: 80px;
}
.planning-table th { background: var(--surface-2); font-weight: 600; padding: 8px; height: auto; min-width: 120px; }
.planning-table th.emp-col { text-align: left; min-width: 180px; }
.planning-table td.emp-col { background: var(--surface-2); font-weight: 500; height: auto; vertical-align: middle; }
.planning-table td.not-available { background: repeating-linear-gradient(45deg, rgba(248,113,113,0.15), rgba(248,113,113,0.15) 6px, transparent 6px, transparent 12px); }

.entry-pill {
  display: block;
  padding: 4px 8px;
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 3px;
  cursor: pointer;
  line-height: 1.2;
}
.entry-pill .time { font-size: 11px; opacity: 0.95; font-weight: 400; }

.emp-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.emp-summary .dot-color { width: 10px; height: 10px; border-radius: 50%; }
.emp-summary .hours-tag {
  font-size: 11px;
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--text-muted);
}
.emp-summary .hours-tag.over { background: rgba(248, 113, 113, 0.22); color: var(--danger); }

/* (alte .day-summary-row Regel entfernt; ersetzt durch .sum-cell) */

/* PLANUMSATZ */
.planned-rev-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.planned-rev-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  background: var(--surface-2);
  border-radius: 8px;
  font-size: 13px;
}
.planned-rev-grid label .name { font-weight: 600; }
.planned-rev-grid label input { font-size: 14px; padding: 6px 8px; }

.date-override-row {
  display: grid;
  grid-template-columns: 1fr 180px 80px;
  gap: 12px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

/* MODAL */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(43, 40, 37, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--surface);
  border-radius: 12px;
  padding: 24px;
  width: min(480px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.modal h2 { margin: 0 0 16px; font-size: 18px; }
.modal .row { display: flex; gap: 12px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
.modal label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-muted); flex: 1; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }

/* SLOT-INFO BANNER */
.slot-info {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
  flex-wrap: wrap;
}

/* VERFÜGBARKEITS-MATRIX:
   - Header (Mitarbeiter-Spalten, Sub-Header Früh/Spät) + Wochentage-Spalte → DUNKEL
   - Auswählbare Zellen (ok/blocked/school) → HELLE Pastellfarben */
.avail-matrix-v2 {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  overflow: hidden;
}
.avail-matrix-v2 th, .avail-matrix-v2 td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  text-align: center;
  vertical-align: middle;
}
.avail-matrix-v2 th {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
}
.avail-matrix-v2 th.day-col, .avail-matrix-v2 td.day-col {
  text-align: left;
  min-width: 100px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  position: sticky; left: 0; z-index: 1;
}
.avail-matrix-v2 th.sub-col {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 6px;
}
.avail-cell-bool {
  cursor: pointer;
  min-width: 50px;
  font-weight: 700;
  font-size: 16px;
  user-select: none;
  transition: filter 0.1s;
}
.avail-cell-bool.ok { background: #dcfce7; color: transparent; }
.avail-cell-bool.blocked { background: #fee2e2; color: #c93535; }
.avail-cell-bool.school { background: #fef3c7; color: #b45309; }
.avail-cell-bool:hover { filter: brightness(1.05); }

.prio-tag {
  font-weight: 700;
  background: transparent !important;
  border: none !important;
  padding: 0 4px !important;
}
.prio-tag.prio-1 { color: #d2e34a; }
.prio-tag.prio-2 { color: #fbb6b1; }
.prio-tag.prio-3 { color: var(--text-muted); }

/* POSITION CHIPS & CHECKBOXES */
.pos-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}
.pos-chip-mini {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  margin-right: 2px;
}
.position-checkboxes {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.pos-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
}
.pos-check input[type="checkbox"] { margin: 0; }
.emp-head-positions { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 2px; }

/* LAYOUT-EDITOR */
.layout-block { margin-bottom: 24px; }
.layout-block h3 { margin: 0 0 12px; font-size: 16px; }
.layout-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.layout-table th, .layout-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.layout-table th { background: var(--surface-2); font-weight: 600; }
.layout-table input { width: 100px; }
.layout-table input[type="number"] { width: 80px; }

/* PLANUNG V2 — 2 Blöcke */
.block-section { margin-bottom: 28px; }
.block-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px;
  padding: 6px 0;
  background: transparent;
  color: var(--text);
}
.planning-v2 {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  overflow: hidden;
}
.planning-v2 th, .planning-v2 td {
  border: 1px solid var(--border);
  padding: 0;
  vertical-align: middle;
}
/* Header + Positions-Spalte: dunkel (wie Verfügbarkeits-Matrix) */
.planning-v2 th {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  padding: 8px;
  font-size: 12px;
}
/* Wochenende: keine Sonder-Hervorhebung */
.planning-v2 .pos-col {
  text-align: left;
  width: 170px;
  min-width: 170px;
  max-width: 170px;
  box-sizing: border-box;
  background: var(--surface-2);
  color: var(--text);
}
.planning-v2 .pos-row-label {
  text-align: left;
  width: 170px;
  min-width: 170px;
  max-width: 170px;
  box-sizing: border-box;
  padding: 8px 12px;
  font-weight: 500;
  background: var(--surface-2);
  color: var(--text);
  vertical-align: middle;
}
.pos-row-inner {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pos-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pos-row-text { flex: 1; }
.pos-remove {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  opacity: 0.35;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}
.pos-row-label:hover .pos-remove { opacity: 0.8; }
.pos-remove:hover { opacity: 1 !important; color: var(--danger); background: rgba(248, 113, 113, 0.18); }

.shift-cell {
  min-width: 130px;
  height: 56px;
  cursor: pointer;
  padding: 4px 6px;
  text-align: center;
  position: relative;
  transition: filter 0.1s;
  background: #ffffff;
  color: #1a1a1a;
}
.shift-cell:hover { filter: brightness(0.97); }
.shift-cell.empty {
  background: #fafaf7;
}
.shift-cell.empty .empty-marker {
  color: #b3b0a8;
  opacity: 0.5;
  font-size: 20px;
  line-height: 56px;
}
.shift-cell.empty:hover .empty-marker { opacity: 0.8; }
.shift-cell.empty-shift {
  border-style: dashed !important;
  /* Hintergrund kommt aus .shift-cell.empty-shift.pos-* (50% Opazität) */
}
/* Positions-Zellen: Original-Pastellfarben, dunkler Text */
.shift-cell.pos-service { background: #fed7aa; color: #1a1a1a; }
.shift-cell.pos-kueche { background: #bbf7d0; color: #1a1a1a; }
.shift-cell.pos-fahrer { background: #bfdbfe; color: #1a1a1a; }
.shift-cell.pos-fahrradfahrer { background: #c7d2fe; color: #1a1a1a; }
.shift-cell.pos-kombi {
  background: linear-gradient(135deg, #fed7aa 0%, #fed7aa 50%, #bbf7d0 50%, #bbf7d0 100%);
  color: #1a1a1a;
}
.shift-cell.empty-shift.pos-service { background: #ffeac6; color: #525252; }
.shift-cell.empty-shift.pos-kueche { background: #d4f7df; color: #525252; }
.shift-cell.empty-shift.pos-fahrer { background: #d4e6fd; color: #525252; }
.shift-cell.empty-shift.pos-fahrradfahrer { background: #dde2fd; color: #525252; }
.shift-cell.empty-shift.pos-kombi {
  background: linear-gradient(135deg, #ffeac6 0%, #ffeac6 50%, #d4f7df 50%, #d4f7df 100%);
  color: #525252;
}
.shift-emp { font-weight: 600; font-size: 13px; color: #1a1a1a; line-height: 1.2; }
.shift-time { font-size: 11px; color: #525252; margin-top: 2px; }
.shift-empty-label { font-size: 11px; color: #757575; font-style: italic; }
.shift-cell.empty-shift .shift-time { color: #525252; font-weight: 500; }

.planning-v2 .day-head {
  min-width: 130px;
  text-align: center;
  font-size: 12px;
}

.sum-cell {
  background: #ffffff !important;
  color: #2b2825;
  padding: 6px;
  text-align: center;
  font-size: 11px;
}
.sum-cell .productivity { color: #2563eb; font-weight: 700; margin-top: 2px; }
.src-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  background: #ece8e2;
  border-radius: 4px;
  font-size: 10px;
  color: #4a4a4a;
}
.sum-cell .muted { color: #6a6a6a; }

/* STUNDENÜBERSICHT */
.hours-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.hours-table th, .hours-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.hours-table th {
  background: var(--surface-2);
  font-weight: 600;
  text-align: left;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.hours-table td.over { color: var(--danger); }
.hours-bar {
  display: inline-block;
  width: 100px;
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
  vertical-align: middle;
  margin-right: 6px;
}
.hours-bar-fill { height: 100%; background: var(--primary); transition: width 0.2s; }
.hours-bar.over .hours-bar-fill { background: var(--danger); }

/* ARCHIV-LISTE */
.archive-list { max-height: 50vh; overflow-y: auto; margin-top: 12px; }
.archive-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  background: var(--surface);
}
.archive-row:hover { background: var(--surface-2); }
.archive-info { flex: 1; }
.archive-title { font-weight: 600; font-size: 14px; }

/* =============================================
   JPG-Export Light-Override
   Der Plan wird auf weißem Hintergrund gerendert.
   Empty-Marker (+) und alle dunklen Hintergründe werden weggeblendet.
   ============================================= */
.jpg-export-light { color: #1f1f1f; background: #ffffff; }
.jpg-export-light .block-title { background: transparent !important; color: #1f1f1f; }
.jpg-export-light .planning-v2 { background: #ffffff; color: #1f1f1f; }
.jpg-export-light .planning-v2 th { background: #f2f0eb !important; color: #1f1f1f !important; }
.jpg-export-light .planning-v2 .pos-col { background: #f2f0eb !important; color: #1f1f1f !important; }
.jpg-export-light .planning-v2 .pos-row-label { background: #f2f0eb !important; color: #1f1f1f !important; }
.jpg-export-light .planning-v2 td.shift-cell { background: #ffffff; color: #1f1f1f; }
.jpg-export-light .planning-v2 td.shift-cell.empty { background: #fafaf7 !important; }
.jpg-export-light .empty-marker { display: none !important; }
.jpg-export-light .pos-remove { display: none !important; }
.jpg-export-light .shift-cell.pos-service { background: #fed7aa !important; color: #1a1a1a !important; }
.jpg-export-light .shift-cell.pos-kueche { background: #bbf7d0 !important; color: #1a1a1a !important; }
.jpg-export-light .shift-cell.pos-fahrer { background: #bfdbfe !important; color: #1a1a1a !important; }
.jpg-export-light .shift-cell.pos-fahrradfahrer { background: #c7d2fe !important; color: #1a1a1a !important; }
.jpg-export-light .shift-cell.pos-kombi {
  background: linear-gradient(135deg, #fed7aa 0%, #fed7aa 50%, #bbf7d0 50%, #bbf7d0 100%) !important;
  color: #1a1a1a !important;
}
.jpg-export-light .shift-cell.empty-shift.pos-service { background: #ffeac6 !important; color: #525252 !important; }
.jpg-export-light .shift-cell.empty-shift.pos-kueche { background: #d4f7df !important; color: #525252 !important; }
.jpg-export-light .shift-cell.empty-shift.pos-fahrer { background: #d4e6fd !important; color: #525252 !important; }
.jpg-export-light .shift-cell.empty-shift.pos-fahrradfahrer { background: #dde2fd !important; color: #525252 !important; }
.jpg-export-light .shift-cell.empty-shift.pos-kombi {
  background: linear-gradient(135deg, #ffeac6 0%, #ffeac6 50%, #d4f7df 50%, #d4f7df 100%) !important;
  color: #525252 !important;
}
.jpg-export-light .shift-emp { color: #1a1a1a !important; }
.jpg-export-light .shift-time { color: #525252 !important; }
.jpg-export-light .shift-empty-label { color: #757575 !important; }
.jpg-export-light table, .jpg-export-light th, .jpg-export-light td { border-color: #d5d0c7 !important; }

/* ANALYSE — Variablen-Toggles */
.analysis-vars {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  background: var(--surface-2);
  border-radius: 8px;
}
.analysis-var-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  user-select: none;
  transition: all 0.15s;
}
.analysis-var-toggle:hover { border-color: var(--primary); color: var(--text); }
.analysis-var-toggle.active {
  background: var(--surface);
  color: var(--text);
  border-color: var(--primary);
}
.analysis-var-toggle .swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}
.analysis-var-toggle.active .swatch { box-shadow: 0 0 0 2px rgba(255,255,255,0.15); }
#analysis-chart { height: 380px !important; }

/* SPINNER */
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Auth / Login-Overlay ===== */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: #0e1116;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.auth-card {
  background: #151a20;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 2rem 2rem 1.5rem;
  width: min(380px, 100%);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.auth-card .auth-logo {
  display: block;
  margin: 0 auto 1rem;
  max-height: 60px;
  width: auto;
}
.auth-card h1 {
  font-size: 1.2rem;
  margin: 0 0 1rem;
  text-align: center;
  color: #fff;
  font-weight: 500;
}
.auth-card form { display: flex; flex-direction: column; gap: .5rem; }
.auth-card label {
  font-size: .85rem;
  color: #aaa;
  margin-top: .5rem;
}
.auth-card input {
  background: #0e1116;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: .55rem .7rem;
  color: #fff;
  font-size: .95rem;
}
.auth-card input:focus {
  outline: none;
  border-color: #6ab8ff;
}
.auth-card button[type="submit"] {
  margin-top: 1rem;
  padding: .65rem 1rem;
  font-weight: 500;
}
.auth-error {
  color: #ff7a7a;
  font-size: .85rem;
  margin-top: .75rem;
  min-height: 1.2em;
  text-align: center;
}

/* Topbar-Zusatz (Account-Info, Logout, Admin) */
.topbar-spacer { flex: 1; }
.topbar-btn {
  padding: .35rem .8rem;
  font-size: .85rem;
  margin-left: .5rem;
}
.account-info {
  color: #bbb;
  font-size: .85rem;
  margin-left: 1rem;
}

/* Admin-Panel im Modal */
.admins-list { display: flex; flex-direction: column; gap: .4rem; }
.admin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,0.03);
  padding: .5rem .7rem;
  border-radius: 6px;
}
.admin-actions { display: flex; gap: .35rem; }
.btn.small { padding: .25rem .6rem; font-size: .8rem; }
.btn.danger { background: rgba(255,80,80,0.18); color: #ff8a8a; border-color: rgba(255,80,80,0.35); }
.btn.danger:hover { background: rgba(255,80,80,0.28); }
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-bottom: 1rem;
}
.grid2 label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; color: #aaa; }
.grid2 input, .grid2 select {
  background: #0e1116;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: .45rem .6rem;
  color: #fff;
  font-size: .9rem;
}

/* Password-Change Modal */
.pw-field {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  margin-bottom: .9rem;
}
.pw-field span {
  font-size: .85rem;
  color: #bbb;
}
.pw-field input[type="password"] {
  background: #0e1116;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: .55rem .7rem;
  color: #fff;
  font-size: .95rem;
  width: 100%;
  box-sizing: border-box;
}
.pw-field input[type="password"]:focus {
  outline: none;
  border-color: #6ab8ff;
}
.pw-field em.muted {
  font-style: normal;
  color: #888;
  font-size: .75rem;
}
.pw-actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  margin-top: 1rem;
}

/* Logo in Sidebar (statt Topbar) */
.sidebar-logo {
  display: block;
  width: 80%;
  max-width: 180px;
  margin: 1rem auto 0.75rem;
  height: auto;
}
/* Im eingeklappten Sidebar-Modus das Logo ausblenden (Platzmangel) */
.app.sidebar-collapsed .sidebar-logo { display: none; }

/* Verfuegbarkeits-Logins Modal */
.verf-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem 1rem;
  margin-bottom: 1rem;
}
.verf-form label {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  font-size: .85rem;
  color: #bbb;
}
.verf-form input[type="text"],
.verf-form input[type="number"],
.verf-form input[type="password"],
.verf-form select {
  background: #0e1116;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: .45rem .6rem;
  color: #fff;
  font-size: .9rem;
}
.verf-form .skills-label,
.verf-form .chk-row {
  grid-column: 1 / -1;
}
.verf-form .skills-checks {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .9rem;
  margin-top: .25rem;
}
.verf-form .chk {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: #ddd;
  font-size: .85rem;
  flex-direction: row !important;
}
.verf-form .chk input,
.verf-form .chk-row input {
  width: auto;
}
.verf-row .verf-meta { line-height: 1.35; }
.verf-row .verf-meta .muted { font-size: .8rem; }
