/* ============================================================
   Office OS — common.css
   Shared across Company, Admin, and Client panels.
   Design tokens, reset, app shell (sidebar + topbar), and
   reusable atoms (avatar, chips/pills, buttons, progress bar, card).
   Panel-specific styles live in <panel>.css (e.g. company.css).
   ============================================================ */

:root {
  /* Surfaces */
  --app-bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --side-bg: #ffffff;
  --top-bg: #ffffff;
  --field-bg: #f8fafc;
  --gray-bg: #eef2f7;
  --hover: #e6f6fd;
  --active-bg: #eef2f7;

  /* Text */
  --text: #0f1b2d;
  --text-2: #33435a;
  --muted: #66768c;
  --muted-2: #7a8aa0;

  /* Lines */
  --line: #e3e9f1;
  --line-strong: #d6dfea;

  /* Accent (Ink sky) */
  --accent: #0ea5e9;
  --accent-hover: #0284c7;
  --accent-fg: #ffffff;
  --accent-soft: #e6f6fd;
  --accent-deep: #0377a8;
  --accent-line: #b7e3f6;

  /* Status colours (meanings stay the same in every theme) */
  --run-bg: #e8effd;
  --run-fg: #2563eb;
  --hold-bg: #faf0dc;
  --hold-fg: #9a6b0c;
  --done-bg: #e4f3ec;
  --done-fg: #177a5b;
  --cancel-bg: #fbeaea;
  --cancel-fg: #b23b3b;
  --pending-bg: #eeedfb;
  --pending-fg: #5b4fc7; /* Task status: Pending — deliberately distinct from Hold's amber, see Task::STATUS_KEYS */

  /* Named colour palette — the source of truth for .chip--*, .bg-* and
     .text-* utility classes. Any status/tag anywhere in the app picks one
     of these six colours instead of getting its own semantic token. The
     -line shades are the matching border colours. */
  --red-bg: #fbeaea;
  --red-fg: #b23b3b;
  --red-line: #efc6c6;
  --green-bg: #e4f3ec;
  --green-fg: #177a5b;
  --green-line: #bee6d3;
  --blue-bg: #e8effd;
  --blue-fg: #2563eb;
  --blue-line: #c9daf1;
  --orange-bg: #faf0dc;
  --orange-fg: #9a6b0c;
  --orange-line: #edd6a3;
  --purple-bg: #eeedfb;
  --purple-fg: #5b4fc7;
  --purple-line: #d9d3f5;
  --gray-fg: #66768c;

  /* Category colours, reused by the task type badges below. */
  --cat-issue-bg: #fdeedc;
  --cat-issue-fg: #b36b12;
  --cat-sugg-bg: #efeafb;
  --cat-sugg-fg: #6a3fb2;

  /* Task type badges (Feature/Bug/Improvement/Research) — .tktype in
     company.css. Bug reuses --red-*, Improvement --cat-sugg-*, Research
     --cat-issue-*; Feature is the only new hue. */
  --type-feature-bg: #dcf2ef;
  --type-feature-fg: #0d7d72;

  --side-w: 208px;
  --top-h: 52px;
  --r: 9px;
  --shadow: 0 1px 2px rgba(15, 27, 45, 0.04), 0 12px 32px -24px rgba(15, 27, 45, 0.3);
  --card-shadow: 0 1px 2px rgba(15, 27, 45, 0.05);
  --card-shadow-h: 0 4px 12px -2px rgba(15, 27, 45, 0.1), 0 2px 6px -2px rgba(15, 27, 45, 0.06);
  --ink: #0f1b2d;
  --focus-ring: none;
  --focus-border: var(--text);
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
/* the hidden attribute always hides, even on elements whose class sets a display */
[hidden] {
  display: none !important;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: var(--app-bg);
  color: var(--text);
  font: 400 14px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* was: outline: 2px solid var(--live) on every focused element —
   removed (2026-09-28) per request; inputs/selects/etc. already get their
   own focus treatment (border-color highlight, sometimes a box-shadow ring)
   from their own component rules (.field input:focus, .tree__search:focus-
   within, and friends throughout company.css), so this global ring was
   redundant and inconsistent with those wherever a component hadn't
   defined its own — new fields should follow suit and add their own
   :focus/:focus-within rule rather than relying on this. */
:focus-visible {
  outline: none;
}
/* Links: no underline (not even on hover), dark text, and on hover only a little softer. Buttons, tabs, nav,
   chips and menu items keep their own styles, so the softening is switched off for them below. */
a {
  color: inherit;
  text-decoration: none;
  opacity: 1;
  transition: opacity 0.12s;
}
a:hover {
  opacity: 0.8;
}
.btn:hover,
.tab:hover,
.brand:hover,
.nav a:hover,
.side__foot a:hover,
.icon-btn:hover,
.pmenu__item:hover,
.chip:hover,
.wkrow:hover,
.tprow:hover,
.searchrow:hover,
.people__row:hover,
.notif:hover,
.fchip:hover,
.rpswitch a:hover,
.seg a:hover,
.pagination a:hover,
.mpick-item:hover,
.pagehead__act:hover,
.avatar:hover {
  opacity: 1;
}

/* One scrollbar style everywhere: 8px for the page and main content, 6px elsewhere.
   Standard properties only without ::-webkit-scrollbar, since Chrome ignores the pseudo-elements once they are set. */
@supports not selector(::-webkit-scrollbar) {
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
  }
}
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
html::-webkit-scrollbar,
.content::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 100px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted-2);
}

