/* ===========================================================================
   Prism — design system.

   This file contains NO brand colour. Everything brand-dependent arrives from
   /api/theme.css as custom properties (--primary, --brand-*, --bg, --surface,
   --line, --text, --radius, --font-*), generated per tenant. That split is the
   whole white-label mechanism: this stylesheet caches forever, the twelve
   lines that differ per customer do not.

   Elevation is border-first — a lightness step plus a 1px hairline. Shadows are
   reserved for things that genuinely float: popovers, modals, the command
   palette. It is the single choice that most separates a product that looks
   considered from one that looks like a template.
   =========================================================================== */

/* --- static tokens: the parts a tenant does not get to change -------------- */
:root {
  /* Semantic colour. Held out of the tenant theme deliberately — "danger" must
     mean danger in every workspace, even one whose brand colour is red. */
  --success-50:#EDF8F0;  --success-100:#DEF3E3; --success-400:#66C081;
  --success-600:#00863E;  --success-700:#006F2F; --success-950:#003011;
  --warning-50:#FEF6EC;  --warning-100:#FCECD7; --warning-400:#E3A340;
  --warning-600:#B36A00;  --warning-800:#7C4600; --warning-950:#432400;
  --danger-50:#FFF1EF;   --danger-100:#FFE4E0;  --danger-400:#FF817A;
  --danger-600:#D13537;   --danger-700:#B1252A;  --danger-950:#510E10;

  /* Progress and achievement only — never a primary action. Keeping one colour
     exclusively for "you are getting somewhere" is what stops a learning
     product reading as a dashboard. */
  --signal-100:#E6F3D8; --signal-300:#B0D580; --signal-400:#8FBE48;
  --signal-600:#508300; --signal-700:#3F6B00;

  /* Categorical series for charts. Ordered so neighbours stay distinguishable
     in the common 2- and 3-series cases, and distinct under deuteranopia. */
  --series-1:#3A71DB; --series-2:#00A2B2; --series-3:#815EDF; --series-4:#B36A00;
  --series-5:#008392; --series-6:#6B4BBD; --series-7:#508300; --series-8:#D13537;

  --space-1:2px;  --space-2:4px;  --space-3:6px;  --space-4:8px;
  --space-5:12px; --space-6:16px; --space-7:20px; --space-8:24px;
  --space-9:32px; --space-10:40px; --space-11:48px; --space-12:64px;
  --space-13:80px; --space-14:96px;

  --sidebar-w:248px;
  --topbar-h:60px;
  --maxw:1280px;
  --maxw-prose:68ch;

  --shadow-1:0 1px 2px -1px rgb(16 17 18 / .07), 0 1px 1px rgb(16 17 18 / .04);
  --shadow-2:0 4px 10px -3px rgb(16 17 18 / .08), 0 2px 4px -2px rgb(16 17 18 / .06);
  --shadow-3:0 12px 28px -8px rgb(16 17 18 / .14), 0 3px 8px -3px rgb(16 17 18 / .08);
  --shadow-4:0 24px 56px -16px rgb(16 17 18 / .2), 0 6px 16px -6px rgb(16 17 18 / .09);

  --dur-1:80ms; --dur-2:140ms; --dur-3:200ms; --dur-4:320ms;
  --ease-out:cubic-bezier(.22,1,.36,1);
  --ease-in-out:cubic-bezier(.65,0,.35,1);
  --ease-spring:cubic-bezier(.34,1.56,.64,1);

  /* Tabular figures. Applied to every metric, table cell and axis label so
     numbers stay in their columns as they change. */
  --nums:'tnum' 1,'zero' 1;
}

