:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #667085;
  --line: #d8dee7;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --danger: #b42318;
  --ok: #067647;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 60px;
  padding: 0 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

nav {
  display: flex;
  gap: 14px;
  flex: 1;
}

nav a,
.button {
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 600;
}

.topbar form {
  margin-left: auto;
}

.page {
  width: min(1180px, calc(100vw - 32px));
  margin: 28px auto 60px;
}

h1 {
  margin: 0 0 12px;
  font-size: 30px;
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 18px;
}

.grid {
  display: grid;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.two {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.full {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 600;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  font: inherit;
  background: #ffffff;
}

.check {
  display: flex;
  align-items: center;
  gap: 9px;
}

.check input {
  width: 18px;
  min-height: 18px;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 9px 14px;
  background: var(--primary);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.ghost {
  background: transparent;
  color: var(--primary-dark);
  border: 1px solid var(--line);
}

.small {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 14px;
}

.actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  font-size: 13px;
  color: var(--muted);
}

.num {
  text-align: right;
  white-space: nowrap;
}

.muted {
  color: var(--muted);
}

.narrow {
  max-width: 760px;
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 30px;
}

.auth {
  width: min(440px, 100%);
  margin: 72px auto;
}

.messages {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.message {
  padding: 11px 13px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.message.error {
  border-color: #fda29b;
  color: var(--danger);
}

.message.ok {
  border-color: #75e0a7;
  color: var(--ok);
}

@media (max-width: 820px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }

  nav {
    flex-wrap: wrap;
  }

  .topbar form {
    margin-left: 0;
  }

  .two,
  .form-grid {
    grid-template-columns: 1fr;
  }

  table {
    display: block;
    overflow-x: auto;
  }
}