.app {
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ===================== SIDEBAR ===================== */
.side {
  background: var(--side-bg);
  border-right: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto 1fr auto;
  position: sticky;
  top: 0;
  /* the shell's layers, here and on .topbar: its menus (space switcher, profile, bell, topbar popovers) live inside
     these two, so both sit above every page card and sticky bar (30 or less); page popovers and windows (50 and up)
     still open over them. The sidebar is above the topbar: the switcher opens over the topbar. */
  z-index: 45;
  height: 100vh;
  overflow: hidden;
}
/* the head: brand row, then the product box (the switcher) */
.side__head {
  padding: 12px 10px 10px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 4px 10px;
  text-decoration: none;
}
.brand__mark {
  width: 25px;
  height: 25px;
  border-radius: 7px;
  background: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12.5px;
  color: var(--accent-fg);
  flex: 0 0 auto;
  box-shadow: 0 2px 6px -1px color-mix(in srgb, var(--accent) 45%, transparent);
}
/* a column that scrolls when taller than the screen (min-height: 0 lets the grid row shrink) */
.nav {
  padding: 10px 8px 6px;
  overflow: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.nav__group {
  margin-bottom: 8px;
}
/* a count on the right of a sidebar link */
.nav a .side__count {
  margin-left: auto;
  padding: 0 7px;
  font-size: 11.5px;
}
/* the API sidebar's Recent: a letter square and the collection name */
.side__recentico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 10px;
  font-weight: 700;
}
.side__recentname {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav__group--admin {
  margin-bottom: 0;
}
.nav__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 0 8px 4px;
}
/* a group title: plain bold text and a chevron, dark when open and muted when closed */
button.nav__label {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px 9px 5px;
  border: 0;
  border-radius: 7px;
  background: none;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: background 0.13s;
}
button.nav__label:hover {
  background: var(--hover);
}
button.nav__label .chev {
  margin-left: auto;
}
.nav__group.is-open > button.nav__label {
  color: var(--text);
}
.nav__group:not(.is-open) .nav__items {
  display: none;
}

/* Disclosures: no browser marker on any summary; one chevron (x-chevron) that only rotates when open */
summary {
  list-style: none;
}
summary::-webkit-details-marker {
  display: none;
}
summary::marker {
  content: "";
}
.chev {
  display: inline-flex;
  flex: none;
  width: 14px;
  height: 14px;
  vertical-align: middle;
  color: var(--muted);
  transform-origin: 50% 50%;
  transition: transform 0.15s;
}
details[open] > summary .chev,
[aria-expanded="true"] .chev {
  transform: rotate(90deg);
}
@media (prefers-reduced-motion: reduce) {
  .chev {
    transition: none;
  }
}
.nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 9px;
  margin-bottom: 1px;
  border-radius: 7px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 450;
  line-height: 1.2;
  position: relative;
  transition:
    background 0.13s,
    color 0.13s;
}
.nav a svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--muted);
  transition: color 0.13s;
}
.nav a:hover {
  background: var(--hover);
  color: var(--text);
}
.nav a:hover svg {
  color: var(--text-2);
}
/* the one highlight: the current page */
.nav a.on {
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 600;
}
.nav a.on svg {
  color: var(--accent-deep);
}
.side__foot {
  border-top: 1px solid var(--line);
  padding: 8px;
}
.side__foot a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 9px;
  margin-bottom: 1px;
  border-radius: 7px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 450;
  line-height: 1.2;
  transition:
    background 0.13s,
    color 0.13s;
}
.side__foot a svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--muted);
  transition: color 0.13s;
}
.side__foot a:hover {
  background: var(--hover);
  color: var(--text);
}
.side__foot a:hover svg {
  color: var(--text-2);
}
.side__foot a.on {
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 600;
}
.side__foot a.on svg {
  color: var(--accent-deep);
}

