/* No hanging words (Rana, 2026-10-06): headings and short copy balance their lines; running text avoids a lone last word */
h1,h2,h3,h4,h5,h6,caption,legend,figcaption,button,.btn{text-wrap:balance}p,li,dd,dt,blockquote,td,th,label,small,summary{text-wrap:pretty}
/* ════════════════════════════════════════════════════════════════════════
   EcomBack 2026 ("modern") — the redesign chosen as Direction C.

   Unlike Classic and Aurora this theme also changes markup (index.php and
   client.php check pms_modern()): an icon rail instead of the labelled
   sidebar, one header for the whole app (search, colour theme, announcements,
   notifications, account), and roomier page heads, cards and tables.

   Loaded after each page's own styles, only when it is the system theme.
   Parts: html[data-app=staff|portal|login|public]. Dark: the staff app and
   portal set data-theme="dark".

   Contrast (WCAG 2.2 AA), every text colour on every surface it sits on:
   light  t1 #171a21 16.9 on white / 15.0 on canvas; t2 #3d4554 9.9 / 8.8;
          t3 #59616f 6.2 / 5.5; accent #0049e8 6.7 / 6.0; white on #0049e8 6.7
   dark   t1 #eef1fb 15.3 on #161b2e; t2 #c3cae0 10.9; t3 #a3acc8 7.6;
          accent #8aa6ff 7.0; #0b1026 on #8aa6ff 7.4
   ════════════════════════════════════════════════════════════════════════ */

/* Instrument Sans, self-hosted (SIL OFL 1.1, see assets/fonts/OFL-InstrumentSans.txt). Variable: weights 400-700. */
@font-face{ font-family:'Instrument Sans'; font-style:normal; font-weight:400 700; font-stretch:75% 100%; font-display:swap;
  src:url(../fonts/instrument-sans-var.woff2) format('woff2'); }

