/* =============================================
   BRÜNING SERVICE APP – Design-System
   Exakt übernommen aus dem Prototyp
   ============================================= */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* Touch-Optimierung für alle klickbaren Elemente (Android PWA) */
button,
.btn,
.card.click,
.pill,
.nav-btn,
.tech-chip,
.list-row.click,
.sheet-close,
.avatar,
[onclick] {
  touch-action: manipulation;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f5f0;
  color: #1a1a1a;
  min-height: 100vh;
  overscroll-behavior: none;
}

/* LAYOUT */
.app {
  max-width: 100%;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

.screen {
  padding: 20px 16px 80px;
  min-height: 100vh;
  animation: fadeIn .2s ease;
}

@media (min-width: 600px) {
  .app { max-width: 100%; }
  .screen { padding: 28px 32px 80px; }
}

@media (min-width: 1024px) {
  .screen { padding: 32px 48px 80px; max-width: 1400px; margin: 0 auto; }
  .stats  { max-width: 560px; }
  #auftraege-liste,
  #kunden-liste,
  #maschinen-liste,
  #artikel-liste,
  #tech-auftraege-liste {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 8px;
  }
  #auftraege-liste .leer-zustand,
  #kunden-liste .leer-zustand,
  #maschinen-liste .leer-zustand,
  #artikel-liste .leer-zustand,
  #tech-auftraege-liste .leer-zustand {
    grid-column: 1 / -1;
  }
}

.screen.no-pad {
  padding: 0;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* HEADER */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eeeeee;
}
.header-left  { display: flex; align-items: center; gap: 10px; }
.header-logo  { font-size: 22px; }
.header-title { font-size: 16px; font-weight: 700; }
.header-right { display: flex; align-items: center; gap: 8px; }

/* AVATAR */
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #E6F1FB;
  color: #185FA5;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.avatar.lg { width: 42px; height: 42px; font-size: 15px; }

