/* PMAU360 application chrome.
   ============================================================================
   What belongs in this file: styling for PMAU's OWN classes - the login card,
   the site footer, the impersonation banner, the dashboard shell, KPI and chart
   tiles. Nothing else.

   What used to be in this file and is now gone: a 27-property `:root` token
   block, and ~650 lines of `[data-theme="dark"]` patches for Bootstrap
   components. Both were load-bearing only because Bootstrap has no dark mode
   and no design tokens. NDS has both, so every one of those rules is now dead
   weight - and the token block was worse than dead: eleven of its names collide
   with NDS, two of them meaning the opposite thing (`--text-primary` is body
   ink here and the brand GREEN in NDS; `--text-secondary` is grey here and the
   accent GOLD in NDS). Whichever sheet loaded last won, silently.

   This file therefore declares no design tokens of its own. It consumes NDS
   semantic tokens, which are theme-aware, so almost nothing here needs a
   `[data-theme="dark"]` twin any more.

   Load order matters: nds-critical.css and nds-main.css must come BEFORE this
   file. Every `var(--…)` below resolves against them.
   ============================================================================ */


/* ============================================================
   Compatibility shim - TEMPORARY
   ============================================================
   98 `var(--…)` references to the old token names still live outside this
   file, in static/css/assistant-*.css, static/css/log-viewer.css and a dozen
   template <style> blocks. Those files belong to other agents, so this block
   keeps them working by re-pointing the old names at NDS.

   Only names NDS does NOT define appear here. `--text-primary` and
   `--text-secondary` are deliberately absent: re-declaring them would recreate
   exactly the collision this migration is removing. Their remaining callers are
   listed in the migration report and must be edited, not shimmed.

   The literal fallbacks are not decoration. templates/dashboard/assistant/print.html
   is a standalone document that loads this file WITHOUT nds-critical.css; until
   it links the NDS tokens, the fallbacks are all that stand between it and a
   colourless PDF. Delete both the fallbacks and this whole block once the last
   caller is converted. */
