/* =============================================================
   Achieva — Cleaning & Janitorial supervisor app
   Ported from design/SupervisorDashboard.dc.html. Values are the
   design's, measured against the prototype at 1440x900.
   ============================================================= */

@font-face {
  font-family: 'Inter';
  src: url('../fonts/InterVariable.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --teal: #006269;
  --teal-dark: #004a50;
  --purple: #72246c;
  --gold: #ffb81c;
  --green: #7a9a01;
  --red: #ba0c2f;
  --soft-teal: #b6cfd0;
  --soft-gray: #d9d9d6;

  --bg-page: #f0f2f5;
  --bg-card: #ffffff;
  --bg-subtle: #f7f8f9;
  --bg-selected: #f4fafa;

  --border: #e0e6eb;
  --border-subtle: #eef1f4;
  --border-row: #f2f4f6;
  --ring: #c8d1d8;

  --fg-1: #2c3439;
  --fg-2: #5a656c;
  --fg-3: #7d888f;
  --muted: #9aa5ad;

  --badge-green-bg: #edf7ed;
  --badge-red-bg: #fde8ec;

  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(.4, 0, .2, 1);

  --shadow-card: 0 1px 4px rgba(0, 0, 0, .07);
  --shadow-lift: 0 4px 12px rgba(0, 98, 105, .3);

  --sidebar-w: 248px;
  --topbar-h: 64px;
  --container-max: 1400px;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 15px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg-1);
  background: var(--bg-page);
}

button, input, select, textarea { font-family: inherit; }

/* ---------------------------------------------------------------- Shell */

.shell { display: flex; flex-direction: row; width: 100%; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--teal);
  display: flex;
  flex-direction: column;
  padding: 22px 0 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar__brand {
  padding: 0 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}
.sidebar__brand img { height: 30px; width: auto; display: block; }
.sidebar__tagline { font-size: 12.5px; color: rgba(255, 255, 255, .7); }

.sidebar__nav { display: flex; flex-direction: column; }

.sidebar__section {
  padding: 18px 20px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .45);
}
.sidebar__section:first-child { padding-top: 4px; }

.nav-item__icon { flex: 0 0 19px; opacity: .85; }
.nav-item.is-active .nav-item__icon { opacity: 1; }
.nav-item__count {
  margin-left: auto;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 20px;
  background: transparent;
  border: 0;
  border-left: 3px solid transparent;
  color: rgba(255, 255, 255, .82);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: background 200ms var(--ease);
}
.nav-item:hover { background: rgba(255, 255, 255, .08); }
.nav-item.is-active {
  background: rgba(255, 255, 255, .15);
  border-left-color: var(--gold);
  color: #fff;
}

.sidebar__footer {
  margin: auto 0 0;
  padding: 14px 20px 0;
  border-top: 1px solid rgba(255, 255, 255, .16);
}
.sidebar__product { font-size: 12.5px; font-weight: 600; color: rgba(255, 255, 255, .82); }
.sidebar__copyright { font-size: 11.5px; color: rgba(255, 255, 255, .5); margin-top: 2px; }

/* ------------------------------------------------------- Account (topbar) */

.account { display: flex; align-items: center; gap: 12px; margin-left: 6px; }
.account__avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}
.account__who { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.account__name { font-size: 13.5px; font-weight: 600; color: var(--fg-1); }
.account__role { font-size: 11.5px; color: var(--fg-3); }
.account__signout {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px 0 14px;
  margin-left: 2px;
  border: 0;
  border-left: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--fg-2);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color 200ms var(--ease);
}
.account__signout:hover { color: var(--teal); }

.main { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  flex: 0 0 auto;
  height: calc(var(--topbar-h) + 1px);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar__title { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.pill-devices {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--badge-green-bg);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--green);
}
.pill-devices .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--green); display: block; }

.content { flex: 1 1 auto; min-height: 0; padding: 28px 32px; }
.content__inner { max-width: var(--container-max); display: flex; flex-direction: column; gap: 24px; }
.content__inner--builder { gap: 20px; }

/* --------------------------------------------------------------- Buttons */

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  border: 0;
  background: var(--teal);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 200ms var(--ease);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.btn-primary--wide { padding: 0 18px; }