:root[data-theme="dark"], :root.dark {
  --shadow-1:0 1px 2px -1px rgb(0 0 0 / .5);
  --shadow-2:0 4px 12px -4px rgb(0 0 0 / .5), 0 2px 6px -2px rgb(0 0 0 / .4);
  --shadow-3:0 12px 32px -10px rgb(0 0 0 / .65), 0 3px 10px -4px rgb(0 0 0 / .45);
  --shadow-4:0 28px 64px -20px rgb(0 0 0 / .75), 0 8px 20px -8px rgb(0 0 0 / .5);
  --success-50:#0C1F14; --warning-50:#231602; --danger-50:#2A0F0E;
  --signal-100:#1A2A0B;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --shadow-1:0 1px 2px -1px rgb(0 0 0 / .5);
    --shadow-2:0 4px 12px -4px rgb(0 0 0 / .5), 0 2px 6px -2px rgb(0 0 0 / .4);
    --shadow-3:0 12px 32px -10px rgb(0 0 0 / .65), 0 3px 10px -4px rgb(0 0 0 / .45);
    --shadow-4:0 28px 64px -20px rgb(0 0 0 / .75), 0 8px 20px -8px rgb(0 0 0 / .5);
    --success-50:#0C1F14; --warning-50:#231602; --danger-50:#2A0F0E;
    --signal-100:#1A2A0B;
  }
}

/* --- reset ---------------------------------------------------------------- */
*,*::before,*::after { box-sizing:border-box; }
* { margin:0; }
html { -webkit-text-size-adjust:100%; }
body {
  font-family:var(--font-body, system-ui, sans-serif);
  font-size:15px; line-height:1.6; letter-spacing:-.005em;
  color:var(--text); background:var(--bg);
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
  font-feature-settings:'cv05' 1,'calt' 1,'kern' 1;
  min-height:100dvh;
}
img,svg,video,canvas { display:block; max-width:100%; }

/* Inline icons carry .ico and are sized here. Without an intrinsic size an
   inline <svg> stretches to its flex container, which is how a 17px glyph
   becomes a 600px one. Charts set their own dimensions and never use .ico. */
.ico { width:17px; height:17px; flex:none; }
.ico-sm { width:14px; height:14px; }
.ico-lg { width:22px; height:22px; }
.empty .ico { width:34px; height:34px; }
.avatar .ico { width:15px; height:15px; }
button,input,select,textarea { font:inherit; color:inherit; }
a { color:inherit; text-decoration:none; }
[hidden] { display:none !important; }

/* Focus is visible and never removed. A keyboard user is an accessibility
   requirement in every enterprise procurement checklist this product will meet. */
:focus-visible {
  outline:2px solid var(--ring, var(--primary));
  outline-offset:2px; border-radius:var(--radius-sm);
}
:focus:not(:focus-visible) { outline:none; }

@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after {
    animation-duration:.01ms !important; animation-iteration-count:1 !important;
    transition-duration:.01ms !important; scroll-behavior:auto !important;
  }
}

::selection { background:var(--primary-wash-strong); color:var(--text); }

/* --- type ----------------------------------------------------------------- */
h1,h2,h3,h4 {
  font-family:var(--font-display, var(--font-body));
  font-weight:600; line-height:1.2; letter-spacing:-.022em; color:var(--text);
  text-wrap:balance;
}
h1 { font-size:clamp(26px,3.4vw,32px); }
h2 { font-size:22px; letter-spacing:-.018em; }
h3 { font-size:17px; letter-spacing:-.012em; }
h4 { font-size:15px; letter-spacing:-.008em; }
p { text-wrap:pretty; }
code,kbd,pre,.mono { font-family:var(--font-mono,'JetBrains Mono',ui-monospace,monospace); }
code {
  font-size:.88em; background:var(--surface-2); padding:2px 6px;
  border-radius:var(--radius-sm); border:1px solid var(--line);
}

.display { font-family:var(--font-display); font-size:clamp(34px,6vw,60px);
           font-weight:700; line-height:1.02; letter-spacing:-.034em; }