/* BADGES */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
}
.badge.gruen  { background: #EAF3DE; color: #3B6D11; }
.badge.orange { background: #FAEEDA; color: #854F0B; }
.badge.rot    { background: #FAECE7; color: #993C1D; }
.badge.blau   { background: #E6F1FB; color: #185FA5; }
.badge.grau   { background: #f0f0f0; color: #888888; }
.badge.pool   { background: #1a1a1a; color: #ffffff; }

/* BUTTONS */
.btn {
  width: 100%;
  padding: 13px;
  border: 1px solid #ddd;
  border-radius: 12px;
  background: #ffffff;
  color: #1a1a1a;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  touch-action: manipulation;
  font-family: inherit;
}
.btn:active          { transform: scale(0.98); }
.btn.primary         { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }
.btn.primary:hover   { opacity: .88; }
.btn.success         { background: #EAF3DE; color: #3B6D11; border-color: #C0DD97; }
.btn.danger          { background: #FAECE7; color: #993C1D; border-color: #F5C4B3; }
.btn.warning         { background: #FAEEDA; color: #854F0B; border-color: #FAC775; }
.btn.sm              { padding: 7px 13px; width: auto; font-size: 13px; display: inline-block; }
.btn + .btn          { margin-top: 10px; }

/* INPUTS */
input, select, textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 12px;
  font-size: 15px;
  background: #fff;
  margin-bottom: 12px;
  -webkit-appearance: none;
  font-family: inherit;
  color: #1a1a1a;
}
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  padding: 0;
  margin: 0;
  border-radius: 4px;
  -webkit-appearance: checkbox;
  appearance: checkbox;
  accent-color: #185FA5;
  cursor: pointer;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #888888;
}
textarea       { resize: vertical; min-height: 72px; }
input[readonly], input:disabled, textarea[readonly], textarea:disabled, select:disabled {
  background: #f5f5f0;
  color: #888;
  cursor: default;
}
.field-label   { font-size: 12px; color: #888888; display: block; margin-bottom: 5px; }
.section-label {
  font-size: 12px;
  font-weight: 600;
  color: #aaaaaa;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 12px;
}

/* SEARCH */
.search-wrap         { position: relative; margin-bottom: 10px; }
.search-wrap input   { padding: 11px 38px; margin-bottom: 0; }
.search-icon         { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 16px; pointer-events: none; }
.search-clear        { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; color: #aaaaaa; font-size: 16px; cursor: pointer; padding: 4px; }

/* FILTER PILLS */
.pills {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 12px;
}
.pills::-webkit-scrollbar { display: none; }
.pill {
  padding: 7px 14px;
  border: 1px solid #ddd;
  border-radius: 20px;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: #888888;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
  flex-shrink: 0;
}
.pill.on { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }

/* TABS */
.tabs {
  display: flex;
  border-bottom: 1px solid #eeeeee;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  background: none;
  border: none;
  padding: 10px 14px;
  font-size: 14px;
  color: #888888;
  border-bottom: 2.5px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  font-family: inherit;
  touch-action: manipulation;
}
.tab.on { color: #1a1a1a; border-bottom-color: #1a1a1a; font-weight: 500; }

/* CARDS */
.card { background: #fff; border: 1px solid #eeeeee; border-radius: 14px; overflow: hidden; margin-bottom: 8px; }
.card.click { cursor: pointer; }
.card.click:active { background: #f9f9f7; transform: scale(0.98); }
.card-body { padding: 12px 14px; }

/* AUFTRAGS-KARTE */
.order-card {
  background: #fff;
  border: 1px solid #eeeeee;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 8px;
  cursor: pointer;
}
.order-card:active       { background: #f9f9f7; transform: scale(0.98); }
.order-card-inner        { padding: 12px 14px; }
.order-top               { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.order-title             { font-size: 15px; font-weight: 500; flex: 1; margin-right: 8px; }
.order-meta              { font-size: 12px; color: #888888; margin-bottom: 6px; }
.order-bottom            { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tag                     { display: inline-block; font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }

/* STATS */
.stats      { display: flex; gap: 10px; margin-bottom: 16px; }
.stat       { flex: 1; background: #fff; border: 1px solid #eeeeee; border-radius: 12px; padding: 12px; }
.stat-label { font-size: 11px; color: #888888; margin-bottom: 4px; }
.stat-value { font-size: 22px; font-weight: 600; }

/* BOTTOM SHEET / OVERLAY */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.overlay.open { display: flex; }
.sheet {
  background: #fff;
  border-radius: 22px 22px 0 0;
  padding: 16px 20px 44px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
/* Breite Variante für inhaltsreiche Sheets (z.B. Filter mit vielen Chips) */
.sheet-wide { max-width: 680px; }
@media (min-width: 900px) {
  .sheet-wide { max-width: 1100px; }
}
@media (min-width: 1400px) {
  .sheet-wide { max-width: 1300px; }
}
/* Innerhalb breiter Sheets brechen Chips um, statt horizontal zu scrollen */
.sheet-wide .pills {
  flex-wrap: wrap;
  overflow-x: visible;
  row-gap: 7px;
}
.sheet-handle { width: 36px; height: 4px; background: #dddddd; border-radius: 2px; margin: 0 auto 14px; }
.sheet-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eeeeee;
}
.sheet-title { font-size: 16px; font-weight: 700; flex: 1; }
.sheet-close { background: none; border: none; font-size: 20px; color: #888; cursor: pointer; padding: 4px; }

/* LOGIN */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}
.login-box {
  background: #fff;
  border: 1px solid #eeeeee;
  border-radius: 16px;
  padding: 22px;
  width: 100%;
  max-width: 320px;
}
.login-logo      { text-align: center; margin-bottom: 20px; }
.login-logo-text { font-size: 20px; font-weight: 700; color: #1a1a1a; }
.login-logo-sub  { font-size: 12px; color: #888888; margin-top: 2px; }
.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #eeeeee;
  border-radius: 12px;
  cursor: pointer;
  margin-bottom: 8px;
}
.user-card:active { background: #f9f9f7; transform: scale(0.98); }
.user-name        { font-size: 15px; font-weight: 500; }
.user-role        { font-size: 12px; color: #888888; }

/* PIN-EINGABE */
.pin-title  { text-align: center; font-size: 15px; font-weight: 500; margin-bottom: 16px; }
.pin-dots   { display: flex; justify-content: center; gap: 12px; margin-bottom: 20px; }
.pin-dot    { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #cccccc; transition: background .1s; }
.pin-dot.filled { background: #1a1a1a; border-color: #1a1a1a; }
.numpad     { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.num-btn {
  padding: 16px;
  border: 1px solid #eeeeee;
  border-radius: 14px;
  font-size: 20px;
  font-weight: 500;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  touch-action: manipulation;
}
.num-btn:active { background: #f5f5f0; }
.num-btn.del    { font-size: 18px; color: #888888; }
.pin-back {
  background: none;
  border: none;
  color: #888888;
  font-size: 13px;
  cursor: pointer;
  display: block;
  margin: 14px auto 0;
  font-family: inherit;
}
.pin-error {
  font-size: 13px;
  color: #993C1D;
  padding: 10px 12px;
  background: #FAECE7;
  border-radius: 10px;
  margin-bottom: 12px;
  text-align: center;
}

/* FORM BOX */
.form-box { background: #f5f5f0; border-radius: 12px; padding: 16px; margin-top: 12px; }

/* INFO BOX */
.info-box             { border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 13px; line-height: 1.5; }
.info-box.blau        { background: #E6F1FB; border-left: 3px solid #185FA5; }
.info-box.gruen       { background: #EAF3DE; border-left: 3px solid #639922; }
.info-box.orange      { background: #FAEEDA; border-left: 3px solid #EF9F27; }
.info-box.rot         { background: #FAECE7; border-left: 3px solid #993C1D; }
.info-box.grau        { background: #f0f0f0; border-left: 3px solid #aaaaaa; color: #555; }

/* OFFLINE-BALKEN */
.offline-bar {
  display: none;
  background: #FAECE7;
  color: #993C1D;
  font-size: 12px;
  text-align: center;
  padding: 6px;
  border-radius: 8px;
  margin-bottom: 10px;
}

/* UNTERE NAVIGATION */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 100%;
  background: #fff;
  border-top: 1px solid #eeeeee;
  display: flex;
  z-index: 100;
}
.nav-btn {
  flex: 1;
  max-width: 120px;
  padding: 10px 4px 8px;
  background: none;
  border: none;
  font-size: 11px;
  color: #888888;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  touch-action: manipulation;
}
.nav-btn.on        { color: #1a1a1a; }
.nav-btn .nav-icon { font-size: 20px; }
.nav-btn .nav-label{ font-size: 10px; font-weight: 500; }

/* LISTEN-REIHE */
.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f0f0f0; }
.list-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; margin-top: 2px; }

/* DETAIL-ANSICHT */
.detail-section { margin-bottom: 20px; }
.detail-row     { display: flex; padding: 8px 0; border-bottom: 1px solid #f5f5f0; font-size: 14px; }
.detail-key     { color: #888888; width: 120px; flex-shrink: 0; }
.detail-val     { font-weight: 500; }

/* TABELLE */
.tbl         { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 12px; }
.tbl th      { background: #f5f5f0; padding: 8px 10px; text-align: left; font-size: 11px; font-weight: 600; color: #888888; text-transform: uppercase; letter-spacing: .3px; }
.tbl td      { padding: 8px 10px; border-bottom: 1px solid #f5f5f0; }
.tbl tr:last-child td { border-bottom: none; }

/* KOMMENTARE */
.comment              { padding: 10px 0; border-bottom: 1px solid #f5f5f0; }
.comment:last-child   { border-bottom: none; }
.comment-meta         { font-size: 11px; color: #aaaaaa; margin-bottom: 4px; }
.comment-text         { font-size: 14px; line-height: 1.5; }

/* PROFIL-SHEET */
.profile-info { background: #f5f5f0; border-radius: 12px; padding: 16px; display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.profile-name { font-size: 16px; font-weight: 600; }
.profile-role { font-size: 13px; color: #888888; margin-top: 2px; }

/* TECHNIKER-CHIPS (Auftragszuweisung) */
.techniker-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tech-chip       { padding: 6px 12px; border: 1px solid #ddd; border-radius: 20px; font-size: 13px; cursor: pointer; background: #fff; }
.tech-chip.on    { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }

/* UPLOAD-BEREICH */
.upload-area {
  width: 100%;
  height: 100px;
  border: 2px dashed #dddddd;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #fafafa;
  margin-bottom: 12px;
  font-size: 13px;
  color: #888888;
  gap: 6px;
}
.upload-area:hover     { border-color: #aaaaaa; }
.upload-area.drag-over { border-color: #185FA5; background: #E6F1FB; color: #185FA5; }

/* IMPORT-ERGEBNIS */
.import-result {
  background: #f5f5f0;
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 12px;
  font-size: 13px;
}
.import-result-zeile {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid #e8e8e4;
}
.import-result-zeile:last-child { border-bottom: none; }
.import-result-zahl { font-weight: 600; }

/* FILTER-ZEILE */
.filter-zeile {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.filter-oeffnen-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid #ddd;
  border-radius: 20px;
  background: #fff;
  font-size: 13px;
  color: #1a1a1a;
  cursor: pointer;
  touch-action: manipulation;
  flex-shrink: 0;
  font-weight: 500;
}
.filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #185FA5;
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 11px;
  font-weight: 700;
}
.filter-aktiv-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}
.filter-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #E8F0FB;
  color: #185FA5;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.filter-chip-kategorie {
  opacity: 0.55;
  font-weight: 400;
  margin-right: 1px;
}
.filter-chip-x {
  cursor: pointer;
  font-size: 11px;
  opacity: 0.7;
  touch-action: manipulation;
}
.filter-chip-x:hover { opacity: 1; }

/* FILTER-SHEET */
.filter-gruppe {
  margin-bottom: 20px;
}
.filter-gruppe-label {
  font-size: 11px;
  font-weight: 600;
  color: #888;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* SORTIER-LEISTE */
.sort-leiste {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.sort-label {
  font-size: 12px;
  color: #888;
  flex-shrink: 0;
}
.sort-btn {
  padding: 5px 11px;
  font-size: 12px;
  border: 1px solid #ddd;
  border-radius: 20px;
  background: #fff;
  color: #444;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.sort-btn.on {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}
.sort-dir-btn {
  padding: 5px 10px;
  font-size: 13px;
  border: 1px solid #ddd;
  border-radius: 20px;
  background: #f5f5f0;
  color: #444;
  cursor: pointer;
  touch-action: manipulation;
  flex-shrink: 0;
  transition: background 0.15s;
}
.sort-dir-btn:active { background: #e0e0e0; }

/* DOKUMENTE */
.dok-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-radius: 12px;
  padding: 10px 13px;
  margin-bottom: 8px;
}
.dok-symbol {
  font-size: 24px;
  flex-shrink: 0;
}
.dok-info {
  flex: 1;
  cursor: pointer;
  min-width: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
.dok-info:active { opacity: 0.7; }
.dok-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dok-meta {
  font-size: 11px;
  color: #aaa;
  margin-top: 2px;
}
.dok-loeschen {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  opacity: 0.5;
}
.dok-loeschen:hover { opacity: 1; }

/* LEER-ZUSTAND */
.leer-zustand {
  text-align: center;
  padding: 40px 20px;
  color: #aaaaaa;
}
.leer-zustand-icon { font-size: 40px; margin-bottom: 12px; }
.leer-zustand-text { font-size: 14px; }

/* KARTE */
.karte-header {
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 1px solid #eee;
  z-index: 500;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.karte-zurueck {
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: #185FA5;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  white-space: nowrap;
}
.karte-zaehler { font-size: 13px; color: #888; }
#karte-container { width: 100%; }
.leaflet-popup-content-wrapper {
  border-radius: 12px !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15) !important;
}
.leaflet-popup-content { margin: 12px 14px !important; }

/* KOMMENTARE */
.kommentar-item {
  background: #ffffff;
  border-radius: 12px;
  padding: 10px 13px;
  margin-bottom: 8px;
}
.kommentar-item.eigen {
  background: #f0f7ff;
}
.kommentar-kopf {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.kommentar-autor {
  font-size: 12px;
  font-weight: 600;
  color: #555;
}
.kommentar-zeit {
  font-size: 11px;
  color: #aaa;
  margin-left: auto;
}
.kommentar-text {
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  color: #1a1a1a;
}
.kommentar-eingabe-wrap {
  margin-top: 14px;
}
.kommentar-eingabe-wrap textarea {
  width: 100%;
  resize: none;
  border-radius: 12px;
  border: 1px solid #ddd;
  padding: 11px 13px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: #1a1a1a;
  line-height: 1.45;
}
.kommentar-eingabe-wrap textarea:focus {
  outline: none;
  border-color: #185FA5;
}

/* =============================================
   OFFLINE-STATUS
   ============================================= */

/* Button der im Offline-Modus gesperrt ist */
.nur-online-gesperrt {
  opacity: 0.38;
  cursor: not-allowed !important;
  pointer-events: none;
}

/* Hinweis "Nur online verfügbar" innerhalb von Sektionen */
.offline-hinweis {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #888;
  background: #f5f5f0;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 4px 0 8px;
}

/* =============================================
   PLANUNG & KALENDER
   ============================================= */

/* -- Steuerleiste -- */
.planung-controls {
  background: white;
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.planung-woche-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.planung-filter-chip {
  background: #f0f0ec;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  user-select: none;
  transition: background 0.15s, opacity 0.15s;
}

.planung-filter-chip:has(input:not(:checked)) {
  opacity: 0.42;
}

/* -- Board-Container: horizontales Scrollen auf Mobilgeräten -- */
#planung-board-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 4px;
}

/* -- Board-Grid -- */
.planung-board {
  min-width: 640px;
  border-radius: 14px;
  overflow: hidden;
  background: white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  margin-bottom: 4px;
}

.planung-board-header {
  display: grid;
  grid-template-columns: 100px repeat(5, minmax(0, 1fr));
  background: #f0f0ec;
  border-bottom: 1px solid #e0e0d8;
}

.planung-tech-header {
  padding: 8px 10px;
  font-size: 10px;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
}

.planung-tag-header {
  padding: 8px 4px;
  text-align: center;
  border-left: 1px solid #e8e8e0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.planung-tag-header.heute {
  background: #e8f0fe;
}

.planung-tag-name {
  font-size: 10px;
  font-weight: 600;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.planung-datum {
  font-size: 13px;
  font-weight: 700;
  color: #1a1a1a;
}

.planung-tag-header.heute .planung-datum {
  color: #185FA5;
}

/* -- Techniker-Zeilen -- */
.planung-row {
  display: grid;
  grid-template-columns: 100px repeat(5, minmax(0, 1fr));
  border-top: 2px solid #c4c4ba;
  min-height: 72px;
}
/* Erste Zeile braucht keine doppelte Linie zum Header */
.planung-row:first-child {
  border-top: none;
}

.planung-tech-cell {
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: #fafaf8;
  border-right: 1px solid #e8e8e0;
}

.planung-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 10px;
  flex-shrink: 0;
}

.planung-tech-name {
  font-size: 9px;
  color: #777;
  text-align: center;
  word-break: break-word;
  line-height: 1.3;
}

/* "＋ Termin"-Button in der Tech-Zelle (Disponent-Board) */
.planung-personal-btn {
  margin-top: 2px;
  padding: 2px 6px;
  font-size: 11px;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  background: #eef2ff;
  color: #4338ca;
  cursor: pointer;
  line-height: 1.4;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.planung-personal-btn:hover {
  background: #4338ca;
  color: #fff;
}

/* Persönliche Termin-Karte (Urlaub, Krankheit …) */
.planung-karte-personal {
  cursor: default;
}

/* -- Tag-Zellen (Drop-Targets) -- */
.planung-tag-zelle {
  padding: 4px 3px;
  border-left: 1px solid #e8e8e0;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: background 0.12s;
  overflow: hidden;
  min-width: 0;
  box-sizing: border-box;
}

/* Wenn in dieser Zeile eine mehrtägige Karte liegt: Platz oben lassen */
.planung-tag-zelle.mit-span {
  padding-top: 80px;
  min-height: 128px;
}

.planung-tag-zelle.heute {
  background: #f6f9ff;
}

.planung-tag-zelle.planung-drag-over,
.planung-pool-grid.planung-drag-over,
.tech-kal-zelle.planung-drag-over {
  background: #ddeeff !important;
  outline: 2px dashed #185FA5;
  outline-offset: -2px;
  border-radius: 6px;
}

/* -- Mehrtägige Spanning-Karte (absolut positioniert im Row) -- */
.planung-karte-mehrtag {
  position: absolute;
  top: 4px;
  z-index: 2;
  overflow: hidden;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.10);
}

.planung-karte-mehrtag .planung-karte-kunde {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* -- Auftragskarte in der Plantafel -- */
.planung-karte {
  background: white;
  border-radius: 7px;
  border-left: 3px solid #185FA5;
  padding: 5px 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s, opacity 0.15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  min-width: 0;
}

.planung-karte:hover {
  box-shadow: 0 3px 10px rgba(0,0,0,0.14);
  transform: translateY(-1px);
}

.planung-karte.dragging {
  opacity: 0.38;
  transform: scale(0.96);
  box-shadow: none;
}

.planung-karte-header {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 2px;
  min-width: 0;
}

.planung-karte-nr {
  font-size: 11px;
  font-weight: 700;
  color: #185FA5;
  white-space: nowrap;
}

.planung-karte-kunde {
  font-size: 11px;
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  max-width: 100%;
}

.planung-karte-detail {
  font-size: 10px;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  max-width: 100%;
}

/* -- Badges -- */
.planung-badge {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 8px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.5;
}

.planung-badge.vorspannung { background: #ebebeb; color: #888; }
.planung-badge.in-arbeit   { background: #d4f0db; color: #1a7a34; }
.planung-badge.pool        { background: #fff0d6; color: #a05c00; }
.planung-badge.mehrtaegig  { background: #ddeeff; color: #185FA5; }
.planung-badge.besuch      { background: #f0e6ff; color: #6b21a8; }
.planung-badge.vorgemerkt  { background: #fef3c7; color: #92400e; }
.planung-badge.fixtermin   { background: #fee2e2; color: #991b1b; }
.planung-badge.angemeldet  { background: #d1fae5; color: #065f46; }

/* ×-Button: Termin aus Tageszelle entfernen */
.planung-termin-loeschen {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  color: #999;
  background: transparent;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.planung-termin-loeschen:hover {
  background: #ffdddd;
  color: #cc2222;
}

/* -- Pool & Ohne-Termin Sektionen -- */
.planung-pool-sektion {
  margin-top: 16px;
}

.planung-pool-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  color: #1a1a1a;
}

.planung-pool-count {
  background: #f0f0ec;
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 12px;
  color: #666;
  font-weight: 700;
}

.planung-pool-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 52px;
  padding: 8px;
  border-radius: 12px;
  background: #fafaf8;
  border: 1px solid #e8e8e0;
  transition: background 0.12s;
}

.planung-pool-grid .planung-karte {
  min-width: 130px;
  max-width: 210px;
  flex: 1 1 140px;
}

.planung-leer {
  font-size: 13px;
  color: #bbb;
  padding: 10px 0;
  width: 100%;
  text-align: center;
}

/* =============================================
   TECHNIKER-KALENDER
   ============================================= */

.tech-kalender {
  background: white;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  margin-bottom: 16px;
}

.tech-kal-header {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: #f0f0ec;
  border-bottom: 1px solid #e0e0d8;
}

.tech-kal-tag-header {
  padding: 8px 4px;
  text-align: center;
  border-left: 1px solid #e8e8e0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.tech-kal-tag-header:first-child {
  border-left: none;
}

.tech-kal-tag-header.heute {
  background: #e8f0fe;
}

.tech-kal-tag-name {
  font-size: 10px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.tech-kal-datum {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.2;
}

.tech-kal-tag-header.heute .tech-kal-datum {
  color: #185FA5;
}

.tech-kal-body {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
}

.tech-kal-zelle {
  padding: 6px 4px;
  border-left: 1px solid #e8e8e0;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background 0.12s;
  overflow: hidden;
  min-width: 0;
  box-sizing: border-box;
}

.tech-kal-zelle:first-child {
  border-left: none;
}

.tech-kal-zelle.heute {
  background: #f6f9ff;
}

/* Wenn eine mehrtägige Span-Karte über dieser Zelle liegt: Platz oben lassen */
.tech-kal-zelle.mit-span {
  padding-top: 82px;
  min-height: 192px;
}

.tech-kal-leer {
  font-size: 18px;
  color: #e0e0e0;
  text-align: center;
  margin: auto;
  padding: 12px 0;
  line-height: 1;
}
