:root {
  color: #17313a;
  background: #f4f7f7;
  font: 16px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

a {
  color: #087181;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px max(20px, calc((100% - 1180px) / 2));
  background: #fff;
  border-bottom: 1px solid #d6e0e1;
}

.brand {
  color: #075f6c;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
}

nav form {
  margin: 0;
}

nav a,
.link-button {
  padding: 0;
  color: #075f6c;
  background: none;
  border: 0;
  font: inherit;
  text-decoration: none;
}

main {
  width: min(1180px, 100%);
  margin: 28px auto;
  padding: 0 20px 40px;
}

h1 {
  margin: 8px 0;
  font-size: 1.8rem;
}

h2 {
  margin: 28px 0 14px;
  font-size: 1.25rem;
}

h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.muted {
  color: #5a6d73;
}

.card {
  padding: 22px;
  background: #fff;
  border: 1px solid #d6e0e1;
  border-radius: 8px;
}

.login-card,
.form-card,
.error-card {
  max-width: 500px;
  margin: 8vh auto;
}

.page-heading,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h2 {
  margin-bottom: 10px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin: 20px 0 30px;
}

.stat-card strong {
  display: block;
  color: #087181;
  font-size: 2rem;
}

.stat-card span {
  color: #52666c;
}

.two-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}

form {
  display: grid;
  gap: 14px;
  margin: 14px 0;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 650;
}

input,
select,
button,
.button,
.secondary-button {
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid #9eb3b6;
  border-radius: 6px;
  background: #fff;
  color: inherit;
  font: inherit;
}

button,
.button {
  width: max-content;
  background: #087888;
  border-color: #087888;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}

.secondary-button {
  align-self: end;
  color: #075f6c;
  text-decoration: none;
}

.link-button {
  min-height: auto;
  cursor: pointer;
}

.filters {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  margin: 20px 0;
}

.filters label {
  min-width: 210px;
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-weight: 500;
}

.checkbox input {
  min-height: auto;
  margin-top: 4px;
}

.details {
  display: grid;
  grid-template-columns: 190px 1fr;
  margin: 20px 0;
}

.details dt {
  font-weight: 700;
}

.details dd {
  margin: 0 0 10px;
}

.stacked-action {
  padding-bottom: 18px;
  border-bottom: 1px solid #e0e8e9;
}

.danger-zone {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid #e0b5b5;
  border-radius: 7px;
  background: #fffafa;
}

.danger-zone form + form {
  padding-top: 14px;
  border-top: 1px solid #efd2d2;
}

.danger-button {
  background: #a43d3d;
  border-color: #a43d3d;
}

.notice {
  margin: 12px 0;
  padding: 12px 14px;
  background: #e5f2f3;
  border-radius: 6px;
}

.notice.error {
  background: #f8e4e4;
}

.notice.success {
  background: #e4f3e8;
}

.status {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  background: #dceff1;
  white-space: nowrap;
}

.status.blocked {
  background: #f5dddd;
  color: #7e2525;
}

.status.expired {
  background: #eee8db;
  color: #6f5423;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  background: #fff;
  border: 1px solid #d6e0e1;
  border-radius: 7px;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px;
  border-bottom: 1px solid #e2e9ea;
  text-align: left;
  vertical-align: top;
  font-size: 0.88rem;
}

th {
  background: #edf4f4;
}

tr:last-child td {
  border-bottom: 0;
}

.pagination {
  justify-content: center;
  margin: 22px 0;
}

@media (max-width: 760px) {
  .site-header {
    display: block;
  }

  .site-header nav {
    margin-top: 14px;
  }

  main {
    margin-top: 20px;
  }

  .page-heading,
  .section-heading {
    align-items: flex-start;
  }

  .page-heading {
    flex-direction: column;
  }

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

  .details {
    grid-template-columns: 1fr;
  }

  .details dd {
    margin-bottom: 14px;
  }

  .filters {
    display: grid;
  }

  .filters label {
    min-width: 0;
  }

  button,
  .button,
  .secondary-button {
    width: 100%;
    text-align: center;
  }

  .link-button {
    width: auto;
  }
}
