.qof {
  --qof-border: #d8dee4;
  --qof-muted: #667085;
  --qof-text: #1f2933;
  --qof-bg: #ffffff;
  --qof-soft: #f6f8fa;
  --qof-green: #218838;
  --qof-green-dark: #17692a;
  --qof-error: #b42318;
  --qof-success: #1f7a3f;
  color: var(--qof-text);
  margin: 24px 0;
}

.qof__header {
  margin-bottom: 16px;
}

.qof__title {
  font-size: 26px;
  line-height: 1.2;
  margin: 0 0 8px;
}

.qof__subtitle {
  color: var(--qof-muted);
  margin: 0;
}

.qof__message {
  border: 1px solid var(--qof-border);
  border-radius: 6px;
  margin-bottom: 14px;
  padding: 10px 12px;
}

.qof__message--success {
  background: #ecfdf3;
  border-color: #abefc6;
  color: var(--qof-success);
}

.qof__message--error {
  background: #fef3f2;
  border-color: #fecdca;
  color: var(--qof-error);
}

.qof__table {
  border: 1px solid var(--qof-border);
  border-radius: 8px;
  overflow: visible;
  background: var(--qof-bg);
}

.qof__row {
  display: grid;
  grid-template-columns: minmax(190px, 1.1fr) minmax(190px, 1fr) 90px minmax(110px, 0.55fr) 48px;
  min-height: 56px;
}

.qof__row + .qof__row {
  border-top: 1px solid var(--qof-border);
}

.qof__row--head {
  background: var(--qof-soft);
  color: #344054;
  font-weight: 700;
  min-height: 44px;
}

.qof__cell {
  align-items: center;
  display: flex;
  min-width: 0;
  padding: 8px;
  position: relative;
}

.qof__cell + .qof__cell {
  border-left: 1px solid var(--qof-border);
}

.qof__autocomplete-wrap {
  position: relative;
  width: 100%;
}

.qof__input {
  background: #ffffff;
  border: 1px solid #cfd6dd;
  border-radius: 6px;
  box-sizing: border-box;
  color: var(--qof-text);
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

.qof__input:focus {
  border-color: #62a8ea;
  box-shadow: 0 0 0 3px rgba(98, 168, 234, 0.22);
  outline: none;
}

.qof__input--readonly {
  background: #f9fafb;
  color: #475467;
}

.qof__autocomplete {
  background: #ffffff;
  border: 1px solid var(--qof-border);
  border-radius: 6px;
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.15);
  left: 0;
  max-height: 300px;
  overflow-y: auto;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
}

.qof__option {
  background: #ffffff;
  border: 0;
  border-bottom: 1px solid #eef2f6;
  color: var(--qof-text);
  cursor: pointer;
  display: block;
  padding: 10px 12px;
  text-align: left;
  width: 100%;
}

.qof__option:hover,
.qof__option:focus {
  background: #f3f7fb;
  outline: none;
}

.qof__option-name {
  display: block;
  font-weight: 700;
  line-height: 1.3;
}

.qof__option-meta {
  color: var(--qof-muted);
  display: block;
  font-size: 13px;
  margin-top: 3px;
}

.qof__remove {
  align-items: center;
  background: #ffffff;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  color: #667085;
  cursor: pointer;
  display: inline-flex;
  font-size: 22px;
  height: 34px;
  justify-content: center;
  line-height: 1;
  width: 34px;
}

.qof__remove:hover {
  border-color: #fda29b;
  color: var(--qof-error);
}

.qof__controls {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

.qof__button {
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  min-height: 42px;
  padding: 10px 18px;
}

.qof__button--primary {
  background: var(--qof-green);
  color: #ffffff;
}

.qof__button--primary:hover,
.qof__button--primary:focus {
  background: var(--qof-green-dark);
}

.qof__button--secondary {
  background: #ffffff;
  border-color: #98a2b3;
  color: #344054;
}

.qof__button:disabled {
  cursor: wait;
  opacity: 0.65;
}

@media (max-width: 768px) {
  .qof__row {
    display: block;
    min-height: 0;
    padding: 10px;
  }

  .qof__row--head {
    display: none;
  }

  .qof__cell {
    align-items: stretch;
    display: block;
    padding: 7px 0;
  }

  .qof__cell + .qof__cell {
    border-left: 0;
  }

  .qof__cell::before {
    color: #475467;
    content: attr(data-label);
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 5px;
  }

  .qof__cell--actions::before {
    content: '';
    display: none;
  }

  .qof__controls {
    align-items: stretch;
    flex-direction: column;
  }

  .qof__button {
    width: 100%;
  }
}