.lead    { font-size:17px; line-height:1.65; color:var(--text-secondary); }
.muted   { color:var(--text-muted); }
.faint   { color:var(--text-faint); }
.small   { font-size:13px; line-height:1.5; }
.label   { font-size:12px; font-weight:500; letter-spacing:.005em; color:var(--text-muted); }
.micro   { font-size:11px; font-weight:600; letter-spacing:.032em;
           text-transform:uppercase; color:var(--text-muted); }
.nums    { font-feature-settings:var(--nums); font-variant-numeric:tabular-nums; }
.metric  { font-family:var(--font-display); font-size:34px; font-weight:600;
           line-height:1; letter-spacing:-.026em;
           font-feature-settings:var(--nums); font-variant-numeric:tabular-nums; }
.truncate { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.clamp-2 { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.clamp-3 { display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }

/* --- layout --------------------------------------------------------------- */
.wrap { width:100%; max-width:var(--maxw); margin-inline:auto; padding-inline:24px; }
@media (max-width:640px){ .wrap { padding-inline:16px; } }
.prose { max-width:var(--maxw-prose); }
.prose h3 { margin:28px 0 10px; }
.prose p { margin:0 0 15px; color:var(--text-secondary); }
.prose ul,.prose ol { margin:0 0 15px; padding-left:22px; color:var(--text-secondary); }
.prose li { margin-bottom:7px; }
.prose strong { color:var(--text); font-weight:600; }

.row { display:flex; align-items:center; gap:var(--space-5); }
.row-tight { display:flex; align-items:center; gap:var(--space-4); }
.col { display:flex; flex-direction:column; gap:var(--space-5); }
.between { display:flex; align-items:center; justify-content:space-between; gap:var(--space-5); }
.wrap-row { flex-wrap:wrap; }
.grow { flex:1; min-width:0; }
.center { display:grid; place-items:center; }

.grid { display:grid; gap:var(--space-6); }
.grid-2 { grid-template-columns:repeat(2,minmax(0,1fr)); }
.grid-3 { grid-template-columns:repeat(3,minmax(0,1fr)); }
.grid-4 { grid-template-columns:repeat(4,minmax(0,1fr)); }
.grid-auto { grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); }
@media (max-width:1000px){ .grid-4{grid-template-columns:repeat(2,minmax(0,1fr));}
                           .grid-3{grid-template-columns:repeat(2,minmax(0,1fr));} }
@media (max-width:640px){ .grid-2,.grid-3,.grid-4{grid-template-columns:1fr;} }
/* Main column + 320px side panel (course, learning path, settings). Stacks on
   phones and narrow tablets, where the panel would otherwise be cut off. */
.grid-side { grid-template-columns:minmax(0,1fr) 320px; align-items:start; }
@media (max-width:900px){ .grid-side{grid-template-columns:minmax(0,1fr);} .grid-side > aside{position:static !important;} }

/* --- surfaces ------------------------------------------------------------- */
.card {
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--radius-lg); padding:var(--space-7);
}
.card-tight { padding:var(--space-6); }
.card-flush { padding:0; overflow:hidden; }
.card-link { transition:border-color var(--dur-2) var(--ease-out),
                        transform var(--dur-2) var(--ease-out); }
.card-link:hover { border-color:var(--line-strong); transform:translateY(-1px); }
.panel { background:var(--surface-2); border:1px solid var(--line);
         border-radius:var(--radius); padding:var(--space-6); }
.divider { height:1px; background:var(--line); border:0; margin:var(--space-7) 0; }

/* --- buttons -------------------------------------------------------------- */
.btn {
  --btn-bg:var(--surface); --btn-fg:var(--text); --btn-bd:var(--line-control);
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  height:38px; padding:0 15px; border-radius:var(--radius);
  background:var(--btn-bg); color:var(--btn-fg); border:1px solid var(--btn-bd);
  font-size:14px; font-weight:500; letter-spacing:-.006em;
  cursor:pointer; white-space:nowrap; user-select:none;
  transition:background var(--dur-2) var(--ease-out),
             border-color var(--dur-2) var(--ease-out),
             opacity var(--dur-2) var(--ease-out);
}
.btn:hover:not(:disabled) { background:var(--hover); }
.btn:active:not(:disabled) { transform:translateY(.5px); }
.btn:disabled { opacity:.5; cursor:not-allowed; }
.btn svg { width:16px; height:16px; flex:none; }

