/* =========================================================================
   The lab space — internal, signed-in only.

   A working surface rather than a publication: quieter type, denser rhythm,
   a persistent sidebar. It borrows the site's two colours so it still feels
   like the same lab, but never pretends to be the public website.
   ========================================================================= */

body.team {
  background: var(--soft);
  color: var(--ink);
}

.team-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

/* ---- Sidebar ------------------------------------------------------------ */
.team-side {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: var(--paper);
}
.team-side__top { padding: 0 8px 18px; }
.team-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.team-brand:hover { text-decoration: none; color: var(--accent); }
.team-brand img { height: 26px; width: auto; }
.team-brand span { font-size: 0.92rem; font-weight: 700; letter-spacing: -0.01em; }

.team-nav { display: grid; gap: 2px; }
.team-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 500;
}
.team-nav a:hover { background: var(--soft); text-decoration: none; }
.team-nav a[aria-current="page"] { background: var(--soft); color: var(--accent); font-weight: 650; }
.team-nav__icon { color: var(--faint); font-size: 0.9em; width: 1.1em; text-align: center; }
.team-nav a[aria-current="page"] .team-nav__icon { color: var(--accent); }

.team-side__foot { margin-top: auto; padding-top: 20px; display: grid; gap: 2px; }
.team-side__link {
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.86rem;
}
.team-side__link:hover { background: var(--soft); color: var(--accent); text-decoration: none; }

.team-who { margin-top: 14px; padding: 12px 10px 4px; border-top: 1px solid var(--line); }
.team-who__name { margin: 0; font-size: 0.9rem; font-weight: 650; }
.team-who__role { margin: 2px 0 8px; color: var(--faint); font-size: 0.78rem; }
/* "Change password" is a link and "Log out" is a form button. Left to the
   browser those two boxes do not agree — a button brings its own appearance,
   metrics and line-height — so both are normalised to the same block here and
   their text starts on the same line. */
.team-who__link {
  display: block;
  width: 100%;
  margin: 0;
  padding: 5px 0;
  border: 0;
  background: none;
  appearance: none;
  -webkit-appearance: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.6;
  text-align: left;
  cursor: pointer;
}
.team-who__link:hover { color: var(--accent); text-decoration: underline; }
.team-who form { margin: 0; }

/* ---- Main --------------------------------------------------------------- */
/* 1100 rather than 1000: at 1000 the content column came to 888px and the
   intro sentence needed 879 — close enough that a different font metric put
   it onto a second line. */
.team-main {
  padding: 42px clamp(20px, 4vw, 56px) 96px;
  max-width: 1100px;
  width: 100%;
}