/* ===================== MAIN ===================== */
.main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: var(--top-h) 1fr;
}
.topbar {
  background: var(--top-bg);
  border-bottom: 1px solid var(--line);
  padding: 0 18px;
  position: sticky;
  top: 0;
  z-index: 40; /* the shell's layer, see .side */
  display: flex;
  align-items: center;
  gap: 12px;
}
.content {
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  scrollbar-gutter: stable;
}
/* a page with a save bar ends on the bar itself, flush with the bottom */
.content:has(.savebar) {
  padding-bottom: 0;
}
/* on a short page the bar's container (the content, or Settings' open panel) fills the window
   and an empty spacer before the bar takes the spare height, so the bar stays at the bottom */
.content:has(> .savebar),
.content:has(> .panel > .savebar),
.content > .panel.on:has(> .savebar) {
  display: flex;
  flex-direction: column;
}
.content:has(> .savebar) > *,
.content:has(> .panel > .savebar) > *,
.content > .panel.on:has(> .savebar) > * {
  flex-shrink: 0;
}
.content > .panel.on:has(> .savebar) {
  flex-grow: 1;
}
.content:has(> .savebar)::after,
.content > .panel.on:has(> .savebar)::after {
  content: "";
  flex: 1 0 0;
  order: 1;
}
.content > .savebar,
.content > .panel.on > .savebar {
  order: 2;
}
/* a bar marked bleed-top sits flush under the top bar when it opens the page */
.content:has(> .bleed-top:first-child) {
  padding-top: 0;
}
/* ===================== shared bits ===================== */
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-fg);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  flex: 0 0 auto;
  object-fit: cover;
}
/* the 3 sizes <x-avatar> (components/avatar.blade.php) picks between —
   centralized here so a size only ever needs changing in one place. Plain
   .avatar with no modifier (30px) is the old ambient default from before
   this existed; nothing new should render that bare. */
.avatar--sm {
  width: 26px;
  height: 26px;
  font-size: 10px;
} /* compact rows — chips, chat, pick lists */
.avatar--md {
  width: 38px;
  height: 38px;
  font-size: 13px;
} /* the Members list */
.avatar--lg {
  width: 56px;
  height: 56px;
  font-size: 18px;
} /* profile-header-style spots — placeholder size, not yet confirmed */
/* <x-avatar-stack> — small overlapping avatars + a "N members" label. The
   -8px overlap and white ring only apply here (.avatar itself stays plain
   everywhere else it's used), so they're their own class layered onto
   <x-avatar>'s size="small" output via its $attributes->merge(), not a
   variant on .avatar. */
.avatarstack {
  display: flex;
  align-items: center;
  gap: 8px;
}
.avatarstack__group {
  display: inline-flex;
}
.avatarstack__av {
  border: 2px solid var(--surface);
  margin-left: -8px;
}
.avatarstack__av:first-child {
  margin-left: 0;
}
/* rotating dark palette for the stack's initials circles (white text stays
   readable on all six) — reuses the app's existing status-color tokens
   instead of inventing new ones, just picked for contrast here rather than
   status meaning. A photo avatar ignores this (the image covers it).
   Selector is .avatarstack__av.avatarstack__av--N (both classes) rather
   than .avatarstack__av--N alone — two classes outweigh .avatar's one, so
   this wins on specificity no matter which rule ends up later in the file. */
