/* ============================================================================
   PICT — modern shell.
   Loaded after app.css, which keeps the data-dense table and form styling that
   the screens depend on. This layer changes the frame around them: the palette,
   the floating sidebar and header, and the way surfaces catch light.

   Sober rather than loud. The gradients are a few degrees of hue across a long
   distance, not a colour wheel — on a screen somebody reads all day, contrast
   belongs to the numbers, not the furniture.
   ========================================================================= */

:root {
  /* A cooler, deeper ink than the original slate, and a page that is very
     slightly blue so white cards read as lit rather than cut out. */
  --bg:        #eef2f7;
  --surface:   #ffffff;
  --surface-2: #f6f8fb;
  --ink:       #101a26;
  --ink-2:     #4a5c70;
  --ink-3:     #7e90a2;
  --line:      #dfe6ee;
  --line-2:    #edf1f6;

  --accent:    #1257a8;
  --accent-2:  #e9f1fb;
  --accent-3:  #c8ddf5;

  /* The one gradient the whole app is built from. Everything branded uses it,
     so the screen holds together instead of looking assembled. */
  --grad:      linear-gradient(135deg, #0e4f9e 0%, #1565c0 46%, #1b7fd4 100%);
  --grad-soft: linear-gradient(135deg, #f4f8fd 0%, #eaf1fa 100%);
  --grad-rail: linear-gradient(180deg, #ffffff 0%, #fbfcfe 55%, #f5f8fc 100%);

  --radius:    10px;
  --radius-lg: 16px;

  /* Layered rather than single shadows: a tight contact shadow plus a wide
     soft one is what makes a floating panel read as floating. */
  --shadow:    0 1px 2px rgba(16,26,38,.05), 0 2px 8px rgba(16,26,38,.05);
  --shadow-md: 0 2px 6px rgba(16,26,38,.07), 0 10px 28px rgba(16,26,38,.08);
  --shadow-lg: 0 10px 40px rgba(16,26,38,.18);

  --rail-w:    216px;
  --rail-mini: 68px;
  --gap:       12px;
}

body {
  /* Two very faint washes, fixed so they do not travel with the content. */
  background:
    radial-gradient(1100px 620px at 12% -8%, #ffffff 0%, rgba(255,255,255,0) 60%),
    radial-gradient(900px 540px at 92% 4%, #e6eefb 0%, rgba(230,238,251,0) 62%),
    var(--bg);
  background-attachment: fixed;
}

/* ---------- shell: everything floats on the page ---------- */

/*
 * The column is sized by the sidebar, not the other way round.
 *
 * Transitioning grid-template-columns re-runs grid layout on the whole shell
 * every frame while the content inside the sidebar is also reflowing, and the
 * result stutters. Letting the track be `auto` and animating the sidebar's own
 * width moves one box instead, and the grid follows it for free.
 */
/*
 * The sidebar floats; it is not a grid track.
 *
 * While the sidebar was a track, every frame of the collapse resized the
 * content column, and the browser re-laid out the whole screen behind it —
 * tables, charts and all. That is what the stutter was: not the animation but
 * the layout work underneath it, and it got worse the more was on screen.
 *
 * Now the sidebar is positioned over the page and only its own width animates,
 * which is cheap and confined. The content's offset snaps once, at the start,
 * so the page is laid out exactly one time per collapse instead of once per
 * frame. `contain` keeps the sidebar's internal reflow from reaching the rest.
 */
.app {
  display: block;
  position: relative;
  max-width: 100%;
  overflow: hidden;
  padding: var(--gap);
}

/* The sidebar is a card, not a wall: it stops short of every edge, so the
   page shows around it and it reads as sitting above the surface. */
.sidebar {
  position: absolute;
  left: var(--gap); top: var(--gap); bottom: var(--gap);
  width: var(--rail-w);
  z-index: 15;
  /* layout only: `paint` containment clips everything outside the box, which
     cropped the collapse button sitting on the edge. */
  contain: layout;
  transition: width .24s cubic-bezier(.4, 0, .2, 1);
  background: var(--grad-rail);
  border: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;                  /* the fixed-width inner layers are clipped to the rail */
}

/* The nav itself scrolls; the brand and the user stay put. */
/* min-height:0 lets the nav actually scroll inside a flex column instead of
   pushing the user box off the bottom. */
.sidebar { min-height: 0; }
.sidebar .nav { overflow-y: auto; overflow-x: hidden; min-height: 0; }

.brand {
  border-bottom: 1px solid var(--line-2);
  padding: 15px 16px 13px;
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,0));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.brand span {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

.nav-group > h2 { padding: 13px 16px 5px; }

.nav a {
  position: relative;
  margin: 1px 9px;
  padding: 7px 11px;
  border-left: none;                 /* replaced by the pill below */
  border-radius: 8px;
  transition: background .13s, color .13s;
}
.nav a:hover { background: rgba(18, 87, 168, .07); color: var(--ink); }
.nav a.active {
  background: var(--grad);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(18, 87, 168, .30);
}
.nav a.active .ic { opacity: 1; }
.nav a .ic { font-size: 13px; }

.who {
  border-top: 1px solid var(--line-2);
  background: transparent;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.who .av { background: var(--grad); box-shadow: 0 2px 8px rgba(18,87,168,.28); }

/* ---------- the collapse button, centred on the sidebar's edge ---------- */

.railtoggle,
.sidebar .railtoggle {
  position: absolute;
  top: 50%;
  right: -13px;
  transform: translateY(-50%);
  width: 26px; height: 26px;
  display: grid; place-items: center;
  padding: 0;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  cursor: pointer;
  z-index: 25;
  transition: background .15s, color .15s, border-color .15s, transform .22s cubic-bezier(.4,0,.2,1);
}
.railtoggle:hover,
.sidebar .railtoggle:hover {
  background: var(--grad); color: #fff; border-color: transparent;
}
.railtoggle svg { width: 13px; height: 13px; display: block; }
.railtoggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- collapsed: a rail of icons, not a hidden sidebar ---------- */

.app.nav-collapsed .sidebar { width: var(--rail-mini); }
.app.nav-collapsed .sidebar { display: flex; }

/*
 * The inside of the sidebar never changes size; only the sidebar does.
 *
 * `display: none` on the labels was the original jerk — every row jumped to a
 * new width in one frame. Animating max-width and height instead was smoother
 * to look at but no cheaper: both are layout properties, so the whole menu was
 * being laid out again on every frame of the collapse.
 *
 * So the three inner blocks keep a fixed width and the sidebar simply clips
 * them. Nothing inside reflows at all; the labels only fade, which the
 * compositor can do without involving layout. The icons stay at the same x in
 * both states, which is also why the rail does not appear to shuffle.
 */
.brand, .nav, .who {
  width: var(--rail-w);
  overflow-x: hidden;
}

.nav a .lbl, .brand span, .who .txt {
  white-space: nowrap;
  transition: opacity .15s ease;
  opacity: 1;
}
.app.nav-collapsed .nav a .lbl,
.app.nav-collapsed .brand span,
.app.nav-collapsed .who .txt { opacity: 0; }

.nav-group > h2 { white-space: nowrap; transition: opacity .15s ease; opacity: 1; }
.app.nav-collapsed .nav-group > h2 { opacity: 0; }

/* Deliberately no re-centring, no padding change and no font change on the
   collapsed rail: each of those is a layout property, and changing them is
   what made the menu reflow mid-animation. The icons keep their place. */
.app.nav-collapsed .nav a .ic { opacity: 1; }
.app.nav-collapsed .railtoggle { transform: translateY(-50%) rotate(180deg); }

/* The label a collapsed icon shows on hover, so the rail stays usable. */
.app.nav-collapsed .nav a::after {
  content: attr(data-label);
  position: absolute; left: calc(100% + 14px); top: 50%;
  transform: translateY(-50%);
  background: #16202c; color: #fff;
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
  padding: 5px 9px; border-radius: 7px;
  box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none;
  transition: opacity .12s;
  z-index: 60;
}
.app.nav-collapsed .nav a:hover::after,
.app.nav-collapsed .nav a:focus-visible::after { opacity: 1; }

/* ---------- the header floats too ---------- */

/* The main column must still clip, or .content cannot scroll inside it and the
   whole page grows instead — which is exactly what happened when this was set
   to visible for the sake of the collapse button. The button escapes the
   sidebar, not this, so only the sidebar needs to overflow. */
/* The main column must still clip, or .content cannot scroll inside it and the
   whole page grows instead. min-width:0 matters just as much: a grid item
   defaults to min-width:auto, so a single wide table stretches the column past
   the viewport and the entire shell scrolls sideways, taking the sidebar with
   it. Both axes have to be pinned for the content to scroll inside its own box. */
/*
 * No transition on the offset. It snaps to its final place as the collapse
 * begins and the sidebar slides over the gap it leaves, so the expensive part
 * of the layout happens once rather than on every frame.
 */
.main {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  height: 100%;
  margin-left: calc(var(--rail-w) + var(--gap));
  overflow: hidden;
  min-height: 0;
  min-width: 0;
  background: transparent;
}
.app.nav-collapsed .main { margin-left: calc(var(--rail-mini) + var(--gap)); }

.topbar {
  flex: 0 0 auto;
  height: 54px;
  border: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(165%) blur(14px);
  -webkit-backdrop-filter: saturate(165%) blur(14px);
  padding: 0 14px;
  position: relative;
  z-index: 20;
}
.topbar h2 {
  font-size: 15.5px; font-weight: 680; letter-spacing: -.1px;
}

/* A hairline of the brand gradient along the top of the header. */
.topbar::before {
  content: ''; position: absolute; left: 16px; right: 16px; top: 0; height: 2px;
  background: var(--grad); opacity: .85;
  border-radius: 0 0 2px 2px;
}

.progress { top: auto; bottom: 0; left: 16px; right: 16px; width: auto; border-radius: 2px; }
.progress.on { width: auto; }

/* The scrolling area is its own rounded surface. */
.content {
  min-width: 0;
  border-radius: var(--radius-lg);
  padding: 4px 2px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

/* ---------- surfaces inside the page ---------- */

.card {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-color: var(--line);
  transition: box-shadow .16s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card > header {
  background: var(--grad-soft);
  border-radius: var(--radius) var(--radius) 0 0;
}

.kpi {
  border-radius: var(--radius);
  background: linear-gradient(170deg, #ffffff 0%, var(--surface-2) 100%);
}

button { border-radius: 8px; }
/* The gradient is for buttons that DO something, not for the chrome. The
   exclusions matter: this selector outranks `.density button` and `.railtoggle`
   on specificity, so without them every segment of the size control rendered as
   though it were the selected one, and the collapse button became a solid blob. */
button:not(.ghost):not(.link):not(.danger):not(.x):not(.navtoggle):not(.railtoggle):not(.density button) {
  background: var(--grad);
  box-shadow: 0 1px 3px rgba(18,87,168,.26);
}
button:not(.ghost):not(.link):not(.danger):not(.x):not(.navtoggle):not(.railtoggle):not(.density button):hover {
  filter: brightness(1.07); background: var(--grad);
}

/* Size control: a segmented control, where only the chosen one is filled. */
.density { border-radius: 8px; border-color: var(--line); }
.density button,
.density button:hover { background: transparent; box-shadow: none; }
.density button:hover { color: var(--accent); background: var(--accent-2); }
.density button[aria-pressed="true"] { background: var(--grad); color: #fff; }

/* The hamburger is chrome too: an outline, not a filled block. */
.navtoggle { background: var(--surface); box-shadow: none; border-radius: 8px; }
.navtoggle:hover { background: var(--surface-2); }
a.btnlink:not(.ghost) { background: var(--grad); border-radius: 8px; }
a.btnlink:not(.ghost):hover { filter: brightness(1.07); background: var(--grad); }
button.ghost { border-radius: 8px; }

select, input[type=text], input[type=date], input[type=number],
input[type=search], input[type=password], input[type=email], textarea {
  border-radius: 8px;
}

/* A clickable row should say so before it is clicked. */
tbody tr[tabindex]:hover, tbody tr.clickable:hover { background: rgba(18, 87, 168, .055); }

.drawer { border-radius: var(--radius-lg) 0 0 var(--radius-lg); box-shadow: var(--shadow-lg); }
.drawer > header { background: var(--grad-soft); }

/* ---------- narrow screens: the sidebar becomes an overlay again ---------- */

@media (max-width: 900px) {
  .app { padding: 8px; gap: 8px; }
  .main { margin-left: 0; }
  .app.nav-collapsed .main { margin-left: 0; }
  /* app.css makes the sidebar a fixed off-canvas drawer here, but this file
     loads after it and the desktop rule above would otherwise win on source
     order and leave the drawer stuck inside the page. Restated so the phone
     layout keeps the behaviour app.css intends. */
  .sidebar, .app.nav-collapsed .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: min(280px, 82vw);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    contain: none;
  }
  .railtoggle { display: none; }          /* the hamburger does this job here */
  .sidebar { border-radius: 0 var(--radius-lg) var(--radius-lg) 0; }
  .app.nav-collapsed { grid-template-columns: 1fr; }
  
  .app.nav-collapsed .nav a .lbl,
  .app.nav-collapsed .brand span,
  .app.nav-collapsed .who .txt,
  .app.nav-collapsed .nav-group > h2 { opacity: 1; }
  .brand, .nav, .who { width: auto; }
  .app.nav-collapsed .nav a::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .app, .railtoggle, .card { transition: none !important; }
}

/* ============================================================================
   Mirror surfaces, scrollbars and scroll progress.
   ========================================================================= */

/* ---------- mirror / glass ----------
   A panel reads as glass when light falls across it rather than when it is
   simply transparent: a bright edge along the top, a faint sheen down the
   left, and a cooler body below. These are pseudo-elements so no markup
   changes and nothing becomes unclickable (pointer-events: none throughout). */

/* Only elements that are statically positioned need this. .drawer is already
   position:fixed and is therefore already a containing block — restating it
   as relative drops the panel out of its overlay and into the page flow,
   where it appears as a stray box below the content. */
/* .sidebar is absolutely positioned above and .drawer is fixed; both are
   already containing blocks, and restating `relative` here would undo that
   on source order. Only the statically positioned ones need it. */
.topbar, .card, .kpi { position: relative; }

.sidebar::before,
.topbar::after,
.drawer::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,.95) 0%, rgba(255,255,255,0) 42%),
    linear-gradient(100deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,0) 26%);
  mix-blend-mode: overlay;
  opacity: .9;
}

/* The highlight that makes an edge look like it catches light. */
.sidebar::after {
  content: '';
  position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg,
    rgba(255,255,255,0) 0%, rgba(255,255,255,.95) 18%,
    rgba(255,255,255,.95) 82%, rgba(255,255,255,0) 100%);
  border-radius: inherit;
  pointer-events: none;
}

/* Cards get a quieter version — on a screen full of them, a strong sheen on
   every one would be noise rather than finish. */
.card::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(170deg, rgba(255,255,255,.7) 0%, rgba(255,255,255,0) 32%);
  mix-blend-mode: overlay;
}
.card > * { position: relative; }      /* keep content above the sheen */

.kpi::after {
  content: '';
  position: absolute; left: 0; top: 0; width: 100%; height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.9), rgba(255,255,255,0));
  pointer-events: none;
}

/* ---------- scrollbars ---------- */

/*
 * Deliberately NOT `scrollbar-width`.
 *
 * In current Chromium, setting scrollbar-width makes the browser draw its own
 * scrollbar and ignore every ::-webkit-scrollbar rule on the page. The custom
 * bar below simply never appeared — what showed instead was the default thin
 * one, which on a near-white background is close to invisible. So the standard
 * property is given only to engines that have no ::-webkit-scrollbar at all
 * (Firefox), and Chromium gets the real thing.
 */
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: #9fb2c6 transparent; }
}

