:root {
  color: #303030;
  background: #f1f1f1;
  font: 13px/1.45 Inter, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

a {
  color: #005bd3;
  text-decoration: none;
}

h1 {
  margin: 0;
  font-size: 20px;
}

h2 {
  margin: 0 0 12px;
  font-size: 14px;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
}

.icon {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex: none;
}

.top {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 52px;
  padding: 0 20px;
  background: #1a1a1a;
  color: #fff;
}
.top__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-weight: 700;
}
.top__mark {
  display: block;
  width: 28px;
  height: 28px;
}
.top__nav {
  display: flex;
  flex: 1;
  gap: 4px;
}
.top__link {
  padding: 6px 10px;
  border-radius: 8px;
  color: #ccc;
}
.top__link--active {
  background: #303030;
  color: #fff;
}
.top__user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ddd;
  font-size: 12px;
}

.avatar {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #5b5bd6;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}
.avatar--brand {
  border-radius: 8px;
  background: #fff;
  color: #1a1a1a;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.card {
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.07), 0 0 0 1px rgba(0, 0, 0, 0.05);
}
.card--table {
  padding: 0;
}
.card--danger {
  box-shadow: 0 0 0 1px #e51c00;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #303030;
  box-shadow: inset 0 0 0 1px #ccc;
  font: 600 13px Inter, sans-serif;
  cursor: pointer;
}
.btn--primary {
  background: #303030;
  color: #fff;
  box-shadow: none;
}
.btn--danger {
  background: #c70a24;
  color: #fff;
  box-shadow: none;
}
.btn--small {
  padding: 4px 8px;
  font-size: 12px;
}
.btn--block {
  width: 100%;
  justify-content: center;
}
.btn--top {
  background: transparent;
  color: #ddd;
  box-shadow: inset 0 0 0 1px #555;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}
.badge--run {
  background: #e0f0ff;
  color: #00527c;
}
.badge--ok {
  background: #cdfee1;
  color: #0c5132;
}
.badge--err {
  background: #fedad9;
  color: #8e1f0b;
}
.badge--wait {
  background: #ffef9d;
  color: #4f4700;
}
.badge--muted {
  background: #e3e3e3;
  color: #4a4a4a;
}
.badge--dry {
  background: #eadfff;
  color: #4b2a85;
}

.bar {
  width: 100%;
  min-width: 0;
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: #e5e7eb;
}
.bar__fill {
  display: block;
  height: 100%;
  width: 0;
  background: #303030;
}
.bar__fill--run {
  background: #2563eb;
}
.bar__fill--ok {
  background: #16a34a;
}
.bar__fill--err {
  background: #dc2626;
}
.bar--lg {
  height: 10px;
}

.progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.muted {
  color: #616161;
}

.small {
  font-size: 12px;
}

.danger-text {
  color: #8e1f0b;
}

.align-right {
  text-align: right;
}

.kpi {
  margin: 0;
}
.kpi__label {
  color: #616161;
  font-size: 12px;
}
.kpi__value {
  font-size: 22px;
  font-weight: 650;
}
.kpi__value--ok {
  color: #0c5132;
}
.kpi__value--warn {
  color: #5e4200;
}
.kpi__value--err {
  color: #8e1f0b;
}

.grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}
.grid--2 {
  grid-template-columns: 1fr 1fr;
}
.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}
.grid--4 {
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.grid--start {
  align-items: start;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.data-table th {
  padding: 8px;
  border-bottom: 1px solid #e3e3e3;
  background: #f7f7f7;
  color: #616161;
  font-weight: 600;
  text-align: left;
}
.data-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #ebebeb;
  vertical-align: middle;
}

.table-link {
  color: #303030;
}

.summary td {
  padding: 6px 8px 6px 0;
}

.note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #eaf4ff;
  color: #00527c;
  font-size: 12.5px;
}
.note--warn {
  background: #fff5d6;
  color: #5e4200;
}
.note--ok {
  background: #e8f9ef;
  color: #0c5132;
}
.note--err {
  background: #fee9e8;
  color: #8e1f0b;
}

.stepper {
  display: flex;
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.step {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  color: #8a8a8a;
  font-size: 12.5px;
  font-weight: 550;
}
.step__index {
  display: grid;
  width: 24px;
  height: 24px;
  flex: none;
  place-items: center;
  border: 2px solid #ccc;
  border-radius: 50%;
  font-size: 11px;
}
.step--current {
  color: #303030;
}
.step--current .step__index {
  border-color: #303030;
  background: #303030;
  color: #fff;
}
.step--done {
  color: #29845a;
}
.step--done .step__index {
  border-color: #29845a;
  background: #29845a;
  color: #fff;
}

.field {
  display: block;
  margin: 12px 0 4px;
}

.field__label {
  display: block;
  margin-bottom: 4px;
  font-weight: 550;
}

.field__hint {
  display: block;
  margin-top: 4px;
  color: #616161;
  font-size: 12px;
}

.field__input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #8a8a8a;
  border-radius: 8px;
  background: #fff;
  font: 13px Inter, sans-serif;
}
.field__input--inline {
  width: auto;
}

.field--end {
  align-self: end;
}

