
/* ATLAS_IOF_REFERENCES_UI_V1 */

.iof-references-card {
  margin-top: 20px;
  padding: 22px;
  border: 1px solid #dfe7e2;
  border-radius: 14px;
  background: #fff;
}

.iof-references-card h4 {
  margin: 0 0 8px;
  font-size: 19px;
}

.iof-references-card h5 {
  margin: 22px 0 12px;
  font-size: 15px;
}

.iof-ref-muted,
.iof-ref-status {
  color: #69776f;
  font-size: 13px;
  line-height: 1.5;
}

.iof-ref-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.iof-ref-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
}

.iof-ref-field input,
.iof-ref-field select,
.iof-ref-field textarea {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  border: 1px solid #ccd8d0;
  border-radius: 9px;
  padding: 11px 12px;
  background: #fff;
  color: #22392e;
  font: inherit;
  font-weight: 400;
}

.iof-ref-field:last-of-type {
  grid-column: 1 / -1;
}

.iof-ref-save {
  grid-column: 1 / -1;
  padding: 13px 18px;
  border: 0;
  border-radius: 9px;
  background: #17643d;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.iof-ref-save:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.iof-ref-status {
  grid-column: 1 / -1;
  margin: 0;
}

.iof-ref-list {
  display: grid;
  gap: 10px;
}

.iof-ref-item {
  padding: 14px;
  border: 1px solid #e0e9e3;
  border-radius: 10px;
  background: #fafcfb;
}

.iof-ref-item strong {
  display: inline-block;
  margin-right: 12px;
  overflow-wrap: anywhere;
}

.iof-ref-item p {
  margin: 7px 0 0;
  font-size: 13px;
}

.iof-ref-badge {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 15px;
  background: #f5edd8;
  color: #80611c;
  font-size: 11px;
  font-weight: 700;
}

@media (max-width: 700px) {
  .iof-references-card { padding: 15px; }
  .iof-ref-form { grid-template-columns: 1fr; }
}


/* ATLAS_IOF_REFERENCE_ACTIONS_V2 */
.iof-ref-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.iof-ref-edit,
.iof-ref-archive,
.iof-ref-cancel {
  padding: 9px 15px;
  border: 1px solid #cbd9d0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.iof-ref-edit {
  background: #eef7f1;
  color: #17643d;
}

.iof-ref-archive {
  background: #fff3f1;
  border-color: #eccbc5;
  color: #a23e32;
}

.iof-ref-cancel {
  grid-column: 1 / -1;
  background: #f5f7f6;
  color: #42584c;
}

.iof-ref-cancel[hidden] {
  display: none !important;
}

.iof-ref-edit:disabled,
.iof-ref-archive:disabled {
  opacity: .5;
  cursor: not-allowed;
}


/* ATLAS_IOF_ARCHIVE_MODAL_V1 */
.iof-ref-modal-overlay[hidden] {
  display: none !important;
}

.iof-ref-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(14, 29, 22, 0.62);
  backdrop-filter: blur(3px);
}

.iof-ref-modal {
  width: min(100%, 520px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-sizing: border-box;
  padding: 28px;
  border: 1px solid #dce8df;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0,0,0,.24);
  color: #283f35;
}

.iof-ref-modal h3 {
  margin: 0 0 12px;
  font-size: 21px;
  font-weight: 750;
}

.iof-ref-modal-code {
  display: inline-block;
  max-width: 100%;
  margin: 0 0 16px;
  padding: 7px 11px;
  border-radius: 7px;
  background: #edf4ee;
  color: #21613f;
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.iof-ref-modal-description {
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.6;
  color: #62746a;
}

.iof-ref-modal-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
}

.iof-ref-modal-reason {
  display: block;
  width: 100%;
  min-height: 105px;
  box-sizing: border-box;
  padding: 13px;
  border: 1px solid #cad8ce;
  border-radius: 9px;
  resize: vertical;
  background: #fff;
  color: #283f35;
  font: inherit;
  font-size: 14px;
}

.iof-ref-modal-reason:focus {
  outline: 2px solid #85b99b;
  border-color: #17643d;
}

.iof-ref-modal-hint {
  margin: 7px 0 10px;
  color: #7b8980;
  font-size: 12px;
}

.iof-ref-modal-error {
  margin: 0;
  color: #a33c30;
  font-size: 13px;
}

.iof-ref-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.iof-ref-modal-cancel,
.iof-ref-modal-confirm {
  padding: 12px 17px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.iof-ref-modal-cancel {
  border: 1px solid #d4dfd7;
  background: #f5f7f6;
  color: #40574a;
}

.iof-ref-modal-confirm {
  border: 1px solid #a43a32;
  background: #a43a32;
  color: #fff;
}

.iof-ref-modal-confirm:disabled {
  opacity: .45;
  cursor: not-allowed;
}

@media (max-width: 600px) {
  .iof-ref-modal {
    padding: 20px;
  }

  .iof-ref-modal-actions {
    flex-direction: column-reverse;
  }

  .iof-ref-modal-actions button {
    width: 100%;
  }
}


/* ATLAS_IOF_REFERENCE_HISTORY_UI_V1 */
.iof-ref-history {
  margin-top: 24px;
  border: 1px solid #dce6df;
  border-radius: 12px;
  background: #f9fbfa;
  overflow: hidden;
}

.iof-ref-history-heading {
  padding: 17px 20px;
  color: #294939;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.iof-ref-history-heading:hover {
  background: #f0f6f2;
}

.iof-ref-history-content {
  display: grid;
  gap: 12px;
  padding: 16px 20px 20px;
  border-top: 1px solid #e2ebe5;
}

.iof-ref-history-item {
  padding: 15px;
  border: 1px solid #e0e6e2;
  border-radius: 10px;
  background: #fff;
}

.iof-ref-history-item strong {
  overflow-wrap: anywhere;
}

.iof-ref-history-item p {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
}

.iof-ref-history-reason {
  color: #364e41;
}