*::-webkit-scrollbar { width: 14px; height: 14px; }

/* A track that is actually visible: without one the thumb floats on nothing and
   the eye cannot tell where the bar starts or how long it is. */
*::-webkit-scrollbar-track {
  background: rgba(16, 26, 38, .045);
  border-radius: 99px;
  margin: 4px 0;
}
*::-webkit-scrollbar-corner { background: transparent; }

/* A mid-tone that reads on both white cards and the pale page. The earlier
   thumb was #b4c3d4 on #eef2f7 - about 1.5:1 contrast, which is invisible. */
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #7f95ad 0%, #5f7893 100%);
  border-radius: 99px;
  border: 3px solid transparent;       /* leaves an 8px thumb inside the 14px gutter */
  background-clip: padding-box;
  min-height: 48px;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--grad);
  background-clip: padding-box;
  border-width: 2px;                   /* grows under the pointer: easier to grab */
}
*::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, #0c4a95 0%, #1565c0 100%);
  background-clip: padding-box;
  border-width: 2px;
}

/* While something is scrolling, its bar lights up in the brand gradient, so
   scrolling gives feedback even when the pointer is nowhere near the bar. */
.is-scrolling::-webkit-scrollbar-thumb {
  background: var(--grad);
  background-clip: padding-box;
}

/* ---------- scroll progress ----------
   A hairline across the bottom of the header that fills as the page is read.
   Driven by a custom property the app sets while scrolling. */

.scrollprog {
  position: absolute; left: 16px; bottom: 0; height: 2px;
  width: calc((100% - 32px) * var(--scroll, 0));
  background: var(--grad);
  border-radius: 99px;
  pointer-events: none;
  opacity: calc(.25 + .75 * var(--scroll, 0));
  transition: width .08s linear, opacity .2s;
}
/* A moving highlight along the filled part, so it reads as live rather than
   as a static rule that happens to be short. */
.scrollprog::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg,
    rgba(255,255,255,0) 0%, rgba(255,255,255,.85) 50%, rgba(255,255,255,0) 100%);
  animation: sheen 2.4s ease-in-out infinite;
}
@keyframes sheen {
  0%   { transform: translateX(-100%); opacity: 0; }
  40%  { opacity: .9; }
  100% { transform: translateX(100%); opacity: 0; }
}

/* ---------- the loading bar, with movement ---------- */

.progress {
  background: var(--grad);
  box-shadow: 0 0 10px rgba(18,87,168,.45);
  overflow: hidden;
}
.progress.on::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg,
    rgba(255,255,255,0) 0%, rgba(255,255,255,.9) 50%, rgba(255,255,255,0) 100%);
  animation: sheen 1.1s linear infinite;
}

/* A skeleton shimmer for anything still loading. */
.spinner {
  position: relative;
  background: linear-gradient(90deg, var(--surface-2) 25%, #eef3f9 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius);
}
@keyframes shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .scrollprog::after, .progress.on::after, .spinner { animation: none; }
  .spinner { background: var(--surface-2); }
}


/* ---------- moving between screens ----------
   Routes are kept in the document and shown by toggling a class, so a short
   animation on the one being shown is all a transition needs — nothing is
   rebuilt, which is why it can afford to be quick. Short and slightly upward
   reads as the page arriving; anything longer starts to feel like waiting. */

.route.active { animation: routein .19s cubic-bezier(.22, 1, .36, 1); }
@keyframes routein {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: none; }
}

/* The drawer's contents arrive the same way, just after the panel itself. */
.drawer.open .dbody > * { animation: routein .22s cubic-bezier(.22, 1, .36, 1); }

/* Rows and cards settle rather than snap when a table is redrawn. */
.card { animation: cardin .22s cubic-bezier(.22, 1, .36, 1); }
@keyframes cardin {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .route.active, .card, .drawer.open .dbody > * { animation: none; }
  .sidebar, .nav a .lbl, .brand span, .who .txt, .nav-group > h2 { transition: none !important; }
}


