/* Look of the service: the tokens come from the approved mock-up; the type is the system face. */
:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --side: #ebecef;
  --card: #ffffff;
  --inset: #f1f2f5;
  --hover: #f6f7f9;
  --ink: #16181d;
  --ink2: #4b5058;
  --ink3: #5f6672;
  --line: #e4e6eb;
  --line2: #d3d7de;
  --accent: #2463eb;
  --accent-ink: #1d4fc4;
  --accent-soft: #e8effd;
  --good-ink: #156c3c;
  --good-soft: #e0f4e8;
  --bad-ink: #b0252b;
  --bad-soft: #fce8e8;
  --warn-ink: #8a5700;
  --warn-soft: #fbefd5;
  --seg: #e6e8ed;
  --btn: #2463eb;
  --shadow: 0 1px 2px rgba(22, 24, 29, 0.05), 0 8px 24px rgba(22, 24, 29, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0e0f12;
    --side: #15171b;
    --card: #1b1d22;
    --inset: #26292f;
    --hover: #22252b;
    --ink: #f2f3f5;
    --ink2: #b4b8c0;
    --ink3: #979ca6;
    --line: #2b2e35;
    --line2: #3a3e47;
    --accent: #5b8def;
    --accent-ink: #8fb2f7;
    --accent-soft: #1f2b45;
    --good-ink: #6fdb9f;
    --good-soft: #173527;
    --bad-ink: #ff9a9d;
    --bad-soft: #3f1f22;
    --warn-ink: #f2c46d;
    --warn-soft: #3a2c10;
    --seg: #26292f;
    --btn: #2463eb;
    --shadow: 0 0 0 1px #2b2e35;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 12px;
}

.link {
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

button.link {
  margin-top: 16px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Shell: menu on the left, page on the right */

.shell {
  display: flex;
  min-height: 100vh;
}

.side {
  position: sticky;
  top: 0;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 248px;
  height: 100vh;
  padding: 20px 14px;
  overflow-y: auto;
  background: var(--side);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 18px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.side-label {
  margin: 0;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink3);
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  color: var(--ink2);
  font-weight: 500;
  text-decoration: none;
}

.nav:hover {
  background: var(--hover);
}

.nav.is-active {
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow);
}

.nav.is-active .ico {
  color: var(--accent);
}

.nav-button {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.ico {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.side-space {
  flex: 1 1 auto;
  min-height: 16px;
}

.who {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
}

.who-name {
  font-weight: 600;
}

.who-mail {
  font-size: 12px;
  color: var(--ink3);
  overflow-wrap: anywhere;
}

.main {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 1240px;
  padding: 28px 32px 48px;
}

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

.sub {
  max-width: 72ch;
  margin: 4px 0 0;
  color: var(--ink2);
}

/* Cards and figures */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.cards > .card {
  margin-bottom: 0;
}

.card {
  margin-bottom: 16px;
  padding: 20px 22px;
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.card > :last-child {
  margin-bottom: 0;
}

.card-flush {
  padding: 8px 0;
}

.card-label {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink2);
}

.hero {
  margin: 0;
  font-size: 56px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.figure {
  margin: 0;
  font-size: 34px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
  gap: 0 16px;
  align-items: start;
}

/* Tables */

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

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

th {
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink3);
  text-align: left;
  white-space: nowrap;
}

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

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

tbody tr:hover {
  background: var(--hover);
}

.strong {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}

a.strong:hover {
  color: var(--accent-ink);
}

.cell-sub {
  display: block;
  font-size: 12px;
  color: var(--ink3);
}

.is-muted td {
  color: var(--ink3);
}

.nowrap {
  white-space: nowrap;
}

.empty {
  margin: 0;
  padding: 28px 20px;
  color: var(--ink2);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 14px 20px 10px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink3);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 20px 8px;
  border-top: 1px solid var(--line);
}

/* A status with a mark in front, so it never depends on colour alone */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.chip-yes {
  background: var(--good-soft);
  color: var(--good-ink);
}

.chip-yes::before {
  content: "✓";
}

.chip-no {
  background: var(--warn-soft);
  color: var(--warn-ink);
}

.chip-no::before {
  content: "!";
}

.chip-skip {
  background: var(--seg);
  color: var(--ink2);
}

.chip-skip::before {
  content: "–";
}

/* Lists with a header row and nested rows: organizations and their departments */

.group + .group {
  border-top: 1px solid var(--line);
}

.group-head,
.group-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 12px 20px;
}

.group-row {
  padding-left: 40px;
  border-top: 1px solid var(--line);
}

/* Forms */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="time"],
select {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
}

input[type="checkbox"] {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field > label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink2);
}

.field-check > label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}

.has-error input,
.has-error select {
  border-color: var(--bad-ink);
}

.hint {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--ink3);
}

.field .hint {
  margin: 0;
}

.hint ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.error {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--bad-ink);
}

.alert {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bad-soft);
  color: var(--bad-ink);
  font-weight: 600;
}

.alert p {
  margin: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 0 16px;
}

.form-stack {
  display: flex;
  flex-direction: column;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px 14px;
}

.filters input {
  flex: 1 1 220px;
  width: auto;
}

.filters select {
  flex: 0 1 240px;
  width: auto;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: var(--seg);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.button:hover {
  filter: brightness(0.96);
}

.button-primary {
  background: var(--btn);
  color: #ffffff;
}

.button-wide {
  width: 100%;
  min-height: 44px;
}

.button-small {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.message {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
}

.message-success {
  background: var(--good-soft);
  color: var(--good-ink);
}

.message-error {
  background: var(--bad-soft);
  color: var(--bad-ink);
}

.message-warning {
  background: var(--warn-soft);
  color: var(--warn-ink);
}

/* Sign-in pages: one card in the middle of the screen */

.auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 32px;
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.auth-card .brand {
  padding: 0 0 20px;
}

.auth-card h1 {
  margin-bottom: 12px;
  font-size: 28px;
}

.auth-card form {
  margin-top: 16px;
}

.auth-card .hint {
  margin-top: 16px;
}

.lead {
  color: var(--ink2);
}

.steps {
  margin: 0 0 16px;
  padding-left: 20px;
  color: var(--ink2);
}

.steps li {
  margin-bottom: 6px;
}

.qr {
  display: flex;
  justify-content: center;
  margin: 8px 0 12px;
}

.qr svg {
  width: 200px;
  height: 200px;
  border-radius: 12px;
}

.secret {
  margin: 0 0 16px;
  padding: 10px;
  border-radius: 10px;
  background: var(--inset);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.06em;
  text-align: center;
  overflow-wrap: anywhere;
}

.secret-large {
  padding: 14px 16px;
  font-size: 22px;
  text-align: left;
}

/* Phone: the menu becomes a row above the page */

@media (max-width: 760px) {
  .shell {
    flex-direction: column;
  }

  .side {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    width: auto;
    height: auto;
    padding: 12px;
  }

  .brand {
    flex: 1 1 100%;
    padding: 4px 10px 8px;
  }

  .side-label,
  .side-space,
  .who {
    display: none;
  }

  .nav-button {
    width: auto;
  }

  .main {
    padding: 20px 16px 40px;
  }

  h1 {
    font-size: 28px;
  }

  th,
  td {
    padding-left: 16px;
    padding-right: 16px;
  }
}