.field__check {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  font-weight: 400;
}

.module {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid #ebebeb;
}
.module:last-child {
  border-bottom: 0;
}
.module__input {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  accent-color: #303030;
}
.module__body {
  flex: 1;
  min-width: 0;
}
.module__text {
  display: block;
  margin-top: 2px;
  color: #6b7280;
  font-size: 13px;
}
.module__count {
  font-weight: 600;
  white-space: nowrap;
}

.module-card {
  margin-bottom: 0;
  padding: 14px 16px;
}
.module-card__head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.progress-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 16px;
}
.progress-board__col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.statline {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: #616161;
  font-size: 12px;
}
.statline__bad {
  color: #8e1f0b;
}

.foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}
.foot > .btn {
  flex: none;
  align-self: flex-start;
}

.inline {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.inline .field__input {
  width: 320px;
  max-width: 100%;
}

.stack {
  display: grid;
  gap: 8px;
}

.log {
  max-height: 190px;
  margin-top: 10px;
  padding: 12px;
  overflow: auto;
  border-radius: 8px;
  background: #1a1a1a;
  color: #cfcfcf;
  font: 12px/1.6 ui-monospace, Menlo, monospace;
}
.log__line--error {
  color: #ff8a80;
}
.log__line--warn {
  color: #ffd479;
}
.log__ok {
  color: #7ee2a8;
}

.log-block summary {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  cursor: pointer;
}

.login {
  display: grid;
  grid-template-columns: minmax(0, 380px);
  justify-content: center;
  align-content: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 100vh;
  padding: 24px 16px;
}
.login__card {
  width: 100%;
  max-width: 380px;
  box-sizing: border-box;
  padding: 28px;
}
.login__submit {
  margin-top: 20px;
}

.logo {
  margin-bottom: 16px;
}
.logo__image {
  display: block;
  width: auto;
  height: 44px;
}
.logo__subtitle {
  margin: 6px 0 0;
  color: #616161;
  font-size: 12px;
  font-weight: 550;
}

.otp {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}

.otp__digit {
  width: 44px;
  height: 48px;
  border: 1px solid #8a8a8a;
  border-radius: 8px;
  font-size: 20px;
  text-align: center;
}

.secret {
  padding: 8px 10px;
  border-radius: 8px;
  background: #f7f7f7;
  font-family: ui-monospace, Menlo, monospace;
  letter-spacing: 0.04em;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.chip {
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: #f1f1f1;
  color: #303030;
  font-size: 12px;
  font-weight: 550;
}
.chip--on {
  background: #303030;
  color: #fff;
}

.qr {
  width: 160px;
  height: 160px;
  margin: 8px 0 12px;
}
.qr__hint {
  margin: 12px 0 0;
}
.qr__image,
.qr svg {
  display: block;
  width: 160px;
  height: 160px;
}

.invite__submit {
  margin-top: 16px;
}

.copy-field {
  display: flex;
  gap: 8px;
  align-items: center;
}
.copy-field__input {
  flex: 1;
  background: #f7f7f7;
}

.secret-field {
  position: relative;
  display: block;
}
.secret-field[hidden] {
  display: none;
}
.secret-field__input {
  padding-right: 40px;
}
.secret-field__toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #616161;
  cursor: pointer;
  transform: translateY(-50%);
}

.secret-saved {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 36px;
}
.secret-saved[hidden] {
  display: none;
}
.secret-saved__status {
  font-weight: 600;
}
.secret-saved__replace {
  padding: 0;
  border: 0;
  background: transparent;
  color: #005bd3;
  font: inherit;
  cursor: pointer;
}

.help {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f7f7f7;
}
.help__summary {
  font-weight: 600;
  cursor: pointer;
}
.help__steps {
  margin: 10px 0 0;
  padding-left: 20px;
}
.help__steps li {
  margin: 0 0 6px;
}
.help__scopes {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 4px;
  color: #616161;
  word-break: break-word;
}
.help__list {
  flex: 1;
  min-width: 0;
}
.help__copy {
  flex: none;
}

@media (max-width: 420px) {
  .otp {
    gap: 6px;
  }
  .otp__digit {
    width: 40px;
  }
}
@media (max-width: 760px) {
  .top {
    height: auto;
    flex-wrap: wrap;
    align-items: center;
    padding: 8px 12px;
    row-gap: 8px;
  }
  .top__nav {
    order: 3;
    flex: 1 0 100%;
    overflow-x: auto;
  }
  .top__name {
    display: none;
  }
  .wrap {
    padding: 16px 12px;
  }
  .page-head {
    align-items: flex-start;
  }
  .page-head .inline {
    width: 100%;
  }
  .grid--2, .grid--3, .progress-board {
    grid-template-columns: 1fr;
  }
  .grid--4 {
    grid-template-columns: 1fr 1fr;
  }
  .step span {
    display: none;
  }
  .module-card__head {
    align-items: center;
  }
  .data-table thead {
    display: none;
  }
  .data-table tr {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid #ebebeb;
  }
  .data-table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 3px 8px;
    border: 0;
  }
  .data-table td::before {
    content: attr(data-label);
    color: #616161;
    font-weight: 550;
  }
}