/* ============================================================================
   Deep-navy chrome, taken from the logo.

   The wordmark is navy #002880 over cyan #0088c0, so that is the whole palette:
   a dark navy that runs toward the logo's blue, with the cyan used sparingly as
   the light. The chrome (sidebar and header) goes dark; the data surfaces stay
   light, because figures are read, not looked at, and dark tables tire the eye
   over a working day.
   ========================================================================= */

:root {
  --navy-0: #050f26;
  --navy-1: #081a40;
  --navy-2: #0b2a63;
  --navy-3: #0c3a82;
  --cyan:   #0088c0;
  --cyan-2: #22b3e8;
  --grad:   linear-gradient(135deg, #0a2f78 0%, #0a58aa 52%, #0088c0 100%);
  --chrome: linear-gradient(185deg, #050f26 0%, #081a40 38%, #0a2a63 100%);
  --on-dark:   #e6eefb;
  --on-dark-2: rgba(214, 228, 248, .72);
  --on-dark-3: rgba(170, 195, 230, .52);
  --edge-dark: rgba(255, 255, 255, .09);
}

/* The page behind the cards: a little deeper, so white surfaces lift off it. */
body {
  background:
    radial-gradient(1000px 560px at 8% -10%, rgba(0,136,192,.20) 0%, rgba(0,136,192,0) 62%),
    radial-gradient(900px 520px at 100% 0%, rgba(10,47,120,.16) 0%, rgba(10,47,120,0) 60%),
    linear-gradient(180deg, #d9e2ef 0%, #cfdae9 100%);
  background-attachment: fixed;
}

/* ---------- sidebar ---------- */
.sidebar {
  background: var(--chrome);
  border-color: var(--edge-dark);
  box-shadow: 0 14px 40px rgba(5, 15, 38, .38), 0 2px 8px rgba(5, 15, 38, .25);
}
.brand {
  background: transparent;
  border-bottom: 1px solid var(--edge-dark);
}
/* The logo has a pale ground, so it sits on a light plate rather than being
   recoloured: recolouring would lose the two-tone wave that makes it the logo. */
.brand .logo-mark {
  background: #f8f8f8;
  border-radius: 9px;
  box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 4px 14px rgba(0,0,0,.28);
  padding: 0;
}
.brand span {
  background: linear-gradient(90deg, #8fd6f5, #cfe6fb);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nav-group > h2 { color: var(--on-dark-3); }
.nav a { color: var(--on-dark-2); }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a.active {
  background: linear-gradient(135deg, #0b4fa6 0%, #0a7fc4 60%, #14a5dc 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,136,192,.45), 0 0 0 1px rgba(255,255,255,.14) inset;
}
.who { border-top: 1px solid var(--edge-dark); }
.who .nm { color: var(--on-dark); }
.who .rl { color: var(--on-dark-3); }
.who .av { background: linear-gradient(135deg, #0a58aa, #0088c0); box-shadow: 0 0 0 2px rgba(255,255,255,.16); }
.who button.ghost {
  background: rgba(255,255,255,.07); color: var(--on-dark);
  border-color: rgba(255,255,255,.16);
}
.who button.ghost:hover { background: rgba(255,255,255,.16); }

/* a scrollbar that suits a dark panel */
.sidebar *::-webkit-scrollbar-track { background: rgba(255,255,255,.05); }
.sidebar *::-webkit-scrollbar-thumb { background: rgba(190,214,245,.34); background-clip: padding-box; }
.sidebar *::-webkit-scrollbar-thumb:hover { background: var(--grad); background-clip: padding-box; }

/* ---------- collapse button ---------- */
.railtoggle, .sidebar .railtoggle {
  background: var(--navy-2); color: #fff;
  border: 1px solid rgba(255,255,255,.28);
  box-shadow: 0 2px 10px rgba(5,15,38,.45);
}
.railtoggle:hover, .sidebar .railtoggle:hover {
  background: linear-gradient(135deg, #0a58aa, #14a5dc); border-color: transparent;
}

/* ---------- header ---------- */
.topbar {
  background: linear-gradient(100deg, rgba(5,15,38,.94) 0%, rgba(8,26,64,.92) 50%, rgba(10,47,120,.90) 100%);
  border-color: var(--edge-dark);
  box-shadow: 0 10px 30px rgba(5,15,38,.30), 0 2px 6px rgba(5,15,38,.2);
}
.topbar::before { background: linear-gradient(90deg, #0a58aa, #22b3e8 60%, #0a58aa); opacity: 1; }
.topbar h2 { color: #fff; }
.topbar .meta { color: var(--on-dark-3); }
.topbar button.ghost {
  background: rgba(255,255,255,.08); color: var(--on-dark); border-color: rgba(255,255,255,.18);
}
.topbar button.ghost:hover { background: rgba(255,255,255,.17); }
.navtoggle { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); }
.navtoggle span { background: var(--on-dark); }
.navtoggle:hover { background: rgba(255,255,255,.16); border-color: var(--cyan-2); }
.navtoggle:hover span { background: #fff; }

.density { border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.05); }
.density button { color: var(--on-dark-2); border-right-color: rgba(255,255,255,.14); }
.density button:hover { color: #fff; background: rgba(255,255,255,.14); }
.density button[aria-pressed="true"] { background: linear-gradient(135deg, #0a58aa, #14a5dc); color: #fff; }

.scrollprog { background: linear-gradient(90deg, #22b3e8, #7fd6f7); box-shadow: 0 0 8px rgba(34,179,232,.7); }
.progress { background: linear-gradient(90deg, #0a58aa, #22b3e8); }

/* the topbar's glass sheen is wasted on a dark panel; keep only a faint top light */
.topbar::after { opacity: .28; }
.sidebar::before { opacity: .35; }

/* ---------- surfaces that stay light ---------- */
.card > header { background: linear-gradient(135deg, #eef3fa 0%, #e3ecf7 100%); }
.drawer > header { background: linear-gradient(135deg, #eef3fa 0%, #e3ecf7 100%); }
button:not(.ghost):not(.link):not(.danger):not(.x):not(.navtoggle):not(.railtoggle):not(.density button) {
  background: var(--grad);
}


/* ============================================================================
   Corrections: lighter gradient, and the cropping / overlap this layer caused.
   ========================================================================= */

/* ---- lighter navy, still the logo's navy-to-cyan ---- */
:root {
  --chrome: linear-gradient(185deg, #0d3a82 0%, #0f4a9e 46%, #0c7bbd 100%);
  --grad:   linear-gradient(135deg, #0d3f8f 0%, #0e63b8 55%, #0a8fcb 100%);
}
body {
  background:
    radial-gradient(1000px 560px at 6% -10%, rgba(0,136,192,.14) 0%, rgba(0,136,192,0) 62%),
    linear-gradient(180deg, #e6edf6 0%, #dbe5f1 100%);
  background-attachment: fixed;
}
.sidebar { box-shadow: 0 10px 30px rgba(13, 58, 130, .28), 0 2px 6px rgba(13, 58, 130, .16); }
.topbar {
  background: linear-gradient(100deg, #0d3a82 0%, #0f4a9e 55%, #0c7bbd 100%);
  box-shadow: 0 8px 24px rgba(13, 58, 130, .24), 0 2px 5px rgba(13, 58, 130, .14);
}
.railtoggle, .sidebar .railtoggle { background: #0f4a9e; }

/* ---- shadows were being cut off at the edge of the scrolling area ---- */
.content { padding: 6px 8px 18px 6px; }

/* ---- the rail: icons centred, logo not cropped to "PI" ---- */
.nav a { padding-left: 18px; }                       /* icon centre = rail centre */
.who { padding-left: 21px; }                          /* avatar centre = rail centre */

/* Collapsed, show just the P of the wordmark on its plate instead of a
   cropped half-word. A clip-path is paint-only, so it costs nothing to animate. */
.brand .logo-mark { transition: clip-path .24s cubic-bezier(.4,0,.2,1), margin .24s cubic-bezier(.4,0,.2,1);
                    clip-path: inset(0 0 0 0 round 9px); }
.app.nav-collapsed .brand .logo-mark {
  clip-path: inset(0 calc(100% - 46px) 0 0 round 9px);
  margin-left: -5px;
}

/* the hover labels were clipped by the sidebar's own overflow; the native
   title attribute does the same job and cannot be cropped */
.app.nav-collapsed .nav a::after { display: none; }

/* ---- nothing may push the shell wider than the window ---- */
.card, .kpis, .toolbar, .grid2, .grid3 { min-width: 0; }
.tw { max-width: 100%; overflow-x: auto; }
.topbar h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .meta { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; }


/* The collapse button lives beside the sidebar, not inside it, so the sidebar
   can clip its contents to the rail without also cropping the button. It
   follows the sidebar's right edge on the same curve and duration. */
.railtoggle, .sidebar .railtoggle {
  right: auto;
  left: calc(var(--gap) + var(--rail-w) - 13px);
  top: 50%;
  transition: left .24s cubic-bezier(.4,0,.2,1), background .15s, border-color .15s, transform .24s cubic-bezier(.4,0,.2,1);
}
.app.nav-collapsed .railtoggle { left: calc(var(--gap) + var(--rail-mini) - 13px); }


/* The logo is the original artwork - same navy, same cyan - with the off-white
   rectangle that was baked into the PNG taken out (assets/PICT-Logo-clear.png).
   There is no box and no fill behind it. Navy on a dark panel needs light, so
   the light is a halo that follows the lettering: a thin bright edge, then a
   wide soft cyan glow. Where there is no ink there is no light. */
.brand .logo-mark {
  background: none;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, .98))
          drop-shadow(0 0 2.5px rgba(255, 255, 255, .8))
          drop-shadow(0 0 10px rgba(110, 200, 255, .9))
          drop-shadow(0 0 22px rgba(60, 170, 240, .55));
  clip-path: none;
  transition: clip-path .24s cubic-bezier(.4,0,.2,1), margin .24s cubic-bezier(.4,0,.2,1);
}
.brand .logo-mark img { filter: none; }
.app.nav-collapsed .brand .logo-mark { clip-path: inset(-26px calc(100% - 46px) -26px -26px); margin-left: -5px; }


/* ============================================================================
   Stability pass: no flicker, no white line, no overlap - and a mirror finish.
   ========================================================================= */

/* ---- what was making the whole app flicker ----
   1. mix-blend-mode on the sidebar, header, drawer and every card forces each
      one to be composited against what is behind it on every frame.
   2. background-attachment: fixed repaints the page background on every scroll.
   3. an infinite animation on the scroll bar ran for as long as the app was open.
   4. a backdrop blur on the header re-samples whatever scrolls beneath it.
   5. cards replayed an entrance animation each time they were redrawn.
   All removed. The finish below is made of plain gradients, which are painted
   once and then left alone. */
.sidebar::before, .topbar::after, .card::before, .drawer::before { mix-blend-mode: normal; }
.topbar { backdrop-filter: none; -webkit-backdrop-filter: none; }
.scrollprog::after, .progress.on::after { animation: none; display: none; }
.spinner { animation: none; background: var(--surface-2); }
.card { animation: none; transition: none; }
.card:hover { box-shadow: var(--shadow); }
.drawer.open .dbody > * { animation: none; }
.route.active { animation: routein .14s ease-out; }
@keyframes routein { from { opacity: 0; } to { opacity: 1; } }

/* The page backdrop lives on its own fixed layer instead of the body, so
   scrolling never repaints it. */
html { background: #dbe5f1; }
body { background: transparent; background-attachment: scroll; }
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 520px at 4% -8%, rgba(0, 136, 192, .26) 0%, rgba(0, 136, 192, 0) 62%),
    radial-gradient(800px 480px at 98% 2%, rgba(14, 74, 158, .20) 0%, rgba(14, 74, 158, 0) 60%),
    linear-gradient(180deg, #e8eff8 0%, #d6e1ef 100%);
  transform: translateZ(0);
}

/* ---- no white line along the top of the sidebar ---- */
.sidebar::after { display: none; }
.brand { background: none; }

/* ---- the mirror finish ----
   Glass reads as glass because of a diagonal reflection: a bright band that
   crosses the panel at an angle, with a clear gap and then a fainter second
   band. Painted as static gradients on a pseudo-element. */
.sidebar::before, .topbar::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    linear-gradient(118deg,
      rgba(255,255,255,0) 0%,   rgba(255,255,255,.17) 18%, rgba(255,255,255,.05) 34%,
      rgba(255,255,255,0) 35%,  rgba(255,255,255,0) 60%,   rgba(255,255,255,.08) 61%,
      rgba(255,255,255,0) 78%);
  opacity: 1;
}
.topbar::after { opacity: 1; }

/* Light surfaces: a clear top-left glare falling away to a cool tint at the
   far corner, a bright inner edge, and a soft shadow underneath. */
.card, .kpi {
  background: linear-gradient(140deg, #ffffff 0%, #f4f8fd 52%, #e7eff9 100%);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow:
    0 0 0 1px rgba(13, 58, 130, .09),
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 1px 0 0 rgba(255, 255, 255, .7),
    0 6px 18px rgba(13, 58, 130, .10);
}
.card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    radial-gradient(120% 70% at 0% 0%, rgba(255,255,255,.95) 0%, rgba(255,255,255,0) 52%),
    linear-gradient(120deg, rgba(255,255,255,0) 40%, rgba(255,255,255,.55) 41%, rgba(255,255,255,0) 52%);
  z-index: 0;
}
.card > * { position: relative; z-index: 1; }
.kpi::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(130% 80% at 0% 0%, rgba(255,255,255,.9) 0%, rgba(255,255,255,0) 55%);
}
.kpi > * { position: relative; }
.card > header, .drawer > header { background: linear-gradient(135deg, rgba(238,244,251,.9), rgba(222,233,247,.9)); }

/* ---- bottom user box: nothing runs under the buttons ---- */
.who { gap: 8px; }
.who .txt { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.who .nm, .who .rl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who button { flex: 0 0 auto; padding: 3px 7px; }

/* ---- brand subtitle: fits the sidebar instead of being clipped ---- */
.brand span {
  display: block; white-space: normal; line-height: 1.35;
  font-size: 9.5px; letter-spacing: .45px;
  max-width: calc(var(--rail-w) - 32px);
}


/* ---------- the main scrollbar (drawn by app.js) ---------- */

/* the native bar on the content area is replaced, so hide it there only */
.content { scrollbar-width: none; scrollbar-gutter: auto; padding-right: 18px; }
.content::-webkit-scrollbar { display: none; width: 0; height: 0; }

.main { position: relative; }

.vscroll {
  position: absolute; right: 4px; width: 12px; z-index: 30;
  border-radius: 99px;
  background: rgba(13, 58, 130, .10);
  transition: opacity .2s, background .15s;
  cursor: default;
}
.vscroll.off { opacity: 0; pointer-events: none; }
.vscroll:hover { background: rgba(13, 58, 130, .18); }

.vthumb {
  position: absolute; left: 2px; right: 2px; top: 0;
  border-radius: 99px;
  background: linear-gradient(180deg, #4d6f9c 0%, #2f5586 100%);
  box-shadow: 0 1px 3px rgba(13, 58, 130, .35), 0 0 0 1px rgba(255, 255, 255, .35) inset;
  transition: background .15s, box-shadow .15s;
  touch-action: none;
  cursor: grab;
}
.vscroll.live .vthumb, .vscroll:hover .vthumb, .vscroll.drag .vthumb {
  background: linear-gradient(180deg, #14a5dc 0%, #0e63b8 100%);
  box-shadow: 0 0 10px rgba(20, 165, 220, .55), 0 0 0 1px rgba(255, 255, 255, .4) inset;
}
.vscroll.drag .vthumb { cursor: grabbing; }

@media (max-width: 900px) {
  .vscroll { display: none; }
  .content { scrollbar-width: thin; padding-right: 12px; }
  .content::-webkit-scrollbar { display: block; width: 8px; }
}
@media (prefers-reduced-motion: reduce) { .vscroll, .vthumb { transition: none; } }


/* ============================================================================
   Glass.

   Four things make a surface read as glass rather than as a coloured box:
     1. something coloured BEHIND it that shows through (so it is translucent),
     2. a bright edge on the side the light comes from and a dim one opposite,
     3. a soft reflection that crosses it at an angle,
     4. a highlight that moves as the light - here, the pointer - moves.

   All of it is gradients. No blur, no blend modes, nothing animated on a timer:
   the last pass removed those because they made the app flicker. The pointer
   highlight changes two numbers on the one panel under the cursor and nothing
   else, and the numbers are registered so they do not inherit - otherwise
   setting them on a card would restyle every cell of a table inside it.
   ========================================================================= */

@property --mx { syntax: '<length>'; inherits: false; initial-value: -600px; }
@property --my { syntax: '<length>'; inherits: false; initial-value: -600px; }

/* 1. coloured light behind everything, large and soft, spread across the page */
body::before {
  background:
    radial-gradient(720px 500px at 6% 14%,  rgba(0, 170, 230, .46) 0%, rgba(0, 170, 230, 0) 66%),
    radial-gradient(780px 540px at 94% 6%,  rgba(40, 100, 220, .38) 0%, rgba(40, 100, 220, 0) 64%),
    radial-gradient(900px 620px at 72% 98%, rgba(0, 195, 235, .34) 0%, rgba(0, 195, 235, 0) 66%),
    radial-gradient(640px 440px at 22% 92%, rgba(80, 90, 215, .26) 0%, rgba(80, 90, 215, 0) 66%),
    linear-gradient(160deg, #eaf2fc 0%, #d2e1f3 100%);
}

/* light panels: frosted, so the colour behind shows through them */
.card, .kpi {
  background:
    radial-gradient(260px circle at var(--mx) var(--my), rgba(255, 255, 255, .85) 0%, rgba(255, 255, 255, 0) 70%),
    linear-gradient(140deg, rgba(255, 255, 255, .84) 0%, rgba(255, 255, 255, .62) 52%, rgba(222, 236, 252, .60) 100%);
  border: 1px solid rgba(255, 255, 255, .8);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, .98),          /* lit edge, top-left */
    inset -1px -1px 0 rgba(13, 58, 130, .12),          /* shaded edge, bottom-right */
    0 12px 30px rgba(13, 58, 130, .15),
    0 2px 6px rgba(13, 58, 130, .08);
}
.card::before {
  background:
    radial-gradient(130% 60% at 0% 0%, rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(116deg, rgba(255,255,255,0) 36%, rgba(255,255,255,.60) 37%, rgba(255,255,255,.12) 47%, rgba(255,255,255,0) 48%);
}
.kpi::before {
  background:
    radial-gradient(140% 70% at 0% 0%, rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, 0) 58%),
    linear-gradient(116deg, rgba(255,255,255,0) 44%, rgba(255,255,255,.55) 45%, rgba(255,255,255,0) 58%);
}
.card > header { background: linear-gradient(135deg, rgba(255,255,255,.55), rgba(205,224,247,.55)); }

/* dark chrome: the same idea, lit from the top-left with a bright reflection band */
.sidebar {
  background:
    radial-gradient(300px circle at var(--mx) var(--my), rgba(120, 205, 255, .40) 0%, rgba(120, 205, 255, 0) 70%),
    var(--chrome);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, .22),
    inset -1px -1px 0 rgba(0, 0, 0, .25),
    inset 0 22px 34px -22px rgba(255, 255, 255, .28),
    0 18px 34px -12px rgba(0, 120, 190, .50),
    0 4px 10px rgba(13, 58, 130, .25);
}
.topbar {
  background:
    radial-gradient(360px circle at var(--mx) var(--my), rgba(120, 205, 255, .42) 0%, rgba(120, 205, 255, 0) 70%),
    linear-gradient(100deg, #0d3a82 0%, #0f4a9e 55%, #0c7bbd 100%);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, .24),
    inset -1px -1px 0 rgba(0, 0, 0, .22),
    inset 0 16px 26px -16px rgba(255, 255, 255, .30),
    0 16px 30px -12px rgba(0, 120, 190, .48),
    0 3px 8px rgba(13, 58, 130, .22);
}
.sidebar::before, .topbar::after {
  background:
    linear-gradient(116deg,
      rgba(255,255,255,0) 0%,  rgba(255,255,255,.30) 17%, rgba(255,255,255,.10) 31%,
      rgba(255,255,255,0) 32%, rgba(255,255,255,0) 58%,   rgba(255,255,255,.14) 59%,
      rgba(255,255,255,0) 74%);
}

/* controls: glossy, with a lit upper half */
button:not(.ghost):not(.link):not(.danger):not(.x):not(.navtoggle):not(.railtoggle):not(.density button),
a.btnlink:not(.ghost) {
  background:
    linear-gradient(180deg, rgba(255,255,255,.28) 0%, rgba(255,255,255,.06) 48%, rgba(255,255,255,0) 50%),
    var(--grad);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), inset 0 -10px 14px -10px rgba(0,30,90,.45),
              0 3px 10px rgba(14, 99, 184, .38);
}
.nav a.active {
  background:
    linear-gradient(180deg, rgba(255,255,255,.26) 0%, rgba(255,255,255,.05) 50%, rgba(255,255,255,0) 52%),
    linear-gradient(135deg, #0b4fa6 0%, #0a7fc4 60%, #14a5dc 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 4px 16px rgba(0,136,192,.5);
}
select, input[type=text], input[type=date], input[type=number], input[type=search],
input[type=password], input[type=email], textarea {
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(240,246,253,.85));
  border-color: rgba(13, 58, 130, .16);
  box-shadow: inset 0 1px 2px rgba(13, 58, 130, .08), 0 1px 0 rgba(255,255,255,.8);
}

/* Hover moves the light, it does not repaint a different shadow. */
.card:hover, .kpi:hover { box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, .98), inset -1px -1px 0 rgba(13, 58, 130, .12),
    0 12px 30px rgba(13, 58, 130, .15), 0 2px 6px rgba(13, 58, 130, .08); }


/* ============================================================================
   Gradient-only glass (final word on the surfaces).

   No lines and no shapes: no hairlines, no 1px lit edges, no diagonal bands, no
   hard-stop reflections. Glass here is translucency plus smooth colour that
   blends into itself, and light that falls off gradually. Appended last so it
   wins; the earlier blocks above are left alone.
   ========================================================================= */

.sidebar, .topbar, .card, .kpi, .drawer { border-color: transparent; }
.topbar::before { display: none; }                    /* the line across the top of the header */
.brand { border-bottom-color: transparent; }
.card > header, .drawer > header { border-bottom-color: transparent; }

/* one smooth sheen per panel, fading across the whole surface */
.sidebar::before, .topbar::after {
  background: linear-gradient(135deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,.08) 40%, rgba(255,255,255,0) 78%);
}
.card::before {
  background: radial-gradient(125% 90% at 0% 0%, rgba(255,255,255,.80) 0%, rgba(255,255,255,.22) 42%, rgba(255,255,255,0) 72%);
}
.kpi::before {
  background: radial-gradient(130% 95% at 0% 0%, rgba(255,255,255,.85) 0%, rgba(255,255,255,.25) 44%, rgba(255,255,255,0) 74%);
}

/* depth from soft shadow only */
.sidebar { box-shadow: 0 26px 50px -18px rgba(0, 125, 195, .50), 0 8px 22px rgba(13, 58, 130, .22); }
.topbar  { box-shadow: 0 20px 40px -16px rgba(0, 125, 195, .46), 0 6px 18px rgba(13, 58, 130, .20); }
.card, .kpi, .card:hover, .kpi:hover {
  box-shadow: 0 16px 38px -12px rgba(13, 58, 130, .24), 0 4px 14px rgba(13, 58, 130, .10);
}

/* controls: a smooth gloss across the whole face instead of a split highlight */
button:not(.ghost):not(.link):not(.danger):not(.x):not(.navtoggle):not(.railtoggle):not(.density button),
a.btnlink:not(.ghost) {
  background: linear-gradient(180deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,0) 100%), var(--grad);
  box-shadow: 0 6px 16px -4px rgba(14, 99, 184, .55);
}
.nav a.active {
  background: linear-gradient(180deg, rgba(255,255,255,.20) 0%, rgba(255,255,255,0) 100%),
              linear-gradient(135deg, #0b4fa6 0%, #0a7fc4 60%, #14a5dc 100%);
  box-shadow: 0 8px 22px -6px rgba(0, 150, 215, .65);
}
select, input[type=text], input[type=date], input[type=number], input[type=search],
input[type=password], input[type=email], textarea { box-shadow: none; }


/* ============================================================================
   Final pass: legible, calm, white and sky blue.
   Appended; nothing above is rewritten.
   ========================================================================= */

/* ---------- 1. legibility ----------
   The glass sheens are pseudo-elements painted after their panel's content, so a
   translucent white film was lying ON TOP of the text: the drawer's title and
   close button were nearly invisible, and the sidebar and header labels were
   washed out. The sheens now sit underneath, and the content is lifted above. */
.drawer::before { display: none; }
.drawer { background: linear-gradient(180deg, #ffffff 0%, #f0f8fd 55%, #e0eff9 100%); }
.drawer > header { background: linear-gradient(135deg, #ffffff 0%, #e6f3fb 100%); }
.drawer > header h3 { color: #0b2a4a; font-weight: 650; }
.drawer .x { color: #35516e; }
.drawer .x:hover { color: #0b2a4a; }

.sidebar::before, .topbar::after { z-index: 0; }
.sidebar > *, .topbar > *:not(.scrollprog) { position: relative; z-index: 1; }

:root {
  --on-dark:   #ffffff;
  --on-dark-2: rgba(255, 255, 255, .92);
  --on-dark-3: rgba(232, 245, 255, .80);
}
.nav-group > h2 { color: rgba(225, 242, 255, .82); }
.nav a { color: rgba(255, 255, 255, .94); }
.usertrigger .rl, .up-who .rl { color: rgba(232, 245, 255, .85); }
.topbar h2 { color: #fff; }

/* ---------- 2. white to sky blue ----------
   One quiet gradient behind everything: white at the top easing into sky blue.
   No coloured blobs. The chrome (sidebar, header, hero) uses a sea blue from the
   same family, deep enough that white text stays readable on it. */
html { background: #e4f1fa; }
body::before {
  background: linear-gradient(180deg, #ffffff 0%, #f1f8fd 34%, #dcedf9 68%, #c9e4f5 100%);
}
:root {
  --chrome: linear-gradient(185deg, #0c4f94 0%, #1167ad 52%, #1a7fc0 100%);
  --grad:   linear-gradient(135deg, #0c4f94 0%, #1370b6 55%, #1d8bc9 100%);
}
.topbar { background:
    radial-gradient(360px circle at var(--mx) var(--my), rgba(190, 230, 255, .35) 0%, rgba(190, 230, 255, 0) 70%),
    linear-gradient(100deg, #0c4f94 0%, #1167ad 55%, #1a7fc0 100%); }
.sidebar { background:
    radial-gradient(300px circle at var(--mx) var(--my), rgba(190, 230, 255, .30) 0%, rgba(190, 230, 255, 0) 70%),
    var(--chrome); }
.hero { background:
    radial-gradient(520px 260px at 0% 0%, rgba(170, 225, 255, .30) 0%, rgba(170, 225, 255, 0) 70%),
    linear-gradient(120deg, #0c4f94 0%, #1370b6 55%, #1d8bc9 100%); }
.installbar { background: linear-gradient(135deg, #0c4f94 0%, #1370b6 55%, #1d8bc9 100%); }
.userpop { background: linear-gradient(160deg, #0f5ba3 0%, #0c4f94 60%, #0a427c 100%); }
.railtoggle, .sidebar .railtoggle { background: #1167ad; }
.card, .kpi { background:
    radial-gradient(260px circle at var(--mx) var(--my), rgba(255, 255, 255, .90) 0%, rgba(255, 255, 255, 0) 70%),
    linear-gradient(140deg, rgba(255, 255, 255, .92) 0%, rgba(255, 255, 255, .78) 100%); }

/* ---------- 3. scroll progress ----------
   The old bar was a 2px line that was only 25% opaque until you had scrolled a
   long way, which on a blue header is the same as not being there. It is now a
   proper track with a bright fill, drawn with a transform so it costs nothing. */
.scrollprog {
  position: absolute; left: 16px; right: 16px; bottom: 7px; width: auto; height: 4px;
  border-radius: 99px; overflow: hidden; opacity: 1; pointer-events: none; z-index: 2;
  background: rgba(255, 255, 255, .26);
  transition: none;
}
.scrollprog::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  transform-origin: left center; transform: scaleX(var(--scroll, 0));
  background: linear-gradient(90deg, #aee8ff 0%, #ffffff 100%);
  box-shadow: 0 0 10px rgba(190, 235, 255, .9);
}
.scrollprog::after { display: none; }

/* ---------- 4. header user menu ---------- */
.usermenu { position: relative; flex: 0 0 auto; margin-left: 4px; }
.usertrigger {
  display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none;
  padding: 5px 12px 5px 6px; border-radius: 99px; color: #fff;
  background: linear-gradient(135deg, rgba(255,255,255,.24) 0%, rgba(255,255,255,.09) 100%);
  transition: background .15s;
}
.usertrigger:hover, .usermenu.open .usertrigger { background: linear-gradient(135deg, rgba(255,255,255,.36) 0%, rgba(255,255,255,.15) 100%); }
.usertrigger:focus-visible { outline: 2px solid #bfeaff; outline-offset: 2px; }
.usertrigger .av, .userpop .av {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #0a58aa, #3bb6ea);
  box-shadow: 0 4px 12px -2px rgba(0, 30, 90, .5);
}
.userpop .av.lg { width: 40px; height: 40px; flex-basis: 40px; font-size: 14px; }
.usertrigger .ut { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.usertrigger .nm { font-size: 12.5px; font-weight: 650; color: #fff; white-space: nowrap; }
.usertrigger .rl { font-size: 10.5px; white-space: nowrap; }
.usertrigger .chev { font-size: 11px; color: rgba(255,255,255,.9); transition: transform .18s; }
.usermenu.open .chev { transform: rotate(180deg); }

.userpop {
  display: none; position: absolute; right: 0; top: calc(100% + 12px); z-index: 80; width: 280px;
  padding: 8px; border-radius: 16px;
  box-shadow: 0 28px 60px -12px rgba(5, 25, 60, .55), 0 8px 24px rgba(5, 25, 60, .3);
}
.usermenu.open .userpop { display: block; }
.up-head {
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 14px; margin-bottom: 4px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,255,255,.18) 0%, rgba(255,255,255,0) 90%);
}
.up-who { min-width: 0; }
.up-who .nm { font-size: 13.5px; font-weight: 650; color: #fff; }
.up-who .rl { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upi {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: #fff; font-size: 13px; cursor: pointer; transition: background .12s;
}
.upi[hidden] { display: none; }
.upi:hover, .upi:focus-visible { background: linear-gradient(135deg, rgba(255,255,255,.22), rgba(255,255,255,.08)); outline: none; }
.upi-ic { width: 20px; text-align: center; color: #bfeaff; }
.upi.danger, .upi.danger .upi-ic { color: #ffd0c8; }
.upi.danger:hover { background: linear-gradient(135deg, rgba(255,120,100,.32), rgba(255,120,100,.10)); }
.sidebar .nav { padding-bottom: 18px; }

/* ---------- 5. welcome panel, quick links ---------- */
.hero {
  position: relative; display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 2.2fr); gap: 22px;
  padding: 26px 28px; margin-bottom: 18px; border-radius: 22px; color: #fff; overflow: hidden;
  box-shadow: 0 30px 60px -22px rgba(13, 80, 160, .60), 0 10px 26px rgba(13, 58, 130, .20);
}
.hero::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,.06) 42%, rgba(255,255,255,0) 75%); }
.hero > * { position: relative; }
.hero-kicker { font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase; color: rgba(232, 245, 255, .92); font-weight: 600; }
.hero h1 { margin: 6px 0 6px; font-size: 30px; line-height: 1.1; font-weight: 700; letter-spacing: -.3px; color: #fff; }
.hero-sub { font-size: 13px; color: rgba(232, 245, 255, .92); }
.hero-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-self: center; }
.fact { padding: 14px 16px; border-radius: 16px; min-width: 0;
        background: linear-gradient(145deg, rgba(255,255,255,.24) 0%, rgba(255,255,255,.08) 100%); }
.fact-l { font-size: 10.5px; letter-spacing: 1.1px; text-transform: uppercase; color: rgba(232, 245, 255, .90); font-weight: 650; }
.fact-v { margin-top: 5px; font-size: 15px; font-weight: 650; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fact-s { margin-top: 3px; font-size: 11.5px; color: rgba(240, 249, 255, .92); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.qtile {
  display: flex; flex-direction: column; gap: 3px; padding: 15px 17px; border-radius: 16px; text-decoration: none; color: var(--ink);
  background: radial-gradient(180px circle at var(--mx) var(--my), rgba(255,255,255,.95) 0%, rgba(255,255,255,0) 70%),
              linear-gradient(140deg, rgba(255,255,255,.92) 0%, rgba(255,255,255,.72) 100%);
  box-shadow: 0 14px 30px -12px rgba(13, 58, 130, .24), 0 3px 10px rgba(13, 58, 130, .08);
  transition: transform .15s, box-shadow .15s;
}
.qtile b { font-size: 13.5px; font-weight: 650; color: #0c4f94; }
.qtile span { font-size: 11.5px; color: var(--ink-2); }
.qtile:hover { transform: translateY(-2px); box-shadow: 0 20px 36px -12px rgba(13, 80, 160, .34), 0 4px 12px rgba(13, 58, 130, .10); }
.sect { display: flex; align-items: baseline; gap: 10px; margin: 4px 2px 10px; font-size: 13px; font-weight: 650; color: #0c4f94; }
.sect span { font-size: 11.5px; font-weight: 500; color: var(--ink-3); }
.quiet { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; border-radius: 16px;
         background: linear-gradient(140deg, rgba(255,255,255,.85), rgba(255,255,255,.6)); color: var(--ink-2); }
.quiet b { color: #0c4f94; }
@media (max-width: 1100px) { .hero { grid-template-columns: 1fr; } .hero-facts { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .usertrigger .ut { display: none; } .usertrigger { padding: 4px; } .hero { padding: 20px; } .hero h1 { font-size: 24px; } }

/* ---------- 6. install banner (phones) ---------- */
.installbar {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 300; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px)); border-radius: 18px; color: #fff;
  box-shadow: 0 24px 50px -10px rgba(5, 25, 60, .55), 0 6px 18px rgba(5, 25, 60, .3);
}
.installbar img { width: 44px; height: 44px; border-radius: 11px; flex: 0 0 44px; }
.ib-text { display: flex; flex-direction: column; min-width: 0; flex: 1; font-size: 12px; line-height: 1.35; color: rgba(240, 249, 255, .95); }
.ib-text strong { font-size: 13.5px; color: #fff; }
.ib-btn { padding: 8px 14px; border-radius: 99px; font-size: 12.5px; font-weight: 650; cursor: pointer; color: #fff;
          background: rgba(255,255,255,.22); flex: 0 0 auto; }
.ib-btn.primary { background: linear-gradient(135deg, #1d8bc9, #0c4f94); box-shadow: 0 6px 16px -4px rgba(0, 20, 70, .5); }
@media (min-width: 901px) { .installbar { display: none; } }

/* ---------- 7. sign-in ---------- */
.login-wrap {
  min-height: 100vh; min-height: 100dvh; padding: 24px 16px; display: grid; place-items: center;
  background:
    radial-gradient(900px 520px at 100% 0%, rgba(120, 190, 235, .28) 0%, rgba(120, 190, 235, 0) 65%),
    linear-gradient(180deg, #ffffff 0%, #eaf5fc 45%, #cde6f6 100%);
}
.login-shell {
  width: 100%; max-width: 880px; display: grid; grid-template-columns: 1.05fr 1fr; overflow: hidden; border-radius: 26px;
  box-shadow: 0 40px 80px -28px rgba(13, 80, 160, .55), 0 12px 30px rgba(13, 58, 130, .16);
  background: #ffffff;
}
.login-art {
  position: relative; display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: 44px 38px; color: #fff;
  background:
    radial-gradient(420px 260px at 0% 0%, rgba(170, 225, 255, .34) 0%, rgba(170, 225, 255, 0) 70%),
    radial-gradient(420px 300px at 100% 100%, rgba(60, 170, 225, .40) 0%, rgba(60, 170, 225, 0) 70%),
    linear-gradient(150deg, #0c4f94 0%, #1370b6 55%, #1d8bc9 100%);
}
.login-art::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.20) 0%, rgba(255,255,255,.05) 45%, rgba(255,255,255,0) 78%); }
.login-art > * { position: relative; }
.login-art .la-kicker { font-size: 11.5px; letter-spacing: 1.6px; text-transform: uppercase; color: rgba(232,245,255,.9); font-weight: 650; }
.login-art h2 { margin: 0; font-size: 27px; line-height: 1.2; font-weight: 700; letter-spacing: -.3px; color: #fff; }
.login-art ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.login-art li { display: flex; gap: 11px; align-items: baseline; font-size: 13.5px; color: rgba(240,249,255,.96); }
.login-art li::before { content: '\2713'; color: #bfeaff; font-weight: 700; }

.login-shell .login {
  max-width: none; border: 0; border-radius: 0; box-shadow: none; background: #fff;
  padding: 44px 40px; text-align: left; display: flex; flex-direction: column; justify-content: center;
}
.login-shell .login .logo-mark { margin: 0 0 22px; width: 150px; }
.login-shell .login h1 { font-size: 22px; font-weight: 700; margin: 0 0 4px; color: #0b2a4a; }
.login-shell .login .sub { margin-bottom: 22px; color: var(--ink-2); }
.login-shell .login input { padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.login-shell .login button { padding: 12px; border-radius: 12px; font-size: 14px; margin-top: 10px; }
/* a lone card (the forced password change) keeps the original centred look */
.login-wrap > .login { box-shadow: 0 30px 60px -24px rgba(13, 80, 160, .45); border: 0; border-radius: 20px; background: #fff; }
@media (max-width: 820px) {
  .login-shell { grid-template-columns: 1fr; max-width: 440px; }
  .login-art { padding: 26px 26px 24px; gap: 12px; } .login-art ul { display: none; } .login-art h2 { font-size: 20px; }
  .login-shell .login { padding: 28px 26px; }
}


/* ---------- Scroll progress, full width ----------
   A strip along the very top of the window, above the header and the whole page,
   rather than a short bar inside the header. Fixed, so nothing scrolls it away or
   clips it; the fill is a transform, so it costs nothing to move. The fill is
   sea blue running to sky blue so it reads on the white at the top of the page. */
.scrollprog {
  position: fixed; top: 0; left: 0; right: 0; bottom: auto; width: auto; height: 4px;
  border-radius: 0; z-index: 600; pointer-events: none; overflow: hidden;
  background: rgba(12, 79, 148, .10);
}
.scrollprog::before {
  background: linear-gradient(90deg, #0c4f94 0%, #1d8bc9 55%, #5fd0ff 100%);
  box-shadow: 0 0 10px rgba(29, 139, 201, .75);
}


/* ---------- Tabs: readable ----------
   The blue gradient given to buttons reached the tabs too, so their dark labels
   sat on blue and could not be read (Audit Log: All activity / Sign-in history).
   Tabs are navigation, not actions: a quiet glass pill when idle, the brand
   gradient with white text only for the one that is open. !important is used
   here deliberately - the general button rule carries seven :not() clauses and
   would otherwise win on specificity every time. */
.tabs { gap: 8px; border-bottom-color: transparent; }
.tabs button, button.tab {
  background: linear-gradient(140deg, rgba(255,255,255,.92), rgba(255,255,255,.66)) !important;
  color: #1f4a73 !important; border: 0 !important; border-radius: 10px !important;
  padding: 8px 16px !important; font-weight: 600; box-shadow: 0 6px 14px -8px rgba(13,58,130,.35) !important;
}
.tabs button:hover, button.tab:hover { color: #0c4f94 !important; filter: none !important; }
.tabs button.on, .tabs button.active, button.tab.active {
  background: linear-gradient(135deg, #0c4f94 0%, #1370b6 55%, #1d8bc9 100%) !important;
  color: #ffffff !important; box-shadow: 0 8px 18px -6px rgba(13,90,170,.6) !important;
}


/* ---------- Pill legibility ----------
   The red "failed" pills measured 2.9:1 against their pink ground. Darker text,
   same colour family, so a failure still reads as red but can actually be read. */
.pill.bad  { color: #8e2418; }
.pill.warn { color: #7a4f05; }


/* ---------- Phone layout: menu above everything ----------
   On a phone the menu is an off-canvas drawer. The desktop rule above gave the
   sidebar a stacking order of 15, which overrode the phone layout's own and put it
   BEHIND the dimming overlay (39) and the header (20): the menu looked grey and its
   top - the logo - was hidden under the header. It must sit above both. */
@media (max-width: 900px) {
  .sidebar, .app.nav-collapsed .sidebar { z-index: 50; }
  .navscrim { z-index: 45; }
  body.nav-open .sidebar { box-shadow: 0 0 60px rgba(5, 25, 60, .55); }

  /* the header must leave room for the page title: the size control is a desktop
     convenience, and the buttons shrink */
  .density { display: none; }
  .topbar { gap: 8px; padding: 0 10px; }
  .topbar h2 { flex: 1 1 auto; min-width: 0; font-size: 15px; }
  .topbar .spacer { display: none; }
  #refresh { padding: 5px 11px; font-size: 12px; }
  .navtoggle { margin-right: 0; }
  .content { padding: 4px 4px 18px 4px; }
  .hero { padding: 18px; }
  .hero-facts { grid-template-columns: 1fr; }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .userpop { position: fixed; left: 10px; right: 10px; top: 70px; width: auto; }
}


/* ---------- No flash of the app frame ----------
   index.php sends the same page to everybody - sidebar, header and all - and only the
   script discovers whether anyone is signed in. So a signed-out visitor saw the
   dashboard's frame for an instant before the sign-in page replaced it. The frame is
   now hidden from the first paint and shown only once the app has confirmed a session.
   The page behind it is already the sky-blue backdrop, so nothing jumps. */
body.booting .app, body.booting .railtoggle, body.booting .scrollprog,
body.booting .drawer, body.booting .drawer-bg, body.booting .navscrim { visibility: hidden; }


/* ---------- Password eye, check question, trap field, install link ---------- */

.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 42px !important; }
.pw-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px;
  color: #4d6f9c; cursor: pointer; user-select: none; transition: background .12s, color .12s;
}
.pw-eye svg { width: 18px; height: 18px; display: block; }
.pw-eye:hover { background: rgba(13, 80, 160, .10); color: #0c4f94; }
.pw-eye[aria-pressed="true"] { color: #0c4f94; }
.pw-eye:focus-visible { outline: 2px solid #1d8bc9; outline-offset: 1px; }

/* the check question */
.cap {
  margin: 4px 0 12px; padding: 12px 14px; border-radius: 14px; text-align: left;
  background: linear-gradient(140deg, #eef7fd 0%, #dcedf9 100%);
}
.cap-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.cap-label { font-size: 11px; letter-spacing: .6px; text-transform: uppercase; font-weight: 650; color: #0c4f94; }
.cap-new { font-size: 11.5px; color: #1370b6; cursor: pointer; user-select: none; }
.cap-new:hover { text-decoration: underline; }
.cap-q { font-size: 16px; font-weight: 650; color: #0b2a4a; margin-bottom: 8px; min-height: 24px; }
.cap input { margin: 0; }

/* A field no person can see or reach: off the page, out of the tab order. */
.hp { position: absolute !important; left: -9999px !important; top: auto !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; }

.ib-link { margin-top: 4px; font-size: 11px; color: rgba(225, 242, 255, .95); text-decoration: underline; cursor: pointer; }


/* ---------- Two-factor QR ---------- */
.qr-wrap { display: flex; flex-wrap: wrap; gap: 22px; align-items: center; margin: 4px 0 18px; }
.qr-box { padding: 10px; border-radius: 16px; background: #ffffff; box-shadow: 0 14px 30px -12px rgba(13, 58, 130, .35), 0 3px 10px rgba(13, 58, 130, .10); line-height: 0; }
.qr-box svg { display: block; max-width: 100%; height: auto; }
.qr-help { flex: 1 1 240px; min-width: 220px; font-size: 13px; line-height: 1.55; color: var(--ink); }
.qr-help p { margin: 0 0 8px; }
.qr-help a { color: #0c4f94; }
@media (max-width: 600px) { .qr-wrap { justify-content: center; } .qr-box svg { width: 220px; } }


/* ---------- Folded menu: the P mark ----------
   Folded to icons, the menu is 68px wide. Clipping the wordmark to that width could
   only ever show half a letter (and a sliver of the next one). So the folded menu
   shows the P as its own picture, centred on the same line as the icons below it
   (34px from the edge), and the wordmark fades out. */
.brand-mark {
  position: absolute; left: 34px; top: 15px; width: 39px; height: 45px;
  transform: translateX(-50%); opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
  filter: drop-shadow(0 0 1px rgba(255,255,255,.95)) drop-shadow(0 0 3px rgba(255,255,255,.55))
          drop-shadow(0 0 10px rgba(90,190,255,.85));
}
.brand-mark img { width: 100%; height: 100%; display: block; }
.app.nav-collapsed .brand-mark { opacity: 1; }
.app.nav-collapsed .brand .logo-mark { opacity: 0; clip-path: none; margin-left: 0; }
.brand .logo-mark { transition: opacity .2s ease; }
@media (max-width: 900px) {
  .brand-mark { display: none; }
  .app.nav-collapsed .brand .logo-mark { opacity: 1; }
}

/* ---------- Sign-in: fits the screen, and follows the cursor ---------- */

/* A card taller than the window must scroll from its TOP. Centring with place-items
   cuts the top off instead; auto margins centre when there is room and stop when not. */
.login-wrap { display: flex; position: relative; isolation: isolate; padding: 14px; }
.login-shell { margin: auto; position: relative; z-index: 1; }

/* with the question showing, the card used to be taller than a laptop screen */
.login-shell .login { padding: 24px 34px; }
.login-shell .login .logo-mark { width: 116px; margin: 0 0 10px; }
.login-shell .login h1 { font-size: 20px; margin: 0 0 1px; }
.login-shell .login .sub { margin-bottom: 12px; }
.login-shell .login label { margin-bottom: 8px; }
.login-shell .login input { padding: 8px 11px; }
.login-shell .login button { margin-top: 6px; padding: 10px; }
.cap { margin: 2px 0 8px; padding: 8px 12px 10px; }
.cap-head { margin-bottom: 2px; }
.cap-q { font-size: 14.5px; margin-bottom: 6px; min-height: 0; }
.login-art { padding: 30px 32px; gap: 16px; }
@media (max-height: 640px) {
  .login-wrap { padding: 8px; }
  .login-shell .login { padding: 16px 28px; }
  /* the logo stays; it only gets smaller. Space is found elsewhere. */
  .login-shell .login .logo-mark { width: 92px; margin: 0 0 4px; }
  .login-shell .login .sub { margin-bottom: 8px; }
  .login-art ul { display: none; }
}

/* a soft light that follows the cursor behind the card... */
.login-wrap::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(420px circle at var(--lx, -500px) var(--ly, -500px), rgba(40, 150, 225, .30) 0%, rgba(40, 150, 225, 0) 66%);
}
/* ...a spotlight on the brand panel... */
.login-art {
  background:
    radial-gradient(320px circle at var(--ax, -500px) var(--ay, -500px), rgba(200, 238, 255, .38) 0%, rgba(200, 238, 255, 0) 65%),
    radial-gradient(420px 260px at 0% 0%, rgba(170, 225, 255, .34) 0%, rgba(170, 225, 255, 0) 70%),
    radial-gradient(420px 300px at 100% 100%, rgba(60, 170, 225, .40) 0%, rgba(60, 170, 225, 0) 70%),
    linear-gradient(150deg, #0c4f94 0%, #1370b6 55%, #1d8bc9 100%);
}
/* ...which also reveals a fine grid of points, only where the cursor is */
.login-art::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .85) 1.1px, transparent 1.7px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(230px circle at var(--ax, -500px) var(--ay, -500px), #000 0%, transparent 72%);
          mask-image: radial-gradient(230px circle at var(--ax, -500px) var(--ay, -500px), #000 0%, transparent 72%);
}
/* and the fields glow when you are in them */
.login-shell .login input:focus { outline: none; border-color: #1d8bc9; box-shadow: 0 0 0 3px rgba(29, 139, 201, .22), 0 0 18px rgba(29, 139, 201, .30); }
.login-shell .login button:not(.pw-eye):hover { box-shadow: 0 10px 26px -6px rgba(14, 99, 184, .75); }


/* ---------- Sign-in: logo on the brand panel, light on both sides ---------- */

.la-logo { position: relative; width: 250px; max-width: 100%; margin: 0 0 4px; }
/* a holographic white glow BEHIND the logo - a soft light with no edge, white at the
   centre drifting to ice-blue and a hint of lilac at the rim. It is light, not a box. */
.la-logo::before {
  content: ''; position: absolute; z-index: 0; inset: -38px -46px; pointer-events: none;
  background:
    radial-gradient(closest-side at 62% 38%, rgba(190, 160, 255, .30) 0%, rgba(190, 160, 255, 0) 70%),
    radial-gradient(closest-side, rgba(255, 255, 255, .96) 0%, rgba(235, 247, 255, .72) 42%, rgba(170, 220, 255, .28) 74%, rgba(170, 220, 255, 0) 100%);
  filter: blur(9px);
}
.la-logo .logo-mark {
  position: relative; z-index: 1; width: 100% !important; margin: 0;
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, .95)) drop-shadow(0 0 5px rgba(255, 255, 255, .8))
          drop-shadow(0 0 16px rgba(150, 215, 255, .85));
}

/* the white side: a visible sea-blue glow under the cursor, and a fine blue grid
   that appears only around it. The fields sit above both. */
.login-shell .login {
  position: relative;
  background:
    radial-gradient(300px circle at var(--fx, -500px) var(--fy, -500px), rgba(29, 139, 201, .26) 0%, rgba(29, 139, 201, .10) 45%, rgba(29, 139, 201, 0) 72%),
    #ffffff;
}
.login-shell .login::after {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(rgba(12, 79, 148, .55) 1.1px, transparent 1.7px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(210px circle at var(--fx, -500px) var(--fy, -500px), #000 0%, transparent 72%);
          mask-image: radial-gradient(210px circle at var(--fx, -500px) var(--fy, -500px), #000 0%, transparent 72%);
}
.login-shell .login > * { position: relative; z-index: 1; }
.login-shell .login input:hover { border-color: rgba(29, 139, 201, .65); box-shadow: 0 0 0 3px rgba(29, 139, 201, .12); }

@media (max-width: 820px) {
  .la-logo { width: 150px; margin: 0 auto 2px; }
  .la-logo::before { inset: -26px -32px; }
}
@media (max-height: 640px) { .la-logo { width: 190px; } .la-logo::before { inset: -26px -34px; } }


/* ---------- Sign-in: glass and the lit grid ---------- */

/* The page behind the card is a grid of squares. Faint everywhere; under the cursor the
   lines brighten and the one square the pointer is in fills with light. Two fixed layers,
   both painted from the same two numbers the cursor glow already uses. */
.login-wrap {
  background:
    radial-gradient(900px 560px at 8% 0%,  rgba(80, 180, 240, .30) 0%, rgba(80, 180, 240, 0) 62%),
    radial-gradient(800px 520px at 96% 100%, rgba(40, 120, 210, .26) 0%, rgba(40, 120, 210, 0) 64%),
    linear-gradient(180deg, #ffffff 0%, #e8f4fc 52%, #cde6f6 100%);
}
.login-wrap::before {
  background:
    /* the square the pointer is in */
    linear-gradient(rgba(29, 139, 201, .20), rgba(29, 139, 201, .20)) var(--cx, -100px) var(--cy, -100px) / 44px 44px no-repeat,
    /* the soft light that follows the cursor */
    radial-gradient(420px circle at var(--lx, -500px) var(--ly, -500px), rgba(40, 150, 225, .22) 0%, rgba(40, 150, 225, 0) 66%),
    /* the grid, always faintly there */
    linear-gradient(rgba(12, 79, 148, .09) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(12, 79, 148, .09) 1px, transparent 1px) 0 0 / 44px 44px;
}
.login-wrap::after {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    linear-gradient(rgba(20, 140, 215, .75) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(20, 140, 215, .75) 1px, transparent 1px) 0 0 / 44px 44px;
  -webkit-mask-image: radial-gradient(260px circle at var(--lx, -500px) var(--ly, -500px), #000 0%, transparent 72%);
          mask-image: radial-gradient(260px circle at var(--lx, -500px) var(--ly, -500px), #000 0%, transparent 72%);
}

/* The card is glass: translucent, so the grid and the glow show through it, with a soft
   blur behind. (One static card on its own page, so the blur costs nothing here.) */
.login-shell {
  background: rgba(255, 255, 255, .34);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
          backdrop-filter: blur(16px) saturate(150%);
  box-shadow: 0 40px 80px -28px rgba(13, 80, 160, .50), 0 12px 30px rgba(13, 58, 130, .14);
}
.login-shell .login {
  background:
    radial-gradient(300px circle at var(--fx, -500px) var(--fy, -500px), rgba(29, 139, 201, .26) 0%, rgba(29, 139, 201, .10) 45%, rgba(29, 139, 201, 0) 72%),
    linear-gradient(150deg, rgba(255, 255, 255, .74) 0%, rgba(255, 255, 255, .52) 100%);
}
.login-art {
  background:
    radial-gradient(320px circle at var(--ax, -500px) var(--ay, -500px), rgba(200, 238, 255, .40) 0%, rgba(200, 238, 255, 0) 65%),
    radial-gradient(420px 260px at 0% 0%, rgba(170, 225, 255, .30) 0%, rgba(170, 225, 255, 0) 70%),
    radial-gradient(420px 300px at 100% 100%, rgba(60, 170, 225, .34) 0%, rgba(60, 170, 225, 0) 70%),
    linear-gradient(150deg, rgba(12, 79, 148, .90) 0%, rgba(19, 112, 182, .86) 55%, rgba(29, 139, 201, .84) 100%);
}
.login-shell .login input, .login-shell .login .cap { background-color: rgba(255, 255, 255, .62); }
.login-wrap > .login { background: rgba(255, 255, 255, .70); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }

.up-ver { padding: 8px 12px 4px; font-size: 10.5px; color: rgba(232, 245, 255, .70); text-align: center; letter-spacing: .3px; }


/* ---------- Sign-in light: compositor only ----------
   Each effect is a small finished picture that JavaScript only SLIDES (transform), so a
   mouse move repaints nothing. Everything that used to be redrawn from pointer-position
   variables - the masks, the moving gradients, the blur behind the card - is replaced. */

/* what the old version redrew on every mouse move is switched off */
.login-wrap::after, .login-art::after, .login-shell .login::after { display: none; }
.login-shell { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(255, 255, 255, .30); }
.login-wrap > .login { -webkit-backdrop-filter: none; backdrop-filter: none; }
.login-wrap::before {                           /* the faint grid: painted once, never again */
  background:
    linear-gradient(rgba(12, 79, 148, .09) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(12, 79, 148, .09) 1px, transparent 1px) 0 0 / 44px 44px;
}
.login-art { background:
    radial-gradient(420px 260px at 0% 0%, rgba(170, 225, 255, .30) 0%, rgba(170, 225, 255, 0) 70%),
    radial-gradient(420px 300px at 100% 100%, rgba(60, 170, 225, .34) 0%, rgba(60, 170, 225, 0) 70%),
    linear-gradient(150deg, rgba(12, 79, 148, .90) 0%, rgba(19, 112, 182, .86) 55%, rgba(29, 139, 201, .84) 100%); }
.login-shell .login { background: linear-gradient(150deg, rgba(255, 255, 255, .74) 0%, rgba(255, 255, 255, .52) 100%); }

/* the sliding pictures */
.lg { position: absolute; left: 0; top: 0; pointer-events: none; will-change: transform; opacity: 0; transition: opacity .25s ease, transform .11s ease-out; }
.login-wrap.lit .lg { opacity: 1; }
.login-wrap > .lg { position: fixed; z-index: 0; }
.login-shell .login > .lg, .login-art > .lg { position: absolute; z-index: 0; }

.lg-glow { width: 520px; height: 520px; background: radial-gradient(closest-side, rgba(40, 150, 225, .30) 0%, rgba(40, 150, 225, .12) 50%, rgba(40, 150, 225, 0) 100%); }
.lg-cell { width: 44px; height: 44px; background: rgba(29, 139, 201, .20); }
.lg-ring {
  width: 308px; height: 308px;
  background:
    linear-gradient(rgba(20, 140, 215, .85) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(20, 140, 215, .85) 1px, transparent 1px) 0 0 / 44px 44px;
  -webkit-mask-image: radial-gradient(closest-side, #000 0%, transparent 100%);
          mask-image: radial-gradient(closest-side, #000 0%, transparent 100%);
}
.lg-spot { width: 380px; height: 380px; background: radial-gradient(closest-side, rgba(205, 240, 255, .42) 0%, rgba(205, 240, 255, 0) 100%); }
.lg-spot.lg-blue { width: 340px; height: 340px; background: radial-gradient(closest-side, rgba(29, 139, 201, .28) 0%, rgba(29, 139, 201, .10) 50%, rgba(29, 139, 201, 0) 100%); }
.lg-dots {
  width: 264px; height: 264px;
  background-image: radial-gradient(rgba(255, 255, 255, .9) 1.1px, transparent 1.7px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(closest-side, #000 0%, transparent 100%);
          mask-image: radial-gradient(closest-side, #000 0%, transparent 100%);
}
.lg-dots.lg-blue { background-image: radial-gradient(rgba(12, 79, 148, .6) 1.1px, transparent 1.7px); }

@media (prefers-reduced-motion: reduce) { .lg { transition: opacity .25s ease; } }


/* ---------- New-version banner ---------- */
.updatebar {
  position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 700;
  display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 18px; max-width: calc(100vw - 24px);
  border-radius: 99px; color: #fff; font-size: 13px;
  background: linear-gradient(135deg, #0c4f94 0%, #1370b6 55%, #1d8bc9 100%);
  box-shadow: 0 20px 44px -10px rgba(5, 25, 60, .55), 0 6px 16px rgba(5, 25, 60, .28);
}
.ub-btn { padding: 6px 14px; border-radius: 99px; font-weight: 650; font-size: 12.5px; cursor: pointer; background: rgba(255,255,255,.2); white-space: nowrap; }
.ub-btn.primary { background: #fff; color: #0c4f94; }
.ub-btn:hover { filter: brightness(1.08); }
@media (max-width: 600px) { .updatebar { border-radius: 18px; flex-wrap: wrap; justify-content: center; top: 8px; } }