.btn-neutral {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg-subtle);
  color: var(--fg-1);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.btn-neutral:hover { background: #eef1f4; }

.btn-quiet {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--fg-2);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.btn-quiet:hover:not([aria-disabled="true"]) { background: var(--bg-subtle); color: var(--fg-1); }
.btn-quiet[aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* ----------------------------------------------------------------- Cards */

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.card__head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
}
.card__head--wrap { flex-wrap: wrap; gap: 12px; }
.card__title { font-size: 15px; font-weight: 600; }
.card__title--grow { margin-right: auto; }

/* ------------------------------------------------------------------ KPIs */

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}
.kpi {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kpi__label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.kpi__value {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.kpi__sub { font-size: 12.5px; color: var(--fg-2); line-height: 1.4; }

/* -------------------------------------------------------------- Main row */

.row { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.row__left { flex: 1 1 620px; min-width: 420px; display: flex; flex-direction: column; gap: 24px; }
.row__right {
  flex: 1 1 300px;
  min-width: 280px;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ----------------------------------------------------------- Submissions */

.filters { display: contents; }

.select {
  min-height: 38px;
  height: 38px;
  /* A native select sizes to its widest option; `appearance: none` does too,
     which would let a long location name blow the filter row out. Cap it so
     the row stays as compact as the design's. */
  max-width: 190px;
  text-overflow: ellipsis;
  padding: 0 30px 0 10px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 13.5px;
  color: var(--fg-1);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237d888f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.select:focus-visible { outline: 2px solid var(--soft-teal); outline-offset: 1px; }

.table__head,
.table__row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 0.8fr 0.85fr 0.7fr;
  gap: 12px;
}
.table__head {
  padding: 11px 22px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.table__item { border-bottom: 1px solid var(--border-row); transition: background 200ms var(--ease); }
.table__item:hover { background: rgba(0, 98, 105, .03); }
.table__row { padding: 14px 22px; align-items: center; }
.table__task { font-size: 14px; font-weight: 500; line-height: 1.4; }
.table__place { display: flex; flex-direction: column; gap: 2px; }
.table__area { font-size: 13px; color: var(--fg-1); }
.table__loc { font-size: 11.5px; color: var(--fg-3); }
.table__staff { font-size: 13px; color: var(--fg-2); }
.table__when { font-size: 13px; color: var(--fg-2); font-variant-numeric: tabular-nums; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.badge--done { background: var(--badge-green-bg); color: var(--green); }
.badge--not { background: var(--badge-red-bg); color: var(--red); }

.table__notes { padding: 0 22px 14px 22px; display: flex; gap: 10px; }
.table__notes-rule { width: 2px; background: var(--gold); border-radius: 2px; flex: 0 0 2px; }
.table__notes-text { font-size: 13px; color: var(--fg-2); line-height: 1.55; }

.empty { padding: 44px 22px; text-align: center; font-size: 14px; color: var(--fg-2); }
.empty--small { padding: 32px 22px; font-size: 13.5px; }
.empty--builder { padding: 32px 20px; font-size: 13.5px; text-align: left; }

/* The design capped the prototype at 60 rows and asks for real pagination. */
.pager {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--border-row);
  font-size: 12.5px;
  color: var(--fg-2);
  font-variant-numeric: tabular-nums;
}
.pager__spacer { margin-left: auto; display: flex; gap: 8px; }

/* --------------------------------------------------- Completion by area */

.bars { padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; }
.bar { display: flex; flex-direction: column; gap: 7px; }
.bar__head { display: flex; align-items: baseline; gap: 8px; }
.bar__label { font-size: 13.5px; font-weight: 500; }
.bar__text {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--fg-2);
  font-variant-numeric: tabular-nums;
}
.bar__track { height: 8px; border-radius: 999px; background: var(--border-subtle); overflow: hidden; }
.bar__fill { height: 100%; border-radius: 999px; transition: width 200ms var(--ease); }

/* -------------------------------------------------------- Needs follow-up */

.count-pill {
  margin-left: auto;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--badge-red-bg);
  color: var(--red);
  font-size: 11.5px;
  font-weight: 700;
}
.follow {
  padding: 14px 22px;
  border-top: 1px solid var(--border-row);
  display: flex;
  align-items: center;
  gap: 12px;
}
.follow__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 auto; }
.follow__task { font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.follow__meta { font-size: 12px; color: var(--fg-2); }
.follow__clear { flex: 0 0 auto; margin-left: 0; }
.follow__undo {
  padding: 10px 22px;
  border-top: 1px solid var(--border-row);
  background: var(--bg-subtle);
  font-size: 12.5px;
  color: var(--fg-2);
}
.follow__undo-btn {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--teal, var(--fg-1));
  cursor: pointer;
  text-decoration: underline;
}

/* --------------------------------------------------------- Connected iPads */

.device { padding: 14px 22px; border-top: 1px solid var(--border-row); display: flex; align-items: center; gap: 12px; }
.device__dot { width: 9px; height: 9px; border-radius: 999px; display: block; flex: 0 0 9px; }
.device__body { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.device__meta { font-size: 12px; color: var(--fg-2); }

/* iOS will not hand out the user-set device name without an entitlement, so
   the supervisor names each iPad here. Same inline-edit affordance the
   builder uses. */
.device__name {
  min-height: 30px;
  padding: 0 8px;
  margin-left: -8px;
  border: 1.5px solid transparent;
  border-radius: 6px;
  background: transparent;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fg-1);
  width: 100%;
  min-width: 0;
}
.device__name::placeholder { color: var(--muted); font-weight: 400; }
.device__name:hover { border-color: var(--border); }
.device__name:focus { border-color: var(--soft-teal); background: #fff; outline: none; }

.btn-quiet--sm { min-height: 30px; padding: 0 10px; font-size: 12.5px; margin-left: auto; }

/* ------------------------------------------------------------ Pairing QR */

.pairing {
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 6px 28px rgba(0, 98, 105, .14);
  padding: 28px;
  width: min(400px, calc(100vw - 32px));
  color: var(--fg-1);
  background: #fff;
}
.pairing::backdrop { background: rgba(28, 43, 51, .45); }
.pairing__close-form { float: right; margin: -12px -8px 0 0; }
.pairing__close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.pairing__close:hover { background: var(--bg-subtle); color: var(--fg-1); }
.pairing__title { font-size: 18px; font-weight: 700; margin: 0 0 6px; }
.pairing__lead { font-size: 13.5px; color: var(--fg-2); line-height: 1.55; margin: 0 0 18px; }

.pairing__qr {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 232px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}
.pairing__qr svg { width: 200px; height: 200px; display: block; }
.pairing__placeholder { font-size: 13.5px; color: var(--fg-3); }

.pairing__expiry {
  font-size: 12.5px;
  color: var(--fg-2);
  text-align: center;
  margin: 12px 0 0;
  font-variant-numeric: tabular-nums;
  min-height: 20px;
}
.pairing__expiry.is-expired { color: var(--red); font-weight: 600; }

.pairing__manual { margin-top: 16px; font-size: 13px; }
.pairing__manual summary { color: var(--fg-2); cursor: pointer; }
.pairing__manual summary:hover { color: var(--fg-1); }
.pairing__field { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.pairing__label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.pairing__value {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 13px;
  color: var(--fg-1);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  word-break: break-all;
}

.pairing__actions { display: flex; gap: 8px; margin-top: 20px; }

.device__revoked { color: var(--red); font-weight: 600; }
.device__revoke { flex: 0 0 30px; align-self: center; }

.footnote { font-size: 12px; color: var(--fg-3); line-height: 1.6; max-width: 760px; }

/* --------------------------------------------------------------- Builder */

.builder__intro { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.builder__copy { display: flex; flex-direction: column; gap: 6px; max-width: 720px; }
.builder__title { font-size: 18px; font-weight: 700; }
.builder__desc { font-size: 13.5px; color: var(--fg-2); line-height: 1.55; text-wrap: pretty; }
.builder__actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.builder__status { font-size: 12.5px; font-weight: 600; color: var(--fg-3); }
.builder__status.is-saved { color: var(--green); }
.builder__status.is-error { color: var(--red); }

.builder__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 20px;
  align-items: start;
}

.builder-card__head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
}
.builder-card__head--stacked { flex-direction: column; align-items: stretch; gap: 2px; }
.builder-card__title { font-size: 15px; font-weight: 600; }
.builder-card__count { margin-left: auto; font-size: 12px; color: var(--fg-3); }
.builder-card__scope { font-size: 12px; color: var(--fg-3); }

.brow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 10px 20px;
  border-top: 1px solid var(--border-row);
  border-left: 3px solid transparent;
  background: #fff;
}
.brow.is-selected { background: var(--bg-selected); border-left-color: var(--teal); }
.brow--task { gap: 6px; padding: 8px 14px 8px 20px; }

.brow__select {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid var(--ring);
  background: #fff;
  cursor: pointer;
  padding: 0;
}
.brow.is-selected .brow__select { border-color: var(--teal); background: var(--teal); }

.brow__input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 36px;
  padding: 0 8px;
  border: 1.5px solid transparent;
  border-radius: 6px;
  background: transparent;
  font-size: 14px;
  font-weight: 400;
  color: var(--fg-1);
}
.brow.is-selected .brow__input { font-weight: 600; }
.brow__input:hover { border-color: var(--border); }
.brow__input:focus { border-color: var(--soft-teal); background: #fff; outline: none; }
.brow__input--task { font-size: 13.5px; line-height: 1.4; font-weight: 400; }

.brow__meta {
  flex: 0 0 auto;
  font-size: 11.5px;
  color: var(--fg-3);
  min-width: 54px;
  text-align: right;
}
.brow__meta--area { min-width: 48px; }
.brow__num {
  flex: 0 0 auto;
  font-size: 11.5px;
  color: var(--fg-3);
  min-width: 18px;
  font-variant-numeric: tabular-nums;
}

.icon-btn {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 200ms var(--ease), color 200ms var(--ease);
}
.icon-btn--sm { width: 28px; height: 28px; }
.icon-btn--danger:hover { background: var(--badge-red-bg); color: var(--red); }
.icon-btn--move:hover { background: var(--bg-page); color: var(--teal); }

.badd { padding: 14px 20px; border-top: 1px solid var(--border-row); display: flex; gap: 8px; }
.badd__input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 14px;
  color: var(--fg-1);
}
.badd__input:focus { border-color: var(--soft-teal); outline: none; }

/* ---------------------------------------------------------------- People */

.people__grid {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(280px, 1fr);
  gap: 20px;
  align-items: start;
}

.table__head--people {
  grid-template-columns: 1.6fr 1fr 0.9fr 0.9fr 1.1fr;
}

.people-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr 0.9fr 0.9fr 1.1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 22px;
  border-top: 1px solid var(--border-row);
}
.people-row.is-inactive { opacity: .55; }
.people-row__person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.people-row__avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 999px;
  background: var(--bg-selected);
  color: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.people-row__names { display: flex; flex-direction: column; min-width: 0; }