.avatarstack__av.avatarstack__av--0 {
  background: var(--blue-fg);
}
.avatarstack__av.avatarstack__av--1 {
  background: var(--green-fg);
}
.avatarstack__av.avatarstack__av--2 {
  background: var(--purple-fg);
}
.avatarstack__av.avatarstack__av--3 {
  background: var(--orange-fg);
}
.avatarstack__av.avatarstack__av--4 {
  background: var(--red-fg);
}
.avatarstack__av.avatarstack__av--5 {
  background: var(--text-2);
}
.avatarstack__more {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--app-bg);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  flex: 0 0 auto;
}
.avatarstack__label {
  font-size: 12.5px;
  color: var(--muted);
}
.avatarstack__empty {
  font-size: 12.5px;
  color: var(--muted-2);
  font-style: italic;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  white-space: nowrap;
  flex: 0 0 auto;
  justify-self: start;
  justify-content: center;
}
.chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* colour modifiers — pick one per chip (e.g. <span class="chip chip--green">).
   Add .chip--outline for a bordered/no-fill variant, .chip--nodot to drop
   the leading dot. Same six colours as the bg/text utilities below. */
.chip--red {
  background: var(--red-bg);
  color: var(--red-fg);
}
.chip--green {
  background: var(--green-bg);
  color: var(--green-fg);
}
.chip--blue {
  background: var(--blue-bg);
  color: var(--blue-fg);
}
.chip--orange {
  background: var(--orange-bg);
  color: var(--orange-fg);
}
.chip--gray {
  background: var(--gray-bg);
  color: var(--gray-fg);
}
.chip--purple {
  background: var(--purple-bg);
  color: var(--purple-fg);
}

/* background/text colour utilities — usable on any element, not just chips */

.projchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  min-width: 0;
}
.projchip .pdot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font: 600 13px/1 var(--sans);
  padding: 9px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition:
    background 0.13s,
    border-color 0.13s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover {
  background: var(--hover);
}
.btn svg {
  width: 16px;
  height: 16px;
}
.btn--sm {
  padding: 6px 12px;
  font-size: 12px;
}
.btn--start {
  color: var(--run-fg);
  border-color: var(--accent-line);
  background: var(--surface);
  font-weight: 600;
}
.btn--start:hover {
  background: var(--run-bg);
}

.bar {
  height: 7px;
  border-radius: 100px;
  background: var(--gray-bg);
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  border-radius: 100px;
  background: var(--text-2);
}

/* ===================== card shell (cards float directly on app-bg) ===================== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}
.card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
}
.card__title {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.card__sub {
  font-size: 12px;
  color: var(--muted);
  font-weight: 450;
}
.card__head .spacer {
  flex: 1;
}
.card__body {
  padding: 6px 0;
}
.card__body.pad {
  padding: 14px 16px;
}
.card__empty {
  padding: 22px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}
.viewall {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.viewall svg {
  width: 13px;
  height: 13px;
}
.card__foot {
  padding: 9px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
}

/* ===================== layout grid ===================== */

/* ===================== forms (shared) ===================== */
.edithead {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--app-bg);
  margin-bottom: 16px;
}
.edithead .tabs {
  position: static;
  margin-bottom: 0;
  border-bottom: 0;
}
.fsec {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  margin-bottom: 16px;
  overflow: hidden;
}
.fsec:last-of-type {
  margin-bottom: 0;
}
.fsec__head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}
.fsec__ico {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--app-bg);
  color: var(--muted);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.fsec__ico svg {
  width: 17px;
  height: 17px;
}
.fsec__ttl {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
}
.fsec__sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}
.fsec__body {
  padding: 20px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}
