:root {
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --text: #22262b;
  --muted: #5f6470;
  --faint: #a2a7b0;
  --line: #e9ecf0;
  --link: #2f5aa8;
  --primary: #2f5aa8;
  --primary-hover: #1f4580;
  --gray: #f0f1f3;
  --panel: #f7f7f8;
  --input: #d3d5da;
  --danger: #791f1f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 16px 20px 48px;
  font: 14px var(--font);
  color: var(--text);
  background: #fff;
}

a {
  color: var(--link);
  text-decoration: none;
}

.account-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.account-user {
  font-weight: 600;
  white-space: nowrap;
}

.nav-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}
.nav-row--sub {
  align-items: center;
  padding: 8px 0 4px;
}
.nav-row--sub .nav-pill {
  font-size: 13px;
}

.nav-pill {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}
.nav-pill--active {
  background: var(--gray);
  color: var(--text);
  font-weight: 600;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 10px 0 12px;
}
.page-head__sub {
  font-size: 12px;
  color: var(--muted);
}
.page-head__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.btn {
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  font: 500 13px var(--font);
  white-space: nowrap;
  color: var(--text);
  background: var(--gray);
  cursor: pointer;
}
.btn:hover {
  background: #e4e6ea;
}
.btn--primary {
  color: #fff;
  background: var(--primary);
}
.btn--primary:hover {
  background: var(--primary-hover);
}
.btn--small {
  padding: 4px 10px;
  font-size: 12px;
}
.btn--block {
  display: block;
  width: 100%;
}
.btn:disabled {
  color: #fff;
  background: #b9c6dd;
  cursor: not-allowed;
}

input,
select {
  padding: 7px 9px;
  border: 1px solid var(--input);
  border-radius: 6px;
  font: 13px var(--font);
  color: var(--text);
  background: #fff;
}
input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 90, 168, 0.15);
}
.input--number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.layout-aside {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 12px;
  align-items: start;
}

.panel {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.panel + .panel {
  margin-top: 12px;
}
.panel__title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
}
.panel__hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
details.panel > summary {
  font-weight: 600;
  cursor: pointer;
}
details.panel[open] > summary {
  margin-bottom: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.form-grid + .panel__title {
  margin-top: 16px;
}
.field label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.field input,
.field select {
  width: 100%;
}
.field--wide {
  grid-column: span 2;
}
.field--full {
  grid-column: 1 / -1;
}

.kpi {
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--panel);
}
.kpi + .panel {
  margin-top: 12px;
}
.kpi__label {
  font-size: 12px;
  color: var(--muted);
}
.kpi__value {
  margin: 3px 0 1px;
  font-size: 21px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.kpi__note {
  font-size: 12px;
  color: var(--muted);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th,
td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th {
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 2px solid var(--input);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--muted);
  background: #fff;
}
.cell--number {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.table--plain td {
  border-bottom: 0;
  padding: 6px 8px 6px 0;
  vertical-align: middle;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 10;
  display: none;
  max-width: 90vw;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13px;
  color: #fff;
  background: var(--text);
  transform: translateX(-50%);
}
.toast--error {
  background: var(--danger);
}
.toast--visible {
  display: block;
}

@media (max-width: 980px) {
  .layout-aside {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .account-user {
    display: none;
  }
}

@media (max-width: 560px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .field--wide {
    grid-column: auto;
  }
}