.people-row__name { font-size: 14px; font-weight: 600; }
.people-row__role { font-size: 11.5px; color: var(--fg-3); }
.people-row__username {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 12.5px;
  color: var(--fg-2);
  word-break: break-all;
}
.people-row__access { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.people-row__off { font-size: 11.5px; color: var(--fg-3); }
.people-row__seen { font-size: 12.5px; color: var(--fg-2); }
.people-row__actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.people-row__you { font-size: 12px; color: var(--fg-3); font-weight: 600; }

.badge--admin { background: #e8f4f5; color: var(--teal); }
.badge--member { background: var(--bg-subtle); color: var(--fg-2); }

.badd--stacked { flex-direction: column; align-items: stretch; gap: 12px; }
.badd__title { font-size: 13.5px; font-weight: 600; }
.badd__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.badd__row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.badd__hint { font-size: 12px; color: var(--fg-3); line-height: 1.5; margin: 0; }
.badd__hint.is-saved { color: var(--green); }
.badd__hint.is-error { color: var(--red); }
.badd__hint .is-error { color: var(--red); }
.badd__hint .is-warning { color: #856000; }

.checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg-2); margin-right: auto; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--teal); }

.account-form { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.account-form code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 12.5px;
  background: var(--bg-subtle);
  border-radius: 4px;
  padding: 1px 4px;
}