:root {
  --bg-primary: var(--background-default, #ffffff);
  --bg-secondary: var(--background-body, #f9fafb);
  --bg-tertiary: var(--background-neutral-light, #f3f4f6);

  --text-muted: var(--text-secondary-paragraph, #6c727e);
  --text-disabled: var(--text-default-disabled, #9da4ae);

  --border-color: var(--border-neutral-secondary, #e5e7eb);
  --border-color-hover: var(--border-neutral-primary, #d2d6db);

  --color-primary: var(--background-primary, #1b8354);
  --color-primary-hover: var(--colors-primary-sa-flag-700, #166a45);
  --color-success: var(--text-success, #067647);
  --color-danger: var(--text-error, #b42318);
  --color-warning: var(--text-warning, #b54707);

  /* Brand green in light, lightened in dark - which is precisely what NDS's
     own `--text-primary` does (green 600 -> green 400). The old hand-rolled
     `#3fae7c` is retired. */
  --brand-accent: var(--text-primary, #1b8354);

  --font-family: var(--nds-font-family, 'IBM Plex Sans Arabic', sans-serif);
}

/* The one thing NDS has no token for: the HOVER step of the brand ink. Because
   `--text-primary` itself flips between themes, its hover has to flip the other
   way in each theme, or a link goes darker on an already dark page. */
:root {
  --seu-brand-ink-hover: var(--colors-primary-sa-flag-700);
}

[data-theme="dark"] {
  --seu-brand-ink-hover: var(--colors-primary-sa-flag-300);
}


/* ============================================================
   Page shell
   ============================================================
   NDS's own `body` rule already sets the font, the page background, the body
   ink and the flex column, so none of that is repeated here. What is left is
   the sticky-footer plumbing for the pre-NDS `<main>`/`<footer>` shell, which
   survives until the shell is `.nds-main-content`. */

body {
  /* Theme flips are instant otherwise, which reads as a flash. */
  transition: background-color 0.2s ease, color 0.2s ease;
}

.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  flex: 1;
}

main {
  flex: 1;
}

footer {
  margin-block-start: auto;
  width: 100%;
}


/* ============================================================
   Auth pages (no header, no footer)
   ============================================================ */

.auth-page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.auth-main-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-5);
}

.login-card {
  position: relative;
}

.login-card .card-body {
  /* Clears the absolutely positioned logo and language toggle below. */
  padding-block-start: 60px;
}

/* Logo at the top of the reading direction: top-right in Arabic, top-left in
   English. One logical rule replaces the [dir="rtl"]/[dir="ltr"] pair. */
.login-logo-container {
  position: absolute;
  top: 15px;
  inset-inline-start: 15px;
  z-index: 10;
}

.login-logo {
  max-height: 40px;
  width: auto;
  display: block;
}

/* Language toggle at the far corner, opposite the logo. */
.login-language-container {
  position: absolute;
  top: 15px;
  inset-inline-end: 15px;
  z-index: 10;
}

.login-language-toggle {
  color: var(--text-default);
  padding: 6px 10px;
  border-radius: var(--radius-md);
  background-color: transparent;
  border: 1px solid var(--border-neutral-secondary);
  transition: all 0.2s ease;
  text-decoration: none;
  font-size: 0.85rem;
  margin: 0;
}

.login-language-toggle:hover {
  background-color: var(--background-neutral-light);
  color: var(--text-primary);
  text-decoration: none;
  border-color: var(--border-primary);
}


/* ============================================================
   Header chrome
   ============================================================ */

.navbar {
  /* `position` is here only to give the bar a stacking context, so the user
     menu can escape the content below it. The layering in this file reads
     navbar 1040 < user menu 1050 < impersonation banner 1060. */
  z-index: 1040;
  position: relative;
}

.navbar-logo {
  height: 40px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

/* `.navbar-logo` and `.login-logo` (the images) and the two `*-logo-text`
   fallbacks below are all queried by literal string in
   static/scripts/image-handler.js, which reveals the text when a logo image
   fails to load. Do not rename any of the four. */
.navbar-logo-text,
.login-logo-text {
  display: none;
  font-weight: 600;
  color: var(--text-default);
}

.navbar-logo-text {
  font-size: 1.25rem;
}

.login-logo-text {
  font-size: 1.2rem;
}

.navbar-logo-text.show,
.login-logo-text.show {
  display: inline-block;
}

.language-toggle {
  padding: var(--spacing-2) var(--spacing-3);
  transition: all 0.2s ease;
}

.language-toggle:hover {
  color: var(--text-primary);
  transform: scale(1.1);
}

.language-toggle i {
  font-size: 18px;
}

#theme-toggle {
  transition: all 0.2s ease;
}

#theme-toggle:hover {
  transform: scale(1.05);
}

#theme-text {
  /* Was `margin-right` plus a [dir="rtl"] override flipping it to
     `margin-left` - the same side, named twice. */
  margin-inline-end: 5px;
}


/* ============================================================
   User card and dropdown in the navbar
   ============================================================
   The old sheet mirrored this block by hand with eight [dir] rules, and used
   `flex-direction: row-reverse` under [dir="rtl"] - which cancelled the
   mirroring rather than performing it, so the avatar sat on the LEFT in Arabic
   too. Logical properties do the job in one pass and mirror correctly. */

.user-dropdown-toggle {
  padding: 0;
  border: none;
}

.navbar-nav .user-dropdown-toggle .user-info-card {
  margin: 0;
}

.user-info-card {
  display: flex;
  align-items: center;
  gap: var(--spacing-4);
  padding: var(--spacing-3) var(--spacing-4);
  background-color: var(--background-neutral-light);
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
  cursor: pointer;
  min-width: 220px;
  border: 1px solid var(--border-neutral-secondary);
  text-align: start;
}

.user-info-card:hover {
  background-color: var(--background-default);
  border-color: var(--border-neutral-primary);
}

.user-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: start;
}

.user-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-default);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.user-email {
  font-size: 13px;
  color: var(--text-secondary-paragraph);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--background-default);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-primary-paragraph);
  font-size: 20px;
  border: 2px solid var(--border-neutral-secondary);
  overflow: hidden;
}

.user-profile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.dropdown-arrow {
  font-size: 12px;
  color: var(--text-secondary-paragraph);
  flex-shrink: 0;
  /* Pushes the chevron to the far end of the card in either direction. */
  margin-inline-start: auto;
  transition: transform 0.2s ease;
}

.user-dropdown-toggle[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
}

.user-dropdown-menu {
  min-width: 220px;
  margin-block-start: var(--spacing-2);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-neutral-secondary);
  background-color: var(--background-menu);
  padding: var(--spacing-2) 0;
  text-align: start;
  z-index: 1050; /* above the impersonation banner */
}

.user-dropdown-menu .dropdown-item {
  padding: var(--spacing-3) var(--spacing-4);
  font-size: 14px;
  color: var(--text-default);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.user-dropdown-menu .dropdown-item:hover {
  background-color: var(--background-neutral-light);
  color: var(--text-primary);
}

.user-dropdown-menu .dropdown-item.text-danger {
  color: var(--text-error);
}

.user-dropdown-menu .dropdown-item.text-danger:hover {
  background-color: var(--alpha-error-10);
  color: var(--text-error);
}

.user-dropdown-menu .dropdown-divider {
  margin: var(--spacing-2) 0;
  border-color: var(--border-neutral-secondary);
}

.user-dropdown-menu .dropdown-item i {
  width: 20px;
  text-align: center;
  margin-inline-end: var(--spacing-2);
}


/* On a phone the card collapses to just the avatar: the name and address are
   the first things worth their width. */
@media (max-width: 768px) {
  .user-info-card {
    min-width: auto;
    padding: var(--spacing-2) var(--spacing-3);
  }

  .user-details,
  .dropdown-arrow {
    display: none;
  }

  .user-avatar {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .user-dropdown-menu {
    min-width: 200px;
  }
}


/* ============================================================
   Impersonation banner
   ============================================================ */

.impersonation-banner {
  position: sticky;
  top: 0;
  z-index: 1060;
  /* Yellow 300 is the closest NDS step to the old #ffc107. Black on it clears
     8:1; the old dark-mode pairing (white on #ff9800) was 2.3:1 and failed. */
  background-color: var(--colors-yellow-300);
  color: var(--text-black);
  border-block-end: 2px solid var(--colors-yellow-500);
  font-weight: 500;
}

[data-theme="dark"] .impersonation-banner {
  /* A pale banner would glare on a dark page; step it down, keep black ink. */
  background-color: var(--colors-yellow-500);
  border-block-end-color: var(--colors-yellow-600);
}

/* Scoped to the banner, so it survives the Bootstrap teardown intact and can be
   deleted the day base.html's banner becomes `.nds-btn`. */
.impersonation-banner .btn-dark {
  background-color: var(--colors-neutral-900);
  border-color: var(--colors-neutral-900);
  color: var(--colors-base-white);
}

.impersonation-banner .btn-dark:hover {
  background-color: var(--colors-base-black);
  border-color: var(--colors-base-black);
}

@media (max-width: 768px) {
  .impersonation-banner {
    font-size: 0.875rem;
  }

  .impersonation-banner .btn-sm {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }
}


/* ============================================================
   Impersonation user search (results are built by impersonate.js)
   ============================================================ */

.user-search-results {
  max-height: 400px;
  overflow-y: auto;
  margin-block-start: var(--spacing-4);
}

/* The results list used to be a Bootstrap `.list-group`, which supplied the box:
   display, padding, separators, and the reset of the anchor's link colour. The
   bridge carries utilities only - components like .list-group are deliberately
   absent - so impersonate.js emits .user-result-list / .user-result-item and the
   two rules below carry what .list-group-item used to. */
.user-result-list {
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.user-result-item {
  cursor: pointer;
  transition: all 0.2s ease;
  border-inline-start: 3px solid transparent;
  display: block;
  padding: var(--spacing-3) var(--spacing-4);
  color: inherit;
  text-decoration: none;
}

.user-result-item + .user-result-item {
  border-block-start: 1px solid var(--border-secondary);
}

/* .nds-loading centres its spinner on the element, so the element needs a box
   tall enough to hold one (28px at .nds-sm) without the dimmed text behind it
   overlapping the glyph. */
.user-search-loading {
  min-height: 56px;
}

.user-result-item:hover {
  background-color: var(--background-neutral-light);
  border-inline-start-color: var(--background-primary);
  /* `transform` has no logical form, so this is one of the two [dir] overrides
     that genuinely earn their keep: the row must nudge INTO the page, which is
     leftwards in English and rightwards in Arabic. */
  transform: translateX(-2px);
}

[dir="rtl"] .user-result-item:hover {
  transform: translateX(2px);
}

.user-avatar-small {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--background-neutral-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary-paragraph);
  font-size: 16px;
  flex-shrink: 0;
}


/* ============================================================
   Profile page
   ============================================================ */

.profile-header {
  background-color: var(--background-neutral-light);
  color: var(--text-default);
  border-block-end: 1px solid var(--border-neutral-secondary);
}

.profile-image-preview {
  width: 150px;
  height: 150px;
  object-fit: cover;
}

.profile-image-placeholder {
  width: 150px;
  height: 150px;
}


/* ============================================================
   Log viewer
   ============================================================ */

.log-viewer-table-responsive {
  max-height: 600px;
  overflow-y: auto;
}

.log-viewer-table th {
  width: 150px;
}

.log-viewer-table th.log-level-column {
  width: 100px;
}

.log-viewer-table th.logger-column {
  width: 150px;
}


/* ============================================================================
   PMAU footer - modelled on the public pmau.edu.sa footer
   ============================================================================ */

.footer {
  /* NDS ships this exact treatment: deep brand green in light, a translucent
     green wash over the dark page in dark. The old hard-coded #084d31 stayed
     put in both themes. */
  background-color: var(--background-footer);
  position: relative;
  color: var(--text-oncolor-primary);
}

.footer * {
  font-family: var(--nds-font-family);
}

.footer .container {
  max-width: 1320px;
}

/* The section headings. The old rule was scoped to `.seu-footer`, a class that
   appears nowhere in the markup, so it never applied - these headings have
   always rendered at Bootstrap's default. Re-scoped to the class the footer
   actually carries. */
.footer h6,
.footer .h6 {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-oncolor-primary);
  margin-block-end: 1rem;
}

.footerLinksList {
  list-style: none;
  padding: 0;
  margin: 0 16px;
  color: var(--text-oncolor-primary);
  text-decoration: none;
  font-weight: 500;
}

.footerLinksList a {
  color: var(--text-oncolor-primary);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 500;
}

.footerLinksList a:hover {
  color: var(--text-oncolor-primary);
  text-decoration: underline;
}

.footerBottom .footerCopyright .links {
  display: flex;
  flex-wrap: wrap;
  font-size: x-small;
}

.copyRight {
  display: flex;
  flex-wrap: wrap;
  font-size: x-small;
  width: 50%;
}

.footerLogos {
  padding-inline-end: 23%;
  min-width: 200px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* Social and app-store buttons. Same story as the headings: the old rule keyed
   off `.seu-footer .btn-outline-light` and never matched. `.icon` is the class
   the markup actually carries, and unlike `.btn-outline-light` it survives the
   Bootstrap teardown. */
.footer .icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  border: 1.5px solid var(--border-oncolor-transparent-30);
  border-radius: var(--radius-sm);
  color: var(--text-oncolor-primary);
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.footer .icon:hover {
  background-color: var(--alpha-white-10);
  border-color: var(--alpha-white-50);
  color: var(--text-oncolor-primary);
  transform: translateY(-2px);
}

.footer .mobile-app-icons .icon {
  /* The app-store buttons are labelled, so they are pills rather than squares. */
  width: auto;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 300;
}

.svg-vertical-align {
  vertical-align: -0.125em;
}

.footer-logo-seu {
  height: 40px;
}

.footer-logo-vision {
  height: 30px;
}

.footer-logo-dga {
  height: 35px;
}

@media (max-width: 768px) {
  .footerLogos {
    padding-inline-end: 0;
  }
}


/* ============================================================
   Back to top
   ============================================================ */

.back-to-top {
  position: fixed;
  bottom: 30px;
  /* Was `right: 30px` plus a [dir="rtl"] override. */
  inset-inline-end: 30px;
  width: 45px;
  height: 45px;
  /* Was `var(--primary-color)`, a name nothing ever defined - so the button had
     no background at all, in either theme, since it was written. */
  background-color: var(--background-primary);
  color: var(--text-oncolor-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--colors-primary-sa-flag-700);
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
  color: var(--text-oncolor-primary);
}

@media (max-width: 768px) {
  .back-to-top {
    bottom: 20px;
    inset-inline-end: 20px;
    width: 40px;
    height: 40px;
  }
}


/* ============================================================
   Skip to main content
   ============================================================ */

.skip-to-content {
  position: absolute;
  inset-inline-start: 8px;
  top: -60px;
  z-index: 1080;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: var(--background-primary);
  color: var(--text-oncolor-primary);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s ease-in-out;
}

.skip-to-content:focus {
  top: 8px;
  color: var(--text-oncolor-primary);
}


/* ============================================================
   Dashboard layout
   ============================================================
   Six [data-theme="dark"] rules used to sit under this section, hand-picking
   #1a2333 / #253347 / #384250 so the sidebar would not dissolve into the page.
   The NDS surface tokens carry that separation themselves - the page is
   `--background-body` and the docked chrome is `--background-default`, one
   elevation step above it in BOTH themes - so all six are gone. */

.dashboard-sidebar {
  position: sticky;
  top: 0;
  height: calc(100vh - 140px);
  overflow-y: auto;
  background: var(--background-default);
  border-inline-end: 1px solid var(--border-neutral-secondary);
  padding: 16px 0;
}

.dashboard-sidebar-section {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary-paragraph);
  padding: 16px 16px 6px;
}

.dashboard-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-size: 0.88rem;
  color: var(--text-primary-paragraph);
  text-decoration: none;
  border-inline-start: 3px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.dashboard-nav-link:hover,
.dashboard-nav-link.active {
  background: var(--background-neutral-light);
  color: var(--text-primary);
}

.dashboard-nav-link.active {
  border-inline-start-color: var(--text-primary);
  font-weight: 600;
}

.dashboard-content {
  padding: 24px;
  min-height: calc(100vh - 140px);
}


/* ============================================================
   KPI cards
   ============================================================ */

.kpi-card {
  background: var(--background-card);
  border: 1px solid var(--border-neutral-secondary);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.kpi-value {
  font-size: clamp(1.25rem, 3.5vw, 1.9rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-default);
  /* break-all split "1,204" mid-thousands-group. Wrap only where it is safe,
     and use tabular figures so columns of numbers line up. */
  overflow-wrap: anywhere;
  word-break: normal;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.kpi-label {
  font-size: 0.8rem;
  color: var(--text-secondary-paragraph);
  margin-block-end: 4px;
  word-break: break-word;
}

.kpi-subtext {
  font-size: 0.75rem;
  color: var(--text-secondary-paragraph);
  margin-block-start: 2px;
}


/* ============================================================
   Chart cards
   ============================================================ */

.chart-card {
  background: var(--background-card);
  border: 1px solid var(--border-neutral-secondary);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.chart-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary-paragraph);
  margin-block-end: 14px;
  word-break: break-word;
}

.echarts-container {
  width: 100%;
  /* ECharts has no RTL mode: it lays out and measures its SVG assuming LTR. On this
     RTL-by-default app the inherited direction made it reserve almost no room for
     category-axis labels, so Arabic college names were drawn against the axis, ran off
     the card and were clipped to a single glyph. Pinning the canvas to LTR keeps the
     chart geometry predictable; the label TEXT still shapes and orders correctly,
     because Unicode bidi resolves that per run, not from this property.
     `.nds-chart` needs none of this - it reads its own computed direction - so this
     rule retires with the last ECharts container. */
  direction: ltr;
}


/* ============================================================
   Saved insights (/dashboard/assistant/cards/)
   ============================================================
   The gallery is a dashboard tab, so it is built from `.kpi-card` and
   `.chart-card` above. These are the few things a panel needs that no other tab
   does: a compact figure row inside a chart card, and a footer that stays at the
   bottom however tall its neighbour grows.

   Every box-model direction here is a LOGICAL property - this app renders RTL by
   default and a `margin-left` would put the footer rule on the wrong side.
   ============================================================ */

.insight-panel {
  display: flex;
  flex-direction: column;
  block-size: 100%;
}

.insight-panel-body { flex: 1 1 auto; }

.insight-panel .chart-title a {
  color: var(--text-default);
  text-decoration: none;
}

.insight-panel .chart-title a:hover { text-decoration: underline; }

/* A KPI row that has to share a card with a chart. Smaller than `.kpi-value`,
   which is sized to be the only thing on its tile. */
.insight-figures {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-block-end: 12px;
}

.insight-figure { min-inline-size: 0; }

.insight-figure-value {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-default);
  overflow-wrap: anywhere;
  word-break: normal;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.insight-figure-unit {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary-paragraph);
}

.insight-meta {
  font-size: 0.75rem;
  color: var(--text-secondary-paragraph);
}

.insight-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-block-start: 14px;
  padding-block-start: 12px;
  border-block-start: 1px solid var(--border-neutral-secondary);
}


/* ============================================================
   Term selector
   ============================================================ */

/* Matches the element, not the Bootstrap class, so it keeps working when the
   control becomes `.nds-select > .nds-form-control > select`. */
.term-selector select {
  font-size: 0.82rem;
}


/* ============================================================
   Mobile navigation (drawer)
   ============================================================ */

.dashboard-mobile-bar {
  background: var(--background-default);
}

.dashboard-drawer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  /* A nav control is a primary touch target: never below 44px. */
  min-height: 44px;
  padding-inline: 14px;
  font-size: 0.85rem;
  font-weight: 600;
}

.dashboard-drawer {
  width: min(310px, 85vw);
  background: var(--background-default);
}

.dashboard-drawer .dashboard-nav-link {
  min-height: 44px;
  font-size: 0.92rem;
}


/* ============================================================
   Hover hints (templates/dashboard/_hint.html)
   ============================================================
   `--text-primary` is NDS's brand ink and already lightens in dark mode, so the
   two [data-theme="dark"] overrides this pair used to carry are gone. */

.hint-icon {
  border: 0;
  background: none;
  padding: 0 2px;
  line-height: 1;
  color: var(--text-secondary-paragraph);
  font-size: 0.8em;
  cursor: help;
  vertical-align: baseline;
}

.hint-icon:hover,
.hint-icon:focus-visible {
  color: var(--text-primary);
}

.hint-icon:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
  border-radius: 50%;
}


/* ============================================================
   Role administration (list, single role, cards -> roles)
   ============================================================ */

/* The role name is the row's only link into the role, so it carries the brand
   colour instead of the browser blue - a table of 38 rows should read as a list
   of destinations. */
.role-link {
  color: var(--text-primary);
}

.role-link:hover,
.role-link:focus-visible {
  color: var(--seu-brand-ink-hover);
  text-decoration: underline;
}

/* One domain of insight cards. The tinted header is what turns 28 checkboxes
   into five short, countable lists. */
.role-card-group {
  overflow: hidden;
}

.role-card-group-head {
  background: var(--background-neutral-light);
  border-block-end: 1px solid var(--border-neutral-secondary);
}

/* Dashboard page body.
   NDS styles .nds-main-content as `display:flex; flex-wrap:wrap` and never sets
   flex-direction, so it is a ROW. That suits NDS's own pages, whose children are
   <section>s carrying flex:1 1 100%. Our dashboard pages put plain blocks in
   there, and each one became a row item that shrank to fit its content - three
   stacked rows measured 961 / 593 / 1036px inside the same 1036px column.

   One wrapper in base_dashboard.html turns the page body back into a column, so
   no page has to think about it. `min-width: 0` is load-bearing: without it a
   wide table refuses to shrink and pushes the whole document past the viewport
   (measured at 1619px wide in a 1440px window). */
.dashboard-page {
  flex: 1 1 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--spacing-8);
}

