* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #07111a;
  color: #e5eef5;
  font-family: Arial, sans-serif;
}

.wrap {
  max-width: 1180px;
  margin: auto;
  padding: 28px;
}

.top,
.send-status-head,
.records-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.top small,
.send-status-head small {
  color: #27c7df;
}

.top h1 {
  margin: 8px 0;
}

.top p,
.records-head p {
  color: #7f96a9;
}

.tabs {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 22px 0;
}

.tabs button,
.toolbar button,
.records-head button {
  padding: 9px 12px;
  border: 1px solid #1d3347;
  background: #0c1a28;
  color: #dce7ee;
  border-radius: 6px;
  cursor: pointer;
}

.tabs button.active {
  color: #23c6df;
  border-color: #23c6df;
}

.page {
  display: none;
  padding: 18px;
  background: #0b1724;
  border: 1px solid #1d3347;
  border-radius: 9px;
}

.page.active {
  display: block;
}

.g2,
.g3 {
  display: grid;
  gap: 11px;
  margin-bottom: 11px;
}

.g2 {
  grid-template-columns: repeat(2, 1fr);
}

.g3 {
  grid-template-columns: repeat(3, 1fr);
}

label {
  display: grid;
  gap: 6px;
  color: #9db0bf;
  font-size: 10px;
}

input,
select,
textarea {
  padding: 10px;
  border: 1px solid #21394d;
  border-radius: 5px;
  background: #07121c;
  color: #e5edf3;
}

select {
  min-height: 38px;
}

input[name="senderBic"],
input[name="receiverBic"],
input[name="assetCurrency"] {
  text-transform: uppercase;
}

input[name="uetr"] {
  font-family: Consolas, monospace;
  letter-spacing: .2px;
}

textarea {
  min-height: 88px;
}

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0;
  padding: 12px;
  background: #071019;
  border: 1px solid #1d3347;
  border-radius: 8px;
}

.primary {
  background: #0d7386 !important;
}

.send-action {
  border-color: #3ab56e !important;
  background: #167746 !important;
  color: #effff5 !important;
  font-weight: 700;
}

.danger {
  color: #ff6d74 !important;
}

button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.send-status {
  margin-top: 14px;
  padding: 17px;
  border: 1px solid #24445a;
  border-radius: 9px;
  background: linear-gradient(145deg, #0a1825, #09141f);
}

.send-status-head {
  align-items: center;
}

.send-status-head h3 {
  margin: 5px 0 0;
}

.status-badge,
.record-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: .6px;
  white-space: nowrap;
}

.status-badge.ready,
.record-status.draft {
  border-color: #47657a;
  background: #132a3a;
  color: #a9bdca;
}

.status-badge.saved {
  border-color: #2c9dba;
  background: #0d3442;
  color: #74dff2;
}

.status-badge.working {
  border-color: #c99835;
  background: #3a2c0b;
  color: #ffd980;
}

.status-badge.sent,
.record-status.sent {
  border-color: #3ab56e;
  background: #103a26;
  color: #8bf0b3;
}

.status-badge.error {
  border-color: #a8444d;
  background: #3b171c;
  color: #ffadb4;
}

.send-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin-top: 15px;
}

.send-step {
  display: grid;
  grid-template-columns: 30px 1fr;
  grid-template-rows: auto auto;
  column-gap: 9px;
  padding: 11px;
  border: 1px solid #263d4d;
  border-radius: 7px;
  background: #0a1520;
}

.send-step i {
  display: grid;
  grid-row: 1 / 3;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #314655;
  color: #e8f3f8;
  font-style: normal;
  font-weight: 700;
}

.send-step small {
  margin-top: 3px;
  color: #748b9a;
}

.send-step.current {
  border-color: #2d9eb8;
  background: #0b2c38;
}

.send-step.current i {
  background: #168ca6;
}

.send-step.working {
  border-color: #b88d34;
  background: #30260e;
}

.send-step.working i {
  background: #ba8721;
}

.send-step.done {
  border-color: #338b58;
  background: #0d2c1e;
}

.send-step.done i {
  background: #239257;
}

.send-step.error {
  border-color: #a8444d;
  background: #32151a;
}

.send-step.error i {
  background: #b23b47;
}

.send-result {
  margin-top: 12px;
  padding: 11px 13px;
  border: 1px solid #2a4659;
  border-radius: 7px;
  background: #0b1b28;
  color: #b9ccd7;
}

.send-result b,
.send-result small {
  display: block;
}

.send-result small {
  margin-top: 4px;
  color: #8dcba7;
}

.send-result.sent {
  border-color: #3b9d64;
  background: #103423;
  color: #91f0b5;
}

.send-result.working {
  border-color: #b88d34;
  color: #ffd980;
}

.send-result.error {
  border-color: #a8444d;
  background: #32151a;
  color: #ffadb4;
}

.send-notice {
  margin: 10px 0 0;
  color: #7f96a9;
  font-size: 10px;
  line-height: 1.45;
}

.panel {
  margin-bottom: 14px;
  padding: 18px;
  background: #0b1724;
  border: 1px solid #1d3347;
  border-radius: 9px;
}

.outputs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.outputs button {
  display: grid;
  grid-template-columns: 52px 1fr;
  grid-template-rows: auto auto;
  gap: 3px 12px;
  padding: 14px;
  border: 1px solid #24445a;
  border-radius: 8px;
  background: #081722;
  color: #eaf3f8;
  text-align: left;
  cursor: pointer;
}

.outputs span {
  display: grid;
  grid-row: 1 / 3;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid #23c6df;
  border-radius: 8px;
  color: #23c6df;
}

.outputs small,
.record small {
  color: #7f96a9;
}

.record {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #173044;
}

.record-main {
  flex: 1;
  min-width: 0;
}

.record small {
  display: block;
  margin-top: 4px;
}

.record button {
  padding: 7px 9px;
  border: 1px solid #2a4a61;
  border-radius: 5px;
  background: #0b1b28;
  color: #dce8ef;
  cursor: pointer;
}

.api-error {
  color: #ff9aa0;
}

#toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(440px, calc(100vw - 36px));
  padding: 10px 14px;
  border: 1px solid #34794a;
  border-radius: 7px;
  background: #0c2d1a;
  color: #80f5a0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}

#toast[data-type="error"] {
  border-color: #8d3840;
  background: #381318;
  color: #ffb0b5;
}

#toast.show {
  opacity: 1;
}

@media (max-width: 850px) {
  .g3,
  .g2,
  .outputs {
    grid-template-columns: 1fr;
  }

  .send-steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .wrap {
    padding: 16px;
  }

  .top,
  .send-status-head,
  .records-head,
  .record {
    align-items: stretch;
    flex-direction: column;
  }

  .send-steps {
    grid-template-columns: 1fr;
  }

  .record-status {
    align-self: flex-start;
  }
}
