:root {
  --accent: #0b76ef;
  --muted: #6b7280;
  --bg: #ffffff;
  --panel-bg: #fbfcfd;
  --border: #e6e9ee;
  --danger: #e11d48;
  --radius: 8px;
  --gap: 8px;
  --shadow: 0 6px 18px rgba(12, 18, 30, 0.06);
}

/* Modal basics */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1200;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 15, 22, 0.45);
}
.modal-panel {
  max-width: 760px;
  width: calc(100% - 40px);
  background: var(--panel-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  border: 1px solid var(--border);
  color: #111827;
  box-sizing: border-box;
}

/* when modal is active, center the panel */
.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal.active .modal-panel {
  margin: auto;
}

/* Modal form layout improvements */
.modal-panel .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px 12px;
}
.modal-panel .modal-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
  color: #0f172a;
}
.modal-panel .modal-body {
  padding: 6px 4px 12px;
}
.modal-panel .modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 8px;
}

.modal-panel form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-panel .form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.modal-panel .form-row.inline {
  flex-direction: row;
  gap: 12px;
  align-items: center;
}
.modal-panel label {
  font-size: 0.95rem;
  color: #374151;
}
.modal-panel input[type="text"],
.modal-panel input[type="date"],
.modal-panel textarea,
.modal-panel select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 0.97rem;
  color: #0f172a;
  transition: box-shadow 0.12s, border-color 0.12s;
  box-sizing: border-box;
}
.modal-panel input:focus,
.modal-panel textarea:focus,
.modal-panel select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(11, 118, 239, 0.08);
}
.modal-panel textarea {
  min-height: 90px;
}

/* Buttons */
.modal-panel .btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
}
.modal-panel .btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}
.modal-panel .btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: #111827;
}

/* Employee preview spacing */
.modal-panel .employee-preview-list {
  margin-top: 6px;
}

@media (max-width: 520px) {
  .modal-panel {
    width: calc(100% - 28px);
    padding: 14px;
  }
  .modal-panel form {
    gap: 10px;
  }
}

/* Employee preview list (used in einteilungen preview) */
.employee-preview-list {
  display: flex;
  gap: var(--gap);
  flex-wrap: wrap;
  align-items: center;
}
.employee-preview-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, #ffffff, #f6f9ff);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 0.95rem;
  color: #0f172a;
}
.employee-preview-item:focus {
  outline: 2px solid rgba(11, 118, 239, 0.15);
}
.employee-preview-item .employee-preview-remove,
.employee-list-item .employee-remove-button {
  margin-left: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
}
.employee-preview-item .employee-preview-remove:hover {
  color: var(--danger);
}

/* tighten visual, make remove button small circular */
.employee-preview-item .employee-preview-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  border: none;
}
.employee-preview-item .employee-preview-remove:hover {
  background: rgba(225, 29, 72, 0.08);
  color: var(--danger);
}

/* name truncation */
.employee-preview-name {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Add button: moved to global `style.css` to keep styles centralized */

/* Generic employee list items (picker and lists) */
.employee-list-item {
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
}
.employee-list-item:hover {
  background: #fff;
  border-color: var(--border);
}
.employee-list-item.selected {
  background: linear-gradient(180deg, #eef6ff, #eef6ff);
  border-color: rgba(11, 118, 239, 0.18);
}

/* ensure preview wrapper has minimum height and sensible vertical alignment */
.employee-preview-list {
  display: flex;
  gap: var(--gap);
  flex-wrap: wrap;
  align-items: center;
  min-height: 42px;
}

/* Small remove button used in lists */
.employee-remove-button {
  margin-left: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
}
.employee-remove-button:hover {
  color: var(--danger);
}

/* Buttons consistency */
.btn-icon.modern {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 6px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-icon.modern:hover {
  background: rgba(11, 118, 239, 0.06);
}

/* Accessibility helpers */
.employee-preview-list,
.einteilungen-list {
  min-height: 40px;
}

/* Dienst name suggestions (autocomplete) */
.dienst-suggestions {
  position: absolute;
  z-index: 1300;
  min-width: 220px;
  max-width: 640px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 8px 26px rgba(12, 18, 30, 0.08);
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.95rem;
}
.dienst-suggestions .item {
  padding: 8px 12px;
  cursor: pointer;
  color: #0f172a;
}
.dienst-suggestions .item:hover,
.dienst-suggestions .item.active {
  background: linear-gradient(
    90deg,
    rgba(11, 118, 239, 0.06),
    rgba(11, 118, 239, 0.02)
  );
}
.dienst-suggestions .item .count {
  float: right;
  color: var(--muted);
  font-size: 0.85rem;
}