/* The dashboard side menu: stuck to the side, scrolling on its own.
   NDS lays .nds-content-layout out as a row, so the <aside> is a flex item and
   stretches to the height of the tallest sibling - on the role dashboard that is
   26 cards, and the menu was rendering 9,623px tall inside a 10,072px page. It
   therefore scrolled away with the content and dragged a column of empty space
   down the whole page.

   align-self keeps it its natural height, sticky pins it while the page moves,
   and the drawer gets the scrollbar so a 36-item nav can never make the DOCUMENT
   longer than its content needs. --nds-nav-height is NDS's own top-nav token, so
   the menu sits directly under the header rather than behind it. */
.nds-content-layout > .nds-sidemenu {
  align-self: flex-start;
  position: sticky;
  top: var(--nds-nav-height, 72px);
  max-block-size: calc(100vh - var(--nds-nav-height, 72px));
  display: flex;
  flex-direction: column;
  min-block-size: 0;
}

.nds-content-layout > .nds-sidemenu > .nds-drawer {
  min-block-size: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* `.nds-toEdge` zeroes --main-padding-inline so the side menu can reach the
   window edge. The content still needs a gutter, so it goes here instead - on
   the page body rather than on the layout, which is what keeps the menu flush
   while the cards stay off the edge. */
.nds-content-layout.nds-toEdge > .nds-main-content > .dashboard-page {
  padding-inline: var(--nds-viewport-padding, 32px);
  padding-block: var(--spacing-8);
}

/* ---------------------------------------------------------------------------
   Theme change: the new theme spreads from the toggle as a growing circle.

   The View Transitions API snapshots the page before and after the change as
   two stacked layers. By default it cross-fades them; we cancel that and
   instead clip the NEW layer to a circle that grows from the point the reader
   clicked out to the furthest corner. The old layer is left untouched
   underneath, so the new theme appears to eat it.

   theme.js supplies --seu-wipe-x / -y / -r, because the origin and the radius
   are geometry CSS cannot derive. It also skips the whole thing under reduced
   motion, and in browsers with no startViewTransition, where the theme simply
   flips - so nothing here needs a fallback of its own.

   The pseudo-elements sit on the document element, hence html::view-transition,
   with no descendant space. --seu-wipe-r has no fallback on purpose: if the
   variable is ever missing the animation is invalid and skipped, which is a
   better failure than a circle of the wrong size.
--------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  html::view-transition-old(root),
  html::view-transition-new(root) {
    /* Kill the default cross-fade; the clip-path below is the whole effect. */
    animation: none;
    mix-blend-mode: normal;
  }

  html[data-theme-wipe]::view-transition-old(root) { z-index: 1; }
  html[data-theme-wipe]::view-transition-new(root) { z-index: 2; }

  html[data-theme-wipe]::view-transition-new(root) {
    animation: seu-theme-wipe 520ms cubic-bezier(0.4, 0, 0.2, 1);
  }

  @keyframes seu-theme-wipe {
    from { clip-path: circle(0 at var(--seu-wipe-x) var(--seu-wipe-y)); }
    to   { clip-path: circle(var(--seu-wipe-r) at var(--seu-wipe-x) var(--seu-wipe-y)); }
  }
}