.field label .req {
  color: var(--cancel-fg);
  margin-left: 2px;
}
.field input,
.field select,
.field textarea,
input.fld,
select.fld,
textarea.fld {
  width: 100%;
  box-sizing: border-box;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--field-bg);
  font: 400 13.5px/1.4 var(--sans);
  color: var(--text);
  outline: none;
  transition:
    border-color 0.12s,
    box-shadow 0.12s;
}
.field textarea,
textarea.fld {
  height: auto;
  min-height: 64px;
  padding: 10px 12px;
  resize: vertical;
}
.field select,
select.fld {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7A8D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 32px;
}
.field input:focus,
.field select:focus,
.field textarea:focus,
input.fld:focus,
select.fld:focus,
textarea.fld:focus {
  border-color: var(--focus-border);
  box-shadow: var(--focus-ring);
}
.field__hint {
  font-size: 11.5px;
  color: var(--muted);
}
.field input:disabled,
.field select:disabled,
.field textarea:disabled,
input.fld:disabled,
select.fld:disabled,
textarea.fld:disabled {
  background: var(--app-bg);
  color: var(--muted);
}
/* a bare field outside .field takes the same style with class="fld"; placeholders are muted in every theme */
.field input::placeholder,
.field textarea::placeholder,
input.fld::placeholder,
textarea.fld::placeholder {
  color: var(--muted-2);
  opacity: 1;
}
/* a phone field (<x-phone-input>): one box with a code button, a thin divider and the number */
.phonefield {
  position: relative;
  display: flex;
  align-items: stretch;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--field-bg);
  transition:
    border-color 0.12s,
    box-shadow 0.12s;
}
.phonefield:focus-within {
  border-color: var(--focus-border);
  box-shadow: var(--focus-ring);
}
.phonefield--error,
.phonefield--error:focus-within {
  border-color: var(--cancel-fg);
  box-shadow: 0 0 0 3px var(--cancel-bg);
}
.phonefield__code {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px 0 10px;
  border: 0;
  background: none;
  font: 500 13px var(--sans);
  color: var(--text);
  cursor: pointer;
  border-radius: 8px 0 0 8px;
}
.phonefield__code:focus-visible {
  outline: none;
  background: var(--app-bg);
}
.phonefield__code svg {
  width: 12px;
  height: 12px;
  color: var(--muted-2);
}
.phonefield__div {
  width: 1px;
  background: var(--line);
  margin: 7px 0;
}
.field .phonefield .phonefield__num {
  flex: 1;
  min-width: 0;
  height: auto;
  border: 0;
  border-radius: 0 8px 8px 0;
  background: none;
  box-shadow: none;
  padding: 0 10px;
}
.phonefield__pop {
  /* fixed, placed by the script, so a card with hidden overflow can't clip it */
  position: fixed;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 26px color-mix(in srgb, var(--ink) 14%, transparent);
  padding: 6px;
  z-index: 20;
}
/* a popover search stays white, not the grey field background */
.field .phonefield__pop input {
  background: var(--surface);
  height: 30px;
  padding: 0 9px;
  margin-bottom: 4px;
  font-size: 12.5px;
}
.phonefield__list {
  max-height: 240px;
  overflow-y: auto;
}
.phonefield__opt {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.phonefield__opt b {
  font-weight: 600;
  color: var(--muted);
}
.phonefield__opt[aria-selected='true'] {
  background: var(--app-bg);
}
.phonefield__empty {
  padding: 8px 9px;
  color: var(--muted);
  font-size: 13px;
}
.fgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 18px;
}
.fgrid .span2 {
  grid-column: span 2;
}
/* ===================== list + table (shared) ===================== */
.tkfilters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.tkfilters .flt-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-2);
  margin-right: 2px;
}
.tkfilters .spacer {
  flex: 1;
}
.tsel {
  height: 32px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  font: 600 12.5px/1 var(--sans);
  color: var(--text-2);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2396A2B2' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 13px;
}
.tsel:hover {
  background-color: var(--hover);
}
/* the opened list of a select follows the dark theme too */
:root[data-theme="dark"] .tsel,
:root[data-theme="dark"] .field select,
:root[data-theme="dark"] select.fld {
  color-scheme: dark;
}
.tksearch {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  min-width: 180px;
}
.tksearch input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: 400 13px/1.4 var(--sans);
  color: var(--text);
}

/* ===== <x-filter-bar> / <x-filter-select> =====
   Server-side filtering: this is a GET form, so submitting it (or a
   select inside it changing, or typing in the search box — see
   wireFilterBars() in common.js) reloads the page with the picked
   values as query params. Any page can drop this in; nothing here
   names a specific page or model. */
.filterbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.filterbar__select {
  height: 32px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  font: 600 12.5px/1 var(--sans);
  color: var(--text-2);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2396A2B2' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 13px;
  outline: none;
}
.filterbar__select:hover {
  background-color: var(--hover);
}
.filterbar__select:focus {
  background-color: var(--surface);
  border-color: var(--focus-border);
  box-shadow: var(--focus-ring);
}
.filterbar__search {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  min-width: 200px;
}
.filterbar__search:focus-within,
.tksearch:focus-within {
  border-color: var(--focus-border);
  box-shadow: var(--focus-ring);
}
.filterbar__search svg {
  width: 15px;
  height: 15px;
  color: var(--muted-2);
  flex: 0 0 auto;
}
.filterbar__search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font: 400 13px/1.4 var(--sans);
  color: var(--text);
}
.filterbar__clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  flex: 0 0 auto;
  transition:
    background 0.13s,
    color 0.13s,
    border-color 0.13s;
}
.filterbar__clear svg {
  width: 15px;
  height: 15px;
}
.filterbar__clear:hover {
  background: var(--hover);
  color: var(--cancel-fg);
  border-color: var(--cancel-fg);
}
.datatable-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}
.datatable {
  width: 100%;
  border-collapse: collapse;
}
.datatable thead th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted-2);
  background: var(--surface);
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.datatable tbody tr {
  border-bottom: 1px solid var(--line);
  transition: background 0.12s;
  cursor: pointer;
}
.datatable tbody tr:last-child {
  border-bottom: 0;
}
.datatable tbody tr:hover {
  background: var(--hover);
}
.datatable td {
  padding: 13px 18px;
  vertical-align: middle;
}
.datacell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.datacell .avatar {
  width: 38px;
  height: 38px;
  font-size: 13px;
  flex: 0 0 auto;
}
.datacell__col {
  min-width: 0;
}
.datacell__name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Members/Teams/Positions/Relationships: the name is a real link to the
   edit/detail page now (the row itself no longer navigates on click —
   that was interfering with selecting/copying text from the list). Reset
   the browser's default link look so it still reads as a plain label,
   with just a hover underline as the click affordance. `display:block`
   (not inline-block) matters here, not just cosmetics: it keeps the extra
   vertical gap an inline-level box reserves for descenders from opening up
   under the name, and on Teams it's what still forces the row's
   description (.datateam, an inline-flex element) onto its own line below
   the name instead of sitting beside it. */
a.datacell__name {
  text-decoration: none;
  display: block;
}
/* and cancel the shared .datatable row's pointer cursor on just those
   four tables, since only the name link is clickable now, not the row */
#membersTable tbody tr,
#teamTable tbody tr,
#posTable tbody tr,
#relTable tbody tr {
  cursor: default;
}
.datacell__mail {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 16px;
}
.pagination__summary {
  font-size: 12.5px;
  color: var(--muted);
}
.pagination__summary strong {
  color: var(--text-2);
  font-weight: 600;
}
.pagination__nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-2);
  font: 600 12.5px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.13s,
    border-color 0.13s,
    color 0.13s;
}
.pagination__btn svg {
  width: 15px;
  height: 15px;
}
.pagination__btn:hover {
  background: var(--hover);
}
.pagination__btn--active,
.pagination__btn--active:hover {
  background: var(--run-fg);
  border-color: var(--run-fg);
  color: var(--accent-fg);
}
.pagination__btn.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}
.pagination__ellipsis {
  padding: 0 2px;
  color: var(--muted-2);
  font-size: 12.5px;
}
/* ===================== fullscreen layout (standalone pages, e.g. the public API doc) ===================== */
.fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--app-bg);
}
.fullscreen > * {
  height: 100%;
}
/* back-to-app button used in standalone page headers */
.mlist__back {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  display: grid;
  place-items: center;
  color: var(--text-2);
  text-decoration: none;
  flex: 0 0 auto;
  transition:
    background 0.13s,
    color 0.13s;
}
.mlist__back:hover {
  background: var(--hover);
  color: var(--text);
}
.mlist__back svg {
  width: 17px;
  height: 17px;
}

/* ===================== standalone page (fullscreen with its own header) ===================== */
/* back link used in standalone headers */

.toast {
  position: fixed;
  top: 26px;
  left: 50%;
  transform: translate(-50%, -16px);
  opacity: 0;
  pointer-events: none;
  background: var(--text);
  color: var(--accent-fg);
  font: 600 13px/1.4 var(--sans);
  padding: 12px 18px;
  border-radius: 10px;
  box-shadow: var(--card-shadow-h);
  display: flex;
  align-items: center;
  gap: 9px;
  z-index: 9999;
  transition:
    transform 0.18s,
    opacity 0.18s;
  max-width: 360px;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
.toast__icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  background: color-mix(in srgb, var(--accent-fg) 20%, transparent);
  color: var(--accent-fg);
}
.toast--success {
  background: var(--done-fg);
}
.toast--error {
  background: var(--cancel-fg);
}
/* the toast's own colour on its dark fill */
.toast__link {
  color: inherit;
  font-weight: 700;
  margin-left: 4px;
  white-space: nowrap;
}

