:root {
  /* ── Sept 2026 design tokens (MIS Home & Navigation handoff) ──────────
     Green is an accent only: active states, primary buttons, the hero band. */
  --primary:       #257F34;   /* link / accent */
  --primary-hover: #1E6429;
  --primary-dark:  #154A1E;   /* hero band, rail active label */
  --primary-light: #D2F8DC;
  --action:        #257F34;   /* primary button: white text 5.0:1 (was #39B54B, 2.66:1, below AA) */
  --action-hover:  #1E6429;
  --accent:        #f0a500;   /* legacy amber, login art only */
  --accent-dark:   #c88600;
  --ink:           #111827;
  --ink-2:         #374151;
  --muted:         #6B7280;
  --muted-2:       #9CA3AF;
  --line:          #E5E7EB;
  --page:          #F9FAFB;
  --panel-active:  #F3F4F6;
  --rail-w:        76px;
  --panel-w:       232px;
  /* SOWA Intelligence surfaces (AI panels, banners, chat) */
  --si-surface:    #F3FAF4;
  --si-border:     #CFE8D4;
  --si-ink:        var(--primary-dark);
  --sidebar-w:     calc(var(--rail-w) + var(--panel-w));
  --topbar-h:      64px;
  --danger:        #B91C1C;
  --success:       #257F34;
  --warning:       #A16207;
  --radius:        14px;
  --shadow-sm:     0 1px 2px rgba(17,24,39,0.04);
  --shadow-md:     0 4px 18px rgba(17,24,39,0.08);
  --shadow-lg:     0 12px 40px rgba(17,24,39,0.16);

  /* ── Workflow status colors ──────────────────────────────
     One pair (bg + fg) per workflow state. Use these — via the
     .badge-<status> classes below — for every status indicator,
     never ad-hoc hex values. */
  --status-pending-bg:           #FEF9C3;  --status-pending-fg:           #A16207;
  --status-approved-bg:          #D2F8DC;  --status-approved-fg:          #257F34;
  --status-rejected-bg:          #FEE2E2;  --status-rejected-fg:          #B91C1C;
  --status-draft-bg:             #F3F4F6;  --status-draft-fg:             #6B7280;
  --status-info-requested-bg:    #FEF9C3;  --status-info-requested-fg:    #A16207;
  --status-awaiting-decision-bg: #DBEAFE;  --status-awaiting-decision-fg: #1D4ED8;
  --status-paid-bg:              #154A1E;  --status-paid-fg:              #ffffff;
  --status-processing-bg:        #DBEAFE;  --status-processing-fg:        #1D4ED8;
}

* { box-sizing: border-box; }
body { font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif; background: var(--page); margin: 0; color: var(--ink); font-size: 13px; }
h1, h2, h3, h4, h5, h6 { color: var(--ink); }

/* ─────────────── LOGIN / GATE SCREENS ─────────────── */
/* ─────────────── SIGN-IN (YoAccountant pre-login shell) ───────────────
   The sign-in screens carry the product's colours, not the organisation's:
   they are the same page for every organisation, so the YoA tokens are set
   here for both themes (brand.css only applies under html.theme-yoa).
   Shape: one 384px panel, 32px padding, 14px radius, 1px border, no shadow,
   on the muted surface; Roboto 15px; buttons rounded-xl, 44px; no animation
   loops. docs/plans/PLAN-sign-in-access-and-organisations.md §2. */
