.field-note {
  display: block;
  margin-top: 0.2rem;
  color: var(--app-muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

label {
  display: block;
  margin-bottom: 0.38rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--app-text);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea {
  width: 100%;
  border: 1px solid var(--app-border-strong);
  border-radius: 0.45rem;
  background: #fff;
  color: var(--app-text);
  min-height: 2.7rem;
  padding: 0.55rem 0.72rem;
  box-shadow: inset 0 1px 2px rgba(31, 41, 55, 0.03);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):hover,
select:hover,
textarea:hover {
  border-color: #9eacc5;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(var(--bs-primary-rgb), 0.7);
  box-shadow: 0 0 0 0.22rem rgba(var(--bs-primary-rgb), 0.18);
}

input[type="checkbox"],
input[type="radio"] {
  width: 1.1rem;
  height: 1.1rem;
  min-width: 1.1rem;
  accent-color: var(--bs-primary);
  cursor: pointer;
  margin: 0.15rem 0 0;
  flex: 0 0 auto;
}

input[type="checkbox"]:focus,
input[type="radio"]:focus {
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.18);
}

textarea {
  min-height: 140px;
  resize: vertical;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) + label,
select + label,
textarea + label,
.field-note + label,
.checkbox-row + label {
  margin-top: 0.9rem;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) + p,
select + p,
textarea + p,
.checkbox-row + p,
.checkbox-field + p,
form > .app-grid + p,
form > .form-grid + p,
form > .split + p,
form > .stack + p,
.form-actions {
  margin-top: 1rem;
}

form > p:has(> button:only-child) {
  margin-bottom: 0;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

/* Einzeiliges "Feld + Hinzufügen"-Formular: Button vertikal mittig zum Eingabefeld */
.form-row-inline-add {
  align-items: end;
}

.form-row-inline-add .form-actions {
  margin-top: 0;
  min-height: 2.7rem;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin: 0.3rem 0 1rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--app-border);
  border-radius: 0.5rem;
  background: #fff;
  cursor: pointer;
}

.checkbox-row:hover {
  border-color: #a8b8d8;
  background: #f8fbff;
}

.checkbox-row-plain {
  align-items: center;
  margin: 0.85rem 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.checkbox-row-plain:hover {
  border-color: transparent;
  background: transparent;
}

.table-checkbox-row {
  align-items: center;
  margin: 0;
  white-space: nowrap;
}

.table-checkbox-row input[type="checkbox"] {
  margin: 0;
}

.form-inline-toggle-cell {
  display: flex;
  align-items: flex-end;
}

.form-inline-toggle-cell .checkbox-row-plain {
  margin: 0 0 0.7rem;
}

.asset-class-actions .alert,
.asset-form-actions .alert {
  flex-basis: 100%;
  margin: 0;
}

.app-grid > .full-span {
  grid-column: 1 / -1;
}

.date-reminder-grid {
  grid-template-columns: 1fr 2fr;
}

.date-reminder-controls {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.date-reminder-controls .date-reminder-summary {
  grid-column: 1 / -1;
  margin: -0.25rem 0 0;
}

.checkbox-row--field-aligned {
  margin-top: calc(0.92rem * 1.5 + 0.38rem);
}

.checkbox-row strong {
  display: block;
  color: var(--app-text);
  font-size: 0.95rem;
}

.checkbox-row .field-note {
  margin-top: 0.15rem;
}

.form-tabs {
  gap: 0.35rem;
  border-bottom: 0;
  margin-bottom: 1rem;
}

.form-tabs .nav-link {
  border: 1px solid var(--app-border);
  background: #fff;
  color: var(--bs-primary);
  font-weight: 700;
}

.form-tabs .nav-link.active {
  border-color: var(--bs-primary);
  background: rgba(var(--bs-primary-rgb), 0.08);
  color: var(--bs-primary-dark);
}

.form-section + .form-section {
  margin-top: 1rem;
}

.employee-form-actions {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.form-actions-end {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.section-divider {
  margin: 1rem 0;
}

.assigned-employee-display {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface-soft, #f8f9fa);
  border: 1px solid var(--border-color, #dee2e6);
  border-radius: var(--radius, 6px);
}

.assigned-employee-display span {
  flex: 1;
  font-weight: 500;
}

.searchable-select {
  position: relative;
}

.searchable-select.is-enhanced > select {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.searchable-select-input {
  padding-right: 2.4rem;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
}

.searchable-select-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.25rem);
  right: 0;
  left: 0;
  max-height: 18rem;
  overflow-y: auto;
  border: 1px solid var(--app-border-strong);
  border-radius: 0.45rem;
  background: #fff;
  box-shadow: var(--app-shadow-sm);
}

.searchable-select-menu[hidden] {
  display: none;
}

.searchable-select-option,
.searchable-select-empty {
  padding: 0.62rem 0.72rem;
}

.searchable-select-option {
  cursor: pointer;
}

.searchable-select-option + .searchable-select-option {
  border-top: 1px solid var(--app-border);
}

.searchable-select-option:hover,
.searchable-select-option.is-active {
  background: rgba(var(--bs-primary-rgb), 0.1);
}

.searchable-select-option[aria-selected="true"] {
  color: var(--bs-primary);
  font-weight: 700;
}

.searchable-select-empty {
  color: var(--app-text-soft);
  font-size: 0.88rem;
}

.document-template-combobox-control {
  position: relative;
}

.document-template-combobox-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.25rem);
  right: 0;
  left: 0;
  max-height: 18rem;
  overflow-y: auto;
  border: 1px solid var(--app-border-strong);
  border-radius: 0.45rem;
  background: #fff;
  box-shadow: var(--app-shadow-sm);
}

.document-template-combobox-menu[hidden] {
  display: none;
}

.document-template-combobox-option,
.document-template-combobox-empty {
  padding: 0.62rem 0.72rem;
}

.document-template-combobox-option {
  cursor: pointer;
}

.document-template-combobox-option + .document-template-combobox-option {
  border-top: 1px solid var(--app-border);
}

.document-template-combobox-option:hover,
.document-template-combobox-option.is-active {
  background: rgba(var(--bs-primary-rgb), 0.1);
}

.document-template-combobox-option strong,
.document-template-combobox-option span {
  display: block;
}

.document-template-combobox-option span,
.document-template-combobox-empty {
  color: var(--app-text-soft);
  font-size: 0.85rem;
}

.document-generation-auto-fields {
  margin-bottom: 1rem;
}

.document-generation-auto-fields summary {
  color: var(--bs-primary);
  cursor: pointer;
  font-weight: 700;
}

.document-generation-auto-fields .table-wrap {
  margin-top: 0.75rem;
}

.document-source-picker {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--app-border);
}

.document-source-combobox-control {
  position: relative;
}

.document-source-combobox-menu {
  position: absolute;
  z-index: 25;
  top: calc(100% + 0.25rem);
  right: 0;
  left: 0;
  max-height: 18rem;
  overflow-y: auto;
  border: 1px solid var(--app-border-strong);
  border-radius: 0.45rem;
  background: #fff;
  box-shadow: var(--app-shadow-sm);
}

.document-source-combobox-menu[hidden] {
  display: none;
}

.document-source-combobox-option,
.document-source-combobox-empty {
  padding: 0.62rem 0.72rem;
}

.document-source-combobox-option {
  cursor: pointer;
}

.document-source-combobox-option + .document-source-combobox-option {
  border-top: 1px solid var(--app-border);
}

.document-source-combobox-option:hover,
.document-source-combobox-option.is-active {
  background: rgba(var(--bs-primary-rgb), 0.1);
}

.document-source-combobox-option strong,
.document-source-combobox-option span {
  display: block;
}

.document-source-combobox-option span,
.document-source-combobox-empty {
  overflow: hidden;
  color: var(--app-text-soft);
  font-size: 0.85rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
