:root {
  color-scheme: light;
  --bg: #eef2f6;
  --ink: #101820;
  --muted: #617080;
  --panel: #ffffff;
  --line: #d9e1ea;
  --nav: #14213d;
  --teal: #087f8c;
  --green: #176f4d;
  --amber: #9b5d00;
  --red: #a13b3b;
  --shadow: 0 14px 34px rgba(20, 33, 61, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 11px 14px;
  background: var(--teal);
  color: #fff;
  font-weight: 750;
  cursor: pointer;
}

button:hover {
  filter: brightness(0.94);
}

button.secondary {
  background: var(--nav);
}

button.ghost {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: transparent;
  color: #fff;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.shell {
  width: min(980px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 14px 42px;
}

.topbar {
  min-height: 118px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 0 -14px 16px;
  padding: 32px 18px 18px;
  background: var(--nav);
  color: #fff;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 5px;
  font-size: 31px;
  line-height: 1;
}

h2 {
  font-size: 18px;
}

.topbar p {
  margin-top: 6px;
  color: #a8c1d9;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.dashboard {
  display: grid;
  gap: 14px;
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 6px;
  margin: 0 -2px;
  padding: 8px 0;
  background: var(--bg);
}

.tab {
  min-height: 40px;
  padding: 8px;
  background: #dde6ef;
  color: var(--ink);
}

.tab.active {
  background: var(--nav);
  color: #fff;
}

.quick-actions {
  display: grid;
  gap: 8px;
}

.quick-actions button {
  width: 100%;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.metrics article,
.panel,
.contract,
.auth-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metrics article {
  padding: 12px;
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metrics strong {
  display: block;
  margin-top: 5px;
  font-size: 25px;
}

.panel,
.auth-panel {
  padding: 16px;
}

.auth-panel {
  width: min(430px, 100%);
  margin-top: 18px;
}

.muted {
  color: var(--muted);
  line-height: 1.5;
}

.section-head,
.form-head,
.contract header,
.deal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.icon-button {
  min-width: 44px;
  width: 44px;
  padding: 0;
  background: #dfe8f1;
  color: var(--nav);
  font-size: 20px;
}

.cards {
  display: grid;
  gap: 11px;
  margin-top: 10px;
}

.contract {
  display: grid;
  gap: 13px;
  padding: 14px;
}

.contract h2 {
  overflow-wrap: anywhere;
}

.contract header p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: #edf3f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.decision-release {
  background: #e7f3ed;
  color: var(--green);
}

.decision-hold,
.decision-manual_review,
.decision-escalate {
  background: #fff4df;
  color: var(--amber);
}

.meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.meta span {
  border-bottom: 1px solid var(--line);
  padding-bottom: 7px;
}

.meta strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 14px;
  overflow-wrap: anywhere;
}

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

.compact {
  grid-template-columns: 1fr;
  margin-top: 14px;
}

.wide,
.form-head {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #fff;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.actions,
.requisites-form,
.payment-form {
  display: grid;
  gap: 10px;
}

.actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.requisites-form,
.payment-form {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.requisites-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.notice {
  border: 1px solid #e6cf9f;
  border-radius: 8px;
  padding: 10px;
  background: #fff9ea;
  color: #705000;
}

.toast {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 18px;
  z-index: 10;
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
}

.hidden {
  display: none !important;
}

@media (max-width: 760px) {
  .grid,
  .meta,
  .metrics,
  .actions,
  .requisites-grid {
    grid-template-columns: 1fr;
  }

  .tabs {
    grid-auto-flow: row;
    grid-template-columns: 1fr 1fr;
  }

  .topbar,
  .form-head,
  .contract header {
    align-items: flex-start;
    flex-direction: column;
  }
}