.confirm-modal {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}
.confirm-modal.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.confirm-modal__box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px color-mix(in srgb, var(--ink) 15%, transparent);
  padding: 18px 20px;
  min-width: 360px;
  max-width: 440px;
}
.confirm-modal__top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.confirm-modal__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--orange-bg);
  color: var(--orange-fg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.confirm-modal__icon svg {
  width: 20px;
  height: 20px;
}
.confirm-modal__icon.danger {
  background: var(--gray-bg);
  color: var(--red-fg);
}
.confirm-modal__text {
  flex: 1;
}
.confirm-modal__title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
}
.confirm-modal__desc {
  font-size: 13px;
  color: var(--muted);
}
.confirm-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
/* ===================== THEMES =====================
   Light is the default in :root. A theme only overrides token values on <html data-theme>. */
:root[data-theme="dark"] {
  --focus-border: var(--text);
  color-scheme: dark;
  --app-bg: #141414;
  --surface: #1c1c1e;
  --surface-2: #212124;
  --side-bg: #18181a;
  --top-bg: #18181a;
  --field-bg: #18181a;
  --gray-bg: #2a2a2e;
  --hover: #2a2a2e;
  --active-bg: #2a2a2e;
  --text: #ececee;
  --text-2: #b4b4ba;
  --muted: #8e8e96;
  --muted-2: #6c6c74;
  --line: #2e2e32;
  --line-strong: #3a3a40;
  --accent-fg: #04111c;
  --accent-soft: rgba(14, 165, 233, 0.16);
  --accent-deep: #5cc8f5;
  --accent-line: rgba(14, 165, 233, 0.4);
  --ink: #000000;
  --run-bg: rgba(96, 140, 255, 0.16);
  --run-fg: #7aa7ff;
  --hold-bg: rgba(227, 179, 65, 0.15);
  --hold-fg: #e3b341;
  --done-bg: rgba(76, 195, 138, 0.15);
  --done-fg: #4cc38a;
  --cancel-bg: rgba(255, 123, 114, 0.14);
  --cancel-fg: #ff7b72;
  --pending-bg: rgba(169, 155, 255, 0.16);
  --pending-fg: #a99bff;
  --red-bg: rgba(255, 123, 114, 0.14);
  --red-fg: #ff7b72;
  --red-line: rgba(255, 123, 114, 0.35);
  --green-bg: rgba(76, 195, 138, 0.15);
  --green-fg: #4cc38a;
  --green-line: rgba(76, 195, 138, 0.35);
  --blue-bg: rgba(96, 140, 255, 0.16);
  --blue-fg: #7aa7ff;
  --blue-line: rgba(96, 140, 255, 0.35);
  --orange-bg: rgba(227, 179, 65, 0.15);
  --orange-fg: #e3b341;
  --orange-line: rgba(227, 179, 65, 0.35);
  --purple-bg: rgba(169, 155, 255, 0.16);
  --purple-fg: #a99bff;
  --purple-line: rgba(169, 155, 255, 0.35);
  --gray-fg: #8e8e96;
  --cat-issue-bg: rgba(227, 179, 65, 0.15);
  --cat-issue-fg: #e3b341;
  --cat-sugg-bg: rgba(169, 155, 255, 0.16);
  --cat-sugg-fg: #a99bff;
  --type-feature-bg: rgba(45, 190, 170, 0.15);
  --type-feature-fg: #2dbeaa;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -24px rgba(0, 0, 0, 0.6);
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --card-shadow-h: 0 4px 12px -2px rgba(0, 0, 0, 0.5), 0 2px 6px -2px rgba(0, 0, 0, 0.4);
}
/* theme choice in the account menu */
.acct__theme {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--muted);
}
.acct__theme button {
  flex: 1;
  height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-2);
  font: 500 12px var(--sans);
  cursor: pointer;
}
.acct__theme button[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-deep);
}
