/* ===========================================================================
   Company Hub — plain, hand-written CSS using BEM naming (cadence convention,
   ADR 0005). No Tailwind, no build step. Deep-green "uButler portal" brand
   (matching the CEO's demo palette) so the Hub reads as its own app next to
   cadence's teal.
   =========================================================================== */

/* Self-hosted variable fonts (no CDN; served from our own origin — ADR 0001).
   Raleway heads the UI; Inter carries the body/UI text. */
@font-face {
  font-family: "Raleway";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/static/fonts/raleway.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/static/fonts/inter.woff2") format("woff2");
}

:root {
  color-scheme: light;

  --ink: #14231A;
  --canvas: #F6F7F3;              /* warm off-white (demo #faf9f6) */
  --brand: #2F5C41;              /* B600 */
  --brand-dark: #27503A;        /* B700 — primary hover / chip text */
  --brand-soft: #DCEBE0;        /* B100 — soft green tint */
  --brand-tint: #F0F5F1;        /* B50 — lightest, cooler green-blue (demo structure fills) */
  --muted: #5C6B60;
  --line: #E2E7E1;
  --white: #FFFFFF;
  --table-head-bg: #F9FAFB;            /* Tailwind gray-50 — table header ROW background */
  --table-head-fg: rgb(107 114 128);   /* Tailwind gray-500 — table header TEXT (on gray-50) */
  --table-subhead-fg: rgb(156 163 175); /* Tailwind gray-400 — secondary/grouping-row TEXT */
  --danger: #DC2626;
  --danger-soft: #FDECEC;
  --ok: #15803D;
  --ok-soft: #DCFCE7;

  /* The sidebar is a fixed dark-green panel in BOTH themes (demo B800). */
  --inverse: #204631;           /* B800 */
  --inverse-ink: #FFFFFF;
  /* Sidebar nav tokens (fixed across themes). */
  --nav-fg: #DCEBE0;            /* B100 — inactive item text */
  --nav-active: #2F5C41;       /* B600 — active pill */
  --nav-head: #7CAF92;         /* brightened B400 — section headers */
  --nav-accent: #A7D2B8;       /* light green for aux hovers */

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(18, 22, 42, .06), 0 1px 3px rgba(18, 22, 42, .04);
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Raleway", var(--font-sans);
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Raleway heads the UI; body/UI text stays Inter. */
h1, h2, h3, h4, h5, h6,
.page-head__title, .card__title, .section-title, .brand__name {
  font-family: var(--font-head);
}

/* Dark palette — same variable names, second set of values (ADR 0017 pattern);
   theme.js sets <html data-theme=…> before first paint. */
[data-theme="dark"] {
  color-scheme: dark;

  --ink: #E4EAE5;
  --canvas: #0E140F;
  --brand: #5F9E77;             /* brighter green for dark surfaces */
  --brand-dark: #86C39D;       /* lighter — hover / chip text on dark */
  --brand-soft: #1D3A2A;
  --brand-tint: #17281E;        /* B50 equivalent on dark surfaces */
  --muted: #93A297;
  --line: #24322A;
  --white: #16211A;
  --table-head-bg: #1C2A22;             /* header row: a touch lighter than the card on dark */
  --table-head-fg: #9CA3AF;             /* gray-400 — table header text on dark */
  --table-subhead-fg: #6B7280;          /* gray-500 — grouping-row text on dark */
  --danger: #F87171;
  --danger-soft: #3A1A1A;
  --ok: #6EE7A0;
  --ok-soft: #12331F;

  /* Sidebar deepens slightly in dark mode but stays green. */
  --inverse: #16301E;
  --inverse-ink: #E4EAE5;

  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 1px 3px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body.app {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.45;
  display: flex;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
code {
  font-family: var(--font-mono); font-size: .85em;
  background: rgba(18, 22, 42, .05); padding: .05em .35em; border-radius: 4px;
}

/* --- Sidebar --------------------------------------------------------------- */
.sidebar {
  position: sticky; top: 0; align-self: flex-start; height: 100vh;
  width: 260px; flex-shrink: 0; box-sizing: border-box;
  background: var(--inverse); color: var(--inverse-ink);
  display: flex; flex-direction: column; gap: 8px; padding: 16px 12px;
}
.sidebar__foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 12px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: -.01em; padding: 6px 8px; }
/* The uButler emblem (white) sits directly on the dark-green sidebar. */
.brand__logo { width: 24px; height: auto; display: block; flex: none; }
/* On light surfaces (login / no-access) the white emblem needs a green badge. */
.brand__badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: #204631; border-radius: 11px;
}
.brand__badge img { width: 62%; height: auto; display: block; }
.brand__badge--lg { width: 52px; height: 52px; }

.nav { display: flex; flex-direction: column; gap: 2px; font-size: 14px; margin-top: 6px; overflow-y: auto; }
.nav__sep { height: 1px; background: rgba(255, 255, 255, .10); margin: 8px 10px; }
.nav__group { display: flex; flex-direction: column; gap: 2px; }
.nav__group + .nav__group { margin-top: 12px; }
.nav__grouphead {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
  color: var(--nav-head); padding: 2px 12px 3px;
}
.nav__tab {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-radius: var(--radius-sm); color: var(--nav-fg); transition: background .15s, color .15s;
}
.nav__tab .ico { opacity: .85; }
.nav__tab:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.nav__tab--active,
.nav__tab--active:hover { background: var(--nav-active); color: #fff; font-weight: 500; }

/* Brand row: logo/name on the left, the notifications bell on the right. */
.brandbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brandbar__actions { display: flex; align-items: center; gap: 4px; }
.bell {
  position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  color: var(--nav-fg); transition: background .15s, color .15s;
  /* reset so a <button>.bell (the theme toggle) matches the <a>.bell bell —
     no default button chrome (white box) */
  background: none; border: 0; padding: 0; cursor: pointer; font: inherit;
}
.bell:hover, .bell--active { color: #fff; background: rgba(255, 255, 255, .09); }
.bell .ico { width: 18px; height: 18px; }
/* Clear "new notification" dot — amber reads against the dark-green sidebar. */
.bell__dot {
  position: absolute; top: 5px; right: 5px; width: 9px; height: 9px;
  border-radius: 50%; background: #F0A03C; box-shadow: 0 0 0 2px var(--inverse);
}

/* Notification centre list. */
.notif { list-style: none; margin: 0; padding: 0; }
.notif__item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 2px; border-top: 1px solid var(--line);
}
.notif__item:first-child { border-top: 0; }
.notif__dot {
  flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%;
  background: transparent;
}
.notif__item--unread .notif__dot { background: var(--brand); }
.notif__body { flex: 1; min-width: 0; }
.notif__title { font-weight: 500; }
.notif__item--unread .notif__title { font-weight: 600; }
.notif__text { color: var(--muted); font-size: 13px; margin-top: 2px; }
.notif__meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.notif__actions { flex: none; }

.ico { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; flex: none; }

.user {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  color: inherit; text-decoration: none;
  padding: 4px 6px; margin: -4px -6px 0; border-radius: var(--radius-sm);
  transition: background .15s;
}
a.user:hover { background: rgba(255, 255, 255, .07); }
.user__avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; background: var(--brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600;
}
.user__name { color: #e2e3ef; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.theme-toggle {
  display: flex; align-items: center; gap: 8px; font: inherit; font-size: 13px; cursor: pointer;
  background: transparent; border: 1px solid rgba(255,255,255,.16); color: #c8cad9;
  border-radius: var(--radius-sm); padding: 7px 10px;
}
.theme-toggle:hover { border-color: var(--nav-accent); color: var(--nav-accent); }
.theme-toggle__sun { display: none; }
[data-theme="dark"] .theme-toggle__moon { display: none; }
[data-theme="dark"] .theme-toggle__sun { display: flex; align-items: center; gap: 8px; }

/* --- Layout ---------------------------------------------------------------- */
.main { flex: 1; min-width: 0; padding: 24px 28px; }
.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 12px; margin-bottom: 20px;
}
.page-head__title { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.page-head__sub { font-size: 14px; color: var(--muted); margin: 4px 0 0; }
.wrap { max-width: 1120px; margin-inline: auto; }
.muted { color: var(--muted); }

/* Sub-navigation — rounded-pill subtabs (matching the demo's SubTabs). */
.subnav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; }
.subnav__tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 14px; font-size: 13px; font-weight: 500; border-radius: 999px;
  color: var(--muted); background: transparent; border: 1px solid var(--line);
  transition: background .15s, border-color .15s, color .15s;
}
.subnav__tab:hover { border-color: var(--brand); color: var(--brand); }
.subnav__tab--active { color: #fff; background: var(--brand); border-color: var(--brand); }
.subnav__tab--active:hover { color: #fff; }

/* --- Cards ----------------------------------------------------------------- */
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.card__title { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
/* Featured block (e.g. "We're hiring") — bigger rounding + soft shadow + lighter
   border, set apart from the flat, border-only cards like the demo. */
.card--feature { border-radius: 18px; border-color: var(--line); box-shadow: 0 6px 24px rgba(20, 35, 26, .07); }
/* "We're hiring" role tiles — 2-up grid inside the featured block. */
.hiregrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 720px) { .hiregrid { grid-template-columns: 1fr; } }
.hirecard { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.card--empty { color: var(--muted); text-align: center; padding: 40px; }

/* --- Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 14px; font-weight: 500; padding: 8px 14px;
  border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn--sm { padding: 6px 10px; font-size: 13px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); }
.btn--ghost { background: transparent; border-color: rgba(255,255,255,.25); color: #e6efe9; }
.btn--ghost:hover { border-color: var(--nav-accent); color: var(--nav-accent); }
.btn--soft { background: var(--white); border-color: var(--line); color: var(--muted); }
.btn--soft:hover { border-color: var(--brand); color: var(--brand); }
.btn--google { background: var(--white); color: var(--ink); border-color: var(--line); }
.btn--google:hover { border-color: #cbd0e0; }
.btn__g { font-weight: 700; color: #4285F4; width: 20px; display: inline-flex; justify-content: center; }

/* --- Forms ----------------------------------------------------------------- */
.field { display: block; margin-bottom: 14px; }
.field__label {
  display: block; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); margin-bottom: 4px;
}
.field__input, .field__select, .field__textarea {
  width: 100%; font-family: inherit; font-size: 14px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); color: var(--ink);
}
.field__textarea { min-height: 120px; resize: vertical; }
.field__input:focus, .field__select:focus, .field__textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.form-actions { display: flex; gap: 8px; margin-top: 4px; }

/* --- Banners / alerts ------------------------------------------------------ */
.banner { border-radius: var(--radius); padding: 12px 14px; font-size: 14px; margin-bottom: 16px; }
.banner--info { background: var(--brand-soft); border: 1px solid var(--line); color: var(--brand-dark); }
.alert { border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14px; margin-bottom: 14px; }
.alert--error { background: var(--danger-soft); border: 1px solid #F4C7C7; color: var(--danger); }

/* --- Login / no-access centered card --------------------------------------- */
.center-card { min-height: 80vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.center-card__inner {
  width: 100%; max-width: 380px; background: var(--white); border: 1px solid var(--line);
  border-radius: 16px; padding: 32px; box-shadow: var(--shadow); text-align: center;
}
.center-card__brand { margin-bottom: 20px; }
.center-card__brand .brand__badge--lg { margin: 0 auto 12px; }
.center-card__title { font-size: 22px; font-weight: 700; margin: 0; }
.center-card__subtitle { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.center-card__note { font-size: 12px; color: var(--muted); margin: 16px 0 0; }
.center-card form { text-align: left; }

/* ===========================================================================
   Split-screen sign-in. Full-bleed (the login screen has no sidebar): a fixed
   overlay so it ignores the .main padding. Left = brand story, right = sign-in.
   =========================================================================== */
.login { position: fixed; inset: 0; display: flex; background: var(--canvas); z-index: 1; }
.login__left {
  position: relative; flex: 1; min-width: 0; overflow: hidden;
  background: var(--inverse); color: #fff;
  display: flex; flex-direction: column; padding: 44px 52px;
}
.login__brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; font-size: 20px; color: #fff; }
.login__brand img { width: 27px; height: auto; display: block; }
.login__hero { margin: auto 0; max-width: 460px; position: relative; z-index: 1; }
.login__headline { font-family: var(--font-head); font-size: 42px; line-height: 1.12; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.login__sub { margin: 22px 0 0; font-size: 16px; line-height: 1.55; color: rgba(255, 255, 255, .72); max-width: 430px; }
.login__foot { font-size: 13px; color: rgba(255, 255, 255, .52); position: relative; z-index: 1; }
.login__watermark { position: absolute; right: -48px; bottom: -72px; width: 400px; height: auto; opacity: .06; pointer-events: none; user-select: none; }
.login__right { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 40px; }
.login__panel { width: 100%; max-width: 384px; }
.login__title { font-family: var(--font-head); font-size: 30px; font-weight: 700; margin: 0; }
.login__hint { color: var(--muted); margin: 6px 0 26px; font-size: 14px; }
.login__form { text-align: left; display: flex; flex-direction: column; gap: 14px; }
.login__note { font-size: 12.5px; color: var(--muted); margin: 18px 0 0; line-height: 1.55; }
.btn--google { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px; font-size: 15px; font-weight: 600; }
.gicon { display: inline-flex; align-items: center; }

@media (max-width: 860px) {
  .login { position: static; min-height: 100vh; flex-direction: column; margin: -24px -28px; }
  .login__left { flex: none; padding: 32px 28px; }
  .login__headline { font-size: 30px; }
  .login__sub { margin-top: 14px; }
  .login__hero { margin: 24px 0; }
  .login__watermark { display: none; }
  .login__right { padding: 32px 28px; }
}

/* --- Hub tiles ------------------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.tile {
  display: flex; flex-direction: column; gap: 8px; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
  color: var(--ink); box-shadow: var(--shadow); transition: box-shadow .15s, border-color .15s, transform .15s;
}
.tile:hover { box-shadow: 0 6px 18px rgba(18,22,42,.10); border-color: var(--brand); transform: translateY(-1px); }
.tile__icon {
  width: 40px; height: 40px; border-radius: 10px; background: var(--brand-soft); color: var(--brand);
  display: inline-flex; align-items: center; justify-content: center; font-size: 20px;
}
.tile__name { font-size: 16px; font-weight: 600; }
.tile__desc { font-size: 13px; color: var(--muted); flex: 1; }
.tile__go { font-size: 13px; color: var(--brand); display: inline-flex; align-items: center; gap: 6px; }
.tile--soft { background: var(--brand-soft); border-style: dashed; }

/* --- Company page + team directory ----------------------------------------- */
.prose { font-size: 14.5px; line-height: 1.6; white-space: pre-wrap; word-wrap: break-word; }
.prose--empty { color: var(--muted); font-style: italic; }
.directory { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.person { display: flex; gap: 12px; align-items: flex-start; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.person__avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; background: var(--brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 600;
}
.person__name { font-weight: 600; font-size: 14px; }
.person__role { font-size: 12.5px; color: var(--muted); }
.person__bio { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.person__avatar--sm { width: 26px; height: 26px; font-size: 11px; }

/* Team Calendar — a week grid (members × Mon–Fri) of who's out of office. */
/* Bounded height so the sticky header (and sticky member column) actually work. */
.teamcal-card { padding: 0; overflow: auto; max-height: 72vh; }
.teamcal { width: 100%; border-collapse: collapse; font-size: 13px; }
.teamcal th, .teamcal td { padding: 10px 12px; border-top: 1px solid var(--line); text-align: center; vertical-align: middle; }
.teamcal thead th {
  position: sticky; top: 0; z-index: 1; background: var(--table-head-bg); box-shadow: inset 0 -1px 0 var(--line);
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--table-head-fg); white-space: nowrap;
}
/* Higher specificity than `.teamcal td` so the member column stays left-aligned. */
.teamcal th.teamcal__memberhead, .teamcal td.teamcal__member { text-align: left; white-space: nowrap; }
.teamcal__member { font-weight: 600; }
.teamcal__member .person__avatar--sm { vertical-align: middle; margin-right: 6px; }
.teamcal__date { display: block; font-size: 11px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); margin-top: 2px; }
.teamcal__today { background: #FCF3DE; }
[data-theme="dark"] .teamcal__today { background: #2C2410; }
.avail { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; }
.avail--in { color: var(--muted); background: var(--canvas); font-weight: 500; }
.avail--out { color: #B4791A; background: #FCEFD5; }
[data-theme="dark"] .avail--out { color: #F0A03C; background: #3A2E12; }
.avail__note { display: block; font-size: 10.5px; color: var(--muted); margin-top: 3px; max-width: 130px; margin-inline: auto; }

/* Team Calendar — month grid: compact per-day markers (off vs WFH). */
.teamcal--month th, .teamcal--month td { padding: 7px 5px; }
.teamcal__day { min-width: 30px; }
.teamcal__dow { display: block; font-size: 9px; }
.teamcal__dnum { display: block; font-size: 12px; font-weight: 600; color: var(--ink); letter-spacing: 0; margin-top: 1px; }
.teamcal__wk { border-left: 2px solid var(--line); }
/* Keep the member column visible while the month scrolls sideways. */
.teamcal--month .teamcal__memberhead, .teamcal--month .teamcal__member { position: sticky; left: 0; background: var(--white); }
.teamcal--month thead .teamcal__memberhead { background: var(--table-head-bg); } /* header corner matches the header row */
.teamcal--month thead .teamcal__memberhead { z-index: 3; }
.teamcal--month tbody .teamcal__member { z-index: 1; }
.daymark { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.daymark--off { color: #B4791A; background: #FCEFD5; }
.daymark--wfh { color: #3B65C4; background: #E7EEFB; }
[data-theme="dark"] .daymark--off { color: #F0A03C; background: #3A2E12; }
[data-theme="dark"] .daymark--wfh { color: #9DB8F0; background: #1E2A44; }
.teamcal-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: 12.5px; margin-bottom: 10px; }
.teamcal-legend .daymark { margin-right: 5px; vertical-align: middle; }
.teamcal-legend__hint { opacity: .85; }

/* Availability type badge (Profile settings list). */
.avail-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px; margin-right: 6px; vertical-align: middle; text-transform: uppercase; letter-spacing: .03em; }
.avail-badge--off { color: #B4791A; background: #FCEFD5; }
.avail-badge--wfh { color: #3B65C4; background: #E7EEFB; }
[data-theme="dark"] .avail-badge--off { color: #F0A03C; background: #3A2E12; }
[data-theme="dark"] .avail-badge--wfh { color: #9DB8F0; background: #1E2A44; }

/* --- Data tables (positions, admin, steering, …) --------------------------- */
/* A rounded, bordered card that also bounds height so the sticky header pins. */
.table-wrap {
  overflow: auto; max-height: 72vh;
  border: 1px solid var(--line); border-radius: 14px; background: var(--white);
}
.perm { width: 100%; border-collapse: collapse; line-height: 1.45; }
.perm th, .perm td { padding: 12px 14px; }
/* Light, uppercase, letter-spaced grey headers on a white header row. */
.perm thead th {
  position: sticky; top: 0; z-index: 1; background: var(--table-head-bg);
  box-shadow: inset 0 -1px 0 var(--line);
  text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--table-head-fg); white-space: nowrap;
  padding-top: 10px; padding-bottom: 10px;
}
.perm__user { text-align: left; }
/* Sortable column header link — looks like the header text, clickable. */
.colsort { color: inherit; text-decoration: none; cursor: pointer; white-space: nowrap; }
.colsort:hover { color: var(--brand); }
.perm__caphead {
  font-family: var(--font-mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--table-head-fg); text-align: center; white-space: nowrap;
}
.perm tbody tr { border-top: 1px solid var(--line); }
.perm tbody tr:hover { background: var(--canvas); }
/* First column reads as the row's primary label. */
.perm tbody td:first-child { font-weight: 600; }
.perm__name { font-weight: 500; font-size: 14px; display: block; }
.perm__email { font-size: 12px; color: var(--muted); }
.perm__cell { text-align: center; }
.permcell {
  width: 28px; height: 28px; border-radius: var(--radius-sm); border: none; cursor: pointer;
  font-size: 13px; background: #eceef5; color: #9aa1b4;
}
.permcell--on { background: var(--brand); color: #fff; }
.permcell:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
[data-theme="dark"] .permcell { background: #22243c; }

/* Multi-app access matrix (docs/adr/0019): each app spans its access cell plus
   its role columns, so the grouping has to be visible or the header lies. */
.perm__apphead {
  text-align: center; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--table-head-fg); white-space: nowrap;
  padding: 8px 10px 6px;
  border-left: 1px solid var(--line);
}
.perm__apphead:first-of-type { border-left: none; }
.perm__caphead--access { color: var(--brand); }
/* The access cell opens each app's block — the vertical rule ties the two
   header rows to the body columns beneath them. */
.perm__caphead--access,
.perm__cell--access { border-left: 1px solid var(--line); }
/* Access is admission, not a permission — square it off so it doesn't read as
   just another role toggle. */
.permcell--access { border-radius: var(--radius-sm); box-shadow: inset 0 0 0 1px var(--line); }

/* Layer-1 rejection page: signed in, but not admitted to this app. */
.noaccess { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--canvas); }
.noaccess__panel {
  max-width: 460px; text-align: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 28px;
}
.noaccess__logo { margin-bottom: 16px; }
.noaccess__title { font-size: 19px; font-weight: 650; margin: 0 0 10px; }
.noaccess__body { font-size: 14px; margin: 0 0 10px; }
.noaccess__hint { font-size: 13px; color: var(--muted); margin: 0 0 20px; }
.noaccess__actions { display: flex; justify-content: center; }

.badge {
  display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 8px; border-radius: 999px; background: var(--ok-soft); color: var(--ok);
}
.badge--muted { background: var(--brand-soft); color: var(--brand-dark); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--amber { background: #FCEFD5; color: #B4791A; }
[data-theme="dark"] .badge--amber { background: #33290F; color: #E0A93C; }
.badge--ok { background: #E2F0E7; color: #2F6042; }
[data-theme="dark"] .badge--ok { background: #17321F; color: #7CC395; }
.chip { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); }

/* --- Roles viewer ---------------------------------------------------------- */
.roles { display: flex; flex-direction: column; gap: 12px; }
.role { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.role__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.role__name { font-weight: 600; font-size: 15px; }
.role__desc { font-size: 13px; color: var(--muted); margin: 4px 0 8px; }
.role__perms { display: flex; flex-wrap: wrap; gap: 6px; }
.role--custom { border-color: #EFE3BD; }
.role__matrix { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 6px; }
.permgroup__label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; margin-bottom: 5px; }
.permgroup__perms { display: flex; flex-direction: column; gap: 4px; }
.permchip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.permchip--on { color: var(--brand-dark); font-weight: 600; }
.permcheck { display: flex; align-items: center; gap: 7px; font-size: 12.5px; cursor: pointer; padding: 2px 0; }
.permcheck input { accent-color: var(--brand); }

/* --- Office Chores rota ---------------------------------------------------- */
.rota { width: 100%; border-collapse: collapse; font-size: 13px; }
.rota th, .rota td { padding: 12px 11px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; line-height: 1.45; }
.rota thead th {
  position: sticky; top: 0; z-index: 1; background: var(--table-head-bg);
  box-shadow: inset 0 -1px 0 var(--line);
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--table-head-fg); white-space: nowrap;
  padding-top: 10px; padding-bottom: 10px;
}
.rota tbody tr:hover { background: var(--canvas); }
.rota__day { white-space: nowrap; font-weight: 600; }
/* Today = a warm amber row, distinct from the violet "my shifts" highlight. */
.rota__today { background: #FCF3DE; }
.rota__today:hover { background: #FBEECF; }
.rota__today .rota__day { color: #B4791A; box-shadow: inset 3px 0 0 #E0A93A; }
[data-theme="dark"] .rota__today { background: #2C2410; }
[data-theme="dark"] .rota__today:hover { background: #352C13; }
[data-theme="dark"] .rota__today .rota__day { color: #F0A03C; box-shadow: inset 3px 0 0 #B87E28; }
.rota select.field__select { font-size: 12px; padding: 5px 6px; min-width: 130px; }
.chore-cant, .chore-swap { margin-top: 4px; }
.chore-cant summary, .chore-swap summary { cursor: pointer; font-size: 11px; color: var(--muted); }
.chore-cant summary:hover, .chore-swap summary:hover { color: var(--brand); }
.chore-swap form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.chore-flag { margin-top: 4px; font-size: 11px; color: #B4791A; }
[data-theme="dark"] .chore-flag { color: #F0A03C; }

/* Toolbar: nav + smart-fill on one aligned row (used on the chores page). */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.toolbar form { margin: 0; }

/* The signed-in person's own chore cells, so they spot their shifts at a glance. */
.rota__cell--mine { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.rota__today .rota__cell--mine { box-shadow: inset 3px 0 0 var(--brand); }
.rota__me { font-weight: 700; color: var(--brand); }
/* "My shifts only" view: fade everything that isn't mine. */
.rota--mine-only tbody td:not(.rota__cell--mine):not(.rota__day) { opacity: .22; }

/* --- Audit log ------------------------------------------------------------- */
.audit { list-style: none; margin: 0; padding: 0; }
.audit__row {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline;
  padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px;
}
.audit__row:first-child { border-top: none; }
.audit__action { font-family: var(--font-mono); font-size: 12px; color: var(--brand); }
.audit__target { color: var(--ink); }
.audit__meta { margin-left: auto; font-size: 12px; color: var(--muted); }
.audit__row--empty { color: var(--muted); }

/* Source badge for the unified activity feed. */
.actkind {
  flex: none; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; padding: 2px 7px; border-radius: 999px;
  min-width: 52px; text-align: center;
}
.actkind--org    { background: var(--brand-soft); color: var(--brand-dark); }
.actkind--review { background: #E7EEFB; color: #3B65C4; }
.actkind--system { background: #FCEFD5; color: #B4791A; }
[data-theme="dark"] .actkind--review { background: #1E2A44; color: #9DB8F0; }
[data-theme="dark"] .actkind--system { background: #33290F; color: #E0A93C; }

/* --- Organisation (team / positions / structure) --------------------------- */
.filters { display: flex; gap: 10px 14px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.filters__search { flex: 1 1 240px; min-width: 180px; }
/* One filter/sort control: an inline label to the left of its select/input —
   the single shared style for every filter bar (tasks, team, rooms, chores…). */
.filterfield { display: inline-flex; align-items: center; gap: 8px; }
.filterfield__label { font-size: 13px; color: var(--muted); white-space: nowrap; }
.filterfield .field__select, .filterfield .field__input { width: auto; }

.chip--soft { background: var(--canvas); color: var(--muted); }
.section-title { font-size: 15px; font-weight: 600; margin: 6px 0 10px; }

/* Strategy page. */
.strat-mv { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.strat-statement { font-size: 17px; line-height: 1.5; margin: 8px 0 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 12px; }
.roadmap__item { display: flex; align-items: baseline; gap: 16px; padding: 13px 16px; border-top: 1px solid var(--line); }
.card > .roadmap__item:first-child { border-top: none; }
.roadmap__year { flex: none; width: 60px; font-family: var(--font-head); font-weight: 700; font-size: 18px; color: var(--brand); }
.roadmap__body { flex: 1; min-width: 0; }
.roadmap__del { margin: 0 0 0 auto; }
.battle__dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
@media (max-width: 760px) { .strat-mv { grid-template-columns: 1fr; } }

/* Lifecycle status tag (sources & tools). */
.statustag { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.statustag--ok { background: var(--brand-soft); color: var(--brand-dark); }
.statustag--warn { background: #FCEFD5; color: #B4791A; }
.statustag--bad { background: var(--danger-soft); color: var(--danger); }
.statustag--muted { background: var(--canvas); color: var(--muted); }
[data-theme="dark"] .statustag--warn { background: #3A2E12; color: #F0A03C; }

/* Rounded status-filter chips. */
.filterbar { display: flex; flex-wrap: wrap; gap: 8px; }
.filterchip { font-size: 13px; font-weight: 500; padding: 5px 13px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); text-decoration: none; background: transparent; font-family: inherit; cursor: pointer; }
.filterchip:hover { border-color: var(--brand); color: var(--brand); }
.filterchip--active, .filterchip--active:hover { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Purple chip (policy type). */
.chip--purple { background: #EDE9FE; color: #6D28D9; }
[data-theme="dark"] .chip--purple { background: #2B2547; color: #C4B5FD; }

/* Policies — type filter cards. */
.poltypes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.poltype { display: block; background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.poltype:hover { border-color: #cbd0e0; }
.poltype--active { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.poltype__head { display: flex; align-items: center; justify-content: space-between; }
.poltype__count { font-size: 18px; font-weight: 600; color: var(--muted); }
.poltype__note { font-size: 14px; margin-top: 12px; }
.poltype__cad { font-size: 12px; margin-top: 6px; }

/* Policies / definitions — list rows. */
.pollist { padding: 0; overflow: hidden; }
.polrow { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.pollist > .polrow:first-child { border-top: none; }
a.polrow[href]:hover { background: var(--canvas); }
.polrow__type { flex: none; min-width: 70px; text-align: center; }
.polrow__name { font-weight: 600; min-width: 0; color: var(--ink); text-decoration: none; }
a.polrow__name--link:hover { text-decoration: underline; }
.polrow__meta { margin-left: auto; display: flex; align-items: center; gap: 14px; flex-shrink: 0; font-size: 13px; }
.polrow--def { align-items: flex-start; }
.def__term { flex: none; width: 168px; font-weight: 600; }
.def__body { flex: 1; min-width: 0; }
.def__actions { flex: none; margin-left: auto; }
@media (max-width: 760px) { .poltypes { grid-template-columns: 1fr; } .polrow__meta { display: none; } .def__term { width: 110px; } }
.person__body { flex: 1; min-width: 0; }
.person__meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; font-size: 12px; }
.person__name { display: flex; align-items: center; gap: 8px; }
.person__edit { flex-shrink: 0; align-self: flex-start; }

.field--check { display: flex; flex-direction: row; align-items: center; gap: 8px; margin-top: 4px; }
.field--check .field__label { margin-bottom: 0; }
.field--check input { width: 16px; height: 16px; }

/* Edit forms shared by the org pages. */
.org-form__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; }
.org-form__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: start; }

/* Reports-to tree. */
.orgtree { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.orgtree__row { padding: 4px 0; border-top: 1px solid var(--line); }
.orgtree__row:first-child { border-top: none; }
.orgtree__rail { color: var(--line); font-family: var(--font-mono); white-space: pre; }
.orgtree__name { font-weight: 600; }

/* Company structure cards. */
.struct { margin-bottom: 16px; }
.struct__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.struct__name { font-size: 16px; font-weight: 600; margin: 0; }
.struct__purpose { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.struct__acc { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.struct__fns { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.struct__fn { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--canvas); }
.struct__fnhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.struct__fnname { font-weight: 600; font-size: 14px; }
.struct__fnpurpose { font-size: 12.5px; margin-top: 3px; }
.struct__positions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pos-pill { display: inline-flex; gap: 6px; align-items: baseline; font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--white); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.pos-pill__who { color: var(--muted); font-size: 11px; }

/* --- Sources & tools: an even 2-column card grid (matches the demo) -------- */
.srcgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: stretch; }
@media (max-width: 820px) { .srcgrid { grid-template-columns: 1fr; } }
.srccard { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; background: var(--white); padding: 18px 20px; }
.srccard__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.srccard__name { font-size: 15px; font-weight: 600; margin: 0; line-height: 1.3; }
.srccard__tags { display: flex; gap: 6px; flex-shrink: 0; }
.srccard__desc { color: var(--muted); font-size: 13.5px; line-height: 1.45; margin: 8px 0 0; }
/* Meta pinned to the bottom so cards in a row stay equal height (no ragged gaps). */
.srccard__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: auto; padding-top: 14px; font-size: 12.5px; color: var(--muted); }
.srccard__who { color: var(--muted); }
.srccard__link { display: inline-flex; align-items: center; gap: 4px; color: var(--brand); text-decoration: none; }
.srccard__link:hover { text-decoration: underline; }
.srccard__actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }

/* --- Dashboards ------------------------------------------------------------ */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.dash-card--wide { grid-column: 1 / -1; }
.dash-grid .card { margin: 0; }
.dash-inlineform { display: flex; gap: 6px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.dash-add { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.dash-add summary { cursor: pointer; font-size: 13px; color: var(--brand); }
.dash-add summary:hover { color: var(--brand-dark); }

.eow { display: flex; gap: 12px; align-items: center; }
.ann { padding: 10px 0; border-top: 1px solid var(--line); }
.ann:first-of-type { border-top: none; }
.ann__head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ann__title { font-weight: 600; font-size: 14px; }
.ann__del { margin-left: auto; }
.ann__body { font-size: 13px; color: var(--muted); margin-top: 4px; white-space: pre-wrap; }

.evt { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.evt:first-of-type { border-top: none; }
.evt__body { flex: 1; min-width: 0; }
.evt__title { font-weight: 600; font-size: 13.5px; }
.evt__title--link { display: inline-block; background: none; border: 0; padding: 0; cursor: pointer; color: inherit; font-family: inherit; text-align: left; }
.evt__title--link:hover { color: var(--brand); text-decoration: underline; }
.daychip--btn { border: 0; cursor: pointer; font-family: inherit; }
.evt__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 3px; font-size: 12px; }
.daychip { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 9px; background: var(--brand-tint); color: var(--brand-dark); }
.daychip__d { font-size: 15px; font-weight: 700; line-height: 1; }
.daychip__m { font-size: 9px; text-transform: uppercase; letter-spacing: .04em; }

.bday { display: flex; gap: 8px; align-items: baseline; padding: 5px 0; border-top: 1px solid var(--line); font-size: 13px; }
.bday:first-of-type { border-top: none; }
.bday__name { font-weight: 600; }

.rep { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.rep:first-of-type { border-top: none; }
.rep__name { font-weight: 600; }
.cock-roles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cock-goal { font-size: 14px; margin: 0 0 6px; }

/* --- Personal tasks -------------------------------------------------------- */
.wrap--narrow { max-width: 760px; }
.backlink { display: inline-block; margin-bottom: 8px; font-size: 13px; color: var(--muted); text-decoration: none; }
.backlink:hover { color: var(--brand); }

.tasklist { display: flex; flex-direction: column; gap: 8px; }
.taskrow { display: flex; gap: 10px; align-items: center; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; box-shadow: var(--shadow); }
.taskrow--overdue { border-left: 3px solid var(--danger); }
.taskrow__today { display: flex; }
.taskrow__body { flex: 1; min-width: 0; }
.taskrow__title { font-weight: 600; font-size: 14px; color: var(--ink); text-decoration: none; }
.taskrow__title:hover { color: var(--brand); }
.taskrow__meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; font-size: 12px; }
.task-due--over { color: var(--danger); font-weight: 600; }

/* "Pick for today" sun toggle — an emoji, so on/off is opacity + grayscale
   (colour can't tint an emoji glyph). */
.star { background: none; border: none; cursor: pointer; font-size: 16px; line-height: 1; padding: 0; opacity: .35; filter: grayscale(1); transition: opacity .12s, filter .12s; }
.star--on { opacity: 1; filter: none; }
.star:hover { opacity: 1; filter: none; }
.focushint { font-weight: 400; font-size: 13px; color: #9A7D2E; }
[data-theme="dark"] .focushint { color: #C9A94E; }

.task-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.task-inline { display: flex; gap: 6px; align-items: center; }
/* Health-review row: the "Mark reviewed" details form must drop to its own
   full-width line and wrap, not cram in beside the text in a narrow column. */
.taskrow--review { flex-wrap: wrap; align-items: flex-start; }
.taskrow--review .taskrow__body { flex: 1 1 60%; min-width: 0; }
.taskrow--review .rejectbox { flex: 0 0 auto; }
.taskrow--review .rejectbox[open] { flex: 1 1 100%; margin-top: 4px; }
.taskrow--review .task-inline { flex-wrap: wrap; }
.taskrow--review .task-inline .field__input { flex: 1 1 180px; min-width: 0; }

.comments { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.comment { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; box-shadow: var(--shadow); }
.comment__head { display: flex; gap: 8px; align-items: baseline; font-size: 12px; }
.comment__author { font-weight: 600; }
.comment__body { font-size: 13.5px; margin-top: 4px; white-space: pre-wrap; }
.comment-form { display: flex; flex-direction: column; gap: 6px; }

/* --- Steering (KPIs / targets) --------------------------------------------- */
.kpistrip { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpicard { display: block; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); }
.kpicard:hover { border-color: var(--brand); }
.kpicard__name { font-size: 12px; color: var(--muted); }
.kpicard__val { font-size: 20px; font-weight: 700; margin-top: 4px; display: flex; align-items: baseline; gap: 8px; }
.kpicard__trend { font-size: 12px; font-weight: 600; }
.kpicard__trend--good { color: var(--ok); }
.kpicard__trend--bad { color: var(--danger); }
.kpi-big { font-size: 26px; font-weight: 700; margin: 4px 0 8px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.kpi-big .kpicard__trend { font-size: 13px; }

.progress { height: 10px; border-radius: 999px; background: var(--brand-soft); overflow: hidden; margin-top: 10px; }
.progress__bar { height: 100%; background: var(--brand); border-radius: 999px; }

/* --- Workflows / runs ------------------------------------------------------ */
.rejectbox { display: inline-block; }
.rejectbox > summary { list-style: none; cursor: pointer; }
.rejectbox > summary::-webkit-details-marker { display: none; }
.rejectbox[open] > summary { margin-bottom: 6px; }

/* ===========================================================================
   Dashboard design system (central / cockpit / department) — shared classes.
   =========================================================================== */

.wrap--wide { max-width: 1360px; }

/* Green hero banner (always dark; used on central + cockpit). */
.hero {
  position: relative; overflow: hidden;
  border-radius: 22px; padding: 38px 42px; margin-bottom: 20px;
  display: flex; gap: 30px; justify-content: space-between; align-items: stretch;
  background:
    radial-gradient(120% 150% at 86% 6%, rgba(255,255,255,.10), transparent 45%),
    radial-gradient(90% 130% at 102% 104%, rgba(130,196,157,.20), transparent 52%),
    linear-gradient(135deg, #2C543A 0%, #1E3A29 72%);
  color: #fff;
}
.hero__intro { align-self: center; max-width: 640px; }
.hero__date { font-size: 14px; color: rgba(255,255,255,.72); margin-bottom: 10px; }
.hero__title { font-size: 33px; line-height: 1.12; font-weight: 700; letter-spacing: -.02em; margin: 0 0 12px; }
.hero__sub { font-size: 15px; line-height: 1.5; color: rgba(255,255,255,.82); margin: 0; }
.hero__badge { display: inline-block; margin-top: 14px; font-size: 13px; font-weight: 600;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2); border-radius: 999px; padding: 5px 12px; }
.hero__badges { display: flex; flex-wrap: wrap; gap: 8px; }
.hero__badge--streak { background: rgba(255,164,60,.24); border-color: rgba(255,190,110,.5); }
.hero__badge--soft { background: rgba(255,255,255,.08); font-weight: 500; }
.streakdots { display: flex; gap: 6px; margin-top: 12px; }
.streakdot { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  border-radius: 8px; font-size: 11px; font-weight: 700; color: rgba(255,255,255,.55);
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); }
.streakdot--won { background: rgba(255,164,60,.9); border-color: rgba(255,164,60,.9); color: #3a2606; }
.streakdot--today { outline: 2px solid rgba(255,255,255,.6); outline-offset: 1px; }
.streakdot--future { opacity: .5; }

/* Hero side panel — glass card (MY WORK on central, TODAY'S FOCUS on cockpit). */
.hero__panel {
  align-self: stretch; min-width: 300px; max-width: 380px;
  display: flex; flex-direction: column;
  background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.18);
  border-radius: 16px; padding: 22px 24px; color: #fff; text-decoration: none;
}
.hero__panel-label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.7); }
.hero__panel-num { font-size: 25px; font-weight: 700; margin: 10px 0 6px; }
.hero__panel-meta { font-size: 14px; color: #F2B49B; margin-bottom: 18px; }
.hero__panel-btn { margin-top: auto; text-align: center; background: #fff; color: var(--ink);
  font-weight: 600; border-radius: 10px; padding: 12px 16px; }
.hero__panel:hover .hero__panel-btn { background: rgba(255,255,255,.88); }

/* Stat cards with sparkline. */
.statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.statcard { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; }
.statcard--link { display: block; text-decoration: none; color: inherit; transition: border-color .12s, box-shadow .12s; }
.statcard--link:hover { border-color: var(--brand); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.statcard__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.statcard__name { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); line-height: 1.35; }
.statcard__spark { width: 92px; height: 36px; flex-shrink: 0; color: var(--brand); }
.statcard__spark.is-down { color: var(--danger); }
.statcard__val { font-size: 32px; font-weight: 700; letter-spacing: -.01em; margin: 14px 0 12px; }
.statcard__delta { display: inline-block; font-size: 12.5px; font-weight: 600; background: var(--brand-soft); color: var(--brand-dark); padding: 5px 11px; border-radius: 999px; }
.statcard__delta.is-bad { background: var(--danger-soft); color: var(--danger); }

/* Compact stat cards + shift bars — the office-chore balance monitor. */
.statgrid--compact { grid-template-columns: repeat(5, 1fr); gap: 12px; }
.statcard--mini { padding: 14px 16px; text-align: center; }
.statcard--mini .statcard__val { font-size: 24px; margin: 0 0 4px; }
.statcard__lbl { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.statcard--ok { border-color: var(--brand); }
.statcard--warn { border-color: #E0A93A; }
.statbar { position: relative; display: flex; align-items: center; height: 22px; background: var(--canvas); border-radius: 999px; overflow: hidden; }
.statbar__fill { position: absolute; left: 0; top: 0; height: 100%; background: var(--brand-soft); border-radius: 999px; min-width: 2px; }
.statbar__val { position: relative; padding-left: 10px; font-weight: 600; font-size: 12.5px; }
.statstable td { vertical-align: middle; }
@media (max-width: 720px) { .statgrid--compact { grid-template-columns: repeat(2, 1fr); } }

/* Recent-achievements strip. */
.achievebar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px;
  background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 15px 22px; box-shadow: var(--shadow); margin-bottom: 16px; }
.achievebar__label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.achievebar__item { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px; }
.achievebar__icon { font-size: 15px; }
.achievebar__del { display: inline; }
.achievebar__add { margin-left: auto; }
.achievebar__add > summary { cursor: pointer; font-size: 13px; color: var(--brand); }
.achievebar__add form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* Two-column dashboard body. */
.dash-two { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; align-items: start; }
.dash-col { display: flex; flex-direction: column; gap: 16px; }

/* Card header with an icon badge. */
.card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card__head .card__title { margin: 0; }
.card__icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 9px; background: var(--brand-tint); color: var(--brand); font-size: 15px; flex-shrink: 0; }
.card__count { margin-left: auto; font-size: 13px; color: var(--muted); font-weight: 600; }
.card__action { margin-left: auto; font-size: 13px; color: var(--brand); text-decoration: none; }
.card__action:hover { color: var(--brand-dark); }

/* Avatar chip (2-letter initials). */
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 600; font-size: 13px; flex-shrink: 0; }
.avatar--lg { width: 46px; height: 46px; font-size: 15px; }
.avatarstack { display: flex; }
.avatarstack .avatar { border: 2px solid var(--white); margin-left: -8px; }
.avatarstack .avatar:first-child { margin-left: 0; }

.spotlight { display: flex; gap: 14px; align-items: center; }
.spotlight__name { font-weight: 600; font-size: 15px; }

/* Announcement rows with a date chip. */
.annrow { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.annrow:first-of-type { border-top: none; }
.annrow__date { flex-shrink: 0; min-width: 48px; text-align: center; font-size: 11px; font-weight: 600; color: var(--muted);
  background: var(--canvas); border: 1px solid var(--line); border-radius: 8px; padding: 7px 6px; line-height: 1.2; }
.annrow__body { min-width: 0; flex: 1; }
.annrow__title { font-weight: 600; font-size: 14.5px; }
.annrow__title--link { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; color: inherit; font-family: inherit; }
.annrow__title--link:hover { color: var(--brand); text-decoration: underline; }
a.taglabel { text-decoration: none; }
.annrow__text { font-size: 13px; color: var(--muted); margin-top: 3px; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.annrow__del { margin-left: auto; }
.annrow__edit { margin-left: auto; }
.annrow__edit + .annrow__del { margin-left: 6px; }

/* Birthday rows. */
.bdayrow { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.bdayrow:first-of-type { border-top: none; }
.bdayrow__name { font-weight: 600; font-size: 14px; }
.bdayrow__when { margin-left: auto; font-size: 13px; color: var(--muted); }

/* Pills / chips shared across dashboards. */
.pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); }
/* Inline button that reads as a link (drawer deep-links). */
.linkbtn { border: none; background: none; padding: 0; font: inherit; color: var(--brand-dark); cursor: pointer; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px; }
.linkbtn:hover { text-decoration-style: solid; }
.pill--today { margin-left: auto; background: #FCEFD5; color: #B4791A; }
.pill--danger { background: var(--danger-soft); color: var(--danger); }
[data-theme="dark"] .pill--today { background: #3A2E12; color: #F0A03C; }

/* Small inline delete button. */
.iconx { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 13px; padding: 2px 4px; line-height: 1; }
.iconx:hover { color: var(--danger); }

/* Task / target / link list rows (department + cockpit). */
.listrow { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
a.listrow { text-decoration: none; color: inherit; }
a.listrow:hover .listrow__title { color: var(--brand); }
.listrow:first-of-type { border-top: none; }
.listrow__main { min-width: 0; flex: 1; }
.listrow__title { font-weight: 600; font-size: 14px; }
.listrow__sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.listrow__meta { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.listrow__due--over { color: var(--danger); font-weight: 600; }

/* Linkbox (hotlinks) + slack chips. */
.linkbox { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; text-decoration: none; color: var(--ink); font-weight: 500; font-size: 14px; }
.linkbox:hover { border-color: var(--brand); }
.chiprow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

/* Progress ring (cockpit "today's focus"). */
.ring { --pct: 0; width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(#fff calc(var(--pct) * 1%), rgba(255,255,255,.22) 0);
  display: inline-flex; align-items: center; justify-content: center; }
.ring__inner { width: 42px; height: 42px; border-radius: 50%; background: #24472F;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; }

@media (max-width: 900px) {
  .hero { flex-direction: column; }
  .hero__panel { max-width: none; }
  .statgrid { grid-template-columns: 1fr; }
  .dash-two { grid-template-columns: 1fr; }
}
.statcard__foot { display: flex; flex-wrap: wrap; gap: 8px; }
.statcard__delta--muted { background: var(--canvas); color: var(--muted); }
.headcard { display: flex; gap: 14px; align-items: center; }
.headcard__label { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--brand); }
.headcard__name { font-weight: 700; font-size: 16px; margin: 2px 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.listrow__del { margin-left: 6px; }

/* Cockpit-specific bits. */
.hero__panel .focus { display: flex; gap: 16px; align-items: center; height: 100%; }
.focus__line { font-weight: 600; margin-top: 4px; }
.card--focus { background: #FCF8EC; border-color: #EFE3BD; }
[data-theme="dark"] .card--focus { background: #241F0E; border-color: #3A3316; }
.focusslot { display: block; padding: 13px 16px; margin-top: 10px; border: 1.5px dashed #D9BE63; border-radius: 12px;
  color: #9A7B1C; font-weight: 600; font-size: 14px; text-decoration: none; }
.focusslot:first-of-type { margin-top: 4px; }
.focusslot:hover { background: rgba(217,190,99,.12); }
[data-theme="dark"] .focusslot { color: #E4C766; border-color: #6A5A24; }
.goalform { display: flex; gap: 10px; }
.goalform .field__input { flex: 1; }
.card--brief { background: var(--brand-soft); border-color: transparent; }
.brief__text { font-size: 14px; line-height: 1.55; margin: 0; }
.attn__lead { display: block; padding: 11px 14px; border-radius: 10px; background: #F0EBFB; color: #5B3FA0;
  font-weight: 600; font-size: 14px; text-decoration: none; margin-bottom: 12px; }
[data-theme="dark"] .attn__lead { background: #241C3A; color: #B9A6E6; }

/* ===========================================================================
   Modal dialogs — the consistent add/edit form pattern (see modal.js).
   =========================================================================== */
dialog.modal { padding: 0; border: none; background: transparent; margin: 0;
  width: 100%; height: 100%; max-width: 100vw; max-height: 100vh; overflow: visible; color: var(--ink);
  opacity: 0; transition: opacity .2s ease, overlay .2s ease allow-discrete, display .2s ease allow-discrete; }
dialog.modal[open] { display: flex; align-items: center; justify-content: center; opacity: 1; }
@starting-style { dialog.modal[open] { opacity: 0; } }
dialog.modal::backdrop { background: rgba(15,25,19,.5); opacity: 0;
  transition: opacity .2s ease, overlay .2s ease allow-discrete, display .2s ease allow-discrete; }
dialog.modal[open]::backdrop { opacity: 1; }
@starting-style { dialog.modal[open]::backdrop { opacity: 0; } }
.modal__panel { background: var(--white); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,.28); width: min(540px, 94vw); max-height: 88vh;
  display: flex; flex-direction: column; overflow: hidden; }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 17px 22px; border-bottom: 1px solid var(--line); }
.modal__title { font-size: 16px; font-weight: 600; margin: 0; }
.modal__x { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; padding: 2px 6px; border-radius: 8px; }
.modal__x:hover { background: var(--canvas); color: var(--ink); }
.modal__body { padding: 20px 22px; overflow: auto; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 15px 22px; border-top: 1px solid var(--line); }
/* Right-anchored side-panel variant for longer forms. */
dialog.modal--side[open] { justify-content: flex-end; }
.modal--side .modal__panel { width: min(480px, 96vw); height: 100vh; max-height: 100vh; border-radius: 0; border-top: none; border-bottom: none; border-right: none;
  transform: translateX(100%); transition: transform .24s ease; }
dialog.modal--side[open] .modal__panel { transform: translateX(0); }
@starting-style { dialog.modal--side[open] .modal__panel { transform: translateX(100%); } }
.empty { padding: 32px; text-align: center; color: var(--muted); font-size: 14px; }
.person--inactive { opacity: .6; }
.person--link { cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.person--link:hover { border-color: var(--brand); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.person__dept { font-size: 12px; color: var(--muted); margin-top: 2px; }
.btn--danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn--danger:hover { filter: brightness(.94); }

/* --- Company structure (cards + hierarchy) --------------------------------- */
.segmented { display: inline-flex; gap: 6px; margin-bottom: 18px; }
.segmented__tab { font-size: 13px; font-weight: 600; padding: 5px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); text-decoration: none; }
.segmented__tab--active { background: var(--brand); border-color: var(--brand); color: #fff; }

.structdept { margin-bottom: 24px; }
.structdept__head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start;
  background: var(--brand-soft); border: 1px solid #b9d6c2; border-radius: 14px; padding: 16px 20px; }
[data-theme="dark"] .structdept__head { border-color: #2c4a38; }
.structdept__eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--brand); }
.structdept__name { font-size: 18px; font-weight: 700; margin: 3px 0; }
.structdept__purpose { font-size: 13.5px; color: var(--muted); margin: 0; }
.structdept__right { text-align: right; font-size: 12.5px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.structfns { margin: 10px 0 0 16px; padding-left: 16px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.structfn { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.structfn__name { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.structfn__purpose { font-size: 13px; color: var(--muted); margin: 3px 0 0; }
.structfn__kpi { font-size: 12px; color: var(--muted); margin-top: 3px; }
.wfpills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.wfpills .pill { text-decoration: none; background: var(--brand-tint); }

/* Company-structure section (Team / Positions / Structure / Change log): the
   demo's lighter, cooler green tint (B50) for its green chips instead of the
   app-wide B100 — see the ".page-org" hook on those pages' wraps. */
.page-org .chip,
.page-org .badge--muted,
.page-org .pill { background: var(--brand-tint); }
.wfpills button.pill { border: none; cursor: pointer; font-family: inherit; }
.wfpills button.pill:hover { background: var(--brand); color: #fff; }
.min0 { min-width: 0; }

.hier { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.hier__mt { background: #204631; color: #fff; border-radius: 12px; padding: 13px 24px; font-weight: 700; text-align: center; }
.hier__mtlist { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }
.hier__mtlist .pill { background: rgba(255,255,255,.16); color: #fff; font-weight: 500; }
.hier__cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; width: 100%; align-items: start; }
.hier__dept { background: var(--brand-tint); border: 1px solid #b9d6c2; border-radius: 12px; padding: 10px 14px; margin-bottom: 8px; }
[data-theme="dark"] .hier__dept { border-color: #2c4a38; }
.hier__deptname { font-weight: 700; }
.hier__box { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }

/* --- Task comments thread -------------------------------------------------- */
.comments { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.comment { display: flex; gap: 10px; align-items: flex-start; }
.comment__main { min-width: 0; flex: 1; background: var(--canvas); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.comment__head { display: flex; align-items: baseline; gap: 8px; }
.comment__author { font-weight: 600; font-size: 13.5px; }
.comment__body { font-size: 13.5px; margin-top: 2px; white-space: pre-wrap; }

/* --- Announcement relations ----------------------------------------------- */
.annrow__links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.annrow__linkadd { display: inline-flex; gap: 6px; align-items: center; }
.annrow__linkadd .field__select--sm { max-width: 180px; }

/* --- KPI sparkline + trend ------------------------------------------------ */
.kpi-trend { white-space: nowrap; }
.spark { display: inline-block; vertical-align: middle; width: 90px; height: 24px; }
.kpi-arrow { font-size: 12px; margin-left: 4px; vertical-align: middle; }
.kpi-spark-lg .spark { width: 100%; height: 48px; }
.kpi-spark-lg { background: var(--canvas); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }

/* --- Tasks: filter bar, labels, pagination -------------------------------- */
.taskfilter__labels { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.taglabel { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--canvas); border: 1px solid var(--line); color: var(--muted); text-decoration: none; }
a.taglabel:hover { border-color: var(--brand); color: var(--brand-dark); }
.taglabel--on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); }
.taglabel--removable { color: var(--brand-dark); background: var(--brand-soft); border-color: var(--brand-soft); }
.taglabel__x { background: none; border: 0; padding: 0 0 0 2px; color: inherit; cursor: pointer; font-size: 13px; line-height: 1; }
.taglabel__x:hover { color: var(--danger); }
.tasklabels { margin: 4px 0 8px; }
.tasklabels__row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.tasklabels__add { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.tasklabels__add .field__input--sm { max-width: 220px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; font-size: 12.5px; }

/* --- Strategy projects ---------------------------------------------------- */
.sproj { margin-bottom: 16px; }
.sproj__head { display: flex; align-items: flex-start; gap: 12px; }
.sproj__name { font-size: 16px; font-weight: 600; margin: 0; }
.sproj__meta { font-size: 12px; margin-top: 3px; }
.sproj__headright { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.sproj__goal { font-size: 13.5px; margin: 10px 0 6px; }
.sproj__reqs { margin: 8px 0; }
.sproj__reqlist { margin: 4px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--muted); }
.sproj__reqlist li { margin: 2px 0; }
.field__input--sm, .field__select--sm { padding: 5px 8px; font-size: 12.5px; }
/* details-based dropdown menu (CSP-safe, no JS) */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu__pop { position: absolute; right: 0; top: 100%; z-index: 20; min-width: 150px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; }
.menu__item { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 7px 10px; font: inherit; font-size: 13px; border-radius: 7px; cursor: pointer; color: inherit; }
.menu__item:hover { background: var(--canvas); }
.menu__item--danger { color: var(--danger); }
.krlist { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.kr { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.kr__head { display: flex; align-items: flex-start; gap: 12px; }
.kr__ctx { display: inline-block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--brand-dark); background: var(--brand-soft); border-radius: 6px; padding: 1px 6px; margin-right: 6px; }
.kr__name { font-weight: 600; font-size: 13.5px; }
.kr__meta { font-size: 11.5px; margin-top: 3px; }
.kr__prog { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.deliv { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.deliv__row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.deliv__check { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line); background: var(--white); font-size: 12px; cursor: pointer; color: var(--muted); flex-shrink: 0; }
.deliv__check--on { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.deliv__name--done { text-decoration: line-through; color: var(--muted); }
.deliv__x { background: none; border: 0; color: var(--line-strong, #c9c9c9); cursor: pointer; font-size: 12px; }
.deliv__x:hover { color: var(--danger); }
.deliv__add { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.deliv__add .field__input--sm { flex: 1; min-width: 140px; }
.kr-add { margin-top: 10px; }
.kr-add > summary { list-style: none; display: inline-block; cursor: pointer; }
.kr-add > summary::-webkit-details-marker { display: none; }
.kr-add__form { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.kr-add__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

/* --- Management team area -------------------------------------------------- */
.approvals { display: flex; flex-direction: column; gap: 8px; }
.approval { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.approval__row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; list-style: none; }
.approval__row::-webkit-details-marker { display: none; }
.approval__title { min-width: 0; flex: 1; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.approval__from { font-size: 12px; flex-shrink: 0; }
.approval__detail { border-top: 1px solid var(--line); background: var(--canvas); padding: 14px; }
.approval__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 12px; }
.approval__verdict { grid-column: 1 / -1; }
.approval__body { white-space: pre-wrap; background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 12px 0; font-size: 12.5px; line-height: 1.55; max-height: 320px; overflow: auto; }
.approval__actions { display: flex; justify-content: flex-end; gap: 8px; }
.mt-recent { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.mt-recent__row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 3px 0; }
.mt-recent__title { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prio { display: flex; flex-direction: column; gap: 8px; }
.prio__row { display: flex; align-items: flex-start; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.prio__row--flat { align-items: center; flex-wrap: wrap; }
.prio__date { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 38px; height: 38px; flex-shrink: 0; border-radius: 10px; background: var(--brand-soft); color: var(--brand-dark); }
.prio__day { font-size: 14px; font-weight: 700; line-height: 1; }
.prio__mon { font-size: 9px; text-transform: uppercase; }
.prio__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.prio__title { font-size: 13.5px; font-weight: 600; }
.prio__note { font-size: 12px; }

/* --- Run conversations: drawer thread + archive --------------------------- */
.comments--tight { gap: 8px; margin-bottom: 10px; }
.avatar--sm { width: 26px; height: 26px; font-size: 11px; }
.convo-list { display: flex; flex-direction: column; gap: 10px; }
.convo { padding: 0; }
.convo__trigger { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 12px 14px; cursor: pointer; color: inherit; font: inherit; }
.convo__top { display: flex; align-items: center; gap: 8px; }
.convo__title { font-weight: 600; font-size: 14.5px; }
.convo__meta { font-size: 12px; margin-top: 2px; }
.convo__last { display: flex; align-items: center; gap: 8px; margin-top: 8px; min-width: 0; }
.convo__preview { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo__author { font-weight: 600; }
.convo__time { font-size: 12px; flex-shrink: 0; }
.convo__trigger:hover { background: var(--canvas); }

/* --- Tasks: Today focus card ---------------------------------------------- */
.todaycard { background: #FCF8EC; border: 1px solid #EFE3BD; border-radius: 14px; padding: 14px 18px; margin-bottom: 16px; }
[data-theme="dark"] .todaycard { background: #241F0E; border-color: #3A3316; }
.todaycard__head { font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.todaycard__row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid rgba(217,190,99,.3); }
.todaycard__row:first-of-type { border-top: none; }
.todaycard__title { flex: 1; min-width: 0; font-weight: 500; font-size: 14px; }
.todaycard__row .task-due--over, .todaycard__row .muted { margin-left: auto; }

/* --- Tasks table (grouped inbox) ------------------------------------------- */
.tasktabs { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.tasktable-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.tasktable { width: 100%; border-collapse: collapse; font-size: 14px; }
.tasktable thead th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--table-head-fg); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--table-head-bg); }
.tasktable__group td { background: var(--canvas); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--table-subhead-fg); font-weight: 600; padding: 8px 16px; }
.tasktable__row td { padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
.tasktable__row:hover td { background: var(--canvas); }
.tasktable__task { display: flex; align-items: flex-start; gap: 12px; }
.tasktable__main { min-width: 0; }
.tasktable__title { font-weight: 600; }
.is-done .tasktable__title { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.tasktable__sub { font-size: 12.5px; margin-top: 3px; }
.tasktable__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.tasktable__source, .tasktable__due { white-space: nowrap; }
.tasktable__due.task-due--over { font-weight: 600; }
.tasktable__act { text-align: right; white-space: nowrap; }
.tasklead { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 999px; font-size: 13px; line-height: 1; flex: none; margin-top: 1px; }
.tasklead--done { background: var(--brand); color: #fff; }
.tasklead--auto { color: #7C5CBF; font-size: 15px; }
.tasklead--out { color: var(--muted); font-size: 15px; }
.tasklead--open { width: 19px; height: 19px; border: 1.5px solid var(--line); }
/* Clickable lead circle = one-click "mark done". Shows a check on hover. */
.tasklead--btn { padding: 0; cursor: pointer; background: none; transition: border-color .12s, background .12s, color .12s; color: transparent; }
.tasklead--btn::before { content: "✓"; font-size: 12px; line-height: 1; }
.tasklead--btn:hover { border-color: var(--brand); background: var(--brand-tint); color: var(--brand); }
.btn--remind { color: var(--danger); background: var(--danger-soft); border: 1px solid transparent; }
.btn--remind:hover { background: var(--danger); color: #fff; }
.tasks-foot { font-size: 12.5px; margin: 14px 2px 0; }

/* --- Task drawer (the editable, auto-saving panel) ------------------------- */
.tpanel__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tpanel__eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding-top: 4px; }
.tpanel__title { font-size: 23px; line-height: 1.28; font-weight: 700; margin: 8px 0 0; }
.tpanel__desc { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 16px 0 0; }
.tpanel__due { color: var(--muted); font-size: 14px; margin: 14px 0 0; }
.tpanel__hint { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 8px 0 0; }
.tpanel > .btn--primary { margin-top: 18px; }
.tpanel__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 18px; }
/* An inline "input + button" action (Mark done / Decline): the field grows, the
   button keeps its natural width, and both stretch to the same height so they
   line up. Takes the full row so it doesn't get cramped next to other buttons. */
.tpanel__inline { display: flex; gap: 8px; align-items: stretch; flex: 1 1 100%; }
.tpanel__inline .field__input--sm { flex: 1 1 auto; min-width: 0; }
.tpanel__inline .btn { flex: 0 0 auto; white-space: nowrap; }
.tpanel__sec { margin-top: 24px; }
.tpanel__label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.pillrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pill { font-size: 13px; font-weight: 600; padding: 6px 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); color: inherit; cursor: pointer; }
.pill:hover { border-color: var(--brand); }
.pill--on { background: var(--brand); border-color: var(--brand); color: #fff; }
.labelchip { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.labelchip__x { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 16px; line-height: 1; padding: 0; }
.labeladd__in { font-size: 13px; padding: 6px 14px; border-radius: 999px; border: 1px dashed var(--line); color: inherit; background: none; width: 130px; }
/* Toggleable label — every known label shown; on = it's applied to this task. */
.labeltoggle { font-size: 13px; font-weight: 500; padding: 5px 14px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--muted); cursor: pointer; transition: background .12s, border-color .12s, color .12s; }
.labeltoggle:hover { border-color: var(--brand); color: var(--brand); }
.labeltoggle--on, .labeltoggle--on:hover { background: var(--brand-soft); border-color: transparent; color: var(--brand-dark); font-weight: 600; }
.tpanel .field__textarea, .tpanel .field__input { width: 100%; }
/* run panel extras */
.runcard { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-top: 16px; }
.runcard__name { font-weight: 700; font-size: 16px; }
.runcard__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin-top: 12px; }
.runcard__wf { margin-top: 12px; font-size: 13px; }
.tpanel__two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-top: 22px; align-items: start; }
.tpanel__two .tpanel__label { margin-bottom: 5px; }
.starrate { display: flex; gap: 4px; }
.starrate__star { background: none; border: 0; cursor: pointer; font-size: 24px; line-height: 1; color: var(--line); padding: 0; transition: color .1s; }
.starrate__star.is-on, .starrate__star:hover { color: #E5A200; }
.btn--blocker { color: #7C5CBF; border: 1px solid #7C5CBF; background: none; }
.btn--blocker:hover { background: #7C5CBF; color: #fff; }

/* --- Workflows/activities table -------------------------------------------- */
.wtable td { vertical-align: middle; }
.wtable__name { font-weight: 600; font-size: 14px; }
.wtable__sub { font-size: 12px; color: var(--muted); }
.wtable__auto { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.wtable__run { text-align: right; white-space: nowrap; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); vertical-align: middle; }
.dot--ok { background: #3E7A54; } .dot--warn { background: #D97706; } .dot--bad { background: #DC2626; } .dot--muted { background: #cbd3cc; }
.runbtn { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--white); color: var(--brand); cursor: pointer; font-size: 12px; }
.runbtn:hover { border-color: var(--brand); background: var(--brand-soft); }
.runbtn--off { color: var(--muted); cursor: not-allowed; opacity: .5; }
.reviewrow { display: inline-flex; align-items: center; gap: 8px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }

/* --- Pill tones ------------------------------------------------------------ */
.pill--amber { background: #FCEFD5; color: #B4791A; }
.pill--purple { background: #F1EDFB; color: #6D57C2; }
.pill--blue { background: #DEEBF7; color: #2A6BB0; }
[data-theme="dark"] .pill--amber { background: #3A2E12; color: #F0A03C; }
[data-theme="dark"] .pill--purple { background: #241C3A; color: #B9A6E6; }
[data-theme="dark"] .pill--blue { background: #16283A; color: #7FB3E0; }

/* --- Meetings -------------------------------------------------------------- */
.meetingcard { margin-bottom: 12px; }
.meetingcard__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.meetingcard__title { font-weight: 600; font-size: 15px; }
.meetingcard__actions { margin-left: auto; display: inline-flex; gap: 6px; }
.meetingcard__meta { font-size: 13px; margin-top: 8px; }
.runrow { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--line); }
.runrow:first-of-type { border-top: none; }
.runrow__main { flex: 1; min-width: 0; }
.runrow__title { font-weight: 600; font-size: 14px; }
.datebadge { flex-shrink: 0; width: 46px; text-align: center; background: var(--canvas); border: 1px solid var(--line); border-radius: 10px; padding: 5px 0; line-height: 1.1; }
.datebadge b { display: block; font-size: 16px; font-weight: 700; }
.datebadge small { font-size: 10px; text-transform: uppercase; color: var(--muted); }
.statustext--planned { color: #B4791A; font-size: 13px; font-weight: 600; }
.progressrow { display: flex; align-items: center; gap: 10px; }

/* --- Chores week view ------------------------------------------------------ */
.rota-card { padding: 0; overflow: auto; max-height: 78vh; }
.weeknav { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 6px 0; }
.weeknav--bottom { margin-top: 12px; }
.weeknav__label { font-weight: 600; font-size: 14px; }
.weeknav__actions { display: flex; align-items: center; gap: 8px; }
.infobtn { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 12px; padding: 0 2px; vertical-align: middle; line-height: 1; }
.infobtn:hover { color: var(--brand); }
/* Hover-reveal cell actions — space stays reserved so the row doesn't jump. */
.cell-actions { opacity: 0; transition: opacity .12s ease; }
.rota td:hover .cell-actions, .rota td:focus-within .cell-actions { opacity: 1; }
/* Accent (green) card — e.g. the current "Your days off" list. */
.card--accent { background: var(--brand-soft); border-color: #b9d6c2; }
[data-theme="dark"] .card--accent { border-color: #2c4a38; }

/* ---------------------------------------------------------------------------
   Cmd+K command palette + sidebar search trigger
   --------------------------------------------------------------------------- */
.navsearch {
  display: flex; align-items: center; gap: 8px; width: 100%;
  margin: 0 0 10px; padding: 8px 10px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius-sm); color: rgba(255, 255, 255, .78);
  font: inherit; font-size: 13px; cursor: pointer; transition: background .12s ease, border-color .12s ease;
}
.navsearch:hover { background: rgba(255, 255, 255, .11); border-color: rgba(255, 255, 255, .24); }
.navsearch__icon { flex: none; opacity: .8; }
.navsearch__label { flex: 1; text-align: left; }
.navsearch__kbd {
  flex: none; font-family: var(--font-mono, ui-monospace, monospace); font-size: 11px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 4px; padding: 1px 5px; color: rgba(255, 255, 255, .7);
}

.cmdk {
  position: fixed; inset: 0; z-index: 200; display: flex; justify-content: center;
  align-items: flex-start; padding-top: 12vh; background: rgba(20, 35, 26, .45);
}
.cmdk[hidden] { display: none; }
.cmdk__panel {
  width: min(620px, 92vw); max-height: 70vh; display: flex; flex-direction: column;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(20, 35, 26, .28); overflow: hidden;
}
.cmdk__input {
  border: 0; border-bottom: 1px solid var(--line); padding: 15px 18px;
  font: inherit; font-size: 16px; color: var(--ink); background: transparent; outline: none;
}
.cmdk__results { overflow-y: auto; padding: 6px; }
.cmdk__group {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); padding: 10px 10px 4px;
}
.cmdk__item {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px;
  border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); cursor: pointer;
}
.cmdk__item--sel { background: var(--brand-soft); }
.cmdk__dot { flex: none; width: 9px; height: 9px; border-radius: 50%; }
.cmdk__title { font-size: 14px; font-weight: 500; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk__sub { margin-left: auto; padding-left: 12px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.cmdk__empty { padding: 26px; text-align: center; color: var(--muted); font-size: 14px; }
.cmdk__hint { border-top: 1px solid var(--line); padding: 8px 14px; font-size: 11px; color: var(--muted); }
.cmdk__hint kbd {
  font-family: var(--font-mono, ui-monospace, monospace); font-size: 10px; background: var(--canvas);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; margin: 0 1px;
}
[data-theme="dark"] .cmdk { background: rgba(0, 0, 0, .6); }
[data-theme="dark"] .cmdk__panel { box-shadow: 0 16px 48px rgba(0, 0, 0, .6); }

/* Today's office chores — dashboard card rows */
.chorerow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.chorerow:first-of-type { border-top: none; }
.chorerow__task { font-weight: 600; }
.chorerow__who { margin-left: auto; color: var(--muted); }

/* ---------------------------------------------------------------------------
   Detail drawer (htmx side panel) + shared .detail__* panel elements
   --------------------------------------------------------------------------- */
.drawer { position: fixed; inset: 0; z-index: 150; }
.drawer[hidden] { display: none; }
.drawer__scrim { position: absolute; inset: 0; background: rgba(20, 35, 26, .42); }
.drawer__panel {
  position: absolute; top: 0; right: 0; width: min(520px, 96vw); height: 100%;
  overflow-y: auto; overscroll-behavior: contain; background: var(--white);
  border-left: 1px solid var(--line);
  box-shadow: -14px 0 44px rgba(20, 35, 26, .16); padding: 24px 26px 36px;
  animation: drawerIn .16s ease;
}
@keyframes drawerIn { from { transform: translateX(18px); opacity: .5; } to { transform: none; opacity: 1; } }
.drawer__loading { color: var(--muted); padding: 30px 6px; font-size: 14px; }
body.drawer-open { overflow: hidden; }
[data-theme="dark"] .drawer__scrim { background: rgba(0, 0, 0, .62); }
[data-theme="dark"] .drawer__panel { box-shadow: -14px 0 44px rgba(0, 0, 0, .5); }

.detail__head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 2px; }
.detail__eyebrow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--brand); }
.detail__title { font-family: var(--font-head); font-size: 19px; font-weight: 700; line-height: 1.2; margin: 2px 0 0; }
.detail__sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.detail__x {
  margin-left: auto; flex: none; border: 1px solid var(--line); background: transparent;
  border-radius: 8px; width: 30px; height: 30px; font-size: 18px; line-height: 1; color: var(--muted); cursor: pointer;
}
.detail__x:hover { border-color: var(--brand); color: var(--brand); }
.detail__actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.detail__section { margin-top: 20px; }
.detail__label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 6px; }
.detail__row { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.detail__row:first-of-type { border-top: none; }
.detail__k { color: var(--muted); flex: none; min-width: 108px; }
.detail__v { font-weight: 500; min-width: 0; }
.detail__list { display: flex; flex-direction: column; }
.detail__link { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13.5px; text-align: left; background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; color: var(--ink); cursor: pointer; }
.detail__list .detail__link:first-child { border-top: none; }
.detail__link:hover { color: var(--brand); }
.detail__link-sub { margin-left: auto; color: var(--muted); font-size: 12px; }
.detail__empty { color: var(--muted); font-size: 13px; padding: 4px 0; }
/* Richer detail panels (e.g. the activity panel): status pills, a 2-col field
   grid, and a tinted "automation" box. */
.detail__pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.detail__grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.detail__grid2 .detail__v { margin-top: 3px; font-weight: 500; }
.detail__box { background: var(--brand-tint); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.chip--warn { background: #FCEFD5; color: #B4791A; }
[data-theme="dark"] .chip--warn { background: #3A2E12; color: #F0A03C; }
/* a plain clickable list-row trigger (used on list pages to open a drawer) */
.rowtrigger { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.rowtrigger:hover { color: var(--brand); text-decoration: underline; }

/* --- Sheet: a big CENTERED modal (the Position overview) ------------------- */
/* Stacks above the drawer (z 160 > 150) so a position can open from a drawer. */
.sheet { position: fixed; inset: 0; z-index: 160; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 18px; overflow-y: auto; }
.sheet[hidden] { display: none; }
.sheet__scrim { position: fixed; inset: 0; background: rgba(20, 35, 26, .46); }
.sheet__card {
  position: relative; width: min(920px, 100%); background: var(--white);
  border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 24px 70px rgba(20, 35, 26, .28); padding: 26px 30px 32px;
  animation: sheetIn .16s ease;
}
@keyframes sheetIn { from { transform: translateY(10px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet__loading { color: var(--muted); padding: 40px 6px; font-size: 14px; }
body.sheet-open { overflow: hidden; }
[data-theme="dark"] .sheet__scrim { background: rgba(0, 0, 0, .66); }
[data-theme="dark"] .sheet__card { box-shadow: 0 24px 70px rgba(0, 0, 0, .55); }

/* --- Position overview (the sheet's content) ------------------------------- */
.posov__top { display: flex; align-items: flex-start; gap: 14px; }
.posov__eyebrow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.posov__track { color: var(--brand); background: var(--brand-wash, rgba(124, 92, 214, .12)); border-radius: 999px; padding: 2px 9px; font-size: 10px; letter-spacing: .05em; }
.posov__track--link { border: 0; cursor: pointer; font-weight: 700; text-transform: uppercase; }
.posov__track--link:hover { filter: brightness(.94); text-decoration: underline; }
.posov__linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; text-align: left; }
.posov__linkbtn:hover { text-decoration: underline; }
.posov__tag--link { border: 0; cursor: pointer; font: inherit; }
.posov__tag--link:hover { color: var(--brand); background: var(--brand-wash, rgba(124, 92, 214, .12)); }
.posov__title { font-family: var(--font-head); font-size: 23px; font-weight: 700; line-height: 1.15; margin: 5px 0 0; }
.posov__topact { margin-left: auto; display: flex; gap: 8px; flex: none; }
.posov__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 30px 40px; margin-top: 22px; }
@media (max-width: 720px) { .posov__cols { grid-template-columns: 1fr; gap: 24px; } }
.posov__col { min-width: 0; }
.posov__group { margin-bottom: 22px; }
.posov__group:last-child { margin-bottom: 0; }
/* Big right-column section headers: ONGOING / ACCOUNTABILITY / OWNERSHIP */
.posov__section { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink); margin-bottom: 12px; }
/* Field/sub-section labels */
.posov__label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--table-head-fg); margin-bottom: 6px; }
.posov__label--mt { margin-top: 18px; }
.posov__sub { font-size: 12.5px; color: var(--muted); margin: -2px 0 8px; line-height: 1.4; }
.posov__muted { color: var(--muted); }

.posov__fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; margin-bottom: 22px; }
.posov__field { min-width: 0; }
.posov__k { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--table-head-fg); margin-bottom: 3px; }
.posov__v { font-size: 14px; color: var(--ink); }
.posov__person { color: var(--brand); font-weight: 600; font-size: 15px; text-decoration: none; }
.posov__person:hover { text-decoration: underline; }
.posov__vacant { display: inline-block; font-size: 13px; font-weight: 600; color: #B4791A; background: #FCEFD5; border-radius: 999px; padding: 3px 11px; text-decoration: none; }
.posov__vacant--link:hover { filter: brightness(.96); text-decoration: underline; }
[data-theme="dark"] .posov__vacant { color: #F0A03C; background: #3A2E12; }

/* Soft pill for scale / type values */
.posov__chip { display: inline-block; font-size: 13px; background: var(--canvas); border-radius: 8px; padding: 4px 10px; color: var(--ink); }
.posov__chip--sm { font-size: 11px; padding: 2px 8px; }

/* Bordered rows: responsibilities, direct reports, targets, projects */
.posov__items { display: flex; flex-direction: column; gap: 8px; }
.posov__item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 13px; font-family: inherit; font-size: 14px; color: var(--ink); background: var(--white); width: 100%; text-align: left; }
.posov__item--link { cursor: pointer; }
.posov__item--link:hover { border-color: var(--brand); }
.posov__item-name { color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.posov__item-sub { margin-left: auto; color: var(--muted); font-size: 12.5px; flex: none; }
.posov__item-tags { margin-left: auto; display: flex; gap: 6px; flex: none; }
.posov__badge { font-size: 11px; font-weight: 600; border-radius: 999px; padding: 2px 9px; margin-left: auto; flex: none; }
.posov__badge--ok { color: #2E7D46; background: #E3F3E8; }
[data-theme="dark"] .posov__badge--ok { color: #7BD69B; background: #16321F; }
.posov__empty { font-size: 13px; color: var(--muted); }

/* Ownership / accountability: label + inline gray tags */
.posov__own { margin-bottom: 14px; }
.posov__own:last-child { margin-bottom: 0; }
.posov__own-label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--table-head-fg); margin-bottom: 6px; }
.posov__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.posov__tag { display: inline-block; font-size: 12.5px; background: var(--canvas); border-radius: 8px; padding: 4px 10px; color: var(--ink); }

/* Cockpit — live "Today's focus" rows */
.focusrow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.focusrow:first-of-type { border-top: none; }
.focuscheck { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--brand); background: transparent; color: var(--brand); font-size: 13px; line-height: 1; cursor: pointer; padding: 0; }
.focuscheck:hover { background: var(--brand-soft); }
.focuscheck:disabled { border-color: var(--brand); background: var(--brand); color: #fff; cursor: default; }
.focusrow__title { flex: 1; min-width: 0; color: var(--ink); text-decoration: none; font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.focusrow__title:hover { text-decoration: underline; }
.focusrow__due { flex: none; font-size: 12px; color: var(--muted); }
.focusrow--done .focusrow__title { color: var(--muted); text-decoration: line-through; }
.focusnav { display: flex; gap: 6px; margin-top: 12px; }

/* Positions & policies review groups — two columns side by side (wraps on narrow). */
.review-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; align-items: start; }

.cta-row { display: flex; align-items: center; gap: 12px; }

/* Cockpit "Your people" chips + focus-panel week dots + over-capacity bar. */
.peoplerow { display: flex; flex-wrap: wrap; gap: 8px; }
.peoplechip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); background: var(--white); }
.peoplechip:hover { border-color: var(--brand); }
.peoplechip__name { font-size: 12.5px; font-weight: 500; }
.focus__week { display: flex; gap: 6px; margin-top: 14px; }
.focus__week .streakdot { background: rgba(255,255,255,.14); color: rgba(255,255,255,.85); border-color: rgba(255,255,255,.2); }
.focus__week .streakdot--won { background: rgba(255,255,255,.9); color: var(--brand-dark); }
.focus__week .streakdot--today { outline: 2px solid rgba(255,255,255,.5); }
.progress__bar--over { background: var(--danger); }

/* Hotlink rows with inline edit/delete controls (dept cockpit). */
.linkbox-row { display: flex; align-items: center; gap: 4px; }
.linkbox-row .linkbox { flex: 1; min-width: 0; }
.linkbox-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.chipwrap { display: inline-flex; align-items: center; gap: 1px; }
.iconx svg { width: 14px; height: 14px; display: block; }
.iconx--edit:hover { color: var(--brand); }

/* Event detail — who's attending (RSVPs) as people chips. */
.evt__attending { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.evt__attending-head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 10px; }

/* @-mentions: highlighted handle in a rendered comment + the typeahead popup. */
.mention { color: var(--brand-dark); font-weight: 600; }
[data-theme="dark"] .mention { color: var(--brand); }
.mention-pop { position: fixed; z-index: 1000; background: var(--white); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(18,22,42,.16); padding: 4px; max-height: 240px; overflow-y: auto; }
.mention-pop__item { display: flex; align-items: baseline; gap: 8px; padding: 6px 10px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.mention-pop__item--sel { background: var(--brand-tint); }
.mention-pop__handle { font-weight: 600; color: var(--brand-dark); font-size: 13px; }
.mention-pop__name { color: var(--muted); font-size: 12.5px; }

/* Admin data-cleanup table + action bar. */
.cleanup { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cleanup th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--table-head-fg); background: var(--table-head-bg); padding: 6px 10px; border-bottom: 1px solid var(--line); }
.cleanup td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.cleanup tr:hover td { background: var(--brand-tint); }
.cleanup__check { width: 34px; text-align: center; }
.cleanup__title { font-weight: 600; }
.cleanup__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.banner--danger { background: var(--danger-soft); border: 1px solid var(--danger); color: var(--danger); border-radius: 10px; padding: 10px 12px; font-size: 13px; }

/* Quick date-set chips under a due-date field. */
.quickdates { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* Searchable-select (combobox) — native <select> hidden underneath; the input +
   popup mirror the Cmd+K / @mention dropdown styling for consistency. */
.ss { position: relative; }
.ss__native { position: absolute; left: 0; top: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; margin: 0; }
.ss__input { width: 100%; padding-right: 30px; cursor: text; }
.ss__caret { position: absolute; right: 12px; top: 50%; width: 8px; height: 8px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.ss__clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 17px; line-height: 1; cursor: pointer; }
.ss__clear:hover { background: var(--brand-tint); color: var(--brand-dark); }
.ss__pop { position: fixed; z-index: 1100; max-height: 260px; overflow-y: auto; background: var(--white); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(18,22,42,.16); padding: 4px; }
.ss__group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px 4px; font-weight: 700; }
.ss__opt { padding: 7px 10px; border-radius: 7px; cursor: pointer; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss__opt--active { background: var(--brand-tint); }
.ss__opt--current { font-weight: 600; color: var(--brand-dark); }
.ss__empty { padding: 8px 10px; color: var(--muted); font-size: 13px; }

/* --- Meeting rooms calendar (rooms as columns, hours down the side) -------- */
.rooms-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.rooms-strip { display: flex; gap: 4px; flex-wrap: wrap; }
.rooms-strip__day { display: flex; flex-direction: column; align-items: center; min-width: 46px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); }
.rooms-strip__day:hover { border-color: var(--brand); }
.rooms-strip__day--sel { background: var(--brand); border-color: var(--brand); color: #fff; }
.rooms-strip__day--today:not(.rooms-strip__day--sel) { border-color: var(--brand); color: var(--brand); }
.rooms-strip__wd { font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em; }
.rooms-strip__num { font-weight: 700; font-size: 15px; }

.rooms-cal { display: flex; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.rooms-cal__gutter { flex: 0 0 54px; border-right: 1px solid var(--line); }
.rooms-cal__corner { height: 34px; border-bottom: 1px solid var(--line); }
.rooms-cal__hour { height: 48px; font-size: 11px; color: var(--muted); text-align: right; padding-right: 6px; box-sizing: border-box; }
.rooms-cal__col { flex: 1 0 150px; border-right: 1px solid var(--line); }
.rooms-cal__col:last-child { border-right: none; }
.rooms-cal__colhead { height: 34px; display: flex; align-items: center; justify-content: center; gap: 4px; font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--line); background: var(--canvas); position: sticky; top: 0; z-index: 1; }
.rooms-cal__body { position: relative; }
.rooms-cal__slot { height: 48px; border-bottom: 1px solid var(--line); box-sizing: border-box; }
.rooms-cal__slot:hover { background: var(--brand-tint); cursor: pointer; }
.rooms-cal__event { position: absolute; left: 3px; right: 3px; min-height: 16px; background: var(--brand-soft); border: 1px solid #b9d6c2; border-radius: 6px; padding: 2px 5px; overflow: hidden; font-size: 11.5px; color: var(--ink); }
.rooms-cal__event--mine { background: var(--brand); border-color: var(--brand-dark); color: #fff; }
.rooms-cal__event-t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 24px; }
.rooms-cal__event-m { font-size: 10.5px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rooms-cal__act { position: absolute; top: 1px; margin: 0; }
.rooms-cal__act--x { right: 2px; }
.rooms-cal__act--series { right: 17px; }
.rooms-cal__btn { background: none; border: none; cursor: pointer; font-size: 11px; line-height: 1; color: inherit; opacity: .6; padding: 1px 2px; }
.rooms-cal__btn:hover { opacity: 1; }

/* ============================================================================
   Support hub (see docs/adr/0020): the "how it fits together" map, editable
   overview sections, the FAQ accordion, and the grounded assistant chat.
   All colours come from the shared tokens, so light/dark both work.
   ========================================================================== */

.page-head__actions { display: flex; align-items: center; gap: 8px; }

/* Relationship map — a fixed, at-a-glance diagram of the core model. */
.rel { padding: 18px 18px 16px; }
.rel__title { font-family: var(--font-head); font-weight: 700; font-size: 15px; margin-bottom: 14px; }
.rel__flow {
  display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px;
  margin-bottom: 12px;
}
.rel__flow:last-of-type { margin-bottom: 4px; }
.rel__node {
  display: flex; flex-direction: column; gap: 2px; justify-content: center;
  min-width: 128px; padding: 10px 14px;
  background: var(--brand-tint); border: 1px solid var(--line);
  border-radius: var(--radius-sm); text-decoration: none; color: var(--ink);
  transition: border-color .12s ease, background .12s ease;
}
a.rel__node:hover { border-color: var(--brand); background: var(--brand-soft); }
.rel__node--soft { background: var(--canvas); border-style: dashed; }
.rel__node--plain { background: var(--canvas); }
.rel__name { font-weight: 650; font-size: 13.5px; }
.rel__sub { font-size: 11.5px; color: var(--muted); }
.rel__link { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 0 2px; }
.rel__arrow { color: var(--brand); display: inline-flex; }
.rel__arrow .ico { width: 18px; height: 18px; }
.rel__linklbl { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.rel__legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.rel__legendlbl { font-size: 12px; color: var(--muted); margin-right: 2px; }
a.chip--soft { text-decoration: none; }
a.chip--soft:hover { border-color: var(--brand); color: var(--brand-dark); }

/* Editable overview sections. */
.support-sections { display: grid; gap: 14px; margin-top: 14px; }
.support-section { padding: 16px 18px; }
.support-section__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.support-section__title { font-size: 16px; font-weight: 700; margin: 0; }
.support-section__body { font-size: 14px; line-height: 1.6; color: var(--ink); white-space: pre-wrap; }

/* FAQ — native <details> accordion (CSP-safe, no JS). */
.faq { display: grid; gap: 10px; margin-top: 4px; }
.faq__item { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.faq__q {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; cursor: pointer; list-style: none; font-weight: 600; font-size: 14.5px;
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q:hover { background: var(--brand-tint); }
.faq__chev { color: var(--muted); display: inline-flex; transition: transform .15s ease; }
.faq__item[open] .faq__chev { transform: rotate(90deg); }
.faq__a { padding: 0 16px 14px; font-size: 14px; line-height: 1.6; color: var(--muted); white-space: pre-wrap; }
.faq__edit { padding: 0 16px 14px; }

/* Assistant chat. */
.chat { margin-top: 18px; padding: 0; overflow: hidden; }
.chat__head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.chat__icon { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); }
.chat__icon .ico { width: 18px; height: 18px; }
.chat__title { font-family: var(--font-head); font-weight: 700; font-size: 15px; }
.chat__sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.chat__log { display: flex; flex-direction: column; gap: 10px; padding: 18px; max-height: 460px; overflow-y: auto; }
.chatmsg { display: flex; }
.chatmsg--user { justify-content: flex-end; }
.chatmsg--bot { justify-content: flex-start; }
.chatmsg__bubble {
  max-width: 82%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.55;
  white-space: pre-wrap; word-wrap: break-word;
}
.chatmsg--bot .chatmsg__bubble { background: var(--brand-tint); border: 1px solid var(--line); border-bottom-left-radius: 4px; color: var(--ink); }
.chatmsg--user .chatmsg__bubble { background: var(--brand); color: var(--inverse-ink); border-bottom-right-radius: 4px; }
.chatmsg--warn .chatmsg__bubble { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--ink); }
/* htmx request indicator — a subtle "thinking" affordance on the send button. */
.chat__form.htmx-request .chat__send { opacity: .6; }
.chat__form { display: flex; align-items: flex-end; gap: 10px; padding: 14px 18px 6px; border-top: 1px solid var(--line); }
.chat__input {
  flex: 1; resize: vertical; min-height: 42px; max-height: 180px; padding: 10px 12px;
  font: inherit; font-size: 14px; color: var(--ink); background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.chat__input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.chat__input:disabled { background: var(--canvas); color: var(--muted); }
.chat__send { white-space: nowrap; }
.chat__hint { padding: 0 18px 14px; font-size: 11.5px; }

/* ============================================================================
   Dashboard idea box (see docs/adr/0021): a submit card whose form swaps to a
   thank-you state in place via htmx. Uses the shared card/field/btn tokens.
   ========================================================================== */
.idea__intro { font-size: 12.5px; margin: -2px 0 12px; }
.idea__form .field { margin-bottom: 10px; }
.idea__form .form-actions { display: flex; justify-content: flex-end; margin-top: 2px; }
.idea__error {
  font-size: 12.5px; color: var(--danger); background: var(--danger-soft);
  border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent);
  border-radius: var(--radius-sm); padding: 8px 10px; margin: 0 0 12px;
}
.idea__done { text-align: center; padding: 8px 4px 6px; }
.idea__check {
  width: 38px; height: 38px; margin: 0 auto 10px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--ok-soft); color: var(--ok);
}
.idea__check .ico { width: 20px; height: 20px; }
.idea__thanks { font-size: 13.5px; line-height: 1.5; margin: 0 0 12px; }
.idea__form.htmx-request .btn--primary { opacity: .6; }