.login-screen {
  --li-primary: #1C6D00; --li-primary-hover: #165800; --li-primary-deep: #114100; --li-primary-tint: #E8F0E6;
  --li-text: #16181D; --li-text-2: #43484F; --li-muted: #5B6169;
  --li-border: #E7E9EC; --li-border-strong: #D8DCE1; --li-surface: #FFFFFF; --li-page: #F5F6F8;
  --li-danger-text: #B91C1C; --li-danger-tint: #FEE2E2; --li-warn-text: #B45309; --li-warn-tint: #FEF3C7;
  --li-info-text: #1D4ED8; --li-info-tint: #DBEAFE;
  --primary: var(--li-primary);          /* legacy name a few inline rules still read */
  min-height: 100vh; min-height: 100dvh;
  background: var(--li-page);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 16px;
  font-family: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px; line-height: 1.5; color: var(--li-text);
}
.login-card {
  width: 100%; max-width: 384px; box-sizing: border-box;
  background: var(--li-surface); border: 1px solid var(--li-border); border-radius: 14px;
  padding: 32px; display: flex; flex-direction: column; gap: 20px;
}
.login-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.login-mark {
  width: 44px; height: 44px; border-radius: 12px; background: var(--li-primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem;
}
.login-mark-img { height: 44px; max-width: 180px; object-fit: contain; display: block; }
.login-wordmark { height: 32px; width: auto; display: block; }
.login-brand { font-size: 17px; font-weight: 900; color: var(--li-primary-deep); letter-spacing: 0.01em; line-height: 1.2; }
.login-head { text-align: center; display: flex; flex-direction: column; gap: 4px; }
.login-title { margin: 0; font-size: 17px; font-weight: 800; color: var(--li-primary-deep); line-height: 1.3; }
.login-sub { margin: 0; font-size: 13px; color: var(--li-muted); }
.login-sub b { color: var(--li-text-2); font-weight: 700; }
.login-otp-status { text-align: center; }
/* Each step stacks its form, the passkey block and the links with one rhythm (hidden parts take no gap). */
#loginStep1, #loginStep2 { display: flex; flex-direction: column; gap: 16px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-field label { font-size: 13px; font-weight: 500; color: var(--li-text-2); }
.login-field-help { font-size: 12px; color: var(--li-muted); }
.login-input {
  box-sizing: border-box; width: 100%; height: 44px; padding: 0 14px; margin: 0;
  font: inherit; font-size: 15px; color: var(--li-text);
  background: var(--li-surface); border: 1px solid var(--li-border-strong); border-radius: 12px;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.login-input:focus { outline: none; border-color: var(--li-primary); box-shadow: 0 0 0 3px rgba(28,109,0,0.12); }
.login-input[readonly] { background: var(--li-page); color: var(--li-text-2); }
.login-input.is-pin { letter-spacing: 0.2em; }
.login-input.is-pin::placeholder, .login-input.is-pin:placeholder-shown { letter-spacing: normal; }
.login-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.login-btn {
  box-sizing: border-box; width: 100%; height: 44px; padding: 0 16px; border-radius: 12px;
  font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.login-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(28,109,0,0.25); }
.login-btn:disabled { opacity: 0.65; cursor: default; }
.login-btn[aria-busy="true"] { opacity: 0.9; }   /* the busy signal the person watches stays legible (4.7:1) */
.login-btn-primary { background: var(--li-primary); border: 1px solid var(--li-primary); color: #fff; }
.login-btn-primary:hover:not(:disabled) { background: var(--li-primary-hover); border-color: var(--li-primary-hover); }
.login-btn-outline { background: var(--li-surface); border: 1px solid var(--li-border-strong); color: var(--li-text); font-weight: 500; }
.login-btn-outline:hover:not(:disabled) { background: var(--li-page); }
.login-btn-outline .bi { color: var(--li-primary); font-size: 1.1rem; }
.login-or { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; color: var(--li-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.login-or::before, .login-or::after { content: ''; flex: 1; height: 1px; background: var(--li-border); }
/* C. Choose an organisation (plan S2 §2.2 C): one button per organisation, 56px, a 40px
   logo chip with initials as the fallback, no per-organisation colour; Sign out is a 40px ghost. */
.login-org-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.login-org-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 12px;
  background: var(--li-surface); border: 1px solid var(--li-border-strong); border-radius: 12px;
  font: inherit; color: var(--li-text); text-align: left; cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease;
}
.login-org-row:hover:not(:disabled) { background: var(--li-page); border-color: var(--li-primary); }
.login-org-row:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(28,109,0,0.25); border-color: var(--li-primary); }
.login-org-row:disabled { opacity: 0.65; cursor: default; }
.login-org-chip {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--li-primary-tint); color: var(--li-primary-deep); font-size: 14px; font-weight: 700;
}
.login-org-chip img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.login-org-text { display: flex; flex-direction: column; min-width: 0; }
.login-org-name { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.login-org-meta { font-size: 13px; color: var(--li-muted); }
.login-btn-ghost { height: 40px; background: transparent; border: 1px solid transparent; color: var(--li-text-2); font-weight: 500; }
.login-btn-ghost:hover:not(:disabled) { background: var(--li-page); }
/* The same rows inside the app's Switch organisation dialog. */
.org-switch-list { --li-surface: #fff; --li-border-strong: #D8DCE1; --li-page: #F5F6F8; --li-primary: #1C6D00; --li-primary-tint: #E8F0E6; --li-primary-deep: #114100; --li-text: #16181D; --li-muted: #5B6169; }
.org-switch-list .login-org-row { margin-bottom: 8px; }
.login-wait { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 13px; color: var(--li-muted); margin-top: 10px; }
.login-wait .login-link-btn { min-height: 40px; padding: 0 10px; }   /* a 40px Cancel (plan §2.2 E) */
.login-links { margin: 0; text-align: center; font-size: 13px; color: var(--li-muted); }
.login-links-stack { display: flex; flex-direction: column; gap: 8px; }
.login-links-stack p { margin: 0; }
.login-link, .login-link-btn { color: var(--li-primary); font-weight: 500; text-decoration: none; }
.login-link:hover, .login-link-btn:hover:not(:disabled) { color: var(--li-primary-hover); text-decoration: underline; }
.login-link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: inherit; font-weight: 700; cursor: pointer; min-height: 24px; }
.login-link-btn:disabled { color: var(--li-muted); font-weight: 500; cursor: default; }
.login-link-btn:focus-visible, .login-link:focus-visible { outline: 2px solid var(--li-primary); outline-offset: 2px; border-radius: 4px; }
/* When the code has expired, Resend is the only sensible action, so it takes the button's shape. */
.login-link-btn.is-primary { display: inline-flex; width: 100%; height: 44px; border-radius: 12px; background: var(--li-primary); color: #fff; align-items: center; justify-content: center; text-decoration: none; margin-top: 4px; }
.login-resend-wait { color: var(--li-muted); margin-left: 4px; font-variant-numeric: tabular-nums; }
.login-countdown { color: var(--li-muted); }
.login-countdown.is-expired { color: var(--li-warn-text); }
.tnum { font-variant-numeric: tabular-nums; color: var(--li-text-2); font-weight: 700; }
.login-alert {
  display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px;
  font-size: 13px; line-height: 1.45; text-align: left;
}
.login-alert-danger { background: var(--li-danger-tint); color: var(--li-danger-text); }
.login-alert-warn   { background: var(--li-warn-tint);   color: var(--li-warn-text); }
.login-alert-info   { background: var(--li-info-tint);   color: var(--li-info-text); }
.login-notice { padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.45; background: var(--li-info-tint); color: var(--li-info-text); }
.login-notice.is-danger { background: var(--li-danger-tint); color: var(--li-danger-text); }
.login-notice.is-warn   { background: var(--li-warn-tint);   color: var(--li-warn-text); }
/* Six code boxes that still fit a 375px phone: 279px of content column, flex-sized with a cap. */
.otp-row { display: flex; justify-content: center; gap: 8px; }
.otp-digit {
  flex: 1 1 0; min-width: 0; max-width: 46px; height: 52px; box-sizing: border-box; padding: 0; margin: 0;
  text-align: center; font: inherit; font-size: 20px; font-weight: 800; color: var(--li-text);
  background: var(--li-surface); border: 1.5px solid var(--li-border-strong); border-radius: 10px;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.otp-digit:focus { outline: none; border-color: var(--li-primary); box-shadow: 0 0 0 3px rgba(28,109,0,0.12); }
.otp-digit:disabled { background: var(--li-page); }
.login-footer-note {
  margin: 0; padding-top: 16px; border-top: 1px solid var(--li-border);
  text-align: center; font-size: 12px; color: var(--li-muted);
}
.login-screen .spinner-border { border-width: 2px; }
@media (prefers-reduced-motion: reduce) {
  .login-screen .spinner-border { animation-duration: 1.5s; }
  .login-input, .login-btn, .otp-digit { transition: none; }
}
@media (max-width: 399.98px) {
  .login-card { padding: 24px; }
}

/* ─────────────── APP LAYOUT ─────────────── */
#sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w); height: 100vh;
  display: flex; flex-direction: row;
  z-index: 100; background: #fff;
}
#mainContent {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--page);
}
#topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0 1.5rem;
  position: sticky; top: 0; z-index: 50;
}
#pageTitle { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; min-width: 90px; }
.page-area { padding: 1.5rem; flex: 1; }
/* The floating SOWA Intelligence button (56px, 24px from the bottom) sat over
   the last rows of a page, e.g. the toggle lists at the foot of Settings.
   While it is on screen, every page keeps room for it below its content. */
body:has(#chatBubble:not(.d-none)) .page-area { padding-bottom: 96px; }

/* ─────────────── SECTION RAIL ─────────────── */
.nav-rail {
  width: var(--rail-w); flex: 0 0 var(--rail-w);
  background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: stretch;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none;
}
.nav-rail::-webkit-scrollbar { display: none; }
.rail-brand {
  height: var(--topbar-h); display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--line); text-decoration: none; flex-shrink: 0;
}
.rail-brand img { max-width: 44px; max-height: 40px; object-fit: contain; }
.rail-brand-mark {
  width: 38px; height: 38px; border-radius: 11px; background: var(--primary-dark);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.rail-items { display: flex; flex-direction: column; padding: 6px 0; flex: 1; }
.rail-bottom { display: flex; flex-direction: column; padding: 6px 0 10px; border-top: 1px solid var(--line); }
.rail-item {
  position: relative; box-sizing: border-box; align-self: stretch;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 60px; padding: 8px 3px 8px 0;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 9.5px; line-height: 1.1; letter-spacing: -0.01em;
  border-left: 3px solid transparent; border-right: 0;
  background: none; border-top: 0; border-bottom: 0; cursor: pointer; width: 100%;
  transition: color 0.15s, background 0.15s;
}
.rail-item i { font-size: 1.25rem; line-height: 1; }
.rail-item:hover { color: var(--ink); background: var(--page); }
.rail-item.active { color: var(--primary-dark); font-weight: 700; border-left-color: var(--primary); background: #fff; }
.rail-item.active i { color: var(--primary); }
.rail-label { text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-badge {
  position: absolute; top: 6px; right: 12px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: #fff; color: var(--danger); border: 1.5px solid var(--danger);
  font-size: 9.5px; font-weight: 800; line-height: 13px; text-align: center;
}
.rail-signout { color: var(--muted-2); }
.rail-signout:hover { color: var(--danger); }

/* ─────────────── SECTION PANEL ─────────────── */
.nav-panel {
  width: var(--panel-w); flex: 0 0 var(--panel-w);
  background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; overflow: hidden;
}
.panel-head { padding: 14px 14px 8px; border-bottom: 1px solid var(--line); }
.panel-title { font-size: 15px; font-weight: 800; color: var(--ink); letter-spacing: -0.01em; margin-bottom: 10px; }
.panel-search, .topbar-search {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: var(--page); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 10px; color: var(--muted); font-size: 12px; cursor: pointer; text-align: left;
  font-family: inherit;
}
.panel-search:hover, .topbar-search:hover { border-color: #D1D5DB; color: var(--ink-2); }
.panel-search span, .topbar-search span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-search kbd, .topbar-search kbd, .cmdk kbd {
  font-family: inherit; font-size: 10px; font-weight: 700; color: var(--muted);
  background: #fff; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px;
}
.panel-body { flex: 1; overflow-y: auto; padding: 8px 10px; }
.panel-group { margin-bottom: 10px; }
.panel-heading { font-size: 10px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); padding: 8px 8px 4px; }
.panel-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 8px; border-radius: 8px; margin-bottom: 1px;
  color: var(--ink-2); text-decoration: none; font-size: 13px; font-weight: 500;
  transition: background 0.12s, color 0.12s;
}
.panel-item i { font-size: 15px; width: 18px; text-align: center; color: var(--muted); flex-shrink: 0; }
.panel-item span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-item:hover { background: var(--page); color: var(--ink); }
.panel-item.active { background: var(--panel-active); color: var(--ink); font-weight: 700; }
.panel-item.active i { color: var(--primary); }
.panel-item.action { color: var(--primary); font-weight: 600; }
.panel-item.action i { color: var(--primary); }
.panel-item.soon { color: var(--muted-2); cursor: default; }
.panel-item.soon i { color: #D1D5DB; }
.panel-soon { font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-2); background: var(--page); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; }
.panel-count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center;
}
.panel-count.muted  { background: var(--panel-active); color: var(--ink-2); }
.panel-count.danger { background: #FEE2E2; color: var(--danger); }
.panel-foot { padding: 8px 10px; border-top: 1px solid var(--line); }
.drawer-user { display: none; }

/* M365 pill (panel footer) */
.m365-pill {
  background: var(--page); border-radius: 20px; border: 1px solid var(--line);
  padding: 0.3rem 0.7rem; display: flex; align-items: center; gap: 0.45rem;
  font-size: 0.72rem; color: var(--ink-2);
}
.m365-dot { width: 8px; height: 8px; border-radius: 50%; background: #9CA3AF; flex-shrink: 0; }
.m365-dot.connected { background: var(--action); box-shadow: 0 0 6px rgba(57,181,75,0.6); }

.avatar-sm {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary-dark);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 0.8rem; flex-shrink: 0;
}
.x-small { font-size: 0.72rem; }

/* ─────────────── TOPBAR ─────────────── */
.topbar-right { display: flex; align-items: center; gap: 0.9rem; min-width: 0; flex: 0 1 auto; }
.topbar-search { width: 240px; flex: 0 1 240px; min-width: 40px; }
@media (max-width: 1199.98px) { .topbar-date { display: none !important; } .topbar-search { flex-basis: 170px; } }
.topbar-date { font-size: 12px; color: var(--muted); white-space: nowrap; }
.topbar-m365 {
  display: flex; align-items: center; gap: 0.4rem;
  background: var(--primary-light); color: var(--primary);
  border-radius: 20px; padding: 0.3rem 0.85rem;
  font-size: 0.76rem; font-weight: 700; cursor: pointer;
  border: 1px solid #B9EBC6;
  transition: background 0.15s;
}
.topbar-m365:hover { background: #BDF0CA; }
.user-chip {
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  padding: 4px 8px 4px 4px; border-radius: 999px; border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
.user-chip:hover { background: var(--page); border-color: var(--line); }
/* Focus lands here when a dialog opened from the profile menu closes (js/orgs.js). */
.user-chip:focus-visible { outline: 2px solid #1C6D00; outline-offset: 2px; }
.user-chip-text { line-height: 1.15; max-width: 160px; }
.user-chip-name { font-size: 12.5px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip-role { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip-caret { font-size: 11px; color: var(--muted-2); }
.user-chip-sep { margin: 0 5px; color: var(--muted-2); }
.avatar-wrap { position: relative; flex-shrink: 0; }
.presence { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #9CA3AF; border: 2px solid #fff; }
.presence.is-live { background: #22C55E; }
.live-text { font-weight: 600; color: var(--muted); }
.live-text.is-live { color: #15803D; }

/* ─────────────── STAT CARDS ─────────────── */
.stat-card {
  background: #fff; border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--line);
  border-left: 5px solid var(--primary);
  display: flex; align-items: center; gap: 1.1rem;
  transition: box-shadow 0.2s, transform 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.success { border-left-color: var(--success); }
.stat-card.danger  { border-left-color: var(--danger); }
.stat-icon {
  width: 54px; height: 54px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
}
.stat-icon.primary { background: var(--primary-light); color: var(--primary); }
.stat-icon.warning { background: #fff8e1; color: #c87f00; }
.stat-icon.success { background: #e8f5e9; color: var(--success); }
.stat-icon.danger  { background: #fdecea; color: var(--danger); }
.stat-number { font-size: 2.1rem; font-weight: 800; line-height: 1; color: #1a2520; }
.stat-label  { font-size: 0.81rem; color: #7a8c82; margin-top: 3px; }

/* ─────────────── CARDS ─────────────── */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; }
.card-header {
  background: #fff; border-bottom: 1px solid var(--line);
  font-weight: 800; font-size: 14px; border-radius: var(--radius) var(--radius) 0 0 !important;
  padding: 0.9rem 1.25rem;
}

/* ─────────────── TABLE ─────────────── */
.table-clean { font-size: 0.875rem; }
.table-clean thead th {
  background: #f7f9f7; font-weight: 700; color: #3d5045;
  border-bottom: 2px solid #e3e9e5; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.table-clean tbody tr { transition: background 0.12s; }
.table-clean tbody tr:hover { background: #f5faf6; }

/* ─────────────── BADGES ─────────────── */
.badge-status {
  padding: 0.3em 0.75em; border-radius: 20px; white-space: nowrap;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
}
/* Status pills (Home + tables). Same five tones as the handoff. */
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; line-height: 1.5; }
.pill-amber { background: #FEF9C3; color: #A16207; }
.pill-blue  { background: #DBEAFE; color: #1D4ED8; }
.pill-green { background: #D2F8DC; color: #257F34; }
.pill-red   { background: #FEE2E2; color: #B91C1C; }
.pill-gray  { background: #F3F4F6; color: #6B7280; }
/* ─────────────── SOWA INTELLIGENCE MARK ─────────────── */
.si-mark { display: inline-grid; place-items: center; flex: none; vertical-align: middle;
  border-radius: 30%; background: var(--primary); color: #fff; }
.si-mark svg { display: block; overflow: visible; }
.si-mark--on-dark { background: rgba(255,255,255,0.16); }
.si-mark--inline { margin-right: 0.35em; }

/* Painted from the local copy, waiting for the first snapshot (js/init.js). */
.app-provisional { cursor: progress; }
.app-provisional #topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  background-size: 40% 100%; background-repeat: no-repeat;
  animation: app-provisional-bar 1.2s linear infinite;
}
@keyframes app-provisional-bar { from { background-position: -40% 0; } to { background-position: 140% 0; } }
@media (prefers-reduced-motion: reduce) { .app-provisional #topbar::after { animation: none; background: var(--primary); opacity: .5; } }

/* ─────────────── SOWA INTELLIGENCE CHAT — FULLSCREEN MODE ─────────────── */
#chatBubble.chat-expanded {
  inset: 16px !important;
  align-items: stretch !important;
  justify-content: stretch;
}
#chatBubble.chat-expanded #chatPanel {
  width: 100% !important;
  height: 100%;
  max-height: none !important;
  flex: 1;
}
#chatBubble.chat-expanded #chatMessages {
  max-height: none !important;
  /* Centre a comfortable reading column on wide screens */
  padding: 20px max(16px, calc((100% - 900px) / 2)) !important;
}
#chatBubble.chat-expanded #chatSuggestions,
#chatBubble.chat-expanded #chatPanel > div:last-child {
  padding-left: max(16px, calc((100% - 900px) / 2)) !important;
  padding-right: max(16px, calc((100% - 900px) / 2)) !important;
}
#chatBubble.chat-expanded #chatFloatBtn { display: none !important; }
@media (max-width: 768px) {
  #chatBubble.chat-expanded { inset: 0 !important; }
  #chatBubble.chat-expanded #chatPanel { border-radius: 0; }
}

/* ─────────────── DASHBOARD CHARTS ─────────────── */
.chart-card { height: 100%; }
.chart-card .card-body { padding: 1rem 1.1rem; }
.donut-svg { width: 130px; height: 130px; flex-shrink: 0; transform: rotate(0deg); }
.donut-seg { transition: stroke-dasharray 0.8s ease; }
@keyframes donutIn { from { stroke-dasharray: 0 100; } }
.donut-seg { animation: donutIn 0.9s ease forwards; }
.donut-center-num { font-size: 9px; font-weight: 800; fill: #1e2b22; }
.donut-center-sub { font-size: 3px; fill: #8c9b94; text-transform: uppercase; letter-spacing: 0.05em; }
.chart-legend { min-width: 140px; }
.chart-legend-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 0.85rem; }
.chart-dot { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.chart-legend-label { flex-grow: 1; color: #41464b; }
.chart-legend-val { font-weight: 700; white-space: nowrap; }
.chart-bars { display: flex; flex-direction: column; gap: 10px; }
.chart-bar-row { display: flex; align-items: center; gap: 10px; }
.chart-bar-label { width: 34%; max-width: 150px; font-size: 0.82rem; color: #41464b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-bar-track { flex-grow: 1; height: 20px; background: #eef1f0; border-radius: 6px; overflow: hidden; }
.chart-bar-fill { height: 100%; border-radius: 6px; min-width: 2px; transition: width 0.8s ease; animation: barIn 0.8s ease forwards; }
@keyframes barIn { from { width: 0 !important; } }
.chart-bar-val { width: 58px; text-align: right; font-size: 0.82rem; font-weight: 700; white-space: nowrap; }

.badge-pending           { background: var(--status-pending-bg);           color: var(--status-pending-fg); }
.badge-approved          { background: var(--status-approved-bg);          color: var(--status-approved-fg); }
.badge-rejected          { background: var(--status-rejected-bg);          color: var(--status-rejected-fg); }
.badge-draft             { background: var(--status-draft-bg);             color: var(--status-draft-fg); }
.badge-info-requested    { background: var(--status-info-requested-bg);    color: var(--status-info-requested-fg); }
.badge-awaiting-decision { background: var(--status-awaiting-decision-bg); color: var(--status-awaiting-decision-fg); }
.badge-paid              { background: var(--status-paid-bg);              color: var(--status-paid-fg); font-weight: 700; }
.badge-processing        { background: var(--status-processing-bg);        color: var(--status-processing-fg); }

/* ─────────────── CONCEPT CARDS ─────────────── */
.req-card {
  background: #fff; border-radius: 12px;
  border: 1px solid #e8edea;
  padding: 1.1rem 1.3rem;
  margin-bottom: 0.75rem;
  transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
  cursor: pointer;
}
.req-card:hover {
  box-shadow: 0 6px 20px rgba(26,107,58,0.10);
  transform: translateY(-2px);
  border-color: #c8dece;
}
.req-card-title { font-weight: 700; font-size: 0.95rem; color: #1e2b22; }
.req-card-meta  { font-size: 0.8rem; color: #7a8c82; }

/* ─────────────── DETAIL VIEW ─────────────── */
.detail-section {
  background: #fff; border-radius: var(--radius); border: 1px solid var(--line);
  padding: 1.5rem 1.75rem; margin-bottom: 1rem;
}
.detail-label {
  font-size: 0.73rem; font-weight: 700; color: #8a9e90;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.detail-value { font-size: 0.95rem; color: #1e2b22; margin-top: 3px; }

/* ─────────────── TIMELINE ─────────────── */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ''; position: absolute; left: 10px; top: 0; bottom: 0;
  width: 2px; background: #dee2e6;
}
.timeline-item { position: relative; margin-bottom: 1.25rem; }
.timeline-dot {
  position: absolute; left: -22px; top: 4px;
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 2px currentColor;
}
.timeline-dot.approved  { color: var(--success); background: var(--success); }
.timeline-dot.rejected  { color: var(--danger);  background: var(--danger); }
.timeline-dot.comment   { color: #0d6efd; background: #0d6efd; }
.timeline-dot.submitted { color: var(--primary); background: var(--primary); }
.timeline-text { font-size: 0.88rem; }
.timeline-time { font-size: 0.75rem; color: #adb5bd; }

/* ─────────────── FORMS ─────────────── */
.form-section {
  background: #fff; border-radius: var(--radius);
  padding: 1.5rem 1.75rem; margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}
.form-section h6 {
  color: var(--primary); font-weight: 800; margin-bottom: 1rem;
  border-bottom: 2px solid var(--primary-light); padding-bottom: 0.6rem;
  font-size: 0.92rem; text-transform: uppercase; letter-spacing: 0.04em;
}
.form-control, .form-select {
  border-radius: 8px; border: 1.5px solid #dde4e0;
  font-size: 0.9rem; transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,107,58,0.12);
}

/* ─────────────── BUTTONS ─────────────── */
.btn-primary { background: var(--action); border-color: var(--action); font-weight: 700; border-radius: 8px; }
.btn-primary:hover, .btn-primary:focus { background: var(--action-hover); border-color: var(--action-hover); }
.btn { border-radius: 8px; }
a { color: var(--primary); }
a:hover { color: var(--primary-hover); }
.text-primary { color: var(--primary) !important; }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); font-weight: 600; }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }

/* ─────────────── EMPTY STATE ─────────────── */
.empty-state { text-align: center; padding: 3.5rem 1rem; color: #b0c0b5; }
.empty-state i { font-size: 3.8rem; display: block; margin-bottom: 1rem; opacity: 0.6; }
.empty-state h6 { font-weight: 700; color: #7a8c82; }
.empty-state p  { font-size: 0.88rem; }

/* ─────────────── SEARCH BAR ─────────────── */
.search-wrap { position: relative; }
.search-wrap input { padding-left: 2.6rem; border-radius: 10px; }
.search-wrap i { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: #b0c0b5; }

/* ─────────────── SETTINGS PAGE ─────────────── */
.settings-banner {
  border-radius: var(--radius); padding: 1.35rem 1.6rem;
}
.settings-banner-connected {
  background: linear-gradient(135deg, var(--primary), #2d9e5a);
  color: #fff;
}
.settings-banner-disconnected {
  background: linear-gradient(135deg, #495057, #6c757d);
  color: #fff;
}

/* ─────────────── M365 SPINNER OVERLAY ─────────────── */
.m365-spinner {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
}
.m365-spinner-box {
  background: #fff; border-radius: 18px;
  padding: 2.5rem 3rem; text-align: center;
  box-shadow: 0 24px 70px rgba(0,0,0,0.30);
}

/* ─────────────── USER ROW ─────────────── */
.user-row:last-child { border-bottom: none !important; }

/* ─────────────── SETTINGS HOME ─────────────── */
.settings-home-card .card-body { display: flex; flex-direction: column; }
.settings-home-link {
  display: flex; align-items: flex-start; gap: 0.6rem;
  padding: 0.45rem 0.5rem; margin: 0 -0.5rem; border-radius: 8px;
  color: inherit; text-decoration: none; font-size: 0.85rem; line-height: 1.35;
}
.settings-home-link > i { color: var(--primary); margin-top: 1px; }
a.settings-home-link:hover, a.settings-home-link:focus-visible { background: color-mix(in srgb, var(--primary-light) 45%, #fff); color: inherit; }
a.settings-home-link:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.settings-home-sys-link { display: inline-flex; align-items: center; min-height: 40px; margin-right: 1rem; }
.settings-status { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 1.5; white-space: nowrap; background: #f1f3f5; color: #495057; }
.settings-status.is-ok { background: #e6f4ea; color: #1e6b34; }
.settings-status.is-warn { background: #fff4e0; color: #8a4b00; }
/* Legacy theme: Bootstrap's outline-warning icon is #ffc107 on white (1.6:1); the YoA theme sets its own token. */
.users-table .btn-outline-warning { --bs-btn-color: #8a4b00; --bs-btn-border-color: #e0a800; --bs-btn-hover-color: #8a4b00; --bs-btn-hover-bg: #fff4e0; --bs-btn-hover-border-color: #c69500; }
.settings-attention { border: 1px solid #f3d19e; background: #fffaf0; border-radius: var(--radius); padding: 12px 16px; }
.settings-attention li + li { margin-top: 6px; }
.users-table td .btn { min-width: 32px; min-height: 32px; }
@media (pointer: coarse) { .users-table td .btn { min-width: 40px; min-height: 40px; } }
.settings-home-link.is-soon { color: #6c757d; align-items: center; }
.settings-home-link.is-soon > i { color: #adb5bd; }

/* ─────────────── APPROVAL TRACK (concept decision panel) ─────────────── */
.approval-track { list-style: none; margin: 0 0 1rem; padding: 0; }
.at-step { position: relative; display: flex; gap: 0.75rem; padding-bottom: 1rem; }
.at-step:not(.at-last)::before {
  content: ""; position: absolute; left: 13px; top: 28px; bottom: 2px; width: 2px; background: var(--line);
}
.at-step.at-done:not(.at-last)::before { background: var(--success); }
.at-last { padding-bottom: 0; }
.at-marker {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700; background: #fff; border: 2px solid var(--muted); color: var(--muted);
}
.at-marker.at-done { background: var(--success); border-color: var(--success); color: #fff; }
.at-marker.at-now  { border-color: var(--status-pending-fg); color: var(--status-pending-fg); background: var(--status-pending-bg); box-shadow: 0 0 0 4px color-mix(in srgb, var(--status-pending-fg) 15%, transparent); }
.at-marker.at-hold { background: var(--status-pending-fg); border-color: var(--status-pending-fg); color: #fff; }
.at-marker.at-stop { background: var(--danger); border-color: var(--danger); color: #fff; }
.at-body { flex: 1; min-width: 0; padding-top: 3px; }
.at-title { font-size: 0.88rem; font-weight: 600; color: var(--ink); line-height: 1.3; }
.at-todo .at-title { color: var(--muted); font-weight: 500; }
.at-note { font-size: 0.78rem; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.at-you {
  display: inline-block; margin-left: 0.4rem; padding: 1px 7px; border-radius: 999px; vertical-align: 1px;
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: var(--status-pending-bg); color: var(--status-pending-fg);
}
.at-lanes { display: grid; gap: 0.4rem; margin-top: 0.5rem; }
.at-lane { border: 1px solid var(--line); border-left-width: 3px; border-radius: 8px; padding: 0.4rem 0.6rem; background: var(--page); }
.at-lane.at-done { border-left-color: var(--success); }
.at-lane.at-now  { border-left-color: var(--status-pending-fg); background: #fff; }
.at-lane.at-hold { border-left-color: var(--warning); }
.at-lane.at-stop { border-left-color: var(--danger); }
.at-lane-title { font-size: 0.8rem; font-weight: 600; color: var(--ink-2); }

/* ─────────────── FINANCE ─────────────── */
.bg-purple  { background-color: #6f42c1 !important; color: #fff; }
.btn-finance { background: #0d47a1; border-color: #0d47a1; color: #fff; font-weight: 700; }
.btn-finance:hover { background: #083591; border-color: #083591; color: #fff; }
.text-finance { color: #0d47a1 !important; }
.bg-finance   { background-color: #0d47a1 !important; color: #fff; }
.frq-budget-bar { height: 8px; border-radius: 4px; background: #e9ecef; overflow: hidden; }
.frq-budget-bar .used { height: 100%; border-radius: 4px; transition: width 0.4s; }
.rf-balance-tracker { margin: 6px 0 4px; }
.rf-balance-tracker .progress { background: #e9ecef; }
.rf-balance-tracker .progress-bar { transition: width 0.4s ease; }
.linked-docs { margin: -0.25rem 0 1rem; }
.linked-docs-toggle {
  display: flex; align-items: center; gap: 0.6rem; width: 100%;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.75rem 1.1rem; font: inherit; font-size: 0.9rem; font-weight: 600; color: #0d47a1; text-align: left;
}
.linked-docs-toggle:hover:not(:disabled) { background: #f5f8fd; }
.linked-docs-toggle:focus-visible { outline: 2px solid #0d47a1; outline-offset: 2px; }
.linked-docs-toggle:disabled { color: #6c757d; cursor: default; }
.linked-docs-toggle.open { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.linked-docs-count { background: #e8f0fe; color: #0d47a1; border-radius: 999px; font-size: 0.7rem; font-weight: 700; padding: 1px 8px; }
.linked-docs-chev { color: #6c757d; }
.linked-docs-body {
  background: #fff; border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius); padding: 0.25rem 0.9rem 0.9rem;
}
.linked-docs-group { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #6c757d; margin: 0.75rem 0 0.15rem 0.4rem; }
.linked-doc { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.4rem; border-radius: 8px; color: inherit; text-decoration: none; }
a.linked-doc:hover { background: #f3f6fb; color: inherit; }
a.linked-doc:focus-visible { outline: 2px solid #0d47a1; outline-offset: 1px; }
.linked-doc-icon { width: 32px; height: 32px; flex: none; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.linked-doc-icon.rf { background: #e8f0fe; color: #0d47a1; }
.linked-doc-icon.pv { background: #eef1f4; color: #495057; }
.linked-doc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.linked-doc-num { font-weight: 700; font-size: 0.85rem; overflow-wrap: anywhere; }
.linked-doc-meta { font-size: 0.74rem; color: #6c757d; font-variant-numeric: tabular-nums; }
.linked-doc-chev { color: #adb5bd; }
.linked-doc-children { margin-left: 1.4rem; padding-left: 0.5rem; border-left: 2px solid #dbe3ef; }
.linked-doc-foot { font-size: 0.75rem; color: #6c757d; margin: 0.3rem 0 0 0.4rem; font-variant-numeric: tabular-nums; }

/* ─────────────── SIGNATURE PAD ─────────────── */
#sigCanvas { user-select: none; -webkit-user-select: none; }
#sigCanvas:active { cursor: crosshair; }
.sig-display {
  display: inline-block; max-height: 44px; max-width: 140px;
  object-fit: contain; vertical-align: middle;
  border: 1px solid #dee2e6; border-radius: 4px;
  background: #fdfdfd; padding: 2px;
}
.sig-ts { font-size: 0.72rem; color: #495057; display: block; margin-top: 2px; }
.sig-placeholder { color: #adb5bd; font-size: 0.78rem; font-style: italic; }

/* ─────────────── PRINT ─────────────── */
@media print {
  #sidebar, #topbar, .no-print { display: none !important; }
  #mainContent { margin-left: 0; }
}

/* ─────────────── SCROLLBAR ─────────────── */
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-thumb { background: #d0d8d3; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #aabab0; }

/* ─────────────── PROFILE DROPDOWN ─────────────── */
.topbar-avatar-btn {
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
  border: 2.5px solid transparent;
}
.topbar-avatar-btn:hover {
  box-shadow: 0 0 0 3px rgba(26,107,58,0.2);
  transform: scale(1.06);
}
.profile-dropdown {
  min-width: 270px;
  border-radius: 14px;
  border: 1px solid #e5ebe7;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.14) !important;
  margin-top: 8px !important;
}
.profile-dd-header {
  display: flex;
  align-items: center;
  padding: 1.1rem 1.2rem 0.9rem;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  gap: 0.75rem;
}
.avatar-lg {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 1rem; flex-shrink: 0;
  border: 2.5px solid rgba(255,255,255,0.4);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.profile-dd-header .fw-bold { color: #fff; font-size: 0.95rem; }
.profile-dd-info {
  padding: 0.75rem 1.2rem 0.6rem;
  background: #f8faf8;
  border-bottom: 1px solid #eef1ee;
}
.profile-dd-row {
  font-size: 0.8rem;
  color: #5a6e60;
  padding: 0.18rem 0;
  display: flex;
  align-items: center;
}
.profile-dd-item {
  font-size: 0.875rem;
  padding: 0.55rem 1.2rem;
  display: flex;
  align-items: center;
  color: #3d5045;
  transition: background 0.15s;
}
.profile-dd-item:hover { background: #f0f7f2; color: var(--primary); }
.profile-dd-item.text-danger { color: #dc3545 !important; }
.profile-dd-item.text-danger:hover { background: #fff5f5; }

/* Topbar hamburger (mobile only) */
.topbar-hamburger {
  padding: 0.25rem 0.5rem;
  margin-right: 0.5rem;
  text-decoration: none;
}

/* ─────────────── MOBILE SIDEBAR BACKDROP ─────────────── */
.sidebar-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 99;
  backdrop-filter: blur(2px);
  animation: pageFadeIn 0.25s ease both;
}

/* ─────────────── TRANSITIONS & ANIMATIONS ─────────────── */

/* App fades in after login */
@keyframes appFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.app-fade-in {
  animation: appFadeIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* App fades out on logout */
@keyframes appFadeOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-8px); }
}
.app-fade-out {
  animation: appFadeOut 0.28s ease both;
  pointer-events: none;
}

/* Page content fades in on every navigation */
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-fade-in {
  animation: pageFadeIn 0.3s ease both;
}

/* The sign-in screen fades out when the app opens; it never animates in (180ms, the only motion the shell allows). */
.login-screen { transition: opacity 180ms ease; }

/* Sidebar nav items — smooth active indicator */
.sidebar-nav > li > a,
.sidebar-subnav li a {
  transition: background 0.18s, border-left-color 0.18s, color 0.18s, transform 0.15s;
}
.sidebar-nav > li > a:active,
.sidebar-subnav li a:active { transform: translateX(2px); }

/* Topbar smooth title change */
#pageTitle { transition: opacity 0.2s ease; }

/* Stat cards stagger on dashboard load */
.stat-card { animation: pageFadeIn 0.35s ease both; }
.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.10s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.20s; }

/* Req cards stagger in list views */
.req-card { animation: pageFadeIn 0.3s ease both; }

/* A background refresh redraws the page in place: no entrance animations,
   or every live update would replay them and the page would blink. */
.bg-render .stat-card,
.bg-render .req-card,
.bg-render .donut-seg,
.bg-render .chart-bar-fill { animation: none; }

/* Modal open feels snappier */
.modal.fade .modal-dialog { transition: transform 0.2s ease, opacity 0.2s ease; }

/* Button press feedback */
.btn { transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s; }
.btn:active { transform: scale(0.97); }

/* ─────────────── MOBILE RESPONSIVE ─────────────── */
@media (max-width: 991.98px) {

  /* Sidebar slides in from the left as an overlay */
  #sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 200;
    box-shadow: none;
  }
  #sidebar.sidebar-mobile-open {
    transform: translateX(0);
    box-shadow: 6px 0 30px rgba(0,0,0,0.25);
  }

  /* Main content takes full width */
  #mainContent { margin-left: 0; }

  /* Show hamburger button */
  .topbar-hamburger { display: inline-flex !important; font-size: 1.5rem; color: var(--ink-2); }
  .topbar-search { width: 40px; padding: 6px 0; justify-content: center; }
  .topbar-search span, .topbar-search kbd { display: none; }
  /* Drawer: rail + panel slide in together; show the avatar at the panel foot */
  #sidebar { width: var(--sidebar-w); max-width: 92vw; }
  .drawer-user { display: flex; position: absolute; left: 0; bottom: 0; width: var(--rail-w); height: 56px; align-items: center; justify-content: center; background: #fff; border-top: 1px solid var(--line); border-right: 1px solid var(--line); }
  .home-grid .home-col-main, .home-grid .home-col-side { flex-basis: 100%; }
  .hero { flex-direction: column; align-items: stretch; padding: 18px; }
  .hero-left, .hero-figs { flex: 0 0 auto; }
  .hero-figs { border-left: 0; border-top: 1px solid var(--line); padding: 12px 0 0; margin: 4px 0 0; }
  .hero-fig { flex: 1 1 30%; min-width: 96px; padding: 6px 10px; }
  .hero-fig-val { font-size: 19px; }

  /* Topbar adjustments */
  #topbar { padding: 0 1rem; }
  #pageTitle { font-size: 1rem; }

  /* Page area padding */
  .page-area { padding: 1rem; }

  /* Stack stat cards */
  .row .col-md-3, .row .col-md-4, .row .col-md-6 { margin-bottom: 0.75rem; }

  /* Tables scroll horizontally */
  .table-responsive-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table { min-width: 600px; }

  /* Form sections full width */
  .form-section { padding: 1.1rem; }
  .detail-section { padding: 1.1rem; }

  /* Detail view button groups wrap */
  .detail-section .d-flex.gap-2 { flex-wrap: wrap; }

  /* Hide date in topbar — too cramped */
  #topbarDate { display: none !important; }

  /* M365 indicator — icon only on mobile */
  #topbarM365Label { display: none !important; }

  /* Modals full width */
  .modal-dialog { margin: 0.5rem; }
  .modal-dialog.modal-lg { max-width: 100%; }
}

@media (max-width: 575.98px) {
  /* Extra small — phones */
  .stat-number  { font-size: 1.6rem; }
  .page-area    { padding: 0.75rem; }
  #topbar       { padding: 0 0.75rem; }
  .profile-dropdown { min-width: 240px; }

  /* Stack form rows */
  .row.g-3 > [class*='col-'] { margin-bottom: 0.5rem; }

  /* Concept cards */
  .req-card { padding: 0.85rem 1rem; }
}

/* Live-updates indicator (sidebar footer) */
.live-dot { display:inline-block; width:8px; height:8px; border-radius:50%; background:#9CA3AF; margin-right:5px; vertical-align:middle; }
.live-dot.is-live { background:#22C55E; }


/* ─────────────── HOME ─────────────── */
.home { max-width: 1240px; }
.hero {
  background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 16px;
  padding: 22px 26px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.hero-left { display: flex; align-items: center; gap: 16px; min-width: 0; flex: 1 1 320px; }
.hero-left > div { min-width: 0; }
.hero-greet, .hero-sub, .hero-eyebrow { overflow-wrap: anywhere; }
.hero-avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--primary-dark); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1rem; flex-shrink: 0; }
.hero-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary); }
.hero-greet { font-size: 22px; font-weight: 800; margin: 2px 0 4px; color: var(--ink); letter-spacing: -0.01em; }
.hero-sub { margin: 0; font-size: 13px; color: var(--muted); }
.hero-figs { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0; border-left: 1px solid var(--line); padding-left: 8px; }
.hero-fig { display: flex; flex-direction: column; justify-content: center; padding: 6px 18px; text-decoration: none; color: var(--ink); border-right: 1px solid var(--line); min-width: 120px; border-radius: 8px; transition: background 0.15s; }
.hero-fig:last-child { border-right: 0; }
.hero-fig:hover { background: var(--page); color: var(--ink); }
.hero-fig.static { cursor: default; }
.hero-fig-val { font-size: 22px; font-weight: 800; line-height: 1.1; color: var(--ink); white-space: nowrap; }
.hero-fig-lbl { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.home-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 13px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer;
  font-family: inherit; transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.chip i { color: var(--primary); font-size: 14px; }
.chip:hover { border-color: var(--primary); color: var(--primary-dark); background: #F6FDF8; }
/* A filter count kept in its own span reads "Label (n)" here; brand.css shows the number alone */
.chip-n::before { content: " ("; }
.chip-n::after { content: ")"; }
.home-grid { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.home-col-main { flex: 1 1 430px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.home-col-side { flex: 1 1 290px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.home-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.home-card.danger { border-color: #FCA5A5; }
.home-card-hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.home-card-title { font-size: 14px; font-weight: 800; color: var(--ink); }
.home-card-link { font-size: 12px; font-weight: 600; color: var(--primary); text-decoration: none; white-space: nowrap; }
.home-card-link:hover { color: var(--primary-hover); text-decoration: underline; }
.home-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 8px; color: var(--muted); font-size: 13px; }
.home-empty i { font-size: 26px; color: var(--primary); }
.home-foot { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-2); }
.home-foot.muted { color: var(--muted); }
.big-fig { font-size: 23px; font-weight: 800; color: var(--ink); line-height: 1.1; margin-bottom: 10px; }
.big-fig.red { color: var(--danger); }
.big-fig-sub { font-size: 12px; font-weight: 500; color: var(--muted); }
.bar { height: 8px; border-radius: 4px; background: var(--panel-active); overflow: hidden; margin-bottom: 12px; }
.bar > span { display: block; height: 100%; border-radius: 4px; }
.bar > span.green, .mini-bar > span.green, .seg.green, .dot.green { background: var(--action); }
.bar > span.amber, .mini-bar > span.amber, .seg.amber, .dot.amber { background: #F59E0B; }
.mini-bar > span.red, .seg.red, .dot.red { background: #DC2626; }
.seg.blue, .dot.blue { background: #3B82F6; }
.mini-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--panel-active); overflow: hidden; }
.mini-bar > span { display: block; height: 100%; border-radius: 3px; }
.lines { display: flex; flex-direction: column; gap: 6px; }
.line { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-2); padding: 3px 0; text-decoration: none; }
.line.link { border-radius: 6px; }
.line.link:hover { background: var(--page); color: var(--ink); }
.line.warn .line-pct, .line.warn .line-val { color: #B45309; font-weight: 700; }
.line-lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-val { color: var(--muted); white-space: nowrap; font-size: 12px; }
.line-pct { width: 42px; text-align: right; font-weight: 700; color: var(--ink); white-space: nowrap; }
.stack-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--panel-active); gap: 2px; margin-bottom: 12px; }
.seg { display: block; min-width: 4px; }
.legend { display: flex; flex-direction: column; gap: 5px; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.legend-lbl { flex: 1; }
.legend-n { color: var(--muted); font-size: 12px; min-width: 20px; text-align: right; }
.legend-val { font-weight: 700; color: var(--ink); min-width: 80px; text-align: right; }
.two-up { display: flex; gap: 10px; }
.two-up-cell { flex: 1; background: var(--page); border: 1px solid var(--line); border-radius: 10px; padding: 12px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 4px; transition: border-color 0.15s; }
.two-up-cell:hover { border-color: var(--primary); color: var(--ink); }
.two-up-lbl { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.two-up-val { font-size: 21px; font-weight: 800; }
.two-up-unit { font-size: 12px; font-weight: 500; color: var(--muted); }

/* Queue + in-flight lists */
.queue { display: flex; flex-direction: column; }
.queue-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; text-decoration: none; color: inherit; }
.queue-row:first-child { border-top: 0; }
.queue-row.link { cursor: pointer; }
.queue-row.link:hover .queue-title { color: var(--primary); }
.queue-tag { flex: 0 0 auto; }
.queue-main { flex: 1 1 200px; min-width: 0; }
.queue-title { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-ref { font-weight: 800; color: var(--ink); margin-right: 6px; }
.queue-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.queue-side { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; margin-left: auto; }
.queue-amt { font-size: 13px; font-weight: 800; color: var(--ink); white-space: nowrap; }
.queue-btns { display: flex; gap: 6px; }
.queue-more { padding: 8px 0 0; font-size: 12px; color: var(--muted); }
.btn-primary-sm { background: var(--action); color: #fff; border: 0; border-radius: 8px; padding: 6px 12px; font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit; white-space: nowrap; }
.btn-primary-sm:hover { background: var(--action-hover); }
.btn-ghost { background: #fff; color: var(--ink-2); border: 1px solid var(--line); border-radius: 8px; padding: 5px 11px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; white-space: nowrap; }
.btn-ghost:hover { border-color: #D1D5DB; color: var(--ink); }

.staff-avatar-wrap { position: relative; flex-shrink: 0; }
.staff-avatar-btn { position: absolute; right: -3px; bottom: -3px; width: 24px; height: 24px; border-radius: 50%; background: var(--action); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; border: 2px solid #fff; box-shadow: var(--shadow-sm); margin: 0; }
.staff-avatar-btn:hover { background: var(--action-hover); }
.staff-avatar-btn i { font-size: 11px; }
.topbar-avatar-btn { background-size: cover; background-position: center; }

/* ─────────────── UNSAVED-WORK RECOVERY ─────────────── */
.formkeep-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #FEF9C3; color: #713F12; border: 1px solid #FDE68A; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; }
.formkeep-banner i { font-size: 16px; color: #A16207; }
.formkeep-banner a { color: #A16207; font-weight: 700; text-decoration: underline; }

/* ─────────────── ⌘K PALETTE ─────────────── */
.cmdk { position: fixed; inset: 0; z-index: 1200; background: rgba(17,24,39,0.45); backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; }
.cmdk-box { width: 100%; max-width: 620px; background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; border: 1px solid var(--line); }
.cmdk-input { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.cmdk-input i { color: var(--muted); font-size: 16px; }
.cmdk-input input { flex: 1; border: 0; outline: 0; font-size: 15px; font-family: inherit; color: var(--ink); background: transparent; }
.cmdk-results { max-height: 52vh; overflow-y: auto; padding: 6px; }
.cmdk-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
.cmdk-row i { width: 22px; text-align: center; color: var(--muted); font-size: 15px; }
.cmdk-row.sel { background: var(--panel-active); }
.cmdk-text { flex: 1; min-width: 0; }
.cmdk-title { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-ref { font-weight: 800; color: var(--primary-dark); margin-right: 8px; }
.cmdk-sub { font-size: 11.5px; color: var(--muted); }
.cmdk-kind { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-2); }
.cmdk-empty { padding: 26px; text-align: center; color: var(--muted); font-size: 13px; }
.cmdk-foot { display: flex; gap: 16px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.cmdk-foot kbd { margin-right: 3px; }

/* ── Send a receipt / Receipts to review (Sept 2026) ─────────────────────── */
.rc-page, .rc-review { max-width: 820px; display: flex; flex-direction: column; gap: 14px; }
.rc-card { box-shadow: var(--shadow-sm); }
.rc-back { align-self: flex-start; font-size: 13px; font-weight: 700; color: var(--primary); text-decoration: none; }
.rc-back:hover { text-decoration: underline; }
.rc-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 6px; }
.rc-head-icon { flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--primary-light); color: var(--primary); display: grid; place-items: center; font-size: 20px; }
.rc-sub { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.rc-opt { color: var(--muted-2); font-weight: 500; font-size: 11px; }
.rc-page .form-label { font-weight: 700; font-size: 12.5px; color: var(--ink-2); margin: 14px 0 5px; }
.rc-page .form-control, .rc-page .form-select { font-size: 15px; min-height: 44px; }   /* comfortable to tap outdoors */
.rc-seg { display: flex; gap: 8px; margin-top: 12px; }
.rc-seg .btn { flex: 1; min-height: 44px; font-weight: 700; }
.rc-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.rc-pick { position: relative; min-height: 48px; display: inline-flex; align-items: center; font-weight: 700; cursor: pointer; }
.rc-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.rc-pick:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.rc-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.rc-thumbs:empty { display: none; }
.rc-thumb { position: relative; width: 88px; height: 88px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--page);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px; font-size: 10.5px; color: var(--muted); text-align: center; word-break: break-all; }
.rc-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rc-thumb i { font-size: 22px; }
.rc-thumb.bad { border-color: #FCA5A5; color: var(--danger); background: #FEF2F2; }
.rc-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(17,24,39,.62); color: #fff; display: grid; place-items: center; padding: 0; font-size: 16px; line-height: 1; }
.rc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; }
.rc-actions .btn-lg { min-height: 50px; font-weight: 800; padding-left: 22px; padding-right: 22px; }
.rc-status { font-size: 13px; font-weight: 600; flex: 1 1 220px; }
.rc-row, .rc-review-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.home-card-hd + .rc-row, .home-card-hd + .rc-review-row { border-top: 0; }
.rc-row-img { flex: none; width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--panel-active); color: var(--muted); display: grid; place-items: center; font-size: 18px; }
.rc-row-main { flex: 1; min-width: 0; }
.rc-row-title { font-weight: 700; font-size: 13px; color: var(--ink); }
.rc-row-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.rc-row-btns, .rc-review-act { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.rc-review-act .form-select { width: auto; max-width: 260px; }
.rc-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.rc-file { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; font-size: 11.5px; font-weight: 600; color: var(--primary); text-decoration: none; background: #fff; }
.rc-file:hover { border-color: var(--primary); }
.rc-adv { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 10px; }
.rc-adv-hd { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; font-size: 12.5px; padding-bottom: 4px; }
.rc-home-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
@media (max-width: 575.98px) {
  .rc-review-row { flex-direction: column; align-items: stretch; }
  .rc-review-act { justify-content: flex-start; }
  .rc-actions .btn-lg { width: 100%; }
}
.uq-hold { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 2000; display: flex; align-items: center; gap: 12px;
  background: #FFFBEB; border: 1px solid #FCD34D; color: #78350F; border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow-lg); font-size: 13px; }
.uq-hold > i { font-size: 22px; flex: none; }
.uq-hold-text { flex: 1; line-height: 1.45; }
@media (min-width: 768px) { .uq-hold { left: auto; max-width: 520px; } }

.req-type-card { transition: box-shadow .15s, border-color .15s; }
.req-type-card:hover, .req-type-card:focus-visible { border-color: #0d47a1; box-shadow: 0 2px 10px rgba(13,71,161,.18); outline: none; }

/* Info-tip: an "i" icon that opens a short explanation (docs/ui-guidance-rules.md, rule 2). */
.infotip { display: inline-flex; align-items: center; vertical-align: middle; margin-left: 4px; font-weight: normal; text-transform: none; letter-spacing: normal; }
.infotip-btn { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin: -2px 0; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; line-height: 1; }
.infotip-btn:hover, .infotip-btn[aria-expanded="true"] { background: #f3f4f6; color: var(--primary); }
.infotip-btn:focus { outline: none; }
.infotip-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.infotip-panel { position: fixed; top: 0; left: 0; z-index: 10000; width: 300px; overflow-y: auto; overscroll-behavior: contain; padding: 10px 12px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(16, 24, 40, .14); font-size: var(--fs-help, 0.8rem); line-height: 1.45; font-weight: normal; text-align: left; text-transform: none; letter-spacing: normal; white-space: normal; }
@media (hover: none) { .infotip-btn { width: 40px; height: 40px; margin: -10px -8px; } }
@media print { .infotip, .infotip-panel { display: none !important; } }

/* ─────────────── REGISTER TABLES (js/rectable.js) ───────────────
   Modelled on YoAccountant's sowa_tables (YoA docs/ux/11-list-patterns.md):
   key-indicator tiles that filter, a toolbar, a table with a pinned
   identifier and row action, status dots, footer totals. Uses tokens that
   both themes define, so it reads the same with or without YOA_THEME. */
.rt {
  --tone-done: var(--primary);
  --tone-attention: #d97706;
  --tone-open: #6BC778;
  --tone-info: #2563eb;
  --tone-danger: #DC2626;
  --tone-neutral: #878E97;
  --rt-hover: color-mix(in srgb, var(--primary-light) 35%, #fff);   /* amber dots keep 3:1 on it */
}
.rt-sub { color: var(--muted); font-size: 12px; font-weight: 400; }
.rt-none { color: var(--muted-2); }

/* Key-indicator tiles: equal widths, a fixed-length bar in a fixed colour per meaning */
.rt-tiles {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px;
  margin-bottom: 16px; padding: 16px 20px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
}
@media (min-width: 768px) { .rt-tiles { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); } }
.rt-tile {
  --tone: #C9CED5;
  display: flex; flex-direction: column; align-items: stretch; min-width: 0;
  padding: 0; border: 0; background: none; text-align: left; color: inherit; border-radius: 10px; cursor: pointer;
}
.rt-tile:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; }
.rt-tile__value { font-size: var(--fs-title, 24px); font-weight: 800; line-height: 1.15; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rt-tile__label { margin: 2px 0 12px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.rt-tile__bar { display: block; margin-top: auto; height: 10px; border-radius: 999px; background: var(--tone); transition: height .12s ease; }
.rt-tile:hover .rt-tile__bar { filter: brightness(.95); }
.rt-tile[aria-pressed="true"] .rt-tile__bar { height: 14px; }
.rt-tile[aria-pressed="true"] .rt-tile__label { color: var(--ink); }
.rt-tile[data-tone="done"]      { --tone: var(--tone-done); }
.rt-tile[data-tone="attention"] { --tone: var(--tone-attention); }
.rt-tile[data-tone="open"]      { --tone: var(--tone-open); }
.rt-tile[data-tone="info"]      { --tone: var(--tone-info); }
.rt-tile[data-tone="danger"]    { --tone: var(--tone-danger); }

/* Card, toolbar, chooser */
.rt-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.rt-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.rt-search { flex: 0 1 300px; min-width: 200px; }
.rt-search input { min-height: 36px; }
.rt-summary { color: var(--muted); font-size: 13px; }
.rt-tools { display: flex; gap: 6px; margin-left: auto; }
.rt-tool { border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-weight: 600; border-radius: 8px; }
.rt-tool:hover, .rt-tool[aria-expanded="true"] { background: var(--page); color: var(--ink); }
.rt-custom { padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--page); }
.rt-custom__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 10px; }
.rt-custom__groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px 20px; }
.rt-custom__group { margin: 0; padding: 0; border: 0; min-width: 0; }
.rt-custom__group legend { float: none; width: auto; margin: 0 0 4px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.rt-custom__opt { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.rt-custom__opt.is-locked { color: var(--muted); cursor: default; }
.rt-custom__density { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: center; }
.rt-custom__density legend { width: 100%; }
.rt-custom__foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.rt-reset { margin-right: auto; border: 0; background: none; color: var(--primary); font-weight: 600; padding: 4px 8px; border-radius: 8px; }
.rt-reset:hover { background: var(--primary-light); }

/* Table: whitespace rows, muted header, right-aligned money */
.rt-scroll { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }   /* relative: absolutely placed bits (screen-reader labels) stay inside the scroll box */
.rt-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; color: var(--ink-2); }
.rt-table th {
  background: var(--page); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 10px 12px; white-space: nowrap; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle;
}
.rt-table td { padding: 11px 12px; background: #fff; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; transition: background .12s; }
.rt[data-density="compact"] .rt-table td { padding-top: 6px; padding-bottom: 6px; }
.rt-table td.rt-wrap { white-space: normal; min-width: 130px; max-width: 360px; }
.rt-table .text-end { text-align: right; }
.rt-table td.rt-k-money, .rt-table td.rt-k-number { font-variant-numeric: tabular-nums; }
.rt-table td.rt-k-ref { font-family: var(--bs-font-monospace); font-size: 12px; font-weight: 700; color: var(--ink); }
.rt-sort { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.rt-sort i { font-size: 11px; opacity: .35; }
.rt-sort:hover { color: var(--primary); }
.rt-sort:hover i { opacity: .7; }
.rt-sort.on { color: var(--primary-dark); }
.rt-sort.on i { opacity: 1; }
.rt-sort:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
th.text-end .rt-sort { flex-direction: row-reverse; }
/* Cells paint the hover colour themselves: pinned cells need an opaque background */
.rt-row.rt-link { cursor: pointer; }
.rt-row:hover > td, .rt-row.rt-open > td { background: var(--rt-hover); }
.rt-row:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.rt-table tfoot td { background: var(--page); font-weight: 800; color: var(--ink); border-bottom: 0; border-top: 2px solid var(--line); }
.rt-table tbody tr:last-child > td { border-bottom: 0; }
/* Pinned identifier (left) and row action (right, tablets and up) */
.rt-pin-left { position: sticky; left: 0; z-index: 1; box-shadow: inset -1px 0 0 var(--line); }
th.rt-pin-left { z-index: 3; }
@media (min-width: 768px) {
  .rt-pin-right { position: sticky; right: 0; z-index: 1; box-shadow: inset 1px 0 0 var(--line); }
  th.rt-pin-right { z-index: 3; }
}
.rt-table td.rt-pin-right { text-align: right; }
.rt-table .rt-x { width: 36px; padding-left: 8px; padding-right: 0; }
.rt-toggle { width: 28px; height: 28px; display: inline-grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--muted); }
.rt-toggle:hover { background: var(--page); color: var(--ink); }
.rt-toggle i { transition: transform .15s ease; }
.rt-toggle[aria-expanded="true"] i { transform: rotate(90deg); }
.rt-detail > td { background: var(--page); white-space: normal; padding: 12px 18px 16px 50px; }
.rt-detail h6 { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.rt-mini { width: 100%; max-width: 760px; border-collapse: collapse; font-size: 12.5px; }
.rt-mini th, .rt-mini td { padding: 5px 10px 5px 0; border-bottom: 1px solid var(--line); text-align: left; }
.rt-mini th { font-size: 11px; color: var(--muted); font-weight: 700; }
.rt-mini .text-end { text-align: right; }
.rt-mini a { font-weight: 600; }
.rt-hist { max-width: none; }
.rt-hist td:first-child { white-space: nowrap; }
.rt-hist td.text-end { font-variant-numeric: tabular-nums; }
.rt-hist a { display: inline-block; padding: 11px 0; }
.rt-hist-sum { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 0 0 16px; }
.rt-hist-sum dt { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.rt-hist-sum dd { margin: 2px 0 0; font-size: 17px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.rt-empty { padding: 56px 16px; text-align: center; }
.rt-empty__title { font-weight: 800; color: var(--ink-2); margin-bottom: 10px; }
.rt-more { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* Status dot: colour = meaning, ring = draft or in approval; words on hover and focus */
.st-dot { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 999px; cursor: default; outline: none; vertical-align: middle; }
.st-dot:focus-visible { box-shadow: 0 0 0 2px var(--primary); }
.st-dot__mark { --tone: var(--tone-neutral); width: 12px; height: 12px; border-radius: 999px; box-sizing: border-box; background: var(--tone); border: 2.5px solid var(--tone); }
.st-dot[data-fill="ring"] .st-dot__mark { background: #fff; }
.st-dot[data-tone="done"] .st-dot__mark      { --tone: var(--tone-done); }
.st-dot[data-tone="attention"] .st-dot__mark { --tone: var(--tone-attention); }
.st-dot[data-tone="open"] .st-dot__mark      { --tone: var(--tone-open); box-shadow: 0 0 0 1px var(--tone-done); }
.st-dot[data-tone="info"] .st-dot__mark      { --tone: var(--tone-info); }
.st-dot[data-tone="danger"] .st-dot__mark    { --tone: var(--tone-danger); }
/* The tip opens leftwards: the Status column sits beside the pinned action */
.st-dot__tip {
  position: absolute; right: calc(100% + 6px); top: 50%; transform: translateY(-50%); z-index: 5;
  white-space: nowrap; padding: 5px 9px; border-radius: 8px; background: var(--ink); color: #fff;
  font-size: 12px; font-weight: 600; line-height: 1.3; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .12s ease;
  width: max-content; max-width: 280px; white-space: normal; text-align: left;
}
.st-dot:hover .st-dot__tip, .st-dot:focus .st-dot__tip { opacity: 1; visibility: visible; }

/* Row action: one split button; the menu is fixed so the scroll box never clips it */
.rt .ra { display: inline-flex; justify-content: flex-end; white-space: nowrap; }
.rt .ra__split { display: inline-flex; align-items: stretch; border: 1px solid var(--yoa-border-strong, #D8DCE1); border-radius: 10px; background: #fff; }
.rt .ra__main { display: inline-flex; align-items: center; padding: 4px 12px; font: inherit; font-size: 13px; font-weight: 600; color: var(--primary-dark); background: transparent; border: 0; border-radius: 9px 0 0 9px; cursor: pointer; }
.rt .ra__main:only-child { border-radius: 9px; }
.rt .ra__main:hover { background: var(--primary-light); }
.rt .ra__caret { display: inline-flex; align-items: center; justify-content: center; width: 30px; padding: 0; border: 0; border-left: 1px solid var(--yoa-border-strong, #D8DCE1); border-radius: 0 9px 9px 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.rt .ra__caret:hover, .rt .ra__caret[aria-expanded="true"] { background: var(--page); }
.rt :is(.ra__main, .ra__caret, .ra__item):focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.rt .ra__menu { position: fixed; z-index: 1200; min-width: 200px; max-height: min(70vh, 480px); overflow-y: auto; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(22, 24, 29, .14); text-align: left; }
.rt .ra__menu[hidden] { display: none; }
/* The open menu lives inside a pinned (sticky) action cell, whose own stacking
   context would let the rows below paint over it: lift that cell (YoA sowa_tables.css). */
.rt-table td:has(.ra__menu:not([hidden])) { z-index: 30 !important; }
.rt .ra__item { display: block; width: 100%; padding: 7px 10px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 13px; color: var(--ink); text-align: left; cursor: pointer; }
.rt .ra__item:hover, .rt .ra__item:focus { background: var(--page); }
.rt .ra__item.is-danger { color: var(--danger); font-weight: 600; }
@media (pointer: coarse) {
  .rt .ra__main, .rt .ra__caret { min-height: 40px; }
  .rt .ra__caret { min-width: 40px; }
  .rt-toggle { width: 40px; height: 40px; }
  .rt-sort, .rt-tool { min-height: 40px; }
  .rt-table th { padding-top: 0; padding-bottom: 0; }
  .rt .ra__item { padding-top: 10px; padding-bottom: 10px; }
  .rt-custom__opt { min-height: 40px; }
}
@media (max-width: 575.98px) {
  .rt-search { flex-basis: 100%; }
  .rt-tools { margin-left: 0; }
  .rt-detail > td { padding-left: 16px; }
}
@media print {
  .rt-tiles, .rt-toolbar, .rt-custom, .rt-more, .rt .ra, .rt-x { display: none !important; }
  .rt-scroll { overflow: visible; }
  .st-dot__tip { position: static; opacity: 1; visibility: visible; transform: none; background: none; color: inherit; padding: 0 0 0 4px; }
}
.rt-table td.rt-foot-label { white-space: normal; }

/* ─────────────── SOWA PLATFORM (platform.html, plan S3 §4.6) ───────────────
   platform.html fixes theme-yoa on <html> and loads brand.css, so these rules use the YoA tokens;
   the fallbacks are the same values. */
.plat-body { background: var(--yoa-surface-muted, #F5F6F8); color: var(--yoa-text, #16181D); min-height: 100vh; }
.plat-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 56px; padding: 8px 16px;
  background: var(--yoa-surface, #fff); border-bottom: 1px solid var(--yoa-border, #E7E9EC); }
.plat-wordmark { height: 27px; width: auto; }
.plat-context { padding: 2px 10px; border-radius: 999px; background: var(--yoa-primary-tint, #E8F0E6); color: var(--yoa-primary-deep, #114100);
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.plat-spacer { flex: 1 1 auto; }
.plat-who { font-size: 13px; color: var(--yoa-text-secondary, #43484F); }
.plat-main { max-width: 960px; margin: 0 auto; padding: 20px 16px 48px; }
.plat-h1 { font-size: var(--fs-title, 1.5rem); font-weight: 700; margin: 0 0 8px; }
.plat-h1:focus { outline: none; }
.plat-card { background: var(--yoa-surface, #fff); border: 1px solid var(--yoa-border, #E7E9EC); border-radius: 16px;
  box-shadow: var(--yoa-shadow-card, 0 1px 3px rgba(16, 24, 40, 0.06)); padding: 20px; margin-bottom: 16px; }
.plat-card-flush { padding: 0; overflow: hidden; }
.plat-card-flush .table { margin-bottom: 0; }
.plat-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--yoa-border, #E7E9EC); margin-bottom: 16px; overflow-x: auto; }
.plat-tab { background: none; border: 0; border-bottom: 2px solid transparent; min-height: 40px; padding: 8px 12px;
  color: var(--yoa-text-secondary, #43484F); font-weight: 600; white-space: nowrap; }
.plat-tab:hover { color: var(--yoa-text, #16181D); }
.plat-tab.active { color: var(--yoa-primary-deep, #114100); border-bottom-color: var(--yoa-primary, #1C6D00); }
.plat-tab:focus-visible { outline: 2px solid var(--yoa-primary, #1C6D00); outline-offset: -2px; }
.plat-invite-row { display: flex; gap: 8px; flex-wrap: wrap; }
.plat-invite-row .form-control { flex: 1 1 220px; min-width: 0; }
.plat-activity { list-style: none; padding: 0; margin: 0; }
.plat-activity li { padding: 10px 16px; border-bottom: 1px solid var(--yoa-border, #E7E9EC); }
.plat-activity li:last-child { border-bottom: 0; }
.plat-when { display: inline-block; min-width: 150px; color: var(--yoa-text-muted, #5B6169); font-size: 12px; }
.plat-toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 10px 16px; z-index: 1090;
  border-radius: 12px; background: var(--yoa-text, #16181D); color: #fff; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity 0.15s; }
.plat-toast.show { opacity: 1; }
.plat-toast-danger { background: var(--yoa-danger-text, #B91C1C); }
.plat-toast-success { background: var(--yoa-primary-hover, #165800); }
.plat-toast-warning { background: var(--yoa-warn-tint, #FEF3C7); color: #78350F; border: 1px solid #FCD34D; }
/* Phones: 40px touch targets for the small buttons in the bar, the table and the passkey list */
@media (max-width: 575.98px) {
  .plat-body :is(.btn, .form-control) { min-height: 40px; }
  .plat-when { display: block; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { .plat-toast { transition: none; } }

/* ─────────────── SOWA PLATFORM: rail and organisations (plan S4) ─────────────── */
.plat-main.plat-main-wide { max-width: 1200px; }
.plat-shell { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; }
.plat-rail { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 16px; }
.plat-rail .plat-tab { display: flex; align-items: center; gap: 10px; text-align: left; border: 0; border-left: 3px solid transparent;
  border-radius: 0 8px 8px 0; padding: 10px 12px; min-height: 44px; }
.plat-rail .plat-tab.active { background: var(--yoa-surface, #fff); border-left-color: var(--yoa-primary, #1C6D00); color: var(--yoa-primary-deep, #114100); }
.plat-pane { min-width: 0; }
.plat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.plat-head .plat-h1 { margin: 0; }
.plat-h2 { font-size: 1rem; font-weight: 700; margin: 0 0 12px; }
.plat-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.plat-chip { border: 1px solid var(--yoa-border, #E7E9EC); background: var(--yoa-surface, #fff); color: var(--yoa-text-secondary, #43484F);
  border-radius: 999px; padding: 4px 12px; min-height: 36px; font-size: 13px; font-weight: 600; }
.plat-chip[aria-pressed="true"] { background: var(--yoa-primary-tint, #E8F0E6); border-color: var(--yoa-primary, #1C6D00); color: var(--yoa-primary-deep, #114100); }
.plat-chip-n { font-variant-numeric: tabular-nums; opacity: 0.8; margin-left: 2px; }
.plat-search { width: auto; flex: 1 1 200px; max-width: 320px; margin-left: auto; }
.plat-empty { text-align: center; padding: 32px 16px; }
.plat-num { font-variant-numeric: tabular-nums; }
.plat-amber { color: #92400E; }
.plat-red { color: var(--yoa-danger-text, #B91C1C); font-weight: 600; }
.plat-orgchip { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; flex: none;
  background: var(--yoa-primary-tint, #E8F0E6); color: var(--yoa-primary-deep, #114100); font-weight: 700; font-size: 12px; vertical-align: middle; margin-right: 10px; }
.plat-orgchip-lg { width: 48px; height: 48px; font-size: 16px; border-radius: 12px; }
.plat-orgname { display: inline-block; vertical-align: middle; font-weight: 600; }
.plat-stepper { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 16px; flex-wrap: wrap; }
.plat-stepper li { display: flex; align-items: center; gap: 8px; color: var(--yoa-text-muted, #5B6169); font-size: 13px; }
.plat-stepper li + li::before { content: ''; width: 24px; height: 1px; background: var(--yoa-border, #E7E9EC); }
.plat-step-n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--yoa-border-strong, #D8DCE1); font-weight: 700; }
.plat-stepper li[aria-current="step"] { color: var(--yoa-text, #16181D); font-weight: 700; }
.plat-stepper li[aria-current="step"] .plat-step-n { background: var(--yoa-primary, #1C6D00); border-color: var(--yoa-primary, #1C6D00); color: #fff; }
.plat-stepper li.done .plat-step-n { background: var(--yoa-primary-tint, #E8F0E6); border-color: var(--yoa-primary, #1C6D00); color: var(--yoa-primary-deep, #114100); }
.plat-wizard { max-width: 720px; }
.plat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.plat-field { margin-bottom: 14px; }
.plat-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.plat-wizard .plat-actions { justify-content: flex-end; border-top: 1px solid var(--yoa-border, #E7E9EC); padding-top: 16px; }
.plat-review { border-bottom: 1px solid var(--yoa-border, #E7E9EC); padding-bottom: 12px; margin-bottom: 12px; }
.plat-review-head { display: flex; justify-content: space-between; align-items: baseline; }
.plat-review dl, .plat-dl { margin: 0; }
.plat-kv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 12px; padding: 6px 0; border-top: 1px solid var(--yoa-border, #E7E9EC); }
.plat-kv:first-child { border-top: 0; }
.plat-kv dt { font-weight: 500; color: var(--yoa-text-secondary, #43484F); font-size: 13px; }
.plat-kv dd { margin: 0; text-align: right; }
.plat-hero-main { display: flex; gap: 12px; align-items: center; }
.plat-hero-main .plat-orgchip { margin-right: 0; }
.plat-headline { font-size: 1.125rem; font-weight: 700; margin: 12px 0 0; }
.plat-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.plat-tile-wide { grid-column: 1 / -1; }
.plat-tiles .plat-activity li { padding: 8px 0; }
@media (max-width: 991.98px) { .plat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767.98px) {
  .plat-shell { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .plat-rail { position: static; flex-direction: row; flex-wrap: wrap; border-bottom: 1px solid var(--yoa-border, #E7E9EC); }
  .plat-rail .plat-tab { border-left: 0; border-bottom: 3px solid transparent; border-radius: 0; white-space: nowrap; }
  .plat-rail .plat-tab.active { border-bottom-color: var(--yoa-primary, #1C6D00); background: none; }
  .plat-tiles { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 639.98px) {
  .plat-grid { grid-template-columns: minmax(0, 1fr); }
  .plat-step-l { display: none; }
  .plat-stepper li[aria-current="step"] .plat-step-l { display: inline; }
  .plat-search { max-width: none; margin-left: 0; }
  .plat-chip { min-height: 40px; }
  /* The organisations table becomes a card list (U20). */
  .plat-orgs thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .plat-orgs, .plat-orgs tbody, .plat-orgs tr, .plat-orgs td { display: block; width: 100%; }
  .plat-orgs tr { padding: 12px 16px; border-bottom: 1px solid var(--yoa-border, #E7E9EC); }
  .plat-orgs td, .plat-body .plat-orgs.table > tbody > tr > td { border: 0; padding: 3px 0; text-align: left !important; }
  .plat-orgs td:last-child { padding-top: 8px; }
  .plat-orgs td[data-label]:not([data-label="Organisation"])::before { content: attr(data-label) ": "; color: var(--yoa-text-muted, #5B6169); font-size: 12px; }
}

/* Plan S5: the SOWA support strip under the top bar (warn tint, always visible while inside a client). */
.support-strip {
  position: sticky; top: var(--topbar-h); z-index: 49;
  display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1rem;
  padding: .5rem 1.5rem; font-size: 13px;
  background: var(--li-warn-tint); color: #78350F; border-bottom: 1px solid #FCD34D;
}
.support-strip .bi { font-size: 1rem; }
.support-strip-text { flex: 1 1 18rem; }
.support-strip-reason { flex: 1 1 100%; order: 3; font-size: 12px; }
.support-strip-leave { margin-left: auto; min-height: 40px; min-width: 64px; }
.plat-access-text { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 575.98px) { .support-strip { padding: .5rem 1rem; } }
/* Plan S6: the licence notice under the top bar (grace: administrators and Finance; read-only: everyone). */
.licence-notice {
  position: sticky; top: var(--topbar-h); z-index: 48;
  display: flex; align-items: center; gap: .5rem 1rem;
  padding: .5rem 1.5rem; font-size: 13px;
  background: var(--li-warn-tint); color: #78350F; border-bottom: 1px solid #FCD34D;
}
.licence-notice.is-readonly { background: #FEF2F2; color: #991B1B; border-bottom-color: #FCA5A5; }
.licence-notice .bi { font-size: 1rem; flex: none; }
.licence-notice-text { flex: 1 1 18rem; }
/* Under the support strip it scrolls away (both stick at the same offset and the strip would cover it);
   on phones it scrolls away too, so four lines of notice do not hold a fifth of the screen. */
.support-strip ~ .licence-notice { position: relative; top: auto; }
@media (max-width: 575.98px) { .licence-notice { padding: .5rem 1rem; position: relative; top: auto; } }
/* Plan S5: the SOWA access tile on the platform's organisation page. */
.plat-access { list-style: none; padding: 0; margin: 0; }
.plat-access-row { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; padding: .5rem 0; border-top: 1px solid var(--line, #E7E9EC); }
.plat-access-row:first-child { border-top: 0; }