.btn-primary { --btn-bg:var(--primary); --btn-fg:var(--primary-fg); --btn-bd:var(--primary); }
.btn-primary:hover:not(:disabled) { --btn-bg:var(--primary-hover); --btn-bd:var(--primary-hover); }
.btn-ghost { --btn-bg:transparent; --btn-bd:transparent; }
.btn-ghost:hover:not(:disabled) { background:var(--hover); }
.btn-soft { --btn-bg:var(--primary-wash); --btn-fg:var(--primary);
            --btn-bd:transparent; font-weight:600; }
.btn-danger { --btn-bg:transparent; --btn-fg:var(--danger-600); --btn-bd:var(--line-control); }
.btn-danger:hover:not(:disabled) { background:var(--danger-50); --btn-bd:var(--danger-400); }
.btn-lg { height:46px; padding:0 22px; font-size:15px; border-radius:var(--radius-lg); }
.btn-sm { height:31px; padding:0 11px; font-size:13px; border-radius:var(--radius-sm); }
.btn-icon { width:38px; padding:0; }
.btn-icon.btn-sm { width:31px; }
.btn-block { width:100%; }

/* --- forms ---------------------------------------------------------------- */
.field { display:flex; flex-direction:column; gap:6px; }
.field > label { font-size:13px; font-weight:500; color:var(--text-secondary); }
.field .hint { font-size:12px; color:var(--text-muted); }
.field .err { font-size:12px; color:var(--danger-600); font-weight:500; }

.input,.select,.textarea {
  width:100%; min-height:38px; padding:8px 12px;
  background:var(--surface); color:var(--text);
  border:1px solid var(--line-control); border-radius:var(--radius);
  font-size:14px; transition:border-color var(--dur-2) var(--ease-out),
                             box-shadow var(--dur-2) var(--ease-out);
}
.input::placeholder,.textarea::placeholder { color:var(--text-faint); }
.input:focus,.select:focus,.textarea:focus {
  outline:none; border-color:var(--primary);
  box-shadow:0 0 0 3px var(--primary-wash);
}
.input[aria-invalid="true"] { border-color:var(--danger-600); }
.textarea { min-height:96px; resize:vertical; line-height:1.55; }
.select { appearance:none; padding-right:34px; cursor:pointer;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23909294' stroke-width='2' stroke-linecap='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat:no-repeat; background-position:right 10px center; background-size:16px; }
.input-lg { min-height:46px; font-size:15px; border-radius:var(--radius-lg); }

.check { display:flex; align-items:flex-start; gap:10px; cursor:pointer; font-size:14px; }
.check input { width:17px; height:17px; margin-top:2px; accent-color:var(--primary); flex:none; cursor:pointer; }

.switch { position:relative; display:inline-block; width:38px; height:22px; flex:none; }
.switch input { opacity:0; width:0; height:0; }
.switch span {
  position:absolute; inset:0; cursor:pointer; border-radius:999px;
  background:var(--line-strong); transition:background var(--dur-2) var(--ease-out);
}
.switch span::after {
  content:''; position:absolute; left:3px; top:3px; width:16px; height:16px;
  border-radius:50%; background:#fff; box-shadow:var(--shadow-1);
  transition:transform var(--dur-2) var(--ease-out);
}
.switch input:checked + span { background:var(--primary); }
.switch input:checked + span::after { transform:translateX(16px); }
.switch input:focus-visible + span { outline:2px solid var(--ring); outline-offset:2px; }

