/* Modal Styles für Einteilungen */
#einteilungenModal {
  display: none;
}
#einteilungenModal[aria-hidden="false"] {
  display: block;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 8000;
}

/* Backdrop blur for modals */
.modal-backdrop {
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.modal-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  padding: 16px;
  width: 480px;
  max-width: 96%;
  max-height: 70vh;
  overflow: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 8001;
  border-radius: 6px;
}
.modal-controls {
  margin-bottom: 8px;
}
.modal-controls input[type="search"] {
  width: 100%;
  padding: 6px;
  box-sizing: border-box;
}
.einteilungen-list {
  display: block;
}
.employee-list-item {
  padding: 8px 10px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  outline: none;
}
.employee-list-item:hover {
  background: rgba(0, 0, 0, 0.03);
}
.employee-list-item.selected {
  background: rgba(0, 120, 212, 0.08);
}
.employee-list-item:focus {
  box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.12);
}
.einteilungen-item {
  display: flex;
  align-items: center;
  padding: 6px 4px;
  border-bottom: 1px solid #eee;
}
.einteilungen-item label {
  flex: 1;
  cursor: pointer;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  .page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .header-actions {
    display: flex;
    gap: 8px;
  }
  .btn-icon.modern {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
  }
  .btn-icon.modern:hover {
    background: rgba(0, 0, 0, 0.04);
  }
}
.modal-actions button {
  .form-row {
    margin-bottom: 8px;
  }
  .form-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
  }
  .form-row input {
    width: 100%;
    padding: 6px;
    box-sizing: border-box;
  }
  padding: 6px 10px;
}
#addEinteilungenList .einteilungen-item {
  padding: 6px 4px;
}

/* Remove button inside selected items */
.employee-remove-button {
  margin-left: 8px;
  background: transparent;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 12px;
}
.employee-remove-button:hover {
  color: #b00;
}

/* Plus button style moved to global `style.css` */

/* Layout: make the page content use a column flex layout so the table can
   grow and scroll within the remaining viewport height. This keeps the
   modals unaffected (they are fixed-position) and restricts the
   `.table-container` to the available space. */
#dienste {
  display: flex;
  flex-direction: column;
  /* Use 100% height so the element sizes relative to its parent
     (`#content` already uses height:100%). `100vh` inside a nested
     container caused the page to overflow and allowed extra scrolling. */
  height: 100%;
  min-height: 0;
}

#dienste .table-container {
  /* allow the table container to fill remaining space inside #dienste */
  flex: 1 1 auto;
  /* ensure children can shrink properly in flex layout, aber zum rendern mindestesgröße */
  min-height: 1px;
  /* enable scrolling when content overflows */
  overflow: auto;
}

/* Make Handsontable's master element use column flex layout so the
   header clone and the scrolling body behave as stacked flex children.
   The outer `.table-container` will provide the vertical scrollbar. */
#dienste .table-container .ht_master {
  display: flex;
  flex-direction: column;
  height: 100%;
}
#dienste .table-container .ht_clone_top {
  flex: 0 0 auto;
}

/* Dashboard-like modal button styles (reuse names from dashboard.css) */
.news-modal-btn {
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
}
.news-modal-btn-cancel {
  background: #e0e0e0;
}
.news-modal-btn-save {
  background: var(--accent, #0b76ef);
  color: #fff;
}
.news-modal-btn-delete {
  background: #e53935;
  color: #fff;
}