.source { display: flex; flex-direction: column; gap: 2px; }
.source__label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.source__value {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 12.5px;
  color: var(--fg-1);
  word-break: break-all;
}
.account-form__field { display: flex; flex-direction: column; gap: 6px; }

/* ----------------------------------------------------------------- Staff */

.staff-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 20px;
  border-top: 1px solid var(--border-row);
}
.staff-row__areas {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.staff-row__areas:hover { border-color: var(--soft-teal); color: var(--fg-1); }
.staff-row__areas.is-scoped { background: var(--bg-selected); border-color: var(--soft-teal); color: var(--teal); }

.badd__hint--inset { padding: 12px 20px 0; margin: 0; }

.areas-dialog__list { display: flex; flex-direction: column; gap: 2px; max-height: 46vh; overflow-y: auto; }
.areas-dialog__group {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 0 4px;
}
.areas-dialog__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 6px;
  border-radius: 6px;
  font-size: 13.5px;
  cursor: pointer;
}
.areas-dialog__item:hover { background: var(--bg-subtle); }
.areas-dialog__item input { width: 16px; height: 16px; accent-color: var(--teal); }

.staff-row__id {
  flex: 0 0 auto;
  font-size: 11.5px;
  color: var(--fg-3);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}

.plan { display: flex; flex-direction: column; gap: 6px; }
.plan__row { font-size: 13px; color: var(--fg-2); display: flex; align-items: baseline; gap: 8px; }
.plan__row--warn { color: var(--red); }
.plan__count {
  min-width: 30px;
  font-size: 15px;
  font-weight: 700;
  color: var(--fg-1);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.plan__row--warn .plan__count { color: var(--red); }
.plan__detail { font-size: 12.5px; color: var(--fg-2); line-height: 1.6; margin-top: 10px; }
.plan__detail strong { color: var(--fg-1); font-weight: 600; }
.plan__choice { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

/* ----------------------------------------------------------------- iPads */

.battery { display: flex; align-items: center; gap: 6px; }
.battery__shell {
  position: relative;
  width: 26px;
  height: 13px;
  border: 1.5px solid var(--border-strong, #b0b3b8);
  border-radius: 4px;
  padding: 1.5px;
  flex: 0 0 26px;
}
/* The nub on the end of the cell. */
.battery__shell::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 50%;
  transform: translateY(-50%);
  width: 2.5px;
  height: 5px;
  border-radius: 0 2px 2px 0;
  background: var(--border-strong, #b0b3b8);
}
.battery__fill { display: block; height: 100%; border-radius: 2px; transition: width 200ms var(--ease); }
.battery__label { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.battery__bolt { flex: 0 0 11px; }

.table__head--devices {
  grid-template-columns: 1.4fr 0.9fr 0.8fr 0.8fr 0.8fr 0.55fr 0.8fr 1.3fr;
}
.dev-row { border-top: 1px solid var(--border-row); }
.dev-row:hover { background: rgba(0, 98, 105, .02); }
.dev-row__grid {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr 0.8fr 0.8fr 0.8fr 0.55fr 0.8fr 1.3fr;
  gap: 12px;
  align-items: center;
  padding: 14px 22px 6px;
}
.dev-row__identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dev-row__names { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.dev-row__status-label { font-size: 13px; font-weight: 600; }
.dev-row__cell { min-width: 0; }
.dev-row__value { font-size: 13px; color: var(--fg-1); font-variant-numeric: tabular-nums; }
.dev-row__sub { font-size: 11.5px; color: var(--fg-3); line-height: 1.4; }
.dev-row__actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.dev-row__revoked { font-size: 12px; font-weight: 600; color: var(--red); align-self: center; }
.dev-row__meta { padding: 0 22px 14px; font-size: 11.5px; color: var(--fg-3); }
.dev-row__id { font-family: ui-monospace, 'SF Mono', Menlo, monospace; }

.btn-quiet--danger { color: var(--red); border-color: #f0d3da; }
.btn-quiet--danger:hover:not([aria-disabled="true"]) { background: var(--badge-red-bg); color: var(--red); }

/* ----------------------------------------------------------------- Login */

.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login__card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 6px 28px rgba(0, 98, 105, .14);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.login__brand img { height: 34px; width: auto; display: block; }
.login__title { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.login__sub { font-size: 13.5px; color: var(--fg-2); margin-top: 4px; }
.login__field { display: flex; flex-direction: column; gap: 8px; }
.login__label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.login__input {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 15px;
  color: var(--fg-1);
}
.login__input:focus { border-color: var(--soft-teal); outline: none; }
.login__error { font-size: 13px; color: var(--red); line-height: 1.5; }
.login__submit {
  min-height: 44px;
  border-radius: 8px;
  border: 0;
  background: var(--teal);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms var(--ease);
}
.login__submit:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* The design targets >=1280px. Below that the shell stacks so a supervisor on
   a laptop or tablet still gets a usable page. */
@media (max-width: 1080px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex: 0 0 auto; height: auto; position: static; padding-bottom: 12px; }
  .sidebar__footer { margin: 14px 12px 0; }
  .content { padding: 20px; }
  .builder__grid { grid-template-columns: 1fr; }
  .people__grid { grid-template-columns: 1fr; }
  .badd__grid { grid-template-columns: 1fr; }
  .table__head--people,
  .table__head--devices { display: none; }
  .people-row,
  .dev-row__grid { grid-template-columns: 1fr; gap: 8px; }
  .people-row__actions,
  .dev-row__actions { justify-content: flex-start; }
}
