:root {
  --bg: #f6f4ee;
  --surface: #ffffff;
  --ink: #17212a;
  --muted: #66717c;
  --line: #d9ddd8;
  --brand: #9f1d2e;
  --accent: #087b63;
  --warn: #b7791f;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(23, 33, 42, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.45;
}

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

.shell {
  margin: 0 auto;
  max-width: 1180px;
  padding: 28px 18px 48px;
}

.topbar {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 24px;
}

.brand h1 {
  font-size: 26px;
  line-height: 1.1;
  margin: 0;
}

.brand p {
  color: var(--muted);
  margin: 6px 0 0;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.card {
  padding: 22px;
}

.panel {
  overflow: hidden;
}

.panel h2,
.card h2 {
  font-size: 18px;
  margin: 0 0 16px;
}

.grid {
  display: grid;
  gap: 18px;
}

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

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

form {
  display: grid;
  gap: 12px;
}

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

input,
textarea,
select {
  background: #fff;
  border: 1px solid #cfd5d1;
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  min-height: 42px;
  padding: 10px 12px;
  width: 100%;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

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

.button.secondary,
button.secondary {
  background: #26343f;
}

.button.ghost,
button.ghost {
  background: #eef0ed;
  color: var(--ink);
}

.button.danger,
button.danger {
  background: var(--danger);
}

.login-page {
  min-height: 100vh;
}

.login-wrap {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 18px;
}

.login-card {
  max-width: 440px;
  width: 100%;
}

.login-card h1 {
  font-size: 28px;
  margin: 0 0 8px;
}

.login-card p {
  color: var(--muted);
  margin: 0 0 20px;
}

.flash {
  border-radius: 6px;
  font-weight: 700;
  margin-bottom: 16px;
  padding: 12px 14px;
}

.flash.ok {
  background: #e7f5ee;
  color: #0d6b50;
}

.flash.error {
  background: #fdeceb;
  color: var(--danger);
}

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

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

th {
  background: #f0f1ee;
  color: #46515c;
  font-size: 12px;
  text-transform: uppercase;
}

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.checkbox-list {
  display: grid;
  gap: 8px;
  min-width: 260px;
}

.check {
  align-items: flex-start;
  color: var(--ink);
  display: flex;
  font-size: 14px;
  font-weight: 700;
  gap: 8px;
}

.check input {
  margin-top: 3px;
  min-height: auto;
  width: auto;
}

.check small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 400;
}

.badge {
  background: #eef0ed;
  border-radius: 999px;
  color: #46515c;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
}

.badge.good {
  background: #dff4ec;
  color: #0d6b50;
}

.badge.warn {
  background: #fff2d7;
  color: #895b11;
}

.score {
  color: var(--accent);
  font-size: 28px;
  font-weight: 800;
}

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

.team-card {
  display: grid;
  gap: 16px;
}

.team-card header {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.team-accordion {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.team-accordion summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  list-style: none;
  min-height: 78px;
  padding: 18px 22px;
}

.team-accordion summary::-webkit-details-marker {
  display: none;
}

.team-accordion summary::before {
  color: var(--brand);
  content: "+";
  flex: 0 0 auto;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.team-accordion[open] summary::before {
  content: "-";
}

.team-accordion summary > div:first-of-type {
  flex: 1;
}

.team-accordion h2 {
  font-size: 18px;
  margin: 0 0 4px;
}

.team-accordion form {
  border-top: 1px solid var(--line);
  padding: 20px 22px 22px;
}

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

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

@media (max-width: 820px) {
  .grid.two,
  .grid.three,
  .criteria {
    grid-template-columns: 1fr;
  }

  .topbar,
  .team-card header,
  .team-accordion summary {
    align-items: stretch;
    flex-direction: column;
  }

  .team-accordion summary::before {
    align-self: flex-start;
  }

  .nav {
    justify-content: flex-start;
  }
}
