/* Minimal Bootstrap-friendly tweaks */
body{ background: var(--bs-body-bg); }
.page-header{ display:flex; align-items:flex-end; justify-content:space-between; gap:1rem; margin-bottom:1rem; }
.page-title{ margin:0; font-weight:700; letter-spacing:.2px; }
.card{ border:1px solid rgba(0,0,0,.075); }
.table thead th{ background: var(--bs-tertiary-bg); color: var(--bs-body-color); }
.navbar .nav-link{ white-space:nowrap; }
.navbar-brand .brand-dot{ width:10px; height:10px; border-radius:999px; background:#0d6efd; display:inline-block; margin-right:.5rem; }

/* Grafische Disposition */
.dispo-board{ overflow:auto; border:1px solid var(--bs-border-color); border-radius:.75rem; background:var(--bs-body-bg); }
.dispo-grid{ display:grid; grid-template-columns: 190px repeat(var(--days), minmax(130px, 1fr)); min-width: calc(190px + var(--days) * 130px); }
.dispo-head{ position:sticky; top:0; z-index:3; background:var(--bs-tertiary-bg); border-bottom:1px solid var(--bs-border-color); }
.dispo-person-head,.dispo-day-head{ padding:.65rem .75rem; font-weight:700; border-right:1px solid var(--bs-border-color); }
.dispo-day-head{ text-align:center; line-height:1.1; }
.dispo-day-head span{ font-weight:500; color:var(--bs-secondary-color); }
.dispo-row{ border-bottom:1px solid var(--bs-border-color); }
.dispo-person{ position:sticky; left:0; z-index:2; background:var(--bs-body-bg); padding:.75rem; border-right:1px solid var(--bs-border-color); min-height:88px; }
.pool-row .dispo-person{ background:var(--bs-tertiary-bg); }
.dispo-cell{ min-height:88px; padding:.45rem; border-right:1px solid var(--bs-border-color); background:rgba(13,110,253,.025); }
.dispo-cell.drop-hover{ outline:2px dashed var(--bs-primary); outline-offset:-5px; background:rgba(13,110,253,.10); }
.dispo-card{ cursor:grab; border:1px solid var(--bs-border-color); border-left:5px solid var(--bs-secondary); border-radius:.55rem; background:var(--bs-body-bg); padding:.5rem; margin-bottom:.45rem; box-shadow:0 1px 2px rgba(0,0,0,.06); }
.dispo-card.dragging{ opacity:.55; }
.dispo-card.locked{ cursor:not-allowed; opacity:.72; }
.dispo-card-top{ display:flex; justify-content:space-between; gap:.5rem; align-items:flex-start; }
.dispo-card-top span{ font-size:.7rem; border-radius:999px; padding:.1rem .45rem; background:var(--bs-tertiary-bg); white-space:nowrap; }
.dispo-card.status-bestaetigt{ border-left-color:var(--bs-success); }
.dispo-card.status-abgeschlossen{ border-left-color:var(--bs-success); background:var(--bs-tertiary-bg); }
.dispo-card.status-storniert{ border-left-color:var(--bs-danger); }

.dispo-section-label{
  margin: 18px 0 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(0,0,0,.04);
  font-weight: 700;
}

/* Rechtsklick-Menü / Dienst bearbeiten */
.dispo-context-menu{
  display:none;
  position:absolute;
  z-index:1080;
  min-width:190px;
  padding:.35rem;
  border:1px solid var(--bs-border-color);
  border-radius:.55rem;
  background:var(--bs-body-bg);
  box-shadow:0 .5rem 1.25rem rgba(0,0,0,.18);
}
.dispo-context-menu button{
  width:100%;
  border:0;
  background:transparent;
  color:var(--bs-body-color);
  text-align:left;
  padding:.55rem .65rem;
  border-radius:.4rem;
}
.dispo-context-menu button:hover{
  background:var(--bs-tertiary-bg);
}

/* Fallback, falls Bootstrap-JS vom CDN nicht geladen wird */
.modal.show{ background:rgba(0,0,0,.45); }
.modal.show .modal-dialog{ pointer-events:auto; }

/* Dispo Modal: Dienstbestandteile */
#serviceEditModal .modal-xl { max-width: 1180px; }
#servicePartsTable th,
#servicePartsTable td { white-space: nowrap; }
#servicePartsTable input { min-width: 120px; }
#servicePartsTable .part-notes { min-width: 180px; }


/* Scrollbares Bearbeiten-Modal mit fester Fußzeile */
#serviceEditModal .modal-dialog-scrollable .modal-content{ max-height: calc(100vh - 2rem); }
#serviceEditModal .service-edit-modal-body{ max-height: 70vh; overflow-y: auto; }
#serviceEditModal .modal-footer{ position: sticky; bottom: 0; z-index: 2; background: var(--bs-body-bg); border-top: 1px solid var(--bs-border-color); }
#serviceEditModal .modal-header{ position: sticky; top: 0; z-index: 2; background: var(--bs-body-bg); border-bottom: 1px solid var(--bs-border-color); }
.service-part-drag-col{ width:36px; text-align:center; }
.service-part-drag{ cursor:grab; text-align:center; vertical-align:middle; user-select:none; font-size:1.1rem; }
.service-part-row.part-dragging{ opacity:.55; }
.service-part-row.part-drop-target{ outline:2px dashed var(--bs-primary); outline-offset:-3px; }
#servicePartsTable tbody tr{ background:var(--bs-body-bg); }
