  :root {
    /* Palette: "Chakra Navy & Saffron" (token names kept from v3 so no markup changes).
       Surfaces/ink/muted/line/soft/row = cool blue-grey neutrals.
       --lime/--lavender/--cream/--green/--rose/--peach keep their slot but now hold
       sage / sky / sand / aqua / blush / saffron tints (KPI tiles, kanban columns). */
    --ink: #0e1a33;
    --muted: #55617e;
    --line: #dce3ef;
    --bg: #ffffff;
    --soft: #e8effa;
    --row: #f4f7fc;
    --lime: #d8ebd7;      /* sage tint   */
    --lavender: #d2e3fa;  /* sky tint    */
    --cream: #f6ebd0;     /* sand tint   */
    --navy: #10285a;      /* dark KPI card */
    --peach: #fbddb2;     /* saffron tint */
    --green: #cbeaea;     /* aqua tint   */
    --rose: #f7d8d8;      /* blush tint  */
    --link: #1d4fb5;
    --red: #c62833;
    --brand: #1d4fb5;     /* primary actions, active states */
    --brand-hover: #163e91;
    --accent: #f59e1b;    /* saffron: highlights, notification dot, active-parent marker */
    --sidebar: #0a1b3d;
    --surface: #ffffff;   /* cards, top bar, popovers */
    --ink2: #33415f;      /* secondary text (was a self-reference in the prototype) */
    /* Sidebar tokens – light theme gets a light sidebar, dark theme the navy one */
    --sb-bg: #f4f7fc; --sb-line: #dce3ef; --sb-text: #0e1a33; --sb-muted: #55617e; --sb-sub: var(--ink2);
    --sb-hover: #e4ebf8; --sb-chip: #e4ebf8; --sb-active-bg: #1d4fb5; --sb-active-fg: #ffffff; --sb-parent-bg: #e1e9f8;
    --logo-bg: #10285a; --logo-fg: #ffffff;
    color-scheme: light;
    --grad: linear-gradient(90deg, #9a3a0a, #b8500a);  /* Donations promo (burnt saffron, white text AA) */
    --radius: 14px;
    --sbw: 250px;
    /* One shape scale for the whole site: big containers / medium panels / controls (10px) */
    --r-lg: 18px;
    --r-md: 12px;
    --gap: 16px;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    color: var(--ink); background: var(--bg);
    display: grid; grid-template-columns: var(--sbw) minmax(0, 1fr); min-height: 100vh;
    transition: grid-template-columns .18s ease;
  }
  body.collapsed { --sbw: 72px; }
  a { color: inherit; }
  body, .topbar, .wcard, .kpi, .hs { transition: background-color .18s ease, color .18s ease, border-color .18s ease; }
  button, select, input { font: inherit; color: inherit; }
  button { cursor: pointer; }
  .i { width: 18px; height: 18px; flex: none; }
  [hidden] { display: none !important; }

  /* ---------- Sidebar ---------- */
  .sidebar { background: var(--sb-bg); color: var(--sb-text); border-right: 1px solid var(--sb-line); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; z-index: 30; transition: background .18s ease, color .18s ease; }
  .sb-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px; border-bottom: 1px solid var(--sb-line); min-height: 64px; }
  .hamb { width: 38px; height: 38px; border: 0; background: var(--sb-chip); color: var(--sb-text); border-radius: 10px; display: grid; place-items: center; flex: none; }
  .hamb:hover { background: var(--sb-hover); }
  .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; color: var(--sb-text); }
  .logo { width: 36px; height: 36px; border-radius: 10px; background: var(--logo-bg); color: var(--logo-fg); display: grid; place-items: center; font-weight: 700; flex: none; }
  .brand-name { font-weight: 600; line-height: 1.15; font-size: 14px; white-space: nowrap; }
  .brand-sub { font-size: 12px; color: var(--sb-muted); }
  .sb-nav { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 2px; scrollbar-width: none; }
  .sb-nav::-webkit-scrollbar { display: none; }
  .navlink { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: transparent; color: var(--sb-text); padding: 11px 12px; border-radius: 10px; text-align: left; font-size: 14.5px; }
  .navlink:hover { background: var(--sb-hover); }
  .navlink .lbl { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .navlink.active { background: var(--sb-active-bg); color: var(--sb-active-fg); }
  .navlink.parent.active { background: var(--sb-parent-bg); color: var(--sb-text); box-shadow: inset 3px 0 0 var(--accent); }
  .navlink.feature { background: var(--grad); color: #fff; }
  .navlink.feature:hover { background: var(--grad); filter: brightness(1.08); }
  .navlink.feature.active { background: var(--grad); color: #fff; box-shadow: inset 0 0 0 2px var(--sb-bg), inset 0 0 0 4px var(--sb-text); }
  .navlink.back { background: var(--sb-chip); margin-bottom: 8px; }
  .navlink.back:hover { background: var(--sb-hover); }
  .chev { width: 14px; height: 14px; transition: transform .15s; opacity: .7; }
  .navlink.open .chev { transform: rotate(180deg); }
  .badge { background: var(--peach); color: var(--ink); font-size: 12px; font-weight: 600; min-width: 22px; text-align: center; padding: 1px 7px; border-radius: 999px; }
  .badge.red { background: var(--red); color: #fff; }
  .badge.sm { font-size: 11px; min-width: 18px; padding: 0 5px; }
  .subs { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 8px 22px; margin-left: 10px; border-left: 1.5px solid var(--sb-line); }
  .sublink, .subgroup { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; color: var(--sb-sub); padding: 8px 12px; border-radius: 8px; font-size: 13.5px; text-align: left; }
  .sublink:hover, .subgroup:hover { background: var(--sb-hover); color: var(--sb-text); }
  .sublink.active { background: var(--sb-active-bg); color: var(--sb-active-fg); font-weight: 600; }
  .sublink.ingroup { padding-left: 18px; }
  .subgroup .rdot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); flex: none; }
  .subgroup .chev { margin-left: auto; }
  .subgroup.open .chev { transform: rotate(180deg); }
  .sb-foot { padding: 12px 16px; border-top: 1px solid var(--sb-line); font-size: 12px; color: var(--sb-muted); }
  body.collapsed .brand, body.collapsed .navlink .lbl, body.collapsed .navlink .badge, body.collapsed .chev, body.collapsed .subs, body.collapsed .sb-foot { display: none; }
  body.collapsed .navlink { justify-content: center; padding: 12px 0; }
  body.collapsed .sb-head { justify-content: center; padding: 14px 0; }

  
  /* ---------- Dark theme (sidebar, top bar and content all switch together) ---------- */
  :root[data-theme="dark"] {
    color-scheme: dark;
    --ink: #e8edf7; --ink2: #b6c3de; --muted: #9fb0d0; --line: #243a6b;
    --bg: #09132b; --surface: #0f1d3d; --soft: #1a2d58; --row: #132447;
    --lime: #1f3d36; --lavender: #1d3a6c; --cream: #43391f; --peach: #4d3715; --green: #1b3d42; --rose: #482328;
    --navy: #14306b; --link: #8fb4ff; --brand: #2f63cf; --brand-hover: #3a72e6; --red: #d6404c;
    --sb-bg: #0a1b3d; --sb-line: #1a2e58; --sb-text: #ffffff; --sb-muted: #a9b8d6; --sb-sub: #c6d2ea;
    --sb-hover: #162b55; --sb-chip: #15284e; --sb-active-bg: #ffffff; --sb-active-fg: #0e1a33; --sb-parent-bg: #162b55;
    --logo-bg: #ffffff; --logo-fg: #0e1a33;
  }
  select option { background: var(--surface); color: var(--ink); }
  :root[data-theme="dark"] .nrow .cnt.bad, :root[data-theme="dark"] .chipstat.warn { background: #4a2026; color: #ffb3b8; }
  :root[data-theme="dark"] .chipstat, :root[data-theme="dark"] .pill-green { background: #17382b; color: #8fe0b0; }
  :root[data-theme="dark"] .pop .danger, :root[data-theme="dark"] .exclude > summary { color: #ff9aa2; }
  :root[data-theme="dark"] .prow.sec { background: var(--soft); }
  :root[data-theme="dark"] .seg button:hover { background: #24396c; }
  :root[data-theme="dark"] .connect .tags span + span { background: var(--row); color: var(--ink2); }
  :root[data-theme="dark"] .dots button { background: #3a4d7c; }
  :root[data-theme="dark"] .star { color: #f0b24a; }
  :root[data-theme="dark"] .overlay { background: rgba(2,8,24,.7); }

  /* ---------- Top bar ---------- */
  .main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
  .topbar { display: flex; align-items: center; gap: 14px; padding: 0 24px; height: 64px; border-bottom: 1.5px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 20; }
  .ptitle { font-size: 20px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .menu-btn { display: none; }
  .actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
  .tbtn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; position: relative; }
  .tbtn:hover, .tbtn.active { background: var(--soft); }
  .tbtn.plus { background: var(--brand); color: #fff; }
  .tbtn.plus:hover { background: var(--brand-hover); }
  .tbtn .i { width: 20px; height: 20px; }
  .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
  .avatar { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--lavender); font-weight: 600; margin-left: 6px; }
  .pwrap { position: relative; display: inline-block; }
  .pop { position: absolute; right: 0; top: 48px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-md); box-shadow: 0 14px 34px rgba(10,27,61,.16); padding: 8px; min-width: 230px; z-index: 40; text-align: left; }
  .pop .ph { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 4px; }
  .pop button, .pop a { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 10px; border-radius: 8px; text-decoration: none; font-size: 14px; }
  .pop button:hover, .pop a:hover { background: var(--soft); }
  .pop .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; font-size: 13px; color: var(--muted); }
  .pop .who b { display: block; color: var(--ink); font-size: 14px; }
  .pop .danger { color: #a5222b; font-weight: 600; }
  .pop .note { padding: 12px 10px; font-size: 13px; color: var(--muted); }
  .mega { position: fixed; top: 70px; right: 16px; width: min(1040px, calc(100vw - var(--sbw) - 32px)); background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 18px 44px rgba(10,27,61,.18); z-index: 40; padding: 20px 24px 24px; }
  .mega h3 { font-size: 17px; font-weight: 600; padding-bottom: 14px; border-bottom: 1.5px solid var(--line); margin-bottom: 16px; }
  .mega .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px; }
  .mega h4 { font-size: 14px; margin-bottom: 8px; }
  .mega a { display: block; padding: 6px 0; font-size: 13.5px; color: var(--muted); text-decoration: none; }
  .mega a:hover { color: var(--ink); text-decoration: underline; }

  .content { padding: 16px 24px 24px; flex: 1; }
  .pfoot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 24px; background: var(--soft); color: var(--muted); font-size: 12.5px; }
  .pfoot a { text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }

  /* ---------- Buttons & inputs ---------- */
  .btn { height: 40px; padding: 0 18px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); white-space: nowrap; }
  .btn:hover { background: var(--soft); }
  .btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
  .btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
  .btn.sm { height: 32px; padding: 0 14px; font-size: 13px; }
  .btn.sm.outline { border-color: var(--ink); }
  .btn.grad { background: var(--grad); color: #fff; border: 0; height: 46px; padding: 0 28px; border-radius: 999px; font-weight: 600; }
  .btn.block { width: 100%; height: 46px; }
  .split { display: inline-flex; }
  .split .btn:first-child { border-radius: 10px 0 0 10px; }
  .split .btn.caret { border-radius: 0 10px 10px 0; padding: 0 12px; border-left-color: #3a4b70; }
  .split .pop { right: 0; top: 46px; }
  .ib { width: 36px; height: 36px; border: 0; background: transparent; border-radius: 10px; display: grid; place-items: center; color: var(--ink2); position: relative; }
  .ib:hover { background: var(--soft); }
  .fwrap { position: relative; display: inline-block; }
  .fcount { position: absolute; top: 1px; right: 1px; width: 15px; height: 15px; border-radius: 50%; background: var(--red); color: #fff; font-size: 10px; font-style: normal; display: grid; place-items: center; pointer-events: none; }
  .isrch { display: inline-flex; align-items: center; }
  .isrch input { height: 36px; width: 200px; border: 0; border-radius: 10px; background: var(--soft); padding: 0 12px; outline: none; margin-right: 4px; }
  .xlink { color: var(--link); text-decoration: none; font-size: 14px; white-space: nowrap; padding: 0 8px; }
  .xlink:hover { text-decoration: underline; }
  select.vsel { font-size: 20px; border: 0; background: transparent; padding: 4px 6px 4px 0; cursor: pointer; font-weight: 400; max-width: 100%; }
  select.flt, select.psel { border: 0; background: transparent; color: var(--link); cursor: pointer; font-size: 13.5px; padding: 6px 2px; }
  select.btn { padding-right: 10px; }
  .dates { display: inline-flex; gap: 10px; margin-left: auto; }
  .dinp { display: inline-flex; align-items: stretch; height: 36px; background: var(--soft); border-radius: 8px; overflow: hidden; }
  .dinp input { border: 0; background: transparent; padding: 0 10px; width: 112px; outline: none; font-size: 13.5px; }
  .dinp span { width: 36px; display: grid; place-items: center; background: var(--brand); color: #fff; }
  input[type=checkbox], input[type=radio] { accent-color: var(--brand); width: 17px; height: 17px; vertical-align: middle; }

  /* ---------- List bar, tabs, chips ---------- */
  .page { margin-top: 0; animation: fade .2s ease; }
  /* every page starts at the same distance below the top bar, whatever its first element is */
  .page > :first-child { margin-top: 0; }
  .page > .dashhead:first-child { padding-top: 0; }
  @keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
  .lbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
  .lbar .lt { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
  .lbar .rt { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-left: auto; }
  .lbar .rt .btn { margin-left: 6px; }
  h2.lh { font-size: 20px; font-weight: 400; }
  .lmeta { color: var(--muted); font-size: 13.5px; border-left: 1.5px solid var(--line); padding-left: 12px; }
  .lmeta b { color: var(--ink); }
  .frow { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 6px; }
  .intro { color: var(--ink2); font-size: 14px; margin-top: 8px; max-width: 1000px; }
  .tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); border: 1.5px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin-top: 18px; background: var(--surface); }
  .tabs button { border: 0; background: var(--surface); padding: 13px 12px; border-left: 1.5px solid var(--line); display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink2); }
  .tabs button:first-child { border-left: 0; }
  .tabs button:hover { background: var(--row); }
  .tabs button.on { background: var(--soft); color: var(--ink); font-weight: 600; box-shadow: inset 0 -3px 0 var(--ink); }
  .subtabs { display: flex; gap: 6px; border-bottom: 1.5px solid var(--line); margin-top: 16px; }
  .subtabs button { border: 0; background: transparent; padding: 10px 14px; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1.5px; }
  .subtabs button.on { color: var(--ink); font-weight: 700; border-bottom-color: var(--lavender); }
  .seg { display: inline-flex; gap: 2px; background: var(--soft); border-radius: 10px; padding: 3px; }
  .seg button { border: 0; background: transparent; width: 36px; height: 32px; border-radius: 8px; display: grid; place-items: center; }
  .seg button:hover { background: #d9e4f7; }
  .seg button.on { background: var(--brand); color: #fff; }
  .chips { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--ink2); }
  .chip { background: var(--soft); border-radius: 6px; padding: 3px 8px; display: inline-flex; align-items: center; gap: 6px; }
  .chip button { border: 0; background: none; font-size: 12px; color: var(--muted); }
  .chips .reset { color: var(--link); text-decoration: none; }
  .pill-green { background: #dcf1e3; color: #17673e; border-radius: 6px; padding: 3px 10px; font-size: 13px; }
  .filterpanel { margin-top: 12px; background: var(--row); border-radius: var(--r-lg); padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
  .filterpanel select { height: 36px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--surface); padding: 0 10px; }

  /* ---------- Tables ---------- */
  .tablewrap { overflow-x: auto; margin-top: 8px; }
  table.dt { border-collapse: separate; border-spacing: 0 8px; width: 100%; min-width: 880px; font-size: 14px; }
  .dt th { text-align: left; font-weight: 600; color: var(--ink2); font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; padding: 6px 10px; white-space: nowrap; }
  .dt th.act { text-align: right; padding-right: 14px; }
  .dt td { background: var(--row); padding: 14px 10px; }
  .dt td:first-child { border-radius: 12px 0 0 12px; }
  .dt td:last-child { border-radius: 0 12px 12px 0; }
  .dt tr.gone { opacity: 0; transition: opacity .25s; }
  .dt .w { width: 34px; }
  .dt td.act { width: 1%; white-space: nowrap; }
  .dt .rowact { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
  .dt tr.msg td { background: none; text-align: center; color: var(--ink2); padding: 16px; border-top: 1.5px solid var(--line); }
  .star { border: 0; background: none; font-size: 16px; color: #c98a1b; }
  .kebab { border: 0; background: none; font-size: 18px; color: var(--muted); padding: 0 6px; }
  .foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 14px; margin-top: 8px; }
  .foot select { border: 0; background: none; color: var(--muted); }
  .link { border: 0; background: none; color: var(--muted); }
  .link:hover { color: var(--ink); }
  .es { text-align: center; padding: 44px 16px; }
  .es .eic { width: 54px; height: 54px; margin: 0 auto 12px; color: #8c97b2; }
  .es .eic .i { width: 54px; height: 54px; stroke-width: 1.4; }
  .es b { display: block; font-size: 17px; margin-bottom: 6px; }
  .es p { color: var(--muted); font-size: 14px; max-width: 520px; margin: 0 auto 10px; }
  .xcta { color: var(--link); text-decoration: none; font-size: 14px; }
  .xcta:hover { text-decoration: underline; }
  .boxed { border: 1.5px solid var(--line); border-radius: var(--r-lg); background: var(--surface); margin-top: 16px; overflow: hidden; }

  /* ---------- KPI strips, widgets ---------- */
  .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1.5px; background: var(--line); border: 1.5px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-top: 16px; }
  .kpi { background: var(--surface); padding: 20px 14px; text-align: center; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; min-height: 130px; }
  .kpi .ap { font-size: 11px; color: var(--muted); height: 13px; }
  .kpi b { font-size: 46px; font-weight: 300; line-height: 1.1; }
  .kpi .kl { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
  .kpi small { font-size: 12px; color: var(--muted); }
  .kpis.tint .kpi small { color: var(--ink2); }
  .lime { background: var(--lime) !important; } .lavender { background: var(--lavender) !important; } .cream { background: var(--cream) !important; }
  .green { background: var(--green) !important; } .peach { background: var(--peach) !important; } .rose { background: var(--rose) !important; }
  .wgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 16px; }
  .wgrid.g4 { grid-template-columns: repeat(4, 1fr); }
  .wgrid.g3 { grid-template-columns: repeat(3, 1fr); }
  .wgrid.g2 { grid-template-columns: repeat(2, 1fr); }
  .span2 { grid-column: span 2; }
  .wcard { border: 1.5px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; display: flex; flex-direction: column; }
  .wcard .wh { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; font-size: 15px; border-bottom: 1.5px solid var(--line); min-height: 52px; }
  .wcard .wb { padding: 18px; flex: 1; }
  .wcard .wf { padding: 10px 18px; border-top: 1.5px solid var(--line); text-align: right; font-size: 13px; }
  .wcard .wf a { color: var(--link); text-decoration: none; }
  .wcard.navy { background: var(--navy); color: #fff; border-color: var(--navy); }
  .wcard.navy .wh { border-bottom-color: rgba(255,255,255,.14); }
  .wcard.navy select.psel { color: #c6d2ea; }
  .wcard.navy select.psel option { color: var(--ink); }
  .big { text-align: center; padding: 8px 0; }
  .big b { display: block; font-size: 54px; font-weight: 300; line-height: 1.1; }
  .big .kl { display: block; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; margin-top: 2px; }
  .big small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
  .phrow { display: flex; justify-content: space-between; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--ink2); }
  .phrow:last-child { border-bottom: 0; }
  .chipstat { font-size: 12px; border-radius: 6px; padding: 2px 8px; background: #dcf1e3; color: #17673e; }
  .chipstat.warn { background: #fde4e6; color: #a5222b; }
  .chipstat.info { background: var(--soft); color: var(--link); }
  .mlink { color: var(--link); text-decoration: none; font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; }
  .metrics { display: flex; gap: 28px; flex-wrap: wrap; }
  .metrics b { display: block; font-size: 32px; font-weight: 300; }
  .metrics span { font-size: 12px; color: var(--muted); }
  .bars { display: flex; align-items: flex-end; gap: 12px; height: 90px; }
  .bars i { width: 26px; border-radius: 6px 6px 2px 2px; background: var(--lavender); }
  .bars small { color: var(--muted); font-size: 12px; margin-left: 8px; align-self: flex-end; }
  .dashhead { display: flex; justify-content: space-between; align-items: center; padding: 12px 0 0; font-size: 15px; gap: 12px; flex-wrap: wrap; }
  .orgcard { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 0 2px; }
  .orglogo { width: 52px; height: 52px; border-radius: 50%; background: var(--sidebar); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
  .orgname { font-weight: 600; }
  .orglinks { display: flex; gap: 14px; margin-top: 2px; }
  .orglinks a { font-size: 13px; color: var(--link); text-decoration: none; }
  .team { display: inline-flex; }
  .team i { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--surface); margin-left: -8px; }
  .team i:first-child { margin-left: 0; }
  .donutbox { display: flex; align-items: center; justify-content: center; gap: 22px; flex-wrap: wrap; padding: 6px; }
  .donut { width: var(--s); height: var(--s); border-radius: 50%; background: var(--g); display: grid; place-items: center; flex: none; }
  .donut .in { width: calc(var(--s) - 16px); height: calc(var(--s) - 16px); border-radius: 50%; background: var(--surface); display: grid; place-content: center; text-align: center; }
  .donut .in b { font-size: 30px; font-weight: 300; line-height: 1.1; }
  .donut .in span { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink2); }
  .legend { list-style: none; font-size: 13px; display: grid; gap: 4px; }
  .legend li { display: flex; align-items: center; gap: 6px; }
  .legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
  .kpis .donutbox { background: var(--surface); }
  .dots { display: flex; gap: 8px; justify-content: center; padding: 10px; }
  .dots button { width: 9px; height: 9px; border-radius: 50%; border: 0; background: #c3cde2; padding: 0; }
  .dots button.on { background: var(--ink); }

  /* ---------- Kanban ---------- */
  .board { display: flex; gap: 16px; overflow-x: auto; margin-top: 16px; padding-bottom: 8px; align-items: flex-start; }
  .col { flex: 0 0 300px; min-height: 380px; border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; }
  .col-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
  .col-head .ib { width: 28px; height: 28px; }
  .col small { display: block; font-weight: 400; margin-top: 2px; }
  .drop { margin-top: auto; width: 100%; border: 1.5px dashed #52617f; border-radius: var(--r-md); padding: 14px; background: rgba(255,255,255,.35); text-align: center; font-size: 13.5px; }
  .drop:hover { background: rgba(255,255,255,.7); }
  .card-op { background: var(--surface); border-radius: var(--r-md); padding: 12px 14px; margin-top: 12px; font-size: 14px; }
  .col .stack { flex: 1; }
  .addcol { flex: 0 0 auto; width: 52px; height: 52px; border-radius: var(--r-lg); border: 1.5px solid var(--ink); background: var(--surface); font-size: 22px; }

  /* ---------- Calendar ---------- */
  .cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 16px; }
  .cal div { background: var(--row); border-radius: 10px; min-height: 70px; padding: 8px; font-size: 13px; }
  .cal .dow { background: none; min-height: 0; color: var(--muted); }
  .cal .today { background: var(--lavender); font-weight: 700; }
  .cal .empty { background: none; }
  .calhead { margin-top: 16px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #6e7b99; }

  /* ---------- Campaign wizard ---------- */
  .stepper { display: flex; align-items: center; background: var(--soft); border-radius: var(--r-md); padding: 6px; margin-top: 18px; gap: 4px; overflow-x: auto; }
  .stepper .st { padding: 10px 18px; border-radius: 9px; white-space: nowrap; color: var(--muted); display: flex; gap: 8px; }
  .stepper .st.on { background: var(--brand); color: #fff; }
  .stepper .st.done { color: var(--ink); }
  .stepper .sep { color: #9aa7c4; }
  .wizbar { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
  .wizhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-top: 18px; flex-wrap: wrap; }
  .wizhead h2 { font-size: 22px; font-weight: 600; }
  .wizhead p { color: var(--muted); font-size: 14px; margin-top: 4px; }
  .uniq { text-align: right; font-size: 14px; display: flex; align-items: center; gap: 10px; }
  .uniq b { font-size: 40px; font-weight: 400; line-height: 1; }
  .uniq small { display: block; font-size: 11px; color: var(--muted); }
  .acclist { border: 1.5px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-top: 14px; background: var(--surface); }
  details.acc2 { border-top: 1.5px solid var(--line); }
  details.acc2:first-child { border-top: 0; }
  details.acc2 summary { padding: 16px 20px; font-weight: 700; font-size: 14px; cursor: pointer; display: flex; align-items: center; gap: 10px; list-style: none; }
  details.acc2 summary::-webkit-details-marker { display: none; }
  details.acc2 summary::after { content: "▸"; margin-left: auto; color: var(--muted); font-size: 12px; }
  details.acc2[open] summary::after { content: "▾"; }
  details.acc2 .body { padding: 0 20px 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 20px; }
  details.acc2 label { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; }
  details.acc2 label em { font-style: normal; font-size: 12px; color: var(--muted); }
  .nb { background: #1d4fb5; color: #fff; border-radius: 50%; width: 18px; height: 18px; font-size: 11px; display: grid; place-items: center; }
  .selcount { color: #1d4fb5; font-weight: 600; font-size: 12px; }
  .exclude { margin-top: 18px; }
  .exclude > summary { color: #a5222b; font-weight: 700; font-size: 17px; cursor: pointer; list-style: none; padding: 6px 0; }
  .exclude > summary::-webkit-details-marker { display: none; }
  .exclude .small-note { font-size: 13px; color: var(--ink2); margin-top: 10px; }
  .placeholder { margin-top: 24px; border: 1.5px dashed var(--line); border-radius: var(--r-lg); padding: 48px 24px; text-align: center; color: var(--muted); }

  /* ---------- Modal ---------- */
  .overlay { position: fixed; inset: 0; background: rgba(10,27,61,.55); display: grid; place-items: center; padding: 16px; z-index: 80; }
  .modal { background: var(--surface); border-radius: var(--r-lg); padding: 28px; width: 480px; max-width: 100%; max-height: 92vh; overflow: auto; }
  .modal.wide { width: 620px; }
  .modal h2 { font-weight: 300; font-size: 24px; margin-bottom: 18px; }
  .modal h3 { font-size: 15px; margin: 6px 0 12px; }
  .modal .f { margin-bottom: 14px; font-size: 14px; }
  .modal .f > span { display: block; margin-bottom: 6px; }
  .modal .f > span em { font-style: normal; color: var(--muted); }
  .modal .f input[type=text], .modal .f select { width: 100%; background: var(--soft); border: 0; height: 44px; border-radius: 10px; padding: 0 14px; outline: none; }
  .modal .f label { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
  .modal .f input.err { outline: 2px solid #d64550; }
  .modal .btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
  .modal .g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
  .avatar-up { width: 92px; height: 92px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; color: #8c97b2; margin-bottom: 14px; }
  .avatar-up .i { width: 44px; height: 44px; }
  .etypes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .etype { border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 18px; text-align: left; background: var(--surface); }
  .etype .i { width: 40px; height: 40px; color: var(--link); margin-bottom: 14px; display: block; }
  .etype b { display: block; margin-bottom: 4px; }
  .etype span { font-size: 13px; color: var(--muted); display: block; }
  .etype em { display: block; margin-top: 12px; font-style: normal; font-size: 13px; color: var(--link); border-top: 1px solid var(--line); padding-top: 8px; }
  .etype.on { border-color: var(--ink); background: var(--soft); box-shadow: 0 0 0 1.5px var(--ink); }
  .etype.err { border-color: #d64550; }

  /* ---------- Roles ---------- */
  .roles { display: grid; grid-template-columns: 220px 1fr; gap: 24px; margin-top: 20px; }
  .rolebtn { display: block; width: 100%; text-align: left; border: 0; background: var(--row); padding: 12px 16px; margin-bottom: 2px; border-left: 4px solid transparent; }
  .rolebtn.on { background: var(--soft); border-left-color: var(--ink); font-weight: 600; }
  .addrole { border: 0; background: none; color: var(--link); padding: 10px 16px; }
  .rtools { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; color: var(--ink2); font-size: 14px; }
  .rtools .lk { display: flex; gap: 16px; }
  .rtools .lk button { border: 0; background: none; color: var(--link); }
  .prow { display: grid; grid-template-columns: 1fr repeat(4, 90px); align-items: center; padding: 8px 14px; background: var(--row); border-radius: 8px; margin-bottom: 4px; font-size: 14px; }
  .prow.head { background: none; color: var(--muted); font-size: 13px; }
  .prow.sec { background: #e3ecf9; font-weight: 700; cursor: pointer; }
  .prow.item { padding-left: 28px; }
  .prow > span:not(:first-child) { text-align: center; }
  .foots { font-size: 12px; color: var(--ink2); margin-top: 14px; display: grid; gap: 4px; }

  /* ---------- Promo pages ---------- */
  .hero { text-align: center; padding: 48px 12px 24px; }
  .hero h2 { font-size: clamp(30px, 4vw, 46px); font-weight: 600; line-height: 1.15; max-width: 720px; margin: 0 auto 18px; }
  .hero p { color: var(--ink2); max-width: 640px; margin: 0 auto 22px; font-size: 16px; line-height: 1.6; }
  .hero .more { display: block; margin: 14px auto 0; border: 0; background: none; color: var(--muted); font-size: 13px; }
  .feat { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; max-width: 1060px; margin: 24px auto 0; }
  .feat .fc { background: var(--row); border-radius: var(--r-lg); padding: 22px; }
  .feat .fc b { display: block; margin-bottom: 8px; font-size: 16px; }
  .feat .fc p { color: var(--ink2); font-size: 14px; line-height: 1.5; }
  .feat .fc .art { height: 120px; border-radius: var(--r-md); margin-top: 16px; background: var(--grad); opacity: .85; }
  .comm { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding: 24px; align-items: center; }
  .comm .art { height: 190px; border-radius: var(--r-lg); background: var(--soft); display: grid; place-items: center; color: var(--lavender); }
  .comm .art .i { width: 80px; height: 80px; stroke-width: 1.2; }
  .status { display: inline-flex; align-items: center; gap: 6px; background: var(--row); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; margin-left: 10px; }
  .status i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
  .scorecard { max-width: 760px; margin: 28px auto; display: grid; gap: 12px; padding: 28px 20px; }
  .scorecard select, .scorecard input { height: 44px; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--surface); width: 100%; }
  .scorecard label { font-size: 12px; color: var(--muted); display: grid; gap: 3px; }
  .connect { text-align: center; padding: 70px 16px; }
  .connect .tags { display: flex; gap: 6px; justify-content: center; margin-bottom: 16px; }
  .connect .tags span { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px; background: var(--soft); }
  .connect .tags span + span { background: #e6ebf4; color: #4a5878; }
  .connect .oc { width: 56px; height: 56px; border-radius: var(--r-md); background: var(--grad); margin: 0 auto 14px; }
  .connect .oc { display: grid; place-items: center; color: #fff; }
  .connect .oc .i { width: 26px; height: 26px; }
  .connect h3 { font-size: 17px; margin-bottom: 6px; }
  .connect p { color: var(--ink2); margin-bottom: 16px; font-size: 14px; }

  /* ---------- Floating AI Copilot ---------- */
  .fab { position: fixed; right: 20px; bottom: 56px; z-index: 50; }
  .fab .round { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; font-size: 14px; font-weight: 700; box-shadow: 0 6px 18px rgba(10,27,61,.3); }
  .copilot { position: absolute; right: 0; bottom: 58px; width: 290px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 16px 40px rgba(10,27,61,.2); padding: 14px; }
  .copilot .ch { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin-bottom: 8px; }
  .copilot .ch button { border: 0; background: none; font-size: 18px; color: var(--muted); }
  .copilot .sug { display: block; width: 100%; text-align: left; border: 1.5px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 12px; margin-top: 6px; font-size: 13.5px; }
  .copilot .sug:hover { background: var(--soft); }


  /* ---------- Footer height (shared) ---------- */
  :root { --pf: 36px; }
  .pfoot { height: var(--pf); padding: 0 24px; flex-wrap: nowrap; font-size: 12px; overflow: hidden; white-space: nowrap; }

  /* ---------- Home › Dashboard: compact, natural-height layout (no stretched gaps) ---------- */
  .content:has(.home) { padding-bottom: 0; }
  /* Capped width + centred: on big monitors the modules stay card-sized instead of stretching across the screen */
  .home { display: grid; gap: var(--gap); align-content: start; padding-bottom: 14px; max-width: 1180px; margin: 0 auto; }
  .hhead { display: flex; align-items: center; gap: 12px; min-width: 0; }
  .hhead .orglogo { width: 40px; height: 40px; font-size: 17px; background: var(--logo-bg); color: var(--logo-fg); }
  .hmain { flex: 1; min-width: 0; }
  .hmain h2 { font-size: 20px; font-weight: 600; line-height: 1.2; }
  .hl2 { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hhead select.psel { height: 32px; }
  .hhead .mlink { white-space: nowrap; }
  .home .kpis { margin-top: 0; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .home .kpi { min-height: 0; padding: clamp(8px, 1.6vh, 14px) 8px; gap: 1px; }
  .home .kpi b { font-size: clamp(24px, 4.2vh, 34px); }
  .home .kpi .kl { font-size: 11px; }
  .home .kpi small { font-size: 11.5px; line-height: 1.25; }

  .hgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
  .hcol { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: var(--gap); min-width: 0; }
  .hc { min-height: 0; }
  .hc .wh { padding: 10px 18px; min-height: 46px; }
  .hc .wb { padding: 8px 16px 10px; min-height: 0; }
  .wlink { font-size: 12.5px; color: var(--link); text-decoration: none; }
  .wcard.navy .wlink { color: #c6d2ea; }

  /* Needs attention: tight list with hairline dividers (same pattern as the other dashboards' lists) */
  .nlist { display: flex; flex-direction: column; }
  .nrow { display: flex; align-items: center; gap: 12px; height: clamp(44px, 6.4vh, 54px); padding: 0 4px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--line); }
  .nrow:last-child { border-bottom: 0; }
  .nrow:hover { background: var(--row); }
  .nrow .cnt { width: 48px; flex: none; height: 28px; border-radius: 999px; display: grid; place-items: center; font-size: 15px; font-weight: 700; background: var(--lavender); color: var(--ink); }
  .nrow .cnt.bad { background: #fde4e6; color: #a5222b; }
  .nrow .cnt.warn { background: var(--peach); color: var(--ink); }
  .nrow .nt { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14.5px; font-weight: 600; line-height: 1.25; }
  .nrow .nt > span, .nrow .nt small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nrow .nt small { font-size: 12px; font-weight: 400; color: var(--muted); }
  .nrow em { font-style: normal; font-size: 12.5px; font-weight: 600; color: var(--link); white-space: nowrap; }

  /* Tasks / activity: one small card, two rows */
  .work .wb { padding: 2px 16px; display: flex; flex-direction: column; justify-content: center; height: 100%; }
  .wrow { display: flex; align-items: center; gap: 12px; min-height: 44px; border-bottom: 1px solid var(--line); min-width: 0; }
  .wrow:last-child { border-bottom: 0; }
  .wrow .i { color: var(--muted); }
  .wrow .ht { flex: 1; min-width: 0; line-height: 1.25; }
  .wrow .ht b { display: block; font-size: 13.5px; font-weight: 600; }
  .wrow .ht small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .wrow > a { color: var(--link); text-decoration: none; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
  .wrow > a:hover { text-decoration: underline; }

  /* Campaign summary: one compact row of four figures */
  .nmetrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; text-align: center; padding: 4px 0 2px; }
  .nm { display: flex; flex-direction: column; align-items: center; gap: 2px; }
  .nmv { font-size: 28px; font-weight: 300; line-height: 1.15; }
  .nml { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: #c6d2ea; }

  /* Income by type: bounded chart with faint gridlines, so bars sit close together */
  .hc .wb:has(.hbars) { display: flex; flex-direction: column; padding: 14px 20px 8px; }
  .hbars { flex: 1; min-height: 100px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; max-width: 460px; width: 100%; margin: 0 auto; }
  .hbars > div { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 0; }
  .hbars .trk { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; min-height: 0; border-bottom: 1.5px solid var(--line); }
  .hbars i { display: block; width: 100%; max-width: 40px; border-radius: 6px 6px 2px 2px; background: #5b8de0; }
  .hbars > div:last-child i { background: var(--brand); }
  .hbars small { font-size: 11px; color: var(--muted); line-height: 1; }
  .hc .wf { padding: 8px 18px; }

  /* Short windows: tighten instead of scrolling */
  @media (max-height: 700px) {
    :root { --gap: 12px; }
    .home { padding-bottom: 10px; }
    .hc .wh { min-height: 40px; padding: 6px 16px; }
    .hc .wf { padding: 6px 18px; }
  }
  @media (max-height: 600px) {
    :root { --gap: 10px; }
    .home .kpi small, .hl2, .wrow .ht small { display: none; }
    .nrow, .wrow { height: 38px; min-height: 38px; }
    .home .kpi { padding: 6px 8px; }
    .home { padding-bottom: 8px; }
    .hhead .orglogo { width: 34px; height: 34px; }
    .hbars { min-height: 60px; }
    .nm .nmv { font-size: 24px; }
  }
  @media (max-height: 520px) { .nrow .nt small { display: none; } }
  @media (max-width: 1100px) { .hhead .mtxt { display: none; } }
  @media (max-width: 1100px) {
    .wgrid.g4, .wgrid.g3 { grid-template-columns: repeat(2, 1fr); }
    .comm { grid-template-columns: 1fr; }
  }
  @media (max-width: 800px) {
    body { display: block; }
    .sidebar { position: fixed; left: 0; top: 0; width: 270px; transform: translateX(-100%); transition: transform .2s; }
    body.nav-open .sidebar { transform: none; }
    body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 25; }
    body.collapsed .brand, body.collapsed .navlink .lbl, body.collapsed .chev, body.collapsed .sb-foot { display: revert; }
    body.collapsed .subs { display: flex; }
    body.collapsed .navlink { justify-content: flex-start; padding: 11px 12px; }
    .menu-btn { display: grid; }
    .topbar, .content, .pfoot { padding-left: 14px; padding-right: 14px; }
    .mega { left: 8px; right: 8px; width: auto; max-height: 80vh; overflow: auto; }
    .wgrid.g4, .wgrid.g3, .wgrid.g2 { grid-template-columns: 1fr; }
    .span2 { grid-column: auto; }
    .roles { grid-template-columns: 1fr; }
    .prow { grid-template-columns: 1fr repeat(4, 56px); }
    .etypes, .modal .g2 { grid-template-columns: 1fr; }
    .dates { margin-left: 0; }
    .fab { bottom: 64px; }
  }

  @media (max-width: 800px) {
    /* phones: stack; a fixed one-screen layout would not fit */
    .home .kpis { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .home .kpi:last-child { grid-column: span 2; }
    .hgrid { grid-template-columns: 1fr; }
    .hcol { grid-template-rows: none; }
    .hgrid > .hcol:last-child > .hc:last-child, .work .wrow:last-child { display: none; }
    .pwrap:has([aria-label="Quick help"]) { display: none; }
    .home { gap: 10px; }
    .home .kpi b { font-size: 22px; }
    .home .kpi { padding: 8px 4px; }
    .hmain h2 { font-size: 18px; }
    .hl2 { display: none; }
    .hhead { flex-wrap: nowrap; }
    .nrow { height: 42px; }
    .content { padding-top: 12px; }
    .home { padding-bottom: 6px; }
    .pfoot > span { display: none; }
    .pfoot { padding: 0 14px; }
  }
a.navlink,a.sublink,a.brand{text-decoration:none}
.navlink.back{margin-bottom:8px}
a.btn{text-decoration:none;display:inline-flex;align-items:center}

/* ---------- Backend additions: flash messages, login, forms, pagination ---------- */
  .flash { margin: 0 0 12px; padding: 11px 16px; border-radius: var(--r-md); font-size: 14px; background: #dcf1e3; color: #17673e; }
  .flash.error { background: #fde4e6; color: #a5222b; }
  .flash.info { background: var(--soft); color: var(--link); }
  :root[data-theme="dark"] .flash { background: #17382b; color: #8fe0b0; }
  :root[data-theme="dark"] .flash.error { background: #4a2026; color: #ffb3b8; }
  .modal .f .ferr { color: #a5222b; font-size: 12.5px; margin-top: 5px; display: block; }
  :root[data-theme="dark"] .modal .f .ferr { color: #ff9aa2; }
  .modal .f input.err, .modal .f select.err { outline: 2px solid #d64550; }
  .modal .f .checks { display: flex; flex-wrap: wrap; gap: 6px 22px; }
  .modal .f .checks label { margin: 4px 0; }
  .tablewrap.pops { padding-bottom: 120px; margin-bottom: -104px; }
  .foot { position: relative; z-index: 2; }
  .foot form { display: contents; }
  .dt th a { color: inherit; text-decoration: none; }
  .dt th a:hover { color: var(--ink); }
  .dt td a.cell { color: var(--ink); font-weight: 600; text-decoration: none; }
  .dt td a.cell:hover { text-decoration: underline; }
  .pill-no { background: var(--soft); color: var(--muted); border-radius: 6px; padding: 3px 10px; font-size: 13px; }
  .pill-arch { background: #fde4e6; color: #a5222b; border-radius: 6px; padding: 3px 10px; font-size: 13px; }
  .bulkbar { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 14px; color: var(--ink2); }
  .filterpanel label { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }

/* ---- Team Members / Security ---- */
.pill-warn { background: #fff1d6; color: #8a5a00; border-radius: 6px; padding: 3px 10px; font-size: 13px; }
:root[data-theme="dark"] .pill-warn { background: #4a3a14; color: #ffd98a; }
.seccards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); margin-top: 16px; align-items: start; }
.seccard { background: var(--surface); border-radius: var(--r-lg); padding: 24px; }
.seccard h3 { font-size: 16px; font-weight: 500; margin-bottom: 16px; }
.seccard .f { margin-bottom: 14px; font-size: 14px; }
.seccard .f > span { display: block; margin-bottom: 6px; }
.seccard .f input[type=password], .seccard .f input[type=text], .seccard .f textarea { width: 100%; background: var(--soft); border: 0; height: 44px; border-radius: 10px; padding: 0 14px; outline: none; color: inherit; }
.seccard .f input.err, .seccard .f textarea.err { outline: 2px solid #d64550; }
.seccard .f textarea { height: auto; padding: 12px 14px; resize: vertical; font: inherit; line-height: 1.5; }
.seccard .f > span em { font-style: normal; color: var(--muted); }
.seccard .f .checks { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.seccard .f .checks label { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.seccard .f .checks em { font-style: normal; color: var(--muted); }
.seccard .f .ferr { color: #a5222b; font-size: 12.5px; margin-top: 5px; display: block; }
:root[data-theme="dark"] .seccard .f .ferr { color: #ff9aa2; }
.seccard .f .hint { color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.seccard .btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.seccard .kv { display: grid; grid-template-columns: 150px 1fr; gap: 10px 14px; font-size: 14px; }
.seccard .kv dt { color: var(--muted); }
.seccard .kv dd { margin: 0; word-break: break-word; }
.seclist { padding-left: 18px; font-size: 14px; color: var(--ink2); display: grid; gap: 6px; }
@media (max-width: 900px) { .seccards { grid-template-columns: 1fr; } }

/* ---- Roles & Permissions (server-rendered) ---- */
a.rolebtn { text-decoration: none; color: inherit; box-sizing: border-box; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
a.rolebtn .cnt { font-size: 12px; font-weight: 400; color: var(--muted); background: var(--surface); border-radius: 10px; padding: 1px 8px; }
a.addrole { display: block; text-decoration: none; }
.rtools .lk { align-items: center; flex-wrap: wrap; }
.rtools .lk a { color: var(--link); text-decoration: none; }
.rtools .lk form { display: inline; margin: 0; }
.rtools .lk button.dangerlink { color: #a5222b; }
:root[data-theme="dark"] .rtools .lk button.dangerlink { color: #ff9aa2; }
.rnote { margin-top: 12px; padding: 10px 14px; border-radius: var(--r-md); background: var(--soft); color: var(--ink2); font-size: 14px; }
.rnote.info { color: var(--link); }
.psec { margin-bottom: 4px; }
.prow input[type=checkbox] { width: 16px; height: 16px; }
.prow.sec .arr { display: inline-block; width: 14px; }
:root[data-theme="dark"] .prow.sec { background: var(--soft); }
.rsave { display: flex; justify-content: flex-end; align-items: center; gap: 16px; margin-top: 16px; position: sticky; bottom: 0; padding: 12px 0; background: var(--bg, transparent); }
.rsave .hint { color: var(--muted); font-size: 13px; }
.foots { display: grid; gap: 6px; margin-top: 18px; font-size: 12.5px; color: var(--muted); }