.team-flashes { margin-bottom: 26px; display: grid; gap: 8px; }
.team-flash {
  margin: 0;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--paper);
  font-size: 0.94rem;
  line-height: 1.6;
}
/* same as the log-in notice: state in the text, no rail */
.team-flash--error { color: var(--crimson); }
.team-flash--ok { color: #15684b; }

.team-head { margin-bottom: 30px; }
.team-kicker {
  margin: 0 0 10px;
  color: var(--crimson);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.team-head h1 { font-size: clamp(1.7rem, 1.4rem + 1.2vw, 2.15rem); font-weight: 750; letter-spacing: -0.028em; line-height: 1.15; }
/* No measure cap: the deck is a single sentence introducing the page, not a
   block of reading, and capping it left a column of white to its right while
   the sentence wrapped. It uses the width it has and wraps only when the
   window is genuinely too narrow. */
.team-deck { margin-top: 12px; color: var(--muted); font-size: 1rem; line-height: 1.65; word-break: keep-all; }
.team-head .team-btn { margin-top: 20px; }

.team-crumb { margin-bottom: 18px; font-size: 0.86rem; }
.team-crumb a { color: var(--muted); }
.team-crumb a:hover { color: var(--accent); }

/* ---- Buttons ------------------------------------------------------------ */
.team-btn {
  display: inline-block;
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: 600 0.86rem/1.2 var(--font-sans);
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}
.team-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.team-btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.team-btn--primary:hover { background: var(--accent-press); border-color: var(--accent-press); color: #fff; }
.team-btn--danger { color: var(--crimson); }
.team-btn--danger:hover { border-color: var(--crimson); background: var(--crimson); color: #fff; }
.team-btn--small { padding: 6px 12px; font-size: 0.78rem; }

/* ---- Overview cards ----------------------------------------------------- */
.team-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 46px;
}
.team-card {
  display: block;
  padding: 22px 22px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: inherit;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.team-card:hover { border-color: var(--accent); text-decoration: none; box-shadow: 0 14px 30px -22px rgba(16, 20, 24, 0.5); }
.team-card h2 { font-size: 1.06rem; font-weight: 700; letter-spacing: -0.016em; }

/* ---- Blocks and lists --------------------------------------------------- */
.team-block { margin-bottom: 40px; }
.team-block__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.team-block__head h2 { font-size: 1.02rem; font-weight: 700; letter-spacing: -0.014em; }
.team-more { color: var(--muted); font-size: 0.84rem; font-weight: 600; }
.team-more:hover { color: var(--accent); }

.team-list { list-style: none; margin: 0; padding: 0; display: grid; }
.team-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.team-list li:last-child { border-bottom: 0; }
.team-list a { color: var(--ink); font-size: 0.94rem; }
.team-list a:hover { color: var(--accent); }
.team-list__meta { color: var(--faint); font-size: 0.8rem; white-space: nowrap; }
.team-pin { color: var(--crimson); font-size: 0.72em; vertical-align: 0.15em; margin-right: 4px; }

.team-entries { display: grid; gap: 0; border-top: 1px solid var(--line); }
.team-entry-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.team-entry-row h2 { font-size: 1.02rem; font-weight: 650; line-height: 1.45; letter-spacing: -0.012em; }
.team-entry-row h2 a { color: var(--ink); }
.team-entry-row h2 a:hover { color: var(--accent); }
.team-entry-row__sub { margin-top: 5px; color: var(--muted); font-size: 0.9rem; line-height: 1.55; }
.team-entry-row__meta { margin-top: 7px; color: var(--faint); font-size: 0.8rem; }

.team-order { display: flex; gap: 4px; margin: 0; flex: none; }
.team-order button {
  width: 28px; height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
}
.team-order button:hover { border-color: var(--accent); color: var(--accent); }

/* ---- Resources ---------------------------------------------------------- */
.team-resources { display: grid; gap: 12px; }
.team-resource {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.team-resource__main { flex: 1; min-width: 0; }
.team-resource h2 { font-size: 1rem; font-weight: 650; letter-spacing: -0.012em; }
.team-resource h2 a { color: var(--ink); }
.team-resource h2 a:hover { color: var(--accent); }
.team-resource__note { margin-top: 6px; color: var(--muted); font-size: 0.89rem; line-height: 1.55; }
.team-resource__links { display: grid; gap: 5px; text-align: right; flex: none; }
.team-resource__links a { font-size: 0.83rem; font-weight: 600; white-space: nowrap; }

.team-tag {
  display: inline-block;
  margin: 0 0 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.team-tag--off { background: #f6e3e5; color: var(--crimson); }

/* ---- Document ----------------------------------------------------------- */
.team-doc {
  padding: 34px clamp(22px, 3vw, 40px) 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}
.team-doc__head { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.team-doc__head h1 { font-size: clamp(1.5rem, 1.3rem + 1vw, 1.95rem); font-weight: 750; letter-spacing: -0.026em; line-height: 1.2; }
.team-doc__summary { margin-top: 10px; color: var(--muted); font-size: 1rem; line-height: 1.6; }
.team-doc__meta { margin-top: 10px; color: var(--faint); font-size: 0.82rem; }
.team-doc__links { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 22px; }
.team-doc__links a { font-size: 0.88rem; font-weight: 600; }
.team-doc__body { font-size: 1rem; line-height: 1.78; word-break: keep-all; }
.team-doc__body p + p { margin-top: 15px; }
.team-doc__body ul { margin: 12px 0; padding-left: 20px; }
.team-doc__body li { margin-bottom: 7px; }
.team-doc__body strong { font-weight: 650; }
.team-doc__actions { display: flex; gap: 10px; margin-top: 22px; }
.team-doc__actions form { margin: 0; }

/* ---- Forms -------------------------------------------------------------- */
.team-form {
  padding: 26px clamp(20px, 3vw, 32px) 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}
.team-form--narrow { max-width: 460px; }
.team-form--inline { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px 18px; align-items: end; }
.team-field { margin-bottom: 20px; }
.team-form--inline .team-field { margin-bottom: 0; }
.team-field label { display: block; margin-bottom: 7px; font-size: 0.86rem; font-weight: 650; }
.team-req { color: var(--faint); font-weight: 500; font-size: 0.78em; }
.team-field input[type="text"],
.team-field input:not([type]),
.team-field input[type="password"],
.team-field input[type="date"],
.team-field input[type="file"],
.team-field select,
.team-field textarea {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  font: 400 0.94rem/1.6 var(--font-sans);
}
.team-field textarea { resize: vertical; min-height: 100px; }
.team-field input:focus, .team-field select:focus, .team-field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: transparent;
}
.team-field__help { margin-top: 6px; color: var(--faint); font-size: 0.8rem; line-height: 1.5; }
.team-field__current { margin-bottom: 8px; font-size: 0.86rem; color: var(--muted); }
.team-check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.team-check input { width: auto; }
.team-check--inline { margin-left: 12px; font-size: 0.82rem; }
.team-form__actions { display: flex; gap: 10px; margin-top: 8px; }
.team-form--inline .team-form__actions { grid-column: 1 / -1; margin-top: 0; }

.team-empty {
  padding: 48px 24px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  text-align: center;
  color: var(--muted);
}
.team-empty p { margin-bottom: 16px; }

/* ---- Members ------------------------------------------------------------ */
.team-members { display: grid; gap: 10px; }
.team-member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.team-member.is-inactive { opacity: 0.6; }
.team-member__name { margin: 0; font-size: 0.98rem; font-weight: 650; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.team-member__name .team-tag { margin: 0; }
.team-member__meta { margin-top: 4px; color: var(--faint); font-size: 0.82rem; }
.team-member__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.team-member__actions form { margin: 0; }
.team-member__actions select { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; font: 600 0.78rem var(--font-sans); background: var(--paper); }

/* =========================================================================
   Log-in page (rendered inside the public site's shell)
   ========================================================================= */
.auth-page { background: var(--soft); }
.auth-card {
  max-width: 430px;
  margin-inline: auto;
  padding: 40px clamp(24px, 4vw, 40px) 34px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}
.auth-title { font-size: 1.75rem; font-weight: 750; letter-spacing: -0.028em; }
.auth-deck { margin-top: 12px; color: var(--muted); font-size: 0.94rem; line-height: 1.65; word-break: keep-all; }
.auth-flash {
  margin-top: 18px;
  padding: 11px 14px;
  border-radius: 8px;
  background: var(--soft);
  font-size: 0.9rem;
  line-height: 1.55;
}
/* No coloured rail down the side — the message itself carries the state, so
   failure and success still read apart without a bar beside them. */
.auth-flash--error { color: var(--crimson); }
.auth-flash--ok { color: #15684b; }
.auth-form { margin-top: 26px; }
.auth-form label { display: block; margin-bottom: 7px; font-size: 0.84rem; font-weight: 650; }
.auth-form input {
  display: block;
  width: 100%;
  margin-bottom: 18px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font: 400 0.98rem var(--font-sans);
  color: var(--ink);
}
.auth-form input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.auth-submit {
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: 650 0.94rem var(--font-sans);
  cursor: pointer;
  transition: background 150ms ease;
}
.auth-submit:hover { background: var(--accent-press); }
.auth-back { margin-top: 22px; text-align: center; font-size: 0.86rem; }
.auth-back a { color: var(--muted); }
.auth-back a:hover { color: var(--accent); }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 860px) {
  .team-shell { grid-template-columns: 1fr; }
  .team-side {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 16px;
  }
  .team-nav { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .team-nav a { white-space: nowrap; }
  .team-side__foot { margin-top: 14px; grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; align-items: center; }
  .team-who { margin-top: 0; padding: 0 0 0 12px; border-top: 0; border-left: 1px solid var(--line); white-space: nowrap; }
  .team-main { padding: 28px 20px 64px; }
  .team-resource { flex-direction: column; gap: 12px; }
  .team-resource__links { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .team-btn, .team-card, .auth-submit { transition-duration: 0.01ms; }
}