/* Segmented control — for 2–4 mutually exclusive view options. */
.segment { display:inline-flex; padding:3px; gap:2px;
           background:var(--surface-2); border:1px solid var(--line);
           border-radius:var(--radius); }
.segment button {
  height:28px; padding:0 12px; border:0; background:transparent; cursor:pointer;
  border-radius:calc(var(--radius) - 4px); font-size:13px; font-weight:500;
  color:var(--text-muted); transition:all var(--dur-2) var(--ease-out);
}
.segment button[aria-pressed="true"] { background:var(--surface); color:var(--text);
                                       box-shadow:var(--shadow-1); }

/* --- chips, badges, pills -------------------------------------------------- */
.chip {
  display:inline-flex; align-items:center; gap:6px; height:24px; padding:0 9px;
  border-radius:var(--radius-sm); font-size:12px; font-weight:500;
  background:var(--surface-2); color:var(--text-secondary);
  border:1px solid var(--line); white-space:nowrap;
}
.chip-brand   { background:var(--primary-wash); color:var(--primary); border-color:transparent; }
.chip-success { background:var(--success-50); color:var(--success-700); border-color:transparent; }
.chip-warning { background:var(--warning-50); color:var(--warning-800); border-color:transparent; }
.chip-danger  { background:var(--danger-50);  color:var(--danger-700);  border-color:transparent; }
.chip-signal  { background:var(--signal-100); color:var(--signal-700);  border-color:transparent; }
.dot { width:6px; height:6px; border-radius:50%; background:currentColor; flex:none; }

.avatar {
  width:32px; height:32px; border-radius:50%; flex:none;
  display:grid; place-items:center; overflow:hidden;
  background:var(--primary-wash); color:var(--primary);
  font-size:12px; font-weight:600; letter-spacing:-.01em;
  border:1px solid var(--line);
}
.avatar img { width:100%; height:100%; object-fit:cover; }
.avatar-lg { width:44px; height:44px; font-size:15px; }
.avatar-sm { width:24px; height:24px; font-size:10px; }

/* --- progress -------------------------------------------------------------- */
.bar { height:6px; border-radius:999px; background:var(--line); overflow:hidden; }
.bar > i { display:block; height:100%; border-radius:999px;
           background:var(--primary); transition:width var(--dur-4) var(--ease-out); }
.bar-signal > i { background:var(--signal-600); }
.bar-lg { height:9px; }

/* Segmented dots for <=10 steps. A bar says "38%"; dots say which lesson you
   are on and which ones are left, which is the question a learner has. */
.steps { display:flex; gap:4px; }
.steps i { height:5px; flex:1; border-radius:999px; background:var(--line); }
.steps i.done { background:var(--signal-600); }
.steps i.now  { background:var(--primary); }

.ring { --pct:0; width:42px; height:42px; flex:none; display:grid; place-items:center;
        border-radius:50%; position:relative; }