/* ───────── 1. design values ───────── */
html[data-skin=modern]{
  --mo-canvas:
    radial-gradient(1000px 640px at 0% 0%, #f5f8ec 0%, rgba(245,248,236,0) 60%),
    radial-gradient(1100px 760px at 70% 0%, #d9eef8 0%, rgba(217,238,248,0) 65%),
    radial-gradient(900px 900px at 100% 100%, #f1ddf4 0%, rgba(241,221,244,0) 60%),
    #eef3f9;
  --mo-primary:#0049e8; --mo-primary-h:#003cc0; --mo-on-primary:#ffffff; --mo-primary-tint:#eef3ff;
  --mo-violet:#5840ef; --mo-violet-tint:#f3f1ff; --mo-violet-ink:#4630c9;
  --mo-hero:linear-gradient(150deg,#0a2c79 0%,#0049e8 55%,#5840ef 100%);
  --mo-hero-acad:linear-gradient(150deg,#241749 0%,#3a289f 55%,#5840ef 100%);
  --mo-surface:#ffffff; --mo-surface-2:#f5f7fb; --mo-surface-3:#eceff6;
  --mo-border:#e6eaf2; --mo-border-2:#d3dae6; --mo-border-ctl:#8a93a6;
  --mo-t1:#171a21; --mo-t2:#3d4554; --mo-t3:#59616f;
  --mo-glass:rgba(255,255,255,.80);
  --mo-shadow:0 1px 2px rgba(16,24,40,.04), 0 8px 24px -12px rgba(36,56,120,.18);
  --mo-shadow-up:0 2px 4px rgba(16,24,40,.05), 0 18px 40px -14px rgba(36,56,120,.26);
  --mo-r:18px; --mo-r-sm:12px;
  --mo-font:'Instrument Sans', Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}
html[data-skin=modern][data-theme=dark]{
  --mo-canvas:
    radial-gradient(1000px 640px at 0% 0%, #1a2140 0%, rgba(26,33,64,0) 60%),
    radial-gradient(1100px 760px at 70% 0%, #122a3d 0%, rgba(18,42,61,0) 65%),
    radial-gradient(900px 900px at 100% 100%, #29143a 0%, rgba(41,20,58,0) 60%),
    #0e1220;
  --mo-primary:#8aa6ff; --mo-primary-h:#a7bcff; --mo-on-primary:#0b1026; --mo-primary-tint:#1c2752;
  --mo-violet:#b0a4ff; --mo-violet-tint:#251f4d; --mo-violet-ink:#cfc7ff;
  --mo-surface:#161b2e; --mo-surface-2:#1c2238; --mo-surface-3:#242b45;
  --mo-border:#2a3150; --mo-border-2:#3a4368; --mo-border-ctl:#7480a3;
  --mo-t1:#eef1fb; --mo-t2:#c3cae0; --mo-t3:#a3acc8;
  --mo-glass:rgba(22,27,46,.84);
  --mo-shadow:0 1px 2px rgba(0,0,0,.3), 0 12px 32px -10px rgba(0,0,0,.5);
  --mo-shadow-up:0 2px 4px rgba(0,0,0,.35), 0 18px 44px -12px rgba(0,0,0,.6);
}
@media (prefers-color-scheme: dark){
  html[data-skin=modern]:is([data-app=login],[data-app=public]):not([data-theme=light]){
    --mo-canvas:
      radial-gradient(1000px 640px at 0% 0%, #1a2140 0%, rgba(26,33,64,0) 60%),
      radial-gradient(1100px 760px at 70% 0%, #122a3d 0%, rgba(18,42,61,0) 65%),
      radial-gradient(900px 900px at 100% 100%, #29143a 0%, rgba(41,20,58,0) 60%),
      #0e1220;
    --mo-primary:#8aa6ff; --mo-primary-h:#a7bcff; --mo-on-primary:#0b1026; --mo-primary-tint:#1c2752;
    --mo-violet:#b0a4ff; --mo-violet-tint:#251f4d; --mo-violet-ink:#cfc7ff;
    --mo-surface:#161b2e; --mo-surface-2:#1c2238; --mo-surface-3:#242b45;
    --mo-border:#2a3150; --mo-border-2:#3a4368; --mo-border-ctl:#7480a3;
    --mo-t1:#eef1fb; --mo-t2:#c3cae0; --mo-t3:#a3acc8;
    --mo-glass:rgba(22,27,46,.84);
    --mo-shadow:0 1px 2px rgba(0,0,0,.3), 0 12px 32px -10px rgba(0,0,0,.5);
  }
}

/* the canvas and the type, everywhere */
html[data-skin=modern],
html[data-skin=modern] body{
  background:var(--mo-canvas); background-attachment:fixed;
  font-family:var(--mo-font); letter-spacing:0;
}
html[data-skin=modern] :is(button,input,select,textarea){ font-family:inherit; }

/* ───────── 2. staff and admin (index.php) ───────── */
html[data-skin=modern][data-app=staff]{
  /* the page's own variables, re-pointed: every page that uses them follows */
  --bg:transparent; --sf:var(--mo-surface); --sf2:var(--mo-surface-2); --br:var(--mo-border); --br2:var(--mo-border-2);
  --t1:var(--mo-t1); --t2:var(--mo-t2); --t3:var(--mo-t3);
  --accent:var(--mo-primary); --brand:var(--mo-primary); --nav:var(--mo-primary); --nav2:var(--mo-primary);
  --r:var(--mo-r);
}

/* 2a. the icon rail */
html[data-skin=modern][data-app=staff] .sb{
  width:76px; background:var(--mo-glass); border-right:1px solid var(--mo-border);
  -webkit-backdrop-filter:saturate(1.4) blur(14px); backdrop-filter:saturate(1.4) blur(14px);
  box-shadow:none; align-items:center;
}
html[data-skin=modern][data-app=staff] .sb-logo{ padding:14px 0 10px; border-bottom:0; justify-content:center; }
html[data-skin=modern][data-app=staff] .sb-logo .sb-mark{ width:42px!important; height:42px!important; border-radius:12px; box-shadow:var(--mo-shadow); }
html[data-skin=modern][data-app=staff] .sb-logo > :not(.sb-mark){ display:none; }
html[data-skin=modern][data-app=staff] .sb>nav{ width:100%; padding:6px 0 10px; scrollbar-color:var(--mo-border-2) transparent; }
html[data-skin=modern][data-app=staff] .sb>nav::-webkit-scrollbar-thumb{ background:var(--mo-border-2); }
/* section names become quiet dividers on the rail */
html[data-skin=modern][data-app=staff] .ns{ font-size:0; height:1px; padding:0; margin:10px 18px; background:var(--mo-border); }
html[data-skin=modern][data-app=staff] .nl{
  width:46px; height:46px; margin:4px auto; padding:0; justify-content:center; gap:0;
  border-radius:13px; color:var(--mo-t2); font-weight:600; position:relative;
}
html[data-skin=modern][data-app=staff] .nl:hover{ background:var(--mo-surface-3); color:var(--mo-t1); }
html[data-skin=modern][data-app=staff] .nl.active{ background:var(--mo-primary); color:var(--mo-on-primary); box-shadow:0 8px 18px -8px rgba(0,73,232,.75); }
html[data-skin=modern][data-app=staff] .nl:focus-visible{ outline:3px solid var(--mo-primary); outline-offset:2px; }
html[data-skin=modern][data-app=staff] .nl .ni{ width:auto; }
html[data-skin=modern][data-app=staff] .nl .ni svg{ width:21px; height:21px; }
/* the label stays the link's name; it is shown beside the rail as a tooltip */
html[data-skin=modern][data-app=staff] .nl-t{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
html[data-skin=modern][data-app=staff] .nl .bdg,
html[data-skin=modern][data-app=staff] .nl [class*=badge]{ position:absolute; top:-3px; right:-5px; font-size:9.5px; padding:1px 5px; }
html[data-skin=modern][data-app=staff] .sb-foot{ width:100%; padding:8px 0 14px; border-top:1px solid var(--mo-border); }
.mo-tip{
  position:fixed; z-index:600; pointer-events:none; padding:6px 10px; border-radius:9px;
  background:#171a21; color:#fff; font:600 13px/1.2 var(--mo-font, system-ui); white-space:nowrap;
  box-shadow:0 8px 22px -8px rgba(0,0,0,.45); transform:translateY(-50%);
}
html[data-theme=dark] .mo-tip{ background:#eef1fb; color:#0b1026; }

/* 2b. the one header */
html[data-skin=modern][data-app=staff] .mh{
  position:sticky; top:0; z-index:150; display:flex; align-items:center; gap:16px;
  padding:12px 28px; background:var(--mo-glass); border-bottom:1px solid var(--mo-border);
  -webkit-backdrop-filter:saturate(1.4) blur(14px); backdrop-filter:saturate(1.4) blur(14px);
}
.mh-logo, .pmsb.mh-logo{ display:none; align-items:center; gap:10px; text-decoration:none; color:var(--mo-t1); font-weight:700; font-size:17px; }
.mh-logo img{ border-radius:10px; }
.mh-search{ position:relative; flex:1 1 auto; max-width:560px; margin:0 auto; }
.mh-search input{
  width:100%; height:44px; padding:0 14px 0 42px; border-radius:13px; font-size:14.5px;
  border:1px solid var(--mo-border-2); background:var(--mo-surface); color:var(--mo-t1);
}
.mh-search input::placeholder{ color:var(--mo-t3); opacity:1; }
.mh-search input:focus{ outline:none; border-color:var(--mo-primary); box-shadow:0 0 0 3px rgba(0,73,232,.20); }
.mh-sic{ position:absolute; left:14px; top:50%; transform:translateY(-50%); color:var(--mo-t3); pointer-events:none; }
html[data-skin=modern][data-app=staff] .mh .dtop-r{ display:flex; align-items:center; gap:10px; margin-left:0; }
/* the page heads keep their title and actions; the header's widgets live in .mh only */
html[data-skin=modern][data-app=staff] .main .topbar .dtop-r{ display:none!important; }
html[data-skin=modern] .tsw3{ display:inline-flex; padding:3px; gap:2px; border-radius:12px; background:var(--mo-surface-3); border:1px solid var(--mo-border); }
html[data-skin=modern] .tsw3 .tibtn{ width:34px; height:34px; border-radius:9px; border:0; background:transparent; color:var(--mo-t2); }
html[data-skin=modern] .tsw3 .tibtn[aria-pressed=true]{ background:var(--mo-surface); color:var(--mo-primary); box-shadow:var(--mo-shadow); }
html[data-skin=modern] .ti-dd > .tibtn{ width:42px; height:42px; border-radius:13px; border:1px solid var(--mo-border); background:var(--mo-surface); color:var(--mo-t2); }
html[data-skin=modern] .ti-dd > .tibtn:hover{ color:var(--mo-t1); border-color:var(--mo-border-2); }
html[data-skin=modern] .ti-panel{ border-radius:16px; border-color:var(--mo-border); box-shadow:var(--mo-shadow-up); }
html[data-skin=modern] .uchip{ display:inline-flex; align-items:center; gap:10px; padding:4px 12px 4px 4px; border-radius:999px; border:1px solid var(--mo-border); background:var(--mo-surface); }
html[data-skin=modern] .uchip .uav{ width:36px; height:36px; border-radius:50%; background:var(--mo-hero); background-color:#0a2c79; color:#fff; display:inline-flex; align-items:center; justify-content:center; font-weight:700; position:relative; }
html[data-skin=modern] .uchip .umeta b{ display:block; font-size:13.5px; color:var(--mo-t1); }
html[data-skin=modern] .uchip .umeta i{ display:block; font-style:normal; font-size:11.5px; color:var(--mo-t3); letter-spacing:.02em; }

/* 2c. page heads and content */
html[data-skin=modern][data-app=staff] :is(.main > .topbar, .main > .ac-app > .topbar, .main > .ac-app .ac-top){
  background:transparent; border-bottom:0; padding:24px 28px 6px; align-items:flex-end; box-shadow:none;
}
html[data-skin=modern][data-app=staff] .topbar h1{ font-size:26px; font-weight:700; letter-spacing:-.4px; color:var(--mo-t1); }
html[data-skin=modern][data-app=staff] .topbar p{ font-size:14px; color:var(--mo-t3); margin-top:4px; }
html[data-skin=modern][data-app=staff] .pgi{ width:44px; height:44px; border-radius:13px; background:var(--mo-primary-tint); color:var(--mo-primary); }
html[data-skin=modern][data-app=staff] .content{ padding:18px 28px 44px; }
html[data-skin=modern][data-app=staff] .flash{ border-radius:12px; }

/* 2d. surfaces */
html[data-skin=modern][data-app=staff] :is(.card,.tw,.scard,.section){
  background:var(--mo-surface); border:1px solid var(--mo-border); border-radius:var(--mo-r); box-shadow:var(--mo-shadow);
}
html[data-skin=modern][data-app=staff] .card{ padding:18px 20px; }

/* 2e. tables */
html[data-skin=modern][data-app=staff] th{
  background:var(--mo-surface); color:var(--mo-t3); font-size:11.5px; font-weight:700; letter-spacing:.04em;
  padding:12px 18px; border-bottom:1px solid var(--mo-border);
}
html[data-skin=modern][data-app=staff] thead th{ background:var(--mo-surface); }
html[data-skin=modern][data-app=staff] td{ padding:13px 18px; font-size:14px; color:var(--mo-t2); border-bottom:1px solid var(--mo-border); }
html[data-skin=modern][data-app=staff] tr:hover td{ background:var(--mo-primary-tint); }
html[data-skin=modern][data-app=staff] td a:not(.btn){ color:var(--mo-primary); }

/* 2f. buttons */
html[data-skin=modern] .btn{ border-radius:11px; font-weight:600; padding:9px 16px; font-size:13.5px; }
html[data-skin=modern] .btn.bsm{ padding:6px 12px; font-size:12.5px; border-radius:9px; }
html[data-skin=modern] .bp{ background:var(--mo-primary); color:var(--mo-on-primary); box-shadow:0 6px 14px -8px rgba(0,73,232,.8); }
html[data-skin=modern] .bp:hover{ background:var(--mo-primary-h); color:var(--mo-on-primary); }
html[data-skin=modern] .bg{ background:var(--mo-surface); color:var(--mo-t1); border:1px solid var(--mo-border-2); }
html[data-skin=modern] .bg:hover{ background:var(--mo-surface-2); border-color:var(--mo-border-ctl); color:var(--mo-t1); }
html[data-skin=modern] .btn:focus-visible{ outline:3px solid var(--mo-primary); outline-offset:2px; }

/* 2g. form fields */
html[data-skin=modern] :is(.fi,.fs,.ft){
  background:var(--mo-surface); border:1px solid var(--mo-border-ctl); border-radius:11px; color:var(--mo-t1); font-size:14px; padding:10px 12px;
}
html[data-skin=modern] :is(.fi,.fs,.ft):focus{ border-color:var(--mo-primary); background:var(--mo-surface); box-shadow:0 0 0 3px rgba(0,73,232,.20); }
html[data-skin=modern] .fl{ font-size:12.5px; font-weight:600; color:var(--mo-t2); text-transform:none; letter-spacing:0; }

/* 2h. badges and pills: rounder, a touch larger */
html[data-skin=modern] .badge{ font-size:11.5px; font-weight:600; padding:3px 10px; }

/* 2i. global search results */
.srch-groups{ display:grid; grid-template-columns:repeat(auto-fit,minmax(min(360px,100%),1fr)); gap:16px; }
.srch-g{ padding:0!important; overflow:hidden; }
.srch-h{ margin:0; padding:14px 18px; font-size:15px; font-weight:700; border-bottom:1px solid var(--br); }
.srch-h span{ color:var(--t3); font-weight:600; }
.srch-l{ list-style:none; margin:0; padding:6px; }
.srch-l a{ display:flex; flex-direction:column; gap:2px; padding:10px 12px; border-radius:11px; text-decoration:none; color:var(--t1); }
.srch-l a:hover,.srch-l a:focus-visible{ background:var(--sf2); }
.srch-l a span{ font-size:13px; color:var(--t3); }

/* 2j. small screens: the rail becomes the existing slide-out menu, with labels */
@media (max-width:680px){
  html[data-skin=modern][data-app=staff] .sb{ width:min(84vw,300px); align-items:stretch; background:var(--mo-surface); }
  html[data-skin=modern][data-app=staff] .ns{ font-size:11px; height:auto; background:none; margin:12px 20px 4px; color:var(--mo-t3); }
  html[data-skin=modern][data-app=staff] .nl{ width:auto; height:auto; margin:2px 12px; padding:10px 12px; justify-content:flex-start; gap:12px; }
  html[data-skin=modern][data-app=staff] .nl-t{ position:static; width:auto; height:auto; overflow:visible; clip:auto; }
  html[data-skin=modern][data-app=staff] .sb-logo{ justify-content:flex-start; padding-left:20px; }
  html[data-skin=modern][data-app=staff] .mh{ padding:10px 14px; gap:10px; flex-wrap:wrap; }
  html[data-skin=modern][data-app=staff] .mh-logo{ display:inline-flex; }
  html[data-skin=modern][data-app=staff] .mh-search{ order:5; flex-basis:100%; max-width:none; }
  html[data-skin=modern][data-app=staff] .mh .uchip .umeta{ display:none; }
  html[data-skin=modern][data-app=staff] .main > .topbar{ padding:16px 14px 4px; position:static; }
  html[data-skin=modern][data-app=staff] .content{ padding:14px 14px 32px; }
  .mo-tip{ display:none; }
}
@media (max-width:980px){
  html[data-skin=modern][data-app=staff] .mh .uchip .umeta{ display:none; }
}

/* ───────── 3. print: nothing of the shell ───────── */
@media print{
  html[data-skin=modern] .mh{ display:none!important; }
  html[data-skin=modern] body{ background:#fff!important; }
}

/* ───────── 4. dashboard (dash_modern.php) ───────── */
html[data-skin=modern] .tile{ background:var(--mo-surface); border:1px solid var(--mo-border); border-radius:var(--mo-r); box-shadow:var(--mo-shadow); }
.md{ display:flex; flex-direction:column; gap:18px; }
.md h2{ margin:0; font-size:16px; font-weight:700; color:var(--mo-t1); }
.md h2 span, .md h3 span, .md h4 span{ color:var(--mo-t3); font-weight:600; }
.md-head{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.md-head h2{ flex:1; }
.md-pad{ padding:16px 20px; }
.md-meta{ font-size:13px; color:var(--mo-t3); }
.md-link{ font-size:13.5px; font-weight:600; color:var(--mo-primary); text-decoration:none; }
.md-link:hover{ text-decoration:underline; }
.md-empty{ margin:6px 0 0; font-size:13.5px; color:var(--mo-t3); }
.md-sub{ margin:16px 0 8px; font-size:13.5px; font-weight:700; color:var(--mo-t2); }

.md-alert{ display:flex; align-items:center; gap:14px; flex-wrap:wrap; padding:14px 16px; border-radius:14px; background:#fffbeb; border:1px solid #f0c36d; }
html[data-theme=dark] .md-alert{ background:#2b2210; border-color:#7a5a14; }
.md-alert-ic{ width:38px; height:38px; border-radius:11px; display:flex; align-items:center; justify-content:center; background:#fef3c7; color:#92400e; }
.md-alert-tx{ flex:1; min-width:220px; display:flex; flex-direction:column; }
.md-alert-tx b{ color:#92400e; } .md-alert-tx span{ font-size:13px; color:#78350f; }
html[data-theme=dark] .md-alert-tx b, html[data-theme=dark] .md-alert-tx span{ color:#fcd34d; }

.md-greet{ display:flex; align-items:flex-end; gap:16px; flex-wrap:wrap; }
.md-greet > div:first-child{ flex:1; min-width:260px; }
.md-greet h1{ margin:0; font-size:26px; font-weight:700; letter-spacing:-.4px; color:var(--mo-t1); }
.md-greet p{ margin:4px 0 0; font-size:14px; color:var(--mo-t3); }
.md-greet-act{ display:flex; gap:8px; flex-wrap:wrap; }

.md-live{ display:flex; align-items:center; gap:14px; padding:10px 14px; }
.md-live-h{ display:flex; align-items:center; gap:8px; font-size:13px!important; padding:6px 10px; border-radius:999px; background:#e7f8ef; color:#0b6e41!important; white-space:nowrap; }
html[data-theme=dark] .md-live-h{ background:#0f2e22; color:#6ee7b7!important; }
.md-pulse{ width:8px; height:8px; border-radius:50%; background:#0e8a50; box-shadow:0 0 0 0 rgba(14,138,80,.6); animation:mdp 1.8s infinite; }
@keyframes mdp{ 0%{box-shadow:0 0 0 0 rgba(14,138,80,.55)} 70%{box-shadow:0 0 0 8px rgba(14,138,80,0)} 100%{box-shadow:0 0 0 0 rgba(14,138,80,0)} }
@media (prefers-reduced-motion: reduce){ .md-pulse{ animation:none; } }
.md-live-l{ flex:1; min-width:0; display:flex; gap:10px; overflow-x:auto; list-style:none; margin:0; padding:2px; scrollbar-width:thin; }
.md-live-l a{ display:flex; flex-direction:column; min-width:220px; max-width:280px; padding:6px 12px; border-radius:12px; border:1px solid var(--mo-border); text-decoration:none; color:var(--mo-t1); background:var(--mo-surface-2); }
.md-live-l a:hover{ border-color:var(--mo-border-2); }
.md-live-l b{ font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.md-live-l span{ font-size:12.5px; color:var(--mo-t2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.md-live-l time{ font-size:11.5px; color:var(--mo-t3); }
.md-live-empty{ flex:1; margin:0; color:var(--mo-t3); font-size:13.5px; }
.md-live-all{ font-size:13px; font-weight:600; color:var(--mo-primary); white-space:nowrap; }

.md-kpis{ display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:14px; }
.md-kpi{ display:flex; flex-direction:column; gap:4px; padding:16px; text-decoration:none; color:var(--mo-t1); transition:transform .15s, box-shadow .15s; }
.md-kpi:hover{ transform:translateY(-2px); box-shadow:var(--mo-shadow-up); }
.md-kpi:focus-visible{ outline:3px solid var(--mo-primary); outline-offset:2px; }
.md-kpi-ic{ width:40px; height:40px; border-radius:12px; display:flex; align-items:center; justify-content:center; margin-bottom:8px; }
.md-kpi-l{ font-size:13px; font-weight:600; color:var(--mo-t2); }
.md-kpi-v{ font-size:28px; font-weight:700; letter-spacing:-.5px; }
.md-blue .md-kpi-ic{ background:#eef3ff; color:#0049e8; } .md-violet .md-kpi-ic{ background:#f3f1ff; color:#5840ef; }
.md-indigo .md-kpi-ic{ background:#eef2ff; color:#4338ca; } .md-red .md-kpi-ic{ background:#fef2f2; color:#c81e1e; }
.md-green .md-kpi-ic{ background:#ecfdf3; color:#0b6e41; } .md-teal .md-kpi-ic{ background:#ecfeff; color:#0e7490; }
html[data-theme=dark] .md-kpi-ic{ background:var(--mo-surface-3)!important; color:var(--mo-primary)!important; }
html[data-theme=dark] .md-red .md-kpi-ic{ color:#fca5a5!important; }

.md-row{ display:grid; gap:18px; align-items:start; }
.md-row-main, .md-row-bottom{ grid-template-columns:minmax(0,1fr) minmax(300px,360px); }
.md-col{ display:flex; flex-direction:column; gap:18px; min-width:0; }

.md-rev{ padding:18px 20px; }
.md-seg{ display:inline-flex; padding:3px; border-radius:12px; background:var(--mo-surface-3); gap:2px; }
.md-seg a{ padding:7px 12px; border-radius:9px; font-size:13px; font-weight:600; color:var(--mo-t2); text-decoration:none; }
.md-seg a.on{ background:var(--mo-surface); color:var(--mo-primary); box-shadow:var(--mo-shadow); }
.md-rev-3{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-top:14px; }
.md-rv{ display:flex; flex-direction:column; gap:2px; padding:14px 16px; border-radius:14px; border:1px solid var(--mo-border); background:var(--mo-surface-2); text-decoration:none; color:var(--mo-t1); }
.md-rv span{ font-size:13px; color:var(--mo-t2); } .md-rv b{ font-size:26px; letter-spacing:-.4px; } .md-rv i{ font-style:normal; font-size:12.5px; font-weight:600; color:var(--mo-primary); }
/* three colours: booked indigo, received green, pending amber (text on each checked at 4.5:1 or better) */
.md-rv{ position:relative; overflow:hidden; }
.md-rv::after{ content:""; position:absolute; right:-28px; top:-28px; width:110px; height:110px; border-radius:50%; background:rgba(255,255,255,.14); pointer-events:none; }
.md-rv-b{ background:linear-gradient(135deg,#4338ca 0%,#6d5ce8 100%); background-color:#4338ca; border:0; }
.md-rv-r{ background:linear-gradient(135deg,#047857 0%,#0e9f6e 100%); background-color:#047857; border:0; }
.md-rv-p{ background:linear-gradient(135deg,#b45309 0%,#c2410c 100%); background-color:#b45309; border:0; }
.md-rv-b b,.md-rv-r b,.md-rv-p b{ color:#fff; }
.md-rv-b span,.md-rv-b i{ color:#e6e3ff; } .md-rv-r span,.md-rv-r i{ color:#e3fbef; } .md-rv-p span,.md-rv-p i{ color:#fff3e6; }
.md-rv-b i,.md-rv-r i,.md-rv-p i{ text-decoration:underline; text-underline-offset:3px; }
.md-rv:hover{ filter:brightness(1.06); } .md-rv:focus-visible{ outline:3px solid var(--mo-primary); outline-offset:3px; }
.md-line svg{ display:block; width:100%; height:160px; }
.md-line-x{ display:flex; justify-content:space-between; font-size:11.5px; color:var(--mo-t3); margin-top:6px; }
.md-plot{ position:relative; flex:1; display:flex; flex-direction:column; min-height:0; cursor:crosshair; }
.md-mx{ border:0; background:none; padding:4px 2px; min-height:24px; min-width:24px; margin:0 -2px; font:inherit; font-size:11.5px; color:var(--mo-t3); cursor:pointer; border-radius:6px; }
.md-mx:hover, .md-mx.on{ color:var(--mo-primary); font-weight:700; }
.md-mx:focus-visible{ outline:3px solid var(--mo-primary); outline-offset:1px; }
@media (max-width:480px){ .md-line-x .md-mx{ margin:0; padding:4px 0; font-size:10.5px; } }
.md-dot{ position:absolute; width:12px; height:12px; margin:-6px 0 0 -6px; border-radius:50%; background:#0049e8; box-shadow:0 0 0 3px var(--mo-surface); pointer-events:none; }
.md-ctip{ position:absolute; transform:translate(-50%,calc(-100% - 14px)); padding:8px 11px; border-radius:10px; background:#0b1026; color:#fff; font-size:12px; line-height:1.35; white-space:nowrap; pointer-events:none; box-shadow:0 8px 20px -8px rgba(0,0,0,.45); z-index:3; }
.md-ctip span{ display:block; }
.md-ct-m{ font-weight:700; margin-bottom:2px; }
.md-ct-s::before, .md-ct-r::before{ content:""; display:inline-block; width:10px; height:3px; border-radius:2px; margin:0 6px 3px 0; vertical-align:middle; }
.md-ct-s::before{ background:#5b8cff; } .md-ct-r::before{ background:#34d399; }
html[data-theme=dark] .md-ct-s::before{ background:#0049e8; } html[data-theme=dark] .md-ct-r::before{ background:#0e8a50; }
.md-dot-r{ background:#0e8a50; }
.md-chead{ display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.md-legend{ display:flex; gap:14px; list-style:none; margin:0; padding:0; font-size:12.5px; font-weight:600; color:var(--mo-t2); }
.md-legend li{ display:flex; align-items:center; gap:6px; }
.md-legend i{ display:inline-block; width:18px; height:0; border-top:3px solid #0049e8; }
.md-legend i.md-lg-r{ border-top:3px dashed #0e8a50; }
.md-legend i.md-lg-p{ border-top:3px dashed #6d5ce8; }
.md-dot-p{ background:#6d5ce8; }
.md-ctip-yy .md-ct-r::before{ background:#b3a8ff; }
html[data-theme=dark] .md-ctip-yy .md-ct-r::before{ background:#6d5ce8; }
.md-seg button{ border:0; background:none; font:inherit; padding:7px 12px; border-radius:9px; font-size:13px; font-weight:600; color:var(--mo-t2); cursor:pointer; }
.md-seg button.on{ background:var(--mo-surface); color:var(--mo-primary); box-shadow:var(--mo-shadow); }
.md-seg button:focus-visible{ outline:3px solid var(--mo-primary); outline-offset:1px; }
[data-panel] > .md-legend{ justify-content:flex-end; margin:-2px 0 4px; }
.md-yyctl{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin:4px 0 6px; font-size:13px; font-weight:600; color:var(--mo-t2); }
.md-yyctl select{ min-height:34px; padding:4px 28px 4px 10px; border:1px solid var(--mo-border-ctl); border-radius:9px; background-color:var(--mo-surface); color:var(--mo-t1); font:inherit; font-weight:600; }
.md-yyctl select:focus-visible{ outline:3px solid var(--mo-primary); outline-offset:1px; }
.md-yyctl .md-legend{ margin-left:auto; }
.md-yysum{ margin:0 0 6px; font-size:13px; color:var(--mo-t2); }
.md-yysum b{ color:var(--mo-t1); }
.md-yych{ display:inline-block; padding:1px 8px; border-radius:999px; font-weight:700; font-size:12px; }
.md-yych.up{ background:#e7f6ee; color:#0b6b3d; } .md-yych.down{ background:#fdecec; color:#a61b1b; }
html[data-theme=dark] .md-yych.up{ background:rgba(52,211,153,.16); color:#6ee7b7; } html[data-theme=dark] .md-yych.down{ background:rgba(248,113,113,.16); color:#fca5a5; }
.md-rev [data-panel]{ display:flex; flex-direction:column; flex:1; min-height:0; }
.md-rev [data-panel][hidden]{ display:none; }
html[data-theme=dark] .md-ctip{ background:#eef1fb; color:#0b1026; }

.md-next, .md-health, .md-cal, .md-acad{ padding:16px 18px; }
.md-list{ list-style:none; margin:8px 0 0; padding:0; display:flex; flex-direction:column; }
.md-list li{ display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--mo-border); }
.md-list li:last-child{ border-bottom:0; }
.md-list li > a, .md-list li > span:first-child{ flex:1; min-width:0; display:flex; flex-direction:column; text-decoration:none; color:var(--mo-t1); }
.md-list li > a:hover b{ text-decoration:underline; }
.md-list b{ font-size:13.5px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.md-list li > a > span, .md-list li > span > span{ font-size:12.5px; color:var(--mo-t3); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.md-when{ display:flex; flex-direction:column; align-items:flex-end; font-size:12.5px; font-weight:600; color:var(--mo-t2); white-space:nowrap; }
.md-when small{ font-size:11.5px; font-weight:500; color:var(--mo-t3); }
.md-when.soon, .md-when.late, .md-late{ color:#b42318; }
html[data-theme=dark] .md-when.soon, html[data-theme=dark] .md-when.late, html[data-theme=dark] .md-late{ color:#fca5a5; }
.md-moreb{ display:flex; gap:8px; padding-top:10px; }
.md-scroll + .md-moreb{ padding:10px 20px 14px; border-top:1px solid var(--mo-border); }
.md-moreb [hidden]{ display:none!important; }

.md-health{ text-align:center; }
.md-health h2{ text-align:left; }
.md-ring{ --p:100; width:132px; height:132px; margin:12px auto 8px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  background:conic-gradient(#0e8a50 calc(var(--p)*1%), var(--mo-surface-3) 0); }
.md-ring b{ width:96px; height:96px; border-radius:50%; background:var(--mo-surface); display:flex; align-items:center; justify-content:center; font-size:26px; color:var(--mo-t1); }
.md-health p{ margin:0; font-size:13px; color:var(--mo-t2); }
.md-quick{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.md-quick a{ display:flex; align-items:center; gap:10px; padding:12px 14px; font-size:13.5px; font-weight:600; color:var(--mo-t1); text-decoration:none; }
.md-quick a svg{ color:var(--mo-primary); flex:none; }
.md-quick a:hover{ border-color:var(--mo-border-2); }

.md-g3{ display:grid; grid-template-columns:repeat(auto-fit,minmax(min(320px,100%),1fr)); gap:16px; margin-top:12px; align-items:stretch; }
.md-gc{ display:flex; flex-direction:column; gap:10px; padding:14px 16px; }
.md-gh{ display:flex; gap:8px; align-items:flex-start; min-height:54px; }
.md-gh > div:first-child{ flex:1; min-width:0; }
.md-gh h3{ margin:0; font-size:15px; font-weight:700; color:var(--mo-t1); }
.md-gh p{ margin:2px 0 0; font-size:12.5px; color:var(--mo-t2); }
.md-gbig{ text-align:right; display:flex; flex-direction:column; }
.md-gbig b{ font-size:20px; line-height:1.1; color:var(--mo-t1); } .md-gbig span{ font-size:11.5px; color:var(--mo-t3); }
.md-livetag{ display:inline-flex; align-items:center; gap:6px; font-weight:600; color:#0b6e41; }
html[data-theme=dark] .md-livetag{ color:#6ee7b7; }
.md-bars{ position:relative; height:150px; }
.md-bars-in{ position:absolute; inset:0 0 18px 0; display:flex; align-items:flex-end; gap:8px; }
.md-bc{ flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; height:100%; }
.md-bc span{ font-size:11.5px; font-weight:700; margin-bottom:3px; color:var(--mo-t1); }
.md-bc i{ display:block; width:100%; max-width:40px; border-radius:9px 9px 4px 4px; background:linear-gradient(180deg,#5f8bff,#0049e8); box-shadow:0 6px 14px -8px rgba(0,73,232,.7); }
.md-bars-v .md-bc i{ background:linear-gradient(180deg,#937bfa,#5840ef); box-shadow:0 6px 14px -8px rgba(88,64,239,.7); }
.md-bc i.sofar{ background:repeating-linear-gradient(135deg,#8eafff 0 6px,#bacdff 6px 12px); border:2px dashed #0049e8; box-shadow:none; }
.md-bars-v .md-bc i.sofar{ background:repeating-linear-gradient(135deg,#b4a6ff 0 6px,#d6cdff 6px 12px); border-color:#5840ef; }
.md-bars svg{ position:absolute; inset:0 0 18px 0; width:100%; height:calc(100% - 18px); overflow:visible; }
.md-bars-x{ position:absolute; left:0; right:0; bottom:0; height:16px; display:flex; gap:8px; }
.md-bars-x span{ flex:1; text-align:center; font-size:11.5px; color:var(--mo-t2); white-space:nowrap; }
.md-chips{ display:flex; flex-wrap:wrap; gap:6px; }
.md-chips span{ padding:3px 9px; border-radius:999px; font-size:11.5px; font-weight:700; background:var(--mo-violet-tint); color:var(--mo-violet-ink); }
.md-gl{ border-top:1px solid var(--mo-border); padding-top:8px; }
.md-gl h4{ margin:0; font-size:12.5px; font-weight:700; color:var(--mo-t2); }
.md-gl .md-list li{ padding:6px 0; }
.md-gf{ margin-top:auto; padding-top:8px; border-top:1px solid var(--mo-border); display:flex; justify-content:flex-end; }
.md-donut-w{ height:150px; display:flex; align-items:center; justify-content:center; }
.md-donut{ width:146px; height:146px; border-radius:50%; display:flex; align-items:center; justify-content:center; box-shadow:0 10px 26px -14px rgba(0,73,232,.6); }
.md-donut span{ width:98px; height:98px; border-radius:50%; background:var(--mo-surface); display:flex; flex-direction:column; align-items:center; justify-content:center; }
.md-donut b{ font-size:22px; color:var(--mo-t1); } .md-donut small{ font-size:11.5px; color:var(--mo-t3); }
html[data-skin=modern] .md-pay th, html[data-skin=modern] .md-pay td{ padding:6px 0; font-size:13px; background:none; border-bottom:1px solid var(--mo-border); text-transform:none; letter-spacing:0; }
html[data-skin=modern] .md-pay thead th{ font-size:11.5px; color:var(--mo-t3); }
html[data-skin=modern] .md-pay tbody th{ font-weight:500; color:var(--mo-t1); text-align:left; }
.md-key{ display:inline-block; width:10px; height:10px; margin-right:8px; background:var(--c); border-radius:50%; vertical-align:-1px; }
.md-key-ach{ border-radius:2px; } .md-key-stripe{ transform:rotate(45deg); border-radius:1px; } .md-key-check{ height:4px; border-radius:0; vertical-align:2px; }
.md-key-paypalandother{ background:none; border:2px solid var(--c); box-sizing:border-box; }

.md-tbl{ overflow:hidden; }
.md-scroll{ overflow-x:auto; }
.md-pn{ font-weight:700; color:var(--mo-t1)!important; text-decoration:none; }
.md-pn:hover{ text-decoration:underline; }
.md-ps{ font-size:12.5px; color:var(--mo-t3); }
.md-tag{ display:inline-block; margin-left:6px; padding:1px 7px; border-radius:999px; font-size:11px; font-weight:700; background:#fef2f2; color:#b42318; }
.md-prog{ display:flex; align-items:center; gap:4px; }
.md-prog i{ width:14px; height:14px; border-radius:4px; background:var(--mo-surface-3); border:1px solid var(--mo-border-2); }
.md-prog i.on{ background:#0e8a50; border-color:#0e8a50; }
.md-prog span{ margin-left:6px; font-size:12.5px; font-weight:600; color:var(--mo-t2); }

.md-ac4{ display:grid; grid-template-columns:repeat(auto-fit,minmax(110px,1fr)); gap:10px; margin-top:12px; }
.md-ac4 div{ padding:12px; border-radius:13px; background:var(--mo-violet-tint); display:flex; flex-direction:column; }
.md-ac4 b{ font-size:20px; color:var(--mo-t1); } .md-ac4 span{ font-size:12.5px; color:var(--mo-t2); }
.md-calg{ display:grid; grid-template-columns:repeat(7,1fr); gap:4px; margin-top:12px; text-align:center; }
.md-wd{ font-size:11.5px; font-weight:700; color:var(--mo-t3); padding-bottom:4px; }
.md-d{ position:relative; padding:7px 0; border-radius:9px; font-size:13px; color:var(--mo-t1); }
.md-d.today{ background:var(--mo-primary); color:var(--mo-on-primary); font-weight:700; }
.md-d.has::after{ content:""; position:absolute; left:50%; bottom:2px; width:5px; height:5px; margin-left:-2.5px; border-radius:50%; background:#c81e1e; }
.md-d.today.has::after{ background:#fff; }
button.md-d{ border:0; background:transparent; font:inherit; font-size:13px; color:var(--mo-t1); cursor:pointer; min-height:32px; }
button.md-d:hover{ background:var(--mo-primary-tint); color:var(--mo-primary); }
button.md-d.today{ background:var(--mo-primary); color:var(--mo-on-primary); }
button.md-d:focus-visible{ outline:3px solid var(--mo-primary); outline-offset:1px; }
button.md-d[aria-pressed=true]{ background:#c81e1e; color:#fff; font-weight:700; }
button.md-d[aria-pressed=true]::after{ background:#fff; }
.md-due-all{ margin:-2px 0 8px; }
.md-mr{ display:flex; gap:8px; flex-wrap:wrap; margin:14px 0 0; padding:12px 0 0; border-top:1px solid var(--mo-border); }

@media (max-width:1280px){ .md-kpis{ grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:1100px){ .md-row-main, .md-row-bottom{ grid-template-columns:1fr; } .md-rev-3{ grid-template-columns:1fr; } }
@media (max-width:560px){ .md-kpis{ grid-template-columns:repeat(2,minmax(0,1fr)); } .md-live{ flex-wrap:wrap; } }
.md [hidden]{ display:none!important; }

/* ───────── 5. client portal (client.php) ─────────
   The portal keeps its labelled sidebar: it holds the project and audit-plan
   pickers, which an icon rail would hide. Same palette, surfaces and current-item
   treatment as the staff app. */
html[data-skin=modern][data-app=portal]{
  --bg:transparent; --card:var(--mo-surface);
  --br:var(--mo-border); --br-ctl:var(--mo-border-ctl);
  --ink:var(--mo-t1); --t2:var(--mo-t2); --t3:var(--mo-t3);
  --n-900:var(--mo-t1); --n-700:var(--mo-t2); --n-600:var(--mo-t2); --n-500:var(--mo-t3); --n-400:var(--mo-t3);
  --surface-0:var(--mo-surface-2); --surface-1:var(--mo-surface-3); --br-soft:var(--mo-border);
  --nav-base:transparent; --nav-hover:var(--mo-surface-3); --nav-plate:var(--mo-surface); --nav-card:var(--mo-surface);
  --nav-br:var(--mo-border); --nav-t:var(--mo-t2); --nav-t-h:var(--mo-t1); --nav-m:var(--mo-t3); --nav-lbl:var(--mo-t3);
  --grad-a:var(--mo-primary); --grad-b:var(--mo-violet); --grad:linear-gradient(90deg,#0049e8 0%,#5840ef 100%);
  --r-card:var(--mo-r); --r-nav:13px;
}
html[data-skin=modern][data-app=portal] body{ font-family:var(--mo-font); }
html[data-skin=modern][data-app=portal] .side{
  width:268px; flex-basis:268px; background:var(--mo-glass); background-image:none; box-shadow:none; border-right:1px solid var(--mo-border);
  -webkit-backdrop-filter:saturate(1.4) blur(14px); backdrop-filter:saturate(1.4) blur(14px);
}
html[data-skin=modern][data-app=portal] .side::after{ display:none; }
html[data-skin=modern][data-app=portal] .side-hd{ border-bottom:0; padding:18px 20px 10px; }
html[data-skin=modern][data-app=portal] .side-logo{ border-radius:12px; box-shadow:var(--mo-shadow); }
html[data-skin=modern][data-app=portal] .nav-lbl{ font-size:11.5px; font-weight:700; letter-spacing:.08em; }
html[data-skin=modern][data-app=portal] .nav-i{ font-size:14.5px; font-weight:600; padding:10px 14px; border-radius:13px; }
html[data-skin=modern][data-app=portal] .nav-i.on{
  background:var(--mo-primary); color:var(--mo-on-primary); border-color:transparent; font-weight:700;
  box-shadow:0 8px 18px -8px rgba(0,73,232,.75);
}
html[data-skin=modern][data-app=portal] .nav-i.on svg{ stroke:var(--mo-on-primary); }
html[data-skin=modern][data-app=portal] .nav-i.on .nav-pill{ background:rgba(255,255,255,.22); color:#fff; }
html[data-skin=modern][data-app=portal] .nav-i:focus-visible{ outline:3px solid var(--mo-primary); outline-offset:2px; }
html[data-skin=modern][data-app=portal] .nav-pill{ background:var(--mo-surface-3); color:var(--mo-t1); }
html[data-skin=modern][data-app=portal] .nav-pill.due{ background:#c81e1e; color:#fff; }
html[data-skin=modern][data-app=portal] .side-ft{ border-top:1px solid var(--mo-border); }
html[data-skin=modern][data-app=portal] .btn-out{ border-radius:11px; }
html[data-skin=modern][data-app=portal] .hdr{
  background:var(--mo-glass); border-bottom:1px solid var(--mo-border); padding:14px 28px;
  -webkit-backdrop-filter:saturate(1.4) blur(14px); backdrop-filter:saturate(1.4) blur(14px);
}
html[data-skin=modern][data-app=portal] .hdr h1, html[data-skin=modern][data-app=portal] .hdr .hdr-t{ font-size:24px; font-weight:700; letter-spacing:-.3px; }
html[data-skin=modern][data-app=portal] .icon-btn{ width:42px; height:42px; border-radius:13px; border-color:var(--mo-border); background:var(--mo-surface); }
html[data-skin=modern][data-app=portal] .card{ border-radius:var(--mo-r); border-color:var(--mo-border); box-shadow:var(--mo-shadow); }
html[data-skin=modern][data-app=portal] .content{ padding:22px 28px 44px; }
@media (max-width:900px){
  html[data-skin=modern][data-app=portal] .hdr{ padding:12px 14px; }
  html[data-skin=modern][data-app=portal] .content{ padding:14px; }
  html[data-skin=modern][data-app=portal] .side{ background:var(--mo-surface); }
}

/* ───────── 6. sign-in pages (login.php and friends) ───────── */
html[data-skin=modern][data-app=login]{
  --bg:transparent; --card:var(--mo-surface); --line:var(--mo-border-2);
  --ink:var(--mo-t1); --ink-2:var(--mo-t2); --ink-3:var(--mo-t3);
  --accent:var(--mo-primary); --accent-2:var(--mo-primary-h); --navy:var(--mo-primary);
}
html[data-skin=modern][data-app=login] body{ font-family:var(--mo-font); }
html[data-skin=modern][data-app=login] .brand{ background:var(--mo-hero); background-color:#0a2c79; margin:16px; border-radius:26px; }
html[data-skin=modern][data-app=login] .brand .waves{ opacity:.35; }
html[data-skin=modern][data-app=login] .card{ border-radius:22px; border-color:var(--mo-border); box-shadow:var(--mo-shadow-up); background:var(--mo-surface); }
html[data-skin=modern][data-app=login] .inp{ border-color:var(--mo-border-ctl); background:var(--mo-surface); color:var(--mo-t1); border-radius:12px; }
html[data-skin=modern][data-app=login] .inp:focus{ border-color:var(--mo-primary); box-shadow:0 0 0 3px rgba(0,73,232,.20); }
html[data-skin=modern][data-app=login] .btn{ background:var(--mo-primary); color:var(--mo-on-primary); border-radius:12px; box-shadow:0 8px 18px -8px rgba(0,73,232,.75); }
html[data-skin=modern][data-app=login] .btn:hover{ background:var(--mo-primary-h); }
html[data-skin=modern][data-app=login] .btn:focus-visible{ outline:3px solid var(--mo-primary); outline-offset:2px; }
@media (max-width:860px){ html[data-skin=modern][data-app=login] .brand{ margin:10px; border-radius:20px; order:2; } }
.md-kpis.md-kpis-4{ grid-template-columns:repeat(4,minmax(0,1fr)); }
@media (max-width:900px){ .md-kpis.md-kpis-4{ grid-template-columns:repeat(2,minmax(0,1fr)); } }

/* ───────── 7. status pills: darker ink on their 13% tint (AA 4.5:1) ─────────
   Pills are built in PHP as background:<colour>22;color:<colour>. On the tint the
   mid greens and reds land near 4.2:1, so in light mode each hue gets its deeper ink. */
html[data-skin=modern]:not([data-theme=dark]) :is([style*="22;color:#15803d"],[style*="22;color:#16a34a"],[style*="22;color:#166534"],[style*="22;color:#059669"]){ color:#0b6e41!important; }
html[data-skin=modern]:not([data-theme=dark]) :is([style*="22;color:#dc2626"],[style*="22;color:#b91c1c"],[style*="22;color:#ef4444"]){ color:#a3241a!important; }
html[data-skin=modern]:not([data-theme=dark]) :is([style*="22;color:#b45309"],[style*="22;color:#d97706"],[style*="22;color:#f59e0b"]){ color:#8a3f06!important; }
html[data-skin=modern]:not([data-theme=dark]) :is([style*="22;color:#1863dc"],[style*="22;color:#2563eb"],[style*="22;color:#2151b7"],[style*="22;color:#3b82f6"]){ color:#1e3fae!important; }
html[data-skin=modern]:not([data-theme=dark]) :is([style*="22;color:#0891b2"],[style*="22;color:#06b6d4"]){ color:#0b6075!important; }
html[data-skin=modern]:not([data-theme=dark]) :is([style*="22;color:#64748b"],[style*="22;color:#6b7280"],[style*="22;color:#94a3b8"]){ color:#3f4a5c!important; }
html[data-skin=modern]:not([data-theme=dark]) :is([style*="22;color:#4f46e5"],[style*="22;color:#7c3aed"],[style*="22;color:#8b5cf6"]){ color:#4b23b8!important; }
/* muted slate set inline across many pages: 4.34:1 on the light grey panels, so one step darker */
html[data-skin=modern]:not([data-theme=dark]) [style*=";color:#64748b"],
html[data-skin=modern]:not([data-theme=dark]) [style^="color:#64748b"]{ color:#4f5b6d!important; }
/* the selected filter tab and its count (auditTabLink) */
html[data-skin=modern] a[aria-current="true"][style*="background:#2563eb"]{ background:var(--mo-primary)!important; border-color:var(--mo-primary)!important; color:var(--mo-on-primary)!important; }
html[data-skin=modern] a[aria-current="true"][style*="background:#2563eb"] > span{ background:rgba(0,16,64,.35)!important; color:#fff!important; }

/* main row: the revenue card runs the full height of the right column, its chart taking the slack */
.md-row-main{ align-items:stretch; }
.md-row-main > .md-col:first-child{ display:flex; }
.md-row-main .md-rev{ flex:1; display:flex; flex-direction:column; }
.md-row-main .md-line{ flex:1; display:flex; flex-direction:column; min-height:200px; }
.md-row-main .md-line svg{ flex:1; height:auto; min-height:180px; }
.md-health{ padding:14px 18px; }
.md-ring{ width:112px; height:112px; margin:8px auto 6px; }
.md-ring b{ width:82px; height:82px; font-size:22px; }
/* managers without money see no revenue card: the side boxes sit in a row instead */
.md-row-noprice{ grid-template-columns:1fr; }
.md-row-noprice > .md-col:first-child{ display:none; }
.md-row-noprice > .md-col-side{ display:grid; grid-template-columns:repeat(auto-fit,minmax(min(300px,100%),1fr)); align-items:start; }

/* ───────── 8. shared list/box views (.pv-*) and other older inline colours ───────── */
html[data-skin=modern][data-app=staff]{ --red:#b42318; --green:#0b6e41; --yellow:#8a4b06; --blue:#1e3fae; }
html[data-skin=modern][data-app=staff][data-theme=dark]{ --red:#fca5a5; --green:#6ee7b7; --yellow:#fcd34d; --blue:#93c5fd; }
html[data-skin=modern] .pv-card{ border-radius:var(--mo-r); border-color:var(--mo-border); box-shadow:var(--mo-shadow); background:var(--mo-surface); }
html[data-skin=modern] .pv-card:hover{ box-shadow:var(--mo-shadow-up); }
html[data-skin=modern] .pv-tag, html[data-skin=modern] .pv-badge{ color:var(--mo-t2); background:var(--mo-surface-3); }
html[data-skin=modern] .pv-ml{ color:var(--mo-t3); }
html[data-skin=modern] .pv-meta{ background:var(--mo-surface-2); border-radius:12px; }
html[data-skin=modern] .pv-switch{ background:var(--mo-surface-3); border-radius:11px; }
html[data-skin=modern] .pv-btn{ color:var(--mo-t2); border-radius:8px; }
html[data-skin=modern] .pv-btn.active, html[data-skin=modern] .pv-btn[aria-pressed=true]{ background:var(--mo-surface); color:var(--mo-primary); box-shadow:var(--mo-shadow); }
html[data-skin=modern] .pv-assignee{ color:var(--mo-t1); }
/* tab counts drawn at 65% opacity and "to"/hint text in #94a3b8 fell under 4.5:1 */
html[data-skin=modern] [style*="opacity:.65"]{ opacity:.9!important; }
html[data-skin=modern]:not([data-theme=dark]) [style*="color:#94a3b8"]{ color:var(--mo-t3)!important; }
/* unlink (x) buttons beside linked projects and audits: 24px targets (WCAG 2.5.8) */
html[data-skin=modern] .unlinkx{ width:24px!important; height:24px!important; }
/* finance period tabs, green Download buttons, the tasks Box/List toggle */
html[data-skin=modern] .tab{ color:var(--mo-t2); }
html[data-skin=modern]:not([data-theme=dark]) .btn.dl, html[data-skin=modern]:not([data-theme=dark]) [style*="background:#16a34a"]{ background:#0e7a46!important; color:#fff!important; }
html[data-skin=modern] button[data-v][aria-pressed]{ color:var(--mo-t2); }
html[data-skin=modern] button[data-v][aria-pressed=true]{ color:var(--mo-primary); }
html[data-skin=modern] .fb{ color:var(--mo-t2); }
html[data-skin=modern][data-app=staff]:not([data-theme=dark]){ --teal:#0b5f59; --purple:#5b2bc4; }
html[data-skin=modern]:not([data-theme=dark]) :is([style*="22;color:#9f7aea"],[style*="22;color:#a855f7"]){ color:#4b23b8!important; }
/* bright inline text colours on white (green 3.3:1, amber 2.6:1, sky 2.8:1) */
html[data-skin=modern]:not([data-theme=dark]) :is([style^="color:#16a34a"],[style*=";color:#16a34a"],[style*="; color:#16a34a"],[style^="color:#22c55e"],[style*=";color:#22c55e"]){ color:#0b6e41!important; }
html[data-skin=modern]:not([data-theme=dark]) :is([style^="color:#d97706"],[style*=";color:#d97706"],[style^="color:#f59e0b"],[style*=";color:#f59e0b"]){ color:#8a4b06!important; }
html[data-skin=modern]:not([data-theme=dark]) :is([style^="color:#0ea5e9"],[style*=";color:#0ea5e9"],[style^="color:#0891b2"],[style*=";color:#0891b2"]){ color:#0b6075!important; }
/* small standalone links in cards get a 24px target (WCAG 2.5.8) */
html[data-skin=modern] .content a[target=_blank][style*="font-size:12px"]{ display:inline-block; min-height:24px; line-height:24px; }

/* top row, compact: quick actions and audit health beside revenue; revenue keeps a fixed chart height */
.md-row-main .md-line{ flex:none; min-height:0; }
.md-row-main .md-line svg{ flex:none; height:150px; min-height:0; }
.md-row-main > .md-col-side{ gap:14px; }
.md-row-main > .md-col-side > .md-health{ flex:1; display:flex; flex-direction:column; }
.md-health-b{ flex:1; display:flex; align-items:center; gap:16px; text-align:left; }
.md-health-b .md-ring{ margin:0; flex:none; width:104px; height:104px; }
.md-health-b .md-ring b{ width:76px; height:76px; font-size:20px; }
.md-health-b p{ margin:0; line-height:1.5; }
.md-quick a{ padding:14px; }
html[data-skin=modern] [style*="opacity:.85"]{ opacity:1!important; }
html[data-skin=modern] .rcp:focus-visible{ outline:3px solid var(--mo-primary); outline-offset:2px; }
@media (max-width:560px){
  .md-head h2{ flex-basis:100%; }
  .md-seg{ width:100%; } .md-seg a{ flex:1; text-align:center; }
  .md-greet h1{ font-size:22px; }
}

/* portal counters: new-design tiles; the status stays in words ("Paid up", "50% done") */
html[data-skin=modern][data-app=portal] .kpi-c{ border-radius:var(--mo-r); border:1px solid var(--mo-border); box-shadow:var(--mo-shadow); background:var(--mo-surface); }
html[data-skin=modern][data-app=portal] .kpi-c::before{ display:none; }
html[data-skin=modern][data-app=portal] .kpis2{ gap:14px; }
/* the account chip uses the theme's typeface, as in the staff header */
html[data-skin=modern] .who, html[data-skin=modern] .who *{ font-family:var(--mo-font)!important; font-style:normal; }
html[data-skin=modern] .who{ border-radius:999px; }
/* below 860px the portal puts its menu across the top (client.php): keep that, full width */
@media (max-width:860px){
  html[data-skin=modern][data-app=portal] .side{ width:100%; flex:none; flex-basis:auto; border-right:0; border-bottom:1px solid var(--mo-border); }
}
.md-mywork{ display:flex; align-items:center; gap:14px; flex-wrap:wrap; padding:14px 18px; }
.md-mw-ic{ margin:0; background:var(--mo-primary-tint); color:var(--mo-primary); }
.md-mw-t{ flex:1; min-width:220px; } .md-mw-t h2{ font-size:15px; } .md-mw-t p{ margin:2px 0 0; font-size:13.5px; color:var(--mo-t2); }

/* sign-in brand panel: readable on every part of the gradient (lightest stop #5840ef).
   White is 5.6:1 there and 6.7:1 on #0049e8; nothing is drawn faint or with opacity. */
html[data-skin=modern][data-app=login] .brand h1{ color:#fff; font-weight:700; letter-spacing:-.3px; }
html[data-skin=modern][data-app=login] .brand p{ color:#fff; font-size:16px; line-height:1.55; }
html[data-skin=modern][data-app=login] .brand p.sys{ color:#fff; font-weight:600; font-size:20px; }
html[data-skin=modern][data-app=login] .brand p.plans-sub{ color:#fff; font-size:14px; line-height:1.5; max-width:400px; }
html[data-skin=modern][data-app=login] .brand .plans{ font-weight:700; font-size:16px; border-radius:14px; }
/* the courses button: white on a deeper EcomBack orange, 5.6:1 */
html[data-skin=modern][data-app=login] .brand .plans.courses{ background:#b83a12; color:#fff; }
html[data-skin=modern][data-app=login] .brand .plans.courses:hover{ background:#9c300d; }
html[data-skin=modern][data-app=login] .brand .plans.courses svg{ stroke:#fff; color:#fff; }
html[data-skin=modern][data-app=login] .brand .plans span{ color:#b83a12; }
html[data-skin=modern][data-app=login] .brand .waves{ opacity:.25; }
/* the 2026 typeface goes to weight 700: never let the browser fake an 800 */
html[data-skin=modern]{ font-synthesis-weight:none; }
html[data-skin=modern] :is(h1,h2,h3,b,strong,th,.btn){ font-synthesis-weight:none; }

/* ───────── 9. client portal, approved layout (C-Client) ─────────
   The labelled sidebar becomes the icon rail; labels stay as the links' names
   and show beside the rail on hover or focus. */
html[data-skin=modern][data-app=portal] .side{ width:76px; flex:0 0 76px; align-items:center; overflow:visible; }
html[data-skin=modern][data-app=portal] .side-hd{ padding:14px 0 8px; justify-content:center; }
html[data-skin=modern][data-app=portal] .side-hd > div:last-child{ display:none!important; }
html[data-skin=modern][data-app=portal] .side-logo{ width:42px; height:42px; flex-basis:42px; }
html[data-skin=modern][data-app=portal] .side-nav{ padding:8px 0; gap:6px; width:100%; align-items:center; overflow-y:auto; overflow-x:visible; }
html[data-skin=modern][data-app=portal] .nav-grp{ align-items:center; gap:6px; width:100%; }
html[data-skin=modern][data-app=portal] .nav-grp + .nav-grp{ border-top:1px solid var(--mo-border); padding-top:8px; margin:0 14px; width:auto; }
html[data-skin=modern][data-app=portal] .nav-lbl{ display:none; }
html[data-skin=modern][data-app=portal] .nav-i{ width:46px; height:46px; padding:0; gap:0; justify-content:center; border-radius:13px; border:0; position:relative; }
html[data-skin=modern][data-app=portal] .nav-i > span:not(.nav-pill):not(.nav-deal):not(.nav-new){ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
html[data-skin=modern][data-app=portal] .nav-i svg{ width:21px; height:21px; }
html[data-skin=modern][data-app=portal] :is(.nav-pill,.nav-deal,.nav-new){ position:absolute; top:-4px; right:-8px; margin:0; min-width:0; height:auto; padding:1px 5px; border-radius:999px; font-size:9.5px; font-weight:700; line-height:1.4; box-shadow:0 0 0 2px var(--mo-surface); }
html[data-skin=modern][data-app=portal] .nav-pill{ background:var(--mo-surface-3); color:var(--mo-t1); }
html[data-skin=modern][data-app=portal] .nav-pill.due, html[data-skin=modern][data-app=portal] .nav-new{ background:#b42318; color:#fff; }
html[data-skin=modern][data-app=portal] .nav-deal{ background:var(--mo-primary); color:var(--mo-on-primary); }
html[data-skin=modern][data-app=portal] .nav-i.on .nav-pill{ background:#fff; color:var(--mo-primary); }
html[data-skin=modern][data-app=portal] .side-ft{ display:none; }
html[data-skin=modern][data-app=portal] .side-out{ margin:8px auto 14px; }
@media (max-width:860px){
  html[data-skin=modern][data-app=portal] .side{ width:100%; flex:none; align-items:stretch; }
  html[data-skin=modern][data-app=portal] .side-nav{ flex-direction:row; flex-wrap:wrap; justify-content:center; }
  html[data-skin=modern][data-app=portal] .nav-grp, html[data-skin=modern][data-app=portal] .nav-grp + .nav-grp{ flex-direction:row; flex-wrap:wrap; justify-content:center; width:auto; border:0; margin:0; padding:0; }
  html[data-skin=modern][data-app=portal] .side-out{ margin:0 auto 10px; }
}

/* dashboard */
.pd-greet h1{ margin:0; font-size:26px; font-weight:700; letter-spacing:-.4px; color:var(--mo-t1); }
.pd-greet p{ margin:4px 0 18px; font-size:14px; color:var(--mo-t3); }
html[data-skin=modern][data-app=portal] .due-alert{ border-radius:14px; margin-bottom:16px; }
html[data-skin=modern][data-app=portal] .kpis2{ margin-bottom:18px; }
.pd-cols{ display:grid; grid-template-columns:minmax(0,1fr) minmax(300px,360px); gap:18px; align-items:start; }
.pd-main, .pd-side{ display:flex; flex-direction:column; gap:16px; min-width:0; }
.pd-pair{ display:grid; grid-template-columns:repeat(auto-fit,minmax(min(260px,100%),1fr)); gap:16px; align-items:stretch; }
.pd-pair > *{ height:100%; box-sizing:border-box; }
html[data-skin=modern][data-app=portal] :is(.pd-main,.pd-side) > :is(section,a,div.card), html[data-skin=modern][data-app=portal] .pd-pair > *{ border-radius:var(--mo-r)!important; border-color:var(--mo-border)!important; box-shadow:var(--mo-shadow); }
@media (max-width:1100px){ .pd-cols{ grid-template-columns:1fr; } }

/* offer cards: white text on the brand gradients (6.2:1 or better throughout) */
.pd-offer, .pd-acad{ position:relative; overflow:hidden; padding:20px; border-radius:var(--mo-r); color:#fff; box-shadow:var(--mo-shadow-up); }
.pd-offer{ background:var(--mo-hero); background-color:#0a2c79; }
.pd-acad{ background:var(--mo-hero-acad); background-color:#241749; }
.pd-eye{ margin:0; display:flex; align-items:center; gap:8px; font-size:12px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:#fff; }
.pd-new{ padding:2px 8px; border-radius:999px; background:#fff; color:#3a289f; letter-spacing:0; text-transform:none; }
.pd-offer h2, .pd-acad h2{ margin:8px 0 6px; font-size:19px; font-weight:700; line-height:1.3; color:#fff; }
.pd-desc{ margin:0 0 14px; font-size:13.5px; line-height:1.55; color:#fff; }
.pd-plan{ display:flex; flex-direction:column; gap:4px; padding:14px 16px; border-radius:14px; background:#fff; color:#101828; text-decoration:none; box-shadow:0 10px 24px -12px rgba(0,0,0,.45); }
.pd-plan:hover{ transform:translateY(-1px); }
.pd-plan:focus-visible, .pd-all:focus-visible, .pd-cta:focus-visible, .pd-more:focus-visible{ outline:3px solid #fff; outline-offset:3px; }
.pd-badge{ align-self:flex-start; padding:3px 10px; border-radius:999px; background:#eef3ff; color:#0049e8; font-size:12px; font-weight:700; }
.pd-pname{ font-size:16px; font-weight:700; color:#101828; }
.pd-price{ display:flex; align-items:baseline; gap:8px; }
.pd-price b{ font-size:34px; font-weight:700; letter-spacing:-.6px; color:#171a21; }
.pd-price span{ font-size:13px; color:#3d4554; }
.pd-go{ font-size:13.5px; font-weight:700; color:#0049e8; }
.pd-deal{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top:12px; font-size:13px; color:#fff; }
.pd-deal > span{ flex:1; min-width:150px; }
.pd-deal .ticket{ display:inline-flex; align-items:center; gap:8px; height:38px; padding:0 12px; border-radius:10px; border:1.5px dashed #fff; background:rgba(0,0,0,.18); color:#fff; font-weight:700; letter-spacing:.06em; cursor:pointer; }
.pd-deal .ticket:focus-visible{ outline:3px solid #fff; outline-offset:2px; }
.pd-all{ display:inline-block; margin-top:12px; font-size:13.5px; font-weight:700; color:#fff; }
.pd-aprice{ display:flex; align-items:center; gap:10px; margin:0 0 14px; padding:12px 14px; border-radius:14px; background:rgba(255,255,255,.14); }
.pd-aprice span{ font-size:12.5px; line-height:1.3; color:#fff; }
.pd-aprice b{ font-size:34px; font-weight:700; letter-spacing:-.6px; color:#fff; }
.pd-acts{ display:flex; gap:10px; flex-wrap:wrap; }
.pd-cta{ display:inline-flex; align-items:center; gap:6px; padding:10px 16px; border-radius:11px; background:#fff; color:#3a289f; font-weight:700; text-decoration:none; }
.pd-more{ display:inline-flex; align-items:center; padding:10px 6px; color:#fff; font-weight:700; }
/* The portal's dark theme colours every link in .main light blue (html[data-theme=dark] .main a), which
   beat the promo cards' own colours: light blue on the white "Get the courses" button, pale blue on blue.
   These win in both themes. */
html[data-skin=modern] .main a.pd-all, html[data-skin=modern] .main a.pd-more{ color:#fff; text-decoration:underline; text-underline-offset:3px; text-decoration-thickness:1px; }
html[data-skin=modern] .main a.pd-all:hover, html[data-skin=modern] .main a.pd-more:hover{ text-decoration-thickness:2px; }
html[data-skin=modern] .main a.pd-cta{ color:#3a289f; }
html[data-skin=modern] .main a.pd-plan{ color:#101828; }
/* mid-year report card */
html[data-skin=modern][data-app=portal] .pd-side .promo{ background:var(--mo-surface); border:1px solid var(--mo-border); }
.pd-brand{ display:inline-flex; align-items:center; gap:10px; text-decoration:none; color:var(--mo-t1); }
.pd-brand img{ border-radius:10px; }
.pd-brand b{ display:block; font-size:17px; } .pd-brand span span{ display:block; font-size:12.5px; color:var(--mo-t3); }
html[data-skin=modern][data-app=portal] .side-hd{ width:100%; }

/* ───────── 10. Academy courses page (academy_courses.php), approved compact layout ───────── */
html[data-skin=modern][data-app=public] body{ font-family:var(--mo-font); }
html[data-skin=modern][data-app=public] .sec{ padding:48px 28px; }
html[data-skin=modern][data-app=public] .wrap{ max-width:1240px; }
/* sections the compact page leaves out: the long feature list and the per-exam breakdown */
html[data-skin=modern][data-app=public] section[aria-labelledby="get-h"],
html[data-skin=modern][data-app=public] #exams{ display:none; }
/* courses: a grid of cards; each course's modules sit behind "View curriculum" */
html[data-skin=modern][data-app=public] #curriculum .wrap{ display:grid; grid-template-columns:repeat(auto-fill,minmax(min(360px,100%),1fr)); gap:18px; align-items:start; }
html[data-skin=modern][data-app=public] #curriculum .head{ grid-column:1/-1; margin-bottom:6px; }
html[data-skin=modern][data-app=public] div.course{ margin:0; padding:20px; border-radius:var(--mo-r); background:var(--mo-surface); border:1px solid var(--mo-border); box-shadow:var(--mo-shadow); display:flex; flex-direction:column; gap:10px; }
html[data-skin=modern][data-app=public] .course-head{ flex-direction:column; align-items:flex-start; margin:0; gap:10px; }
html[data-skin=modern][data-app=public] .course-head h3{ font-size:20px; }
html[data-skin=modern][data-app=public] .course-head p{ font-size:16px; line-height:1.6; }
html[data-skin=modern][data-app=public] .facts{ gap:6px 14px; }
.mods-wrap > summary{ cursor:pointer; padding:10px 14px; border-radius:11px; background:var(--mo-primary-tint); color:var(--mo-primary); font-weight:700; font-size:14px; list-style:none; }
.mods-wrap > summary::-webkit-details-marker{ display:none; }
.mods-wrap > summary::after{ content:" ▾"; }
.mods-wrap[open] > summary::after{ content:" ▴"; }
.mods-wrap > summary:focus-visible{ outline:3px solid var(--mo-primary); outline-offset:2px; }
.mods-wrap .mods{ margin-top:10px; }
/* plans: a grid instead of a long column; "Good to know" runs underneath */
html[data-skin=modern][data-app=public] .price-layout{ display:grid; grid-template-columns:1fr; gap:18px; }
/* one package left (each course's price sits on its row above): the card and "Good to know" side by side */
html[data-skin=modern][data-app=public] .price-layout.one{ grid-template-columns:minmax(0,400px) minmax(0,1fr); align-items:start; }
html[data-skin=modern][data-app=public] .price-layout.one .plans{ grid-template-columns:minmax(0,1fr); }
html[data-skin=modern][data-app=public] .price-layout.one .know .ticks{ grid-template-columns:minmax(0,1fr); }
@media (max-width:860px){ html[data-skin=modern][data-app=public] .price-layout.one{ grid-template-columns:minmax(0,1fr); } }
/* at most three plans to a row: four made each card narrow and its text cramped */
html[data-skin=modern][data-app=public] .plans{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; flex:none; }
@media (max-width:1000px){ html[data-skin=modern][data-app=public] .plans{ grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:640px){ html[data-skin=modern][data-app=public] .plans{ grid-template-columns:minmax(0,1fr); } }
html[data-skin=modern][data-app=public] .card.plan{ border-radius:var(--mo-r); padding:18px; gap:10px; }
html[data-skin=modern][data-app=public] .card.plan.pop{ border:2px solid var(--mo-primary); }
html[data-skin=modern][data-app=public] .card.plan .price .amt{ font-size:34px; }
html[data-skin=modern][data-app=public] .card.plan .ticks{ font-size:16px; gap:8px; }
html[data-skin=modern][data-app=public] .know{ border-radius:var(--mo-r); }
html[data-skin=modern][data-app=public] .know .ticks{ display:grid; grid-template-columns:repeat(auto-fit,minmax(min(320px,100%),1fr)); gap:10px 22px; }
/* steps band and FAQ: compact, FAQ at full width */
html[data-skin=modern][data-app=public] .faq{ max-width:none; }
html[data-skin=modern][data-app=public] .faq details{ border-radius:0; }
html[data-skin=modern][data-app=public] .steps{ display:grid; grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr)); }
html[data-skin=modern][data-app=public] .card{ border-radius:var(--mo-r); border-color:var(--mo-border); box-shadow:var(--mo-shadow); }
/* page colours: the theme's blue for actions and accents */
html[data-skin=modern][data-app=public]{ --btn:#0049e8; --btnH:#003cc0; --btnT:#fff; --acc:#0049e8; --accBg:#eef3ff; --ink:#0049e8; --inkT:#fff; --inkH:#003cc0; --link:#0049e8; }
html[data-skin=modern][data-app=public][data-theme=dark]{ --btn:#8aa6ff; --btnH:#a7bcff; --btnT:#0b1026; --acc:#a7bcff; --accBg:#16224a; --ink:#8aa6ff; --inkT:#0b1026; --inkH:#a7bcff; --link:#a7bcff; }
/* the same dark colours when the device is in dark mode and no theme is picked (the offer box kept its light
   tint behind light text, and links stayed dark blue on the dark page) */
@media (prefers-color-scheme: dark){ html[data-skin=modern][data-app=public]:not([data-theme=light]){ --btn:#8aa6ff; --btnH:#a7bcff; --btnT:#0b1026; --acc:#a7bcff; --accBg:#16224a; --ink:#8aa6ff; --inkT:#0b1026; --inkH:#a7bcff; --link:#a7bcff; } }
/* hero on the brand gradient: white text throughout (6.2:1 or better); the highlight is large text at 3:1+ */
html[data-skin=modern][data-app=public] .band.hero{ background:var(--mo-hero); background-color:#0a2c79; border-bottom:0; }
html[data-skin=modern][data-app=public] .band.final{ background:var(--mo-hero); background-color:#0a2c79; }
html[data-skin=modern][data-app=public] .hero .in > div:first-child :is(p,span,li,dt,dd,b,strong){ color:#fff; }
html[data-skin=modern][data-app=public] .hero .in > div:first-child a:not(.btn){ color:#fff; text-decoration:underline; }
html[data-skin=modern][data-app=public] .hero h1{ color:#fff; font-weight:700; }
html[data-skin=modern][data-app=public] .hero h1 em{ color:#ffd8cc; }
html[data-skin=modern][data-app=public] .hero .btn-pri, html[data-skin=modern][data-app=public] .band.final .btn-pri{ background:#fff; color:#0049e8; border-color:#fff; }
html[data-skin=modern][data-app=public] .hero .btn-pri:hover{ background:#eef3ff; }
html[data-skin=modern][data-app=public] .hero .btn-sec{ color:#fff; border-color:#fff; }
html[data-skin=modern][data-app=public] .hero .offer-badge .ob-tag{ background:#fff; color:#0049e8; }
html[data-skin=modern][data-app=public] .btn{ border-radius:12px; font-weight:700; }
html[data-skin=modern][data-app=public] .hero .offer-badge .ob-tag{ background:#fff!important; color:#0049e8!important; }
html[data-skin=modern][data-app=public] .hero .offer-badge{ background:rgba(0,0,0,.18); border-color:rgba(255,255,255,.5); }
/* "From free account to certified": the four steps in one row, the signed-in box underneath */
html[data-skin=modern][data-app=public] .buy-grid{ grid-template-columns:1fr; gap:16px; }
html[data-skin=modern][data-app=public] .buy-grid .steps{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
html[data-skin=modern][data-app=public] .buy-grid .steps > li{ padding:18px; }
html[data-skin=modern][data-app=public] .buy-grid .steps h3{ font-size:20px; line-height:1.3; }
html[data-skin=modern][data-app=public] .buy-grid .steps p{ font-size:16px; line-height:1.6; }
html[data-skin=modern][data-app=public] .buy-grid .aside{ display:flex; align-items:center; gap:12px 24px; flex-wrap:wrap; padding:18px 22px; }
html[data-skin=modern][data-app=public] .buy-grid .aside h3{ margin:0; }
html[data-skin=modern][data-app=public] .buy-grid .aside > p{ flex:1 1 280px; margin:0; }
html[data-skin=modern][data-app=public] .buy-grid .aside .btn-block{ width:auto; flex:0 0 auto; padding-inline:24px; }
@media (max-width:1100px){ html[data-skin=modern][data-app=public] .buy-grid .steps{ grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:620px){ html[data-skin=modern][data-app=public] .buy-grid .steps{ grid-template-columns:1fr; } }
/* the step number sits above its heading in the four-column row (it was drawn over the text) */
html[data-skin=modern][data-app=public] .buy-grid .steps > li{ padding:18px; display:flex; flex-direction:column; align-items:flex-start; gap:6px; }
html[data-skin=modern][data-app=public] .buy-grid .steps > li::before{ position:static; margin:0 0 6px; flex:none; }
html[data-skin=modern][data-app=public] .buy-grid .steps h3{ margin:0; }
html[data-skin=modern][data-app=public] .buy-grid .steps .done{ margin:6px 0 0; display:inline-block; }

/* ============================================================
   11. phone widths: nothing may widen the page (WCAG 1.4.10)
   ============================================================ */
/* tables scroll inside their own box (the wrapper is added by the page script) */
html[data-skin=modern] .mo-tscroll{ max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }
html[data-skin=modern] .mo-tscroll:focus-visible{ outline:3px solid var(--mo-primary); outline-offset:2px; }
/* a screen-reader-only table still sizes to its content: move it off the left edge, which never adds scroll */
html[data-skin=modern] table.sr-only{ left:-10000px; top:auto; }
html[data-skin=modern] code{ overflow-wrap:anywhere; }
/* one-column grids must let a wide child shrink (its table then scrolls in its own box) */
html[data-skin=modern] .p2two > *, html[data-skin=modern] .cpw .grid > *, html[data-skin=modern] .drow > *{ min-width:0; }
@media (max-width:860px){
  html[data-skin=modern][data-app=staff] .topbar > div{ flex-wrap:wrap; }
  /* the page title gets the full width; its buttons and tabs go on the row below */
  html[data-skin=modern][data-app=staff] .main > .topbar > :not(:first-child){ flex:1 1 100%; }
  html[data-skin=modern] .profitcard{ grid-template-columns:minmax(0,1fr); }
}
@media (max-width:480px){
  html[data-skin=modern] .month-grid{ grid-template-columns:repeat(3,minmax(0,1fr)); }
}
html[data-skin=modern] .tpw .grid{ width:100%; min-width:0; }
html[data-skin=modern] .tpw .grid > *{ min-width:0; }
@media (max-width:400px){ html[data-skin=modern] .rep-bars{ gap:2px !important; } }
/* portal on a phone: a slim bar with the logo and a Menu button; the menu opens below it with labels */
html[data-skin=modern][data-app=portal] .side-menu{ display:none; }
@media (max-width:860px){
  html[data-skin=modern][data-app=portal] .side{ flex-direction:row; flex-wrap:wrap; align-items:center; justify-content:space-between; padding:8px 14px; gap:8px; }
  html[data-skin=modern][data-app=portal] .side-hd{ padding:0; width:auto; justify-content:flex-start; }
  html[data-skin=modern][data-app=portal] .side-hd > div:last-child{ display:flex!important; }
  html[data-skin=modern][data-app=portal] .side-hd > div:last-child span:first-child{ font-size:17px!important; color:var(--mo-t1)!important; }
  html[data-skin=modern][data-app=portal] .side-hd > div:last-child span:last-child{ font-size:12px!important; color:var(--mo-t3)!important; }
  html[data-skin=modern][data-app=portal] .pd-brand{ display:none; }
  html[data-skin=modern][data-app=portal] .side-menu{ display:inline-flex; align-items:center; gap:8px; min-height:44px; padding:0 16px; border:1px solid var(--mo-border-2); border-radius:12px; background:var(--mo-surface); color:var(--mo-t1); font:600 14px/1 var(--mo-font); cursor:pointer; }
  html[data-skin=modern][data-app=portal] .side-menu:focus-visible{ outline:3px solid var(--mo-primary); outline-offset:2px; }
  html[data-skin=modern][data-app=portal] .side-menu[aria-expanded=true]{ background:var(--mo-primary-tint); border-color:var(--mo-primary); color:var(--mo-primary); }
  html[data-skin=modern][data-app=portal] .side:not(.mo-open) :is(.side-nav,.side-out){ display:none!important; }
  html[data-skin=modern][data-app=portal] .side.mo-open .side-nav{ flex:1 1 100%; display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:6px; padding:6px 0 4px; overflow:visible; }
  html[data-skin=modern][data-app=portal] .side.mo-open :is(.nav-grp,.nav-grp + .nav-grp){ display:contents; }
  html[data-skin=modern][data-app=portal] .side.mo-open .nav-i{ width:auto; height:auto; min-height:44px; justify-content:flex-start; gap:10px; padding:8px 12px; }
  html[data-skin=modern][data-app=portal] .side.mo-open .nav-i > span:not(.nav-pill):not(.nav-deal):not(.nav-new){ position:static; width:auto; height:auto; overflow:visible; clip:auto; white-space:normal; }
  html[data-skin=modern][data-app=portal] .side.mo-open :is(.nav-pill,.nav-deal,.nav-new){ position:static; margin-left:auto; box-shadow:none; }
  html[data-skin=modern][data-app=portal] .side.mo-open .side-out{ flex:1 1 100%; display:flex; margin:0 0 6px; border-top:1px solid var(--mo-border); border-radius:0; padding-top:12px; }
}
/* plans.php: its hero is a plain .hero (no .band), so it takes the same brand gradient as the courses page;
   without it the white heading above sat on a near-white background */
html[data-skin=modern][data-app=public] div.hero:not(.band){ background:var(--mo-hero); background-color:#0a2c79; border-bottom:0; }
html[data-skin=modern][data-app=public] div.hero:not(.band) p{ color:#fff; }
html[data-skin=modern][data-app=public] div.hero:not(.band) .trust span{ background:rgba(255,255,255,.14); border-color:rgba(255,255,255,.55); color:#fff; }

/* the logo at the top of the menu goes to the dashboard (staff and portal) */
html[data-skin=modern] a.sb-logo{ text-decoration:none; color:inherit; }
html[data-skin=modern] a.sb-logo:focus-visible, html[data-skin=modern][data-app=portal] a.side-hd:focus-visible{ outline:3px solid var(--mo-primary); outline-offset:3px; border-radius:14px; }

/* ───────── courses page: one course per row (approved 2026-10-05) ─────────
   number badge (colour by level) | level, title, summary | at-a-glance panel | price and button;
   "View curriculum" runs across the bottom of the row */
html[data-skin=modern][data-app=public] #curriculum .wrap{ display:flex; flex-direction:column; gap:16px; }
html[data-skin=modern][data-app=public] #curriculum .course{ padding:0; gap:0; overflow:hidden; border-left:5px solid var(--lv,#0049e8); }
html[data-skin=modern][data-app=public] div.course[data-level=beginner]{ --lv:#0e8a50; --lvt:#e7f6ee; --lvi:#0b6b3d; }
html[data-skin=modern][data-app=public] div.course[data-level=intermediate]{ --lv:#0049e8; --lvt:#eef3ff; --lvi:#003cc0; }
html[data-skin=modern][data-app=public] div.course[data-level=advanced]{ --lv:#6d5ce8; --lvt:#f1efff; --lvi:#4630c9; }
html[data-skin=modern][data-app=public] #curriculum .course-head{ display:grid; grid-template-columns:56px minmax(0,1fr) minmax(280px,340px) 190px; align-items:center; gap:22px; padding:22px 24px; flex-direction:initial; }
html[data-skin=modern][data-app=public] .c-num{ width:56px; height:56px; border-radius:16px; display:grid; place-items:center; background:var(--lvt,#eef3ff); color:var(--lvi,#003cc0); font-weight:800; font-size:20px; letter-spacing:-.3px; }
html[data-skin=modern][data-app=public] #curriculum .level{ color:var(--lvi,#003cc0); }
html[data-skin=modern][data-app=public] #curriculum .course-head h3{ font-size:22px; margin:2px 0 0; }
html[data-skin=modern][data-app=public] #curriculum .course-head p{ max-width:none; }
html[data-skin=modern][data-app=public] #curriculum .facts{ display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:0; padding:12px; border-radius:14px; background:var(--mo-surface-2); border:1px solid var(--mo-border); }
html[data-skin=modern][data-app=public] #curriculum .fact{ white-space:nowrap; background:none; border:0; padding:4px 2px; border-radius:0; font-size:14.5px; font-weight:600; color:var(--mo-t1); }
html[data-skin=modern][data-app=public] #curriculum .fact .ic{ color:var(--lvi,#003cc0); }
html[data-skin=modern][data-app=public] .c-buy{ display:flex; flex-direction:column; align-items:stretch; gap:6px; text-align:center; }
html[data-skin=modern][data-app=public] .c-price{ margin:0; display:flex; align-items:baseline; justify-content:center; gap:5px; }
html[data-skin=modern][data-app=public] .c-price b{ font-size:26px; font-weight:800; letter-spacing:-.5px; color:var(--mo-t1); }
html[data-skin=modern][data-app=public] .c-price span{ font-size:14.5px; color:var(--mo-t2); }
html[data-skin=modern][data-app=public] .c-free{ margin:0; font-size:14.5px; font-weight:600; color:#0b6b3d; }
html[data-skin=modern][data-app=public] .c-cta{ justify-content:center; margin-top:4px; }
html[data-skin=modern][data-app=public] #curriculum .mods-wrap{ border-top:1px solid var(--mo-border); }
html[data-skin=modern][data-app=public] #curriculum .mods-wrap > summary{ border-radius:0; background:var(--mo-surface-2); color:var(--mo-primary); padding:13px 24px; }
html[data-skin=modern][data-app=public] #curriculum .mods-wrap > summary:hover{ background:var(--mo-primary-tint); }
html[data-skin=modern][data-app=public] #curriculum .mods-wrap > summary:focus-visible{ outline-offset:-3px; }
/* one module per row; an open module spreads its lessons across the full width */
html[data-skin=modern][data-app=public] #curriculum .mods-wrap .mods{ margin:0; padding:14px 24px 20px; display:flex; flex-direction:column; gap:10px; }
html[data-skin=modern][data-app=public] #curriculum .mod-body{ padding:4px 22px 20px 70px; }
html[data-skin=modern][data-app=public] #curriculum .mod-body > p{ max-width:none; }
html[data-skin=modern][data-app=public] #curriculum ol.lessons{ columns:4 230px; column-gap:28px; }
html[data-skin=modern][data-app=public] #curriculum ol.lessons li{ font-size:16px; }
@media (max-width:1100px){
  html[data-skin=modern][data-app=public] #curriculum .course-head{ grid-template-columns:56px minmax(0,1fr); }
  html[data-skin=modern][data-app=public] #curriculum .facts{ grid-column:2; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); }
  html[data-skin=modern][data-app=public] .c-buy{ grid-column:2; flex-direction:row; flex-wrap:wrap; align-items:center; text-align:left; gap:10px 16px; }
  html[data-skin=modern][data-app=public] .c-cta{ margin:0 0 0 auto; }
}
@media (max-width:600px){
  html[data-skin=modern][data-app=public] #curriculum .course-head{ grid-template-columns:1fr; padding:18px; gap:14px; }
  html[data-skin=modern][data-app=public] .c-num{ width:44px; height:44px; font-size:16px; border-radius:12px; }
  html[data-skin=modern][data-app=public] #curriculum .facts, html[data-skin=modern][data-app=public] .c-buy{ grid-column:1; }
  html[data-skin=modern][data-app=public] #curriculum .facts{ grid-template-columns:1fr 1fr; }
  html[data-skin=modern][data-app=public] .c-cta{ margin:0; flex:1 1 100%; }
  html[data-skin=modern][data-app=public] #curriculum .mods-wrap > summary, html[data-skin=modern][data-app=public] #curriculum .mods-wrap .mods{ padding-left:18px; padding-right:18px; }
}
/* dark: the level tints become deep tones, inks light */
html[data-skin=modern][data-app=public][data-theme=dark] .course[data-level=beginner]{ --lvt:#123524; --lvi:#7ee2a0; }
html[data-skin=modern][data-app=public][data-theme=dark] .course[data-level=intermediate]{ --lvt:#16224a; --lvi:#a7bcff; }
html[data-skin=modern][data-app=public][data-theme=dark] .course[data-level=advanced]{ --lvt:#251f4f; --lvi:#c4b8ff; }
html[data-skin=modern][data-app=public][data-theme=dark] .c-free{ color:#7ee2a0; }
@media (prefers-color-scheme: dark){
  html[data-skin=modern][data-app=public]:not([data-theme=light]) .course[data-level=beginner]{ --lvt:#123524; --lvi:#7ee2a0; }
  html[data-skin=modern][data-app=public]:not([data-theme=light]) .course[data-level=intermediate]{ --lvt:#16224a; --lvi:#a7bcff; }
  html[data-skin=modern][data-app=public]:not([data-theme=light]) .course[data-level=advanced]{ --lvt:#251f4f; --lvi:#c4b8ff; }
  html[data-skin=modern][data-app=public]:not([data-theme=light]) .c-free{ color:#7ee2a0; }
}
@media (max-width:400px){ html[data-skin=modern][data-app=public] #curriculum .facts{ grid-template-columns:1fr; } }
@media (max-width:700px){ html[data-skin=modern][data-app=public] #curriculum .mod-body{ padding:4px 16px 18px; } }

/* ───────── 10. collapse / expand the rail (Rana, 2026-10-07) ─────────
   The rail is the default. A toggle at the top of the rail (the panel icon, as in ChatGPT)
   expands it to a labelled sidebar; the choice is kept per browser (localStorage "pms_sb")
   and applied before paint by a line of script in <head> (html.sb-x). Phones keep their own
   drawer or stacked bar, so the toggle is hidden there. */
.sb-x-btn{ display:inline-flex; align-items:center; justify-content:center; gap:10px; width:46px; height:46px; margin:4px auto 2px; padding:0; border:0; border-radius:13px;
  background:transparent; color:var(--mo-t2); cursor:pointer; font:600 14px/1.2 var(--mo-font, system-ui); flex:0 0 auto; }
.sb-x-btn:hover{ background:var(--mo-surface-3); color:var(--mo-t1); }
.sb-x-btn:focus-visible{ outline:3px solid var(--mo-primary); outline-offset:2px; }
.sb-x-btn svg{ width:21px; height:21px; flex:0 0 21px; }
.sb-x-btn .sb-x-l{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
html.sb-x .sb-x-btn{ width:auto; justify-content:flex-start; margin:4px 12px 2px; padding:0 12px; align-self:stretch; }
html.sb-x .sb-x-btn .sb-x-l{ position:static; width:auto; height:auto; overflow:visible; clip:auto; }
@media (max-width:680px){ html[data-app=staff] .sb-x-btn{ display:none; } }
@media (max-width:860px){ html[data-app=portal] .sb-x-btn{ display:none; } }

/* staff and admins: the rail opens to the labelled sidebar */
@media (min-width:681px){
  html[data-skin=modern][data-app=staff].sb-x .sb{ width:250px; align-items:stretch; }
  html[data-skin=modern][data-app=staff].sb-x .sb-logo{ justify-content:flex-start; padding-left:16px; gap:12px; }
  html[data-skin=modern][data-app=staff].sb-x .sb-logo > :not(.sb-mark){ display:block; }
  html[data-skin=modern][data-app=staff].sb-x .sb-logo .sb-t{ font-size:16px; font-weight:800; color:var(--mo-t1); }
  html[data-skin=modern][data-app=staff].sb-x .sb-logo .sb-s{ font-size:11.5px; color:var(--mo-t3); }
  html[data-skin=modern][data-app=staff].sb-x .ns{ font-size:11px; height:auto; background:none; margin:12px 20px 4px; color:var(--mo-t3); letter-spacing:.08em; text-transform:uppercase; font-weight:700; }
  html[data-skin=modern][data-app=staff].sb-x .nl{ width:auto; height:auto; margin:2px 12px; padding:10px 12px; justify-content:flex-start; gap:12px; }
  html[data-skin=modern][data-app=staff].sb-x .nl-t{ position:static; width:auto; height:auto; overflow:visible; clip:auto; }
  html[data-skin=modern][data-app=staff].sb-x .nl .bdg,
  html[data-skin=modern][data-app=staff].sb-x .nl [class*=badge]{ position:static; margin-left:auto; font-size:11px; padding:2px 7px; }
}

/* Admin menu groups (Rana, 2026-10-13). Labelled sidebar and phone drawer: a bold heading with a
   chevron, its pages under it with a small ring and no icon. Icon rail: the heading is its icon,
   and an open group shows its pages as icons below it, each with the usual tooltip. */
html[data-skin=modern][data-app=staff] .ng-h{ font-weight:700; }
html[data-skin=modern][data-app=staff] .ng-h.ng-on:not(:hover){ color:var(--mo-primary); }
html[data-skin=modern][data-app=staff] .ng-b .nl{ font-weight:500; color:var(--mo-t2); }
html[data-skin=modern][data-app=staff] .ng-b .nl.active{ color:var(--mo-on-primary); font-weight:600; }
@media (min-width:681px){
  /* Icon rail (Rana, 2026-10-21): an open group is a menu beside the rail, its name on top and its pages
     listed with their labels; one open at a time, placed by the script in index.php (--fly-y). */
  html[data-skin=modern][data-app=staff]:not(.sb-x) .ng-c{ display:none; }
  /* the rail's backdrop-filter would make it the menu's containing block, and the rail clips (overflow:hidden) */
  html[data-skin=modern][data-app=staff]:not(.sb-x) .sb:has(.ng[open]){ -webkit-backdrop-filter:none; backdrop-filter:none; z-index:640; }
  html[data-skin=modern][data-app=staff]:not(.sb-x) .ng[open] > summary{ background:var(--mo-surface-3); color:var(--mo-t1); }
  html[data-skin=modern][data-app=staff]:not(.sb-x) .ng[open] > .ng-b{
    position:fixed; z-index:650; left:84px; top:var(--fly-y,80px); width:max-content; min-width:230px; max-width:300px;
    max-height:calc(100vh - 24px); overflow-y:auto; padding:14px 8px 8px; border-radius:16px;
    background:var(--mo-surface); border:1px solid var(--mo-border); box-shadow:0 22px 48px -14px rgba(10,16,40,.38);
  }
  html[data-skin=modern][data-app=staff]:not(.sb-x) .ng-b::before{
    content:attr(data-label); display:block; margin:0 12px 8px; font-size:11.5px; font-weight:700;
    letter-spacing:.09em; text-transform:uppercase; color:var(--mo-t3);
  }
  html[data-skin=modern][data-app=staff]:not(.sb-x) .ng-b .nl{ width:auto; height:auto; margin:1px 0; padding:9px 12px; justify-content:flex-start; gap:14px; }
  html[data-skin=modern][data-app=staff]:not(.sb-x) .ng-b .nl-t{ position:static; width:auto; height:auto; overflow:visible; clip:auto; white-space:nowrap; }
  html[data-skin=modern][data-app=staff]:not(.sb-x) .ng-b .nl .bdg,
  html[data-skin=modern][data-app=staff]:not(.sb-x) .ng-b .nl [class*=badge]{ position:static; margin-left:auto; font-size:11px; padding:2px 7px; }
  html[data-skin=modern][data-app=staff].sb-x .ng-b .nl{ padding-left:33px; gap:14px; }
}
@media (max-width:680px){
  html[data-skin=modern][data-app=staff] .ng-b .nl{ padding-left:33px; gap:14px; }
}
/* clients: the same */
@media (min-width:861px){
  html[data-skin=modern][data-app=portal].sb-x .side{ width:268px; flex:0 0 268px; align-items:stretch; }
  html[data-skin=modern][data-app=portal].sb-x .side-hd{ padding:18px 20px 10px; justify-content:flex-start; }
  html[data-skin=modern][data-app=portal].sb-x .side-hd > div:last-child{ display:flex!important; }
  html[data-skin=modern][data-app=portal].sb-x .side-hd > div:last-child span:first-child{ font-size:17px!important; color:var(--mo-t1)!important; }
  html[data-skin=modern][data-app=portal].sb-x .side-hd > div:last-child span:last-child{ font-size:12px!important; color:var(--mo-t3)!important; }
  html[data-skin=modern][data-app=portal].sb-x .side-nav{ align-items:stretch; padding:8px 12px; }
  html[data-skin=modern][data-app=portal].sb-x .nav-grp{ align-items:stretch; }
  html[data-skin=modern][data-app=portal].sb-x .nav-grp + .nav-grp{ margin:0; padding-top:10px; width:auto; }
  html[data-skin=modern][data-app=portal].sb-x .nav-lbl{ display:block; margin:6px 10px 2px; color:var(--mo-t3); }
  html[data-skin=modern][data-app=portal].sb-x .nav-i{ width:auto; height:auto; min-height:44px; padding:9px 12px; gap:10px; justify-content:flex-start; }
  html[data-skin=modern][data-app=portal].sb-x .nav-i > span:not(.nav-pill):not(.nav-deal):not(.nav-new){ position:static; width:auto; height:auto; overflow:visible; clip:auto; white-space:normal; }
  html[data-skin=modern][data-app=portal].sb-x :is(.nav-pill,.nav-deal,.nav-new){ position:static; margin-left:auto; box-shadow:none; font-size:11px; padding:2px 7px; }
  html[data-skin=modern][data-app=portal].sb-x .side-out{ margin:8px 12px 14px; }
}

/* Unpaid invoices: three boxes with audit health below, in one card (replaced the quick-action tiles) */
.md-unpaid .md-head{ margin-bottom:10px; }
.md-up3{ display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.md-up{ display:flex; flex-direction:column; gap:2px; min-width:0; text-align:left; padding:10px 12px; border-radius:12px; border:1px solid var(--mo-border); background:var(--mo-surface-2); text-decoration:none; color:var(--mo-t1); }
.md-up:hover{ border-color:var(--mo-border-2); }
.md-up span{ font-size:12.5px; color:var(--mo-t2); } .md-up b{ font-size:19px; letter-spacing:-.3px; overflow-wrap:anywhere; } .md-up i{ font-style:normal; font-size:12px; color:var(--mo-t2); }
.md-up-all{ border-top:3px solid var(--mo-primary); }
.md-up-over{ border-top:3px solid #dc2626; } .md-up-over b{ color:#b42318; }
.md-up-soon{ border-top:3px solid #d97706; }
html[data-theme=dark] .md-up-over b{ color:#fca5a5; }
.md-unpaid .md-sub{ margin:16px 0 8px; padding-top:14px; border-top:1px solid var(--mo-border); text-align:left; }
@media (max-width:420px){ .md-up3{ grid-template-columns:1fr; } }

/* Revenue and Unpaid invoices amounts: hidden until clicked (Show amounts) */
.md-eye{ display:inline-flex; align-items:center; gap:6px; min-height:32px; padding:4px 12px; margin-left:auto; border:1px solid var(--mo-border); border-radius:999px; background:var(--mo-surface-2); color:var(--mo-t2); font:inherit; font-size:13px; font-weight:600; cursor:pointer; }
.md-eye:hover{ color:var(--mo-t1); border-color:var(--mo-border-2); }
.md-eye[aria-pressed=true]{ color:var(--mo-primary); }
.md-rev .md-head .md-eye{ margin-left:12px; margin-right:auto; }
.md-amt{ cursor:pointer; letter-spacing:1px; }
.md-amt.md-amt-on{ cursor:inherit; letter-spacing:normal; }
.md-unpaid .md-head{ gap:10px; }
.md-unpaid .md-head .md-eye{ margin-left:auto; }
