.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 2px solid rgba(var(--primary-rgb) / 0.2);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.7);
}

.formInModal {
  padding: 0;
  border: none;
  background: transparent;
}

.error {
  font-size: 13px;
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.fieldRow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.fieldRowTriple {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.optionalMark {
  font-weight: 400;
  color: var(--text-muted);
}

.field input,
.field select {
  width: 100%;
  min-height: var(--field-height);
  padding: var(--field-padding-y) var(--field-padding-x);
  font-size: var(--field-font-size);
  font-family: var(--font-fa);
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.field input::placeholder {
  font-family: var(--font-fa);
  color: var(--text-muted);
  opacity: 1;
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-inline-start: var(--field-padding-x);
  padding-inline-end: var(--select-padding-end);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left var(--select-arrow-offset) center;
  background-size: var(--select-arrow-size);
  cursor: pointer;
}

.field input:focus,
.field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb) / 0.12);
}

.formActions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.cancelBtn {
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-secondary);
  background: rgba(148, 163, 184, 0.12);
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.cancelBtn:hover:not(:disabled) {
  background: rgba(148, 163, 184, 0.2);
}

.saveBtn {
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  color: white;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 14px rgba(var(--primary-rgb) / 0.3);
  transition: opacity 0.2s;
}

.saveBtn:disabled,
.cancelBtn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.addRow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border: 2px dashed rgba(148, 163, 184, 0.45);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.45);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.addRow:hover {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb) / 0.06);
}

@media (max-width: 720px) {
  .fieldRow,
  .fieldRowTriple {
    grid-template-columns: 1fr;
  }
}