.ring::before {
  content:''; position:absolute; inset:0; border-radius:50%;
  background:conic-gradient(var(--primary) calc(var(--pct)*1%), var(--line) 0);
  -webkit-mask:radial-gradient(farthest-side,transparent calc(100% - 4px),#000 calc(100% - 4px));
          mask:radial-gradient(farthest-side,transparent calc(100% - 4px),#000 calc(100% - 4px));
}
.ring b { font-size:11px; font-weight:600; font-variant-numeric:tabular-nums; }

/* --- tables ---------------------------------------------------------------- */
.table-wrap { overflow-x:auto; border:1px solid var(--line);
              border-radius:var(--radius-lg); background:var(--surface); }
table.data { width:100%; border-collapse:collapse; font-size:14px; }
table.data th {
  text-align:left; padding:11px 14px; font-size:12px; font-weight:600;
  letter-spacing:.01em; color:var(--text-muted); background:var(--surface-2);
  border-bottom:1px solid var(--line); white-space:nowrap; position:sticky; top:0; z-index:1;
}
table.data td { padding:12px 14px; border-bottom:1px solid var(--line);
                vertical-align:middle; }
table.data tbody tr:last-child td { border-bottom:0; }
/* No zebra striping: it collides with hover, selected and disabled greys, and
   a row can only carry one background. */
table.data tbody tr { transition:background var(--dur-1) var(--ease-out); }
table.data tbody tr:hover { background:var(--hover); }
table.data tbody tr[aria-selected="true"] { background:var(--primary-wash); }
table.data td.num,table.data th.num { text-align:right;
  font-variant-numeric:tabular-nums; font-feature-settings:var(--nums); }
table.data td.sticky,table.data th.sticky { position:sticky; left:0;
  background:var(--surface); z-index:2; }
table.data th.sticky { background:var(--surface-2); z-index:3; }

/* --- empty states ---------------------------------------------------------- */
.empty { display:grid; place-items:center; text-align:center;
         padding:var(--space-12) var(--space-7); gap:var(--space-5); }
.empty svg { width:36px; height:36px; color:var(--text-faint); }
.empty h3 { font-size:16px; }
.empty p { max-width:44ch; color:var(--text-muted); font-size:14px; }

/* --- overlays -------------------------------------------------------------- */
.scrim {
  position:fixed; inset:0; z-index:90; display:grid; place-items:center;
  padding:24px; background:rgb(10 11 13 / .5);
  backdrop-filter:blur(3px); -webkit-backdrop-filter:blur(3px);
  animation:fade var(--dur-2) var(--ease-out);
}
.modal {
  width:100%; max-width:520px; max-height:88dvh; overflow:auto;
  background:var(--surface-overlay,var(--surface)); border:1px solid var(--line);
  border-radius:var(--radius-xl); box-shadow:var(--shadow-4);
  animation:pop var(--dur-3) var(--ease-out);
}
.modal-wide { max-width:820px; }
.modal-head { padding:20px 24px 0; }
.modal-body { padding:16px 24px; }
.modal-foot { padding:16px 24px 20px; display:flex; gap:10px; justify-content:flex-end;
              position:sticky; bottom:0; background:inherit; }
@keyframes fade { from{opacity:0} }
@keyframes pop  { from{opacity:0; transform:translateY(8px) scale(.985)} }

/* Bottom-anchored bar that appears on first selection. Anchoring it to the
   viewport rather than the table means it stays reachable in a 900-row list. */
.bulkbar {
  position:fixed; left:50%; bottom:22px; transform:translateX(-50%);
  z-index:60; display:flex; align-items:center; gap:14px;
  padding:10px 12px 10px 18px; border-radius:var(--radius-pill);
  background:var(--surface-overlay,var(--surface));
  border:1px solid var(--line-strong); box-shadow:var(--shadow-4);
  animation:rise var(--dur-3) var(--ease-spring);
}
@keyframes rise { from{opacity:0; transform:translate(-50%,14px)} }

.toasts { position:fixed; right:20px; bottom:20px; z-index:100;
          display:flex; flex-direction:column; gap:8px; pointer-events:none; }
.toast {
  pointer-events:auto; display:flex; align-items:flex-start; gap:10px;
  min-width:280px; max-width:400px; padding:12px 14px;
  background:var(--surface-overlay,var(--surface)); border:1px solid var(--line-strong);
  border-radius:var(--radius); box-shadow:var(--shadow-3); font-size:14px;
  animation:rise-r var(--dur-3) var(--ease-out);
}
.toast svg { width:17px; height:17px; flex:none; margin-top:1px; }
.toast.ok   svg { color:var(--success-600); }
.toast.warn svg { color:var(--warning-600); }
.toast.err  svg { color:var(--danger-600); }
@keyframes rise-r { from{opacity:0; transform:translateX(12px)} }

/* --- app shell ------------------------------------------------------------- */
.shell { display:grid; grid-template-columns:var(--sidebar-w) 1fr;
         min-height:100dvh; }
.sidebar {
  background:var(--surface-2); border-right:1px solid var(--line);
  display:flex; flex-direction:column; gap:var(--space-5);
  padding:var(--space-6) var(--space-5); position:sticky; top:0; height:100dvh;
  overflow-y:auto;
}
.sidebar nav { display:flex; flex-direction:column; gap:1px; }
.navlink {
  display:flex; align-items:center; gap:10px; height:34px; padding:0 10px;
  border-radius:var(--radius-sm); font-size:14px; font-weight:500;
  color:var(--text-secondary);
  transition:background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.navlink svg { width:17px; height:17px; flex:none; opacity:.8; }
.navlink:hover { background:var(--hover); color:var(--text); }
.navlink[aria-current="page"] { background:var(--primary-wash); color:var(--primary); font-weight:600; }
.navlink[aria-current="page"] svg { opacity:1; }
.navgroup { margin-top:var(--space-6); padding:0 10px 6px; }

.topbar {
  height:var(--topbar-h); display:flex; align-items:center; gap:var(--space-6);
  padding:0 var(--space-8); border-bottom:1px solid var(--line);
  background:var(--surface); position:sticky; top:0; z-index:40;
}
.main { min-width:0; display:flex; flex-direction:column; }
.page { padding:var(--space-9) var(--space-8) var(--space-12); flex:1; }
@media (max-width:900px) {
  .shell { grid-template-columns:1fr; }
  .sidebar { position:fixed; left:0; top:0; z-index:80; width:var(--sidebar-w);
             transform:translateX(-100%); transition:transform var(--dur-3) var(--ease-out);
             box-shadow:var(--shadow-4); }
  .sidebar.open { transform:none; }
  .page { padding:var(--space-7) var(--space-6) var(--space-11); }
  .topbar { padding:0 var(--space-6); }
}

.brandmark { display:flex; align-items:center; gap:9px; font-family:var(--font-display);
             font-weight:600; font-size:15px; letter-spacing:-.018em; color:var(--text); }
.brandmark img { height:26px; width:auto; max-width:150px; object-fit:contain; }
.brandmark img.plogo { height:34px; width:auto; }
/* Theme-matched images (the Upnava lockup has a dark-mode version). */
.when-dark { display:none !important; }
:root[data-theme="dark"] .when-light, :root.dark .when-light { display:none !important; }
:root[data-theme="dark"] .when-dark, :root.dark .when-dark { display:inline-block !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .when-light { display:none !important; }
  :root:not([data-theme="light"]) .when-dark { display:inline-block !important; }
}
.brandmark .glyph {
  width:26px; height:26px; border-radius:7px; flex:none; display:grid; place-items:center;
  background:var(--primary); color:var(--primary-fg); font-size:13px; font-weight:700;
}

/* --- skeletons ------------------------------------------------------------- */
.sk { background:linear-gradient(90deg,var(--surface-2) 25%,var(--line) 37%,var(--surface-2) 63%);
      background-size:400% 100%; animation:sheen 1.4s ease infinite;
      border-radius:var(--radius-sm); }
@keyframes sheen { from{background-position:100% 50%} to{background-position:0 50%} }

/* --- utilities ------------------------------------------------------------- */
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px;
           overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.stack-1{gap:var(--space-2)!important} .stack-2{gap:var(--space-4)!important}
.stack-3{gap:var(--space-5)!important} .stack-4{gap:var(--space-6)!important}
.stack-5{gap:var(--space-7)!important} .stack-6{gap:var(--space-8)!important}
.mt-4{margin-top:var(--space-6)} .mt-6{margin-top:var(--space-8)}
.mt-8{margin-top:var(--space-9)} .mb-4{margin-bottom:var(--space-6)}
.mb-6{margin-bottom:var(--space-8)}
.text-right{text-align:right} .text-center{text-align:center}
.full{width:100%} .nowrap{white-space:nowrap} .relative{position:relative}
