/* ==========================================================================
   🤖 EQUIPAY ENGINE - GLOBAL STYLESHEET
   ========================================================================== */

/* 1. EQUIPAY DESIGN SYSTEM TOKENS
   Colours are CSS variables only — never hardcode a hex in a component.
   Light values live on :root; html[data-theme="dark"] overrides them.
   The legacy --md-* tokens below are aliased to the design system so every
   not-yet-redesigned component themes (and flips to dark) for free; each page
   drops the aliases for the real tokens as it's converted. */
:root {
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface2: #eef2f0;
  --ink: #132420;
  --muted: #5b6b64;
  --faint: #93a099;
  --border: #e4eae6;
  --hair: #f1f4f2;
  --topbar: rgba(244, 246, 245, 0.85);
  --accent: #0f7a5c;
  --accent2: #0a5a43;
  --accent-ink: #0a5a43;
  --accent-soft: #e6f2ec;
  --gold: #b3862f;
  --gold-soft: #f6edda;
  --alert: #c0442e;
  --alert-soft: #fae7e2;
  --warn: #b9772a;
  --grid: #eef2f0;
  --grid2: #e4eae6;
  --pad: 24px;
  --rowpad: 16px;
  --msr: 'Material Symbols Rounded';
  --font-ui: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  /* Legacy Material tokens → aliased to the design system (see note above). */
  --md-primary: var(--accent);
  --md-primary-bg: var(--accent-soft);
  --md-surface: var(--surface);
  --md-background: var(--bg);
  --md-on-surface: var(--ink);
  --md-on-surface-variant: var(--muted);
  --md-border: var(--border);

  --md-type-headline: 700 22px/1.25 var(--font-ui);
  --md-type-title-large: 700 18px/1.3 var(--font-ui);
  --md-type-title-medium: 600 16px/1.4 var(--font-ui);
  --md-type-body-large: 400 15px/1.5 var(--font-ui);
  --md-type-body-medium: 400 14px/1.5 var(--font-ui);
  --md-type-label-large: 500 14px/20px var(--font-ui);
  --md-type-label-small: 500 11px/16px var(--font-ui);
}

html[data-theme="dark"] {
  --bg: #0e1512;
  --surface: #151f1b;
  --surface2: #1c2723;
  --ink: #e9f0ec;
  --muted: #9db0a7;
  --faint: #6b7d75;
  --border: #26332d;
  --hair: #212d28;
  --topbar: rgba(14, 21, 18, 0.86);
  --accent: #2ba884;
  --accent2: #1f8e6b;
  --accent-ink: #6fdcb4;
  --accent-soft: #15322a;
  --gold: #d0a24e;
  --gold-soft: #2a2214;
  --alert: #e26a54;
  --alert-soft: #3a201b;
  --warn: #d0904a;
  --grid: #243029;
  --grid2: #2e3b34;
}

/* Dark-mode gotcha: the element carrying the dark tokens must itself set
   color/background against the active --ink/--bg, or inherited (uncoloured)
   text keeps the light --ink and disappears. body does that here. */
body { font: var(--md-type-body-medium); background-color: var(--bg); color: var(--ink); margin: 0; padding: 0; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6 { margin-top: 0; color: var(--md-on-surface); }

/* ==========================================================================
   2. APP SHELL — sidebar + sticky topbar + scrolling content
   ========================================================================== */
#app-container { display: flex; min-height: 100vh; }
.app-main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ── Sidebar ── */
#sidebar {
  width: 264px; flex-shrink: 0; box-sizing: border-box;
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 20px 12px; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 60;
}
#sidebar .logo { display: flex; align-items: center; gap: 11px; padding: 4px 8px 20px; margin: 0; }
#sidebar .logo .e {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; letter-spacing: -0.02em; flex-shrink: 0;
}
#sidebar .logo .wordmark { display: flex; flex-direction: column; line-height: 1.15; }
#sidebar .logo .brand { font-weight: 700; font-size: 16px; letter-spacing: -0.02em; color: var(--ink); }
#sidebar .logo .engine {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.14em;
  color: var(--faint); text-transform: uppercase;
}

#sidebar nav {
  display: flex; flex-direction: column; gap: 2px;
  padding: 0 4px; flex: 1; width: 100%; min-height: 0;
}

/* Scrollable region for the normal nav-group/root-item list. Inställningar
   (Settings) is a sibling of this div, not a child of it, so it renders
   pinned directly above the account/logout footer at a fixed position —
   never inside the scrollable area, regardless of how long this list grows. */
#sidebar nav .nav-scroll {
  display: flex; flex-direction: column; gap: 2px;
  flex: 1; overflow-y: auto; min-height: 0;
  /* With 9 top-level nav groups (Anställda, Lönekartläggning, Medarbetar-
     undersökning, OKR, DEI, Workforce, Dashboards, Rapporter, Schema) plus
     an open submenu, this list now genuinely exceeds the viewport on most
     screens — especially for SuperAdmin, whose extra tenant-switcher block
     eats more header space, leaving less room here. The overflow-y:auto
     above is enough for mouse-wheel/trackpad, but touch drags on mobile can
     feel unresponsive inside a nested scroll container without an explicit
     opt-in — some mobile browsers otherwise let an ancestor (or nothing)
     claim the gesture instead of scrolling this list.
     `touch-action: pan-y` lets the browser handle vertical touch scrolling
     here immediately instead of waiting to see if JS will preventDefault it. */
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  /* Discoverability (learned the hard way, reported as "menu items are
     hidden"): overflowing content with no visual cue reads as a dead end —
     the last visible item's text just stops at the box edge with nothing
     suggesting "scroll for more," especially where the OS/browser
     auto-hides the scrollbar until an active drag. Two independent fixes,
     neither relying on JS (so they can't drift out of sync with the
     JS-driven submenu open/close state):
     1. An explicitly visible thin scrollbar, so its mere presence signals
        "there's more" regardless of OS scrollbar-visibility settings. */
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  /* 2. A pure-CSS top/bottom "scroll shadow": two gradients that scroll
        WITH the content (background-attachment: local) mask the shadow
        near the top/bottom edge until you're actually there, layered under
        two fixed shadow gradients (background-attachment: scroll) — the
        classic technique, shows a shadow on a given edge ONLY when there is
        more content to scroll to in that direction. */
  background-image:
    linear-gradient(var(--surface) 30%, rgba(255, 255, 255, 0)),
    linear-gradient(rgba(255, 255, 255, 0), var(--surface) 70%),
    linear-gradient(to bottom, rgba(19, 36, 32, 0.10), rgba(19, 36, 32, 0)),
    linear-gradient(to top, rgba(19, 36, 32, 0.12), rgba(19, 36, 32, 0));
  /* Per-layer position (a "position" component is only valid appended to an
     image within the `background` SHORTHAND, never in the `background-image`
     LONGHAND — putting it there makes that one layer invalid, which per spec
     invalidates the entire comma-separated list, silently dropping the whole
     declaration. Keeping position as its own longhand, aligned by layer
     index, avoids that trap and keeps `background-color` a plain longhand
     too (verified via an isolated getComputedStyle check, not just visually,
     since a silently-dropped background is exactly the kind of thing that
     looks fine in the CSS source and does nothing in the browser). */
  background-position: 0 0, 0 100%, 0 0, 0 100%;
  background-repeat: no-repeat;
  background-color: var(--surface);
  background-size: 100% 24px, 100% 24px, 100% 10px, 100% 10px;
  background-attachment: local, local, scroll, scroll;
}
#sidebar nav .nav-scroll::-webkit-scrollbar { width: 6px; }
#sidebar nav .nav-scroll::-webkit-scrollbar-track { background: transparent; }
#sidebar nav .nav-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Settings, pinned above the account/logout footer (see .sidebar-user
   below) and outside .nav-scroll's scrollable area. */
#sidebar nav > a.nav-pinned-item {
  flex-shrink: 0;
  margin-top: 6px;
}

/* Group trigger (collapsible) */
#sidebar .nav-group-trigger {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 10px; cursor: pointer;
  color: var(--muted); font-weight: 600; font-size: 13px;
  user-select: none; margin: 0; box-sizing: border-box;
  transition: background 0.15s, color 0.15s;
}
#sidebar .nav-group-trigger:hover { background: var(--surface2); color: var(--ink); }
#sidebar .nav-group-trigger .material-symbols-rounded { font-size: 20px; }
#sidebar .nav-group-trigger .arrow { font-size: 18px; margin-left: auto; transition: transform 0.2s ease; }
#sidebar .nav-group-trigger.open { color: var(--accent-ink); }
#sidebar .nav-group-trigger.open .arrow { transform: rotate(90deg); }

/* Submenu (indented under a left rule, animated max-height) */
#sidebar .nav-submenu {
  max-height: 0; overflow: hidden;
  transition: max-height 0.28s ease;
  display: flex; flex-direction: column; gap: 2px;
  margin: 2px 0 0 22px; padding-left: 12px;
  border-left: 1.5px solid var(--border);
  /* .nav-submenu is a flex item inside .nav-scroll's own flex column. A flex
     item with non-visible overflow gets an AUTOMATIC MINIMUM SIZE of 0 per
     the flexbox spec, so without flex-shrink:0 the max-height above is only
     an upper bound — flexbox silently crushes this toward 0px real height
     whenever the sidebar's total content (9 top-level groups + submenus)
     overflows .nav-scroll's available height, which is common on shorter
     viewports (worse for SuperAdmin, whose tenant-switcher card eats extra
     vertical space above the nav list). Confirmed via a real-markup+real-CSS
     Playwright repro: without this, an open submenu measured 0px actual
     height despite max-height computing correctly to 340px. */
  flex-shrink: 0;
}
#sidebar .nav-submenu.open { max-height: 340px; margin-bottom: 6px; }

/* Nav links (flat items + submenu links) */
#sidebar nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 10px;
  font-size: 13.5px; font-weight: 500;
  color: var(--muted); text-decoration: none; box-sizing: border-box;
  transition: background 0.15s, color 0.15s;
}
#sidebar nav a:hover { background: var(--surface2); color: var(--ink); }
#sidebar nav a.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
#sidebar .nav-submenu a { padding: 7px 12px; border-radius: 8px; font-size: 13px; }
#sidebar nav a .material-symbols-rounded { font-size: 20px; }
#sidebar .nav-submenu-placeholder { display: block; padding: 7px 12px; font-size: 12.5px; color: var(--faint); font-style: italic; }

/* Sidebar user footer */
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  margin-top: 8px; padding: 12px 8px 4px;
  border-top: 1px solid var(--border);
}
.sidebar-user-info {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
  cursor: pointer; border-radius: 8px; padding: 4px; margin: -4px;
  transition: background 0.15s;
}
.sidebar-user-info:hover { background: var(--surface2); }
.sidebar-user .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; flex-shrink: 0;
}
.sidebar-user .avatar.has-photo { background-size: cover; background-position: center; color: transparent; }
.sidebar-user .who { flex: 1; min-width: 0; line-height: 1.2; }
.sidebar-user .who .name { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .who .role { font-size: 11px; color: var(--faint); }
.sidebar-user .logout {
  width: 34px; height: 34px; border-radius: 9px;
  border: none; background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); flex-shrink: 0;
}
.sidebar-user .logout:hover { background: var(--surface2); color: var(--alert); }

/* ── Topbar ── */
#topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--topbar); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 12px clamp(16px, 3vw, 32px); box-sizing: border-box;
}
#topbar .topbar-title { min-width: 0; }
#topbar .eyebrow {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.12em; color: var(--faint); text-transform: uppercase;
}
#topbar .page-title {
  font-size: clamp(18px, 2.4vw, 22px); font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.2; color: var(--ink);
}
#topbar .topbar-spacer { flex: 1; }
#topbar .search-trigger {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 11px; padding: 9px 12px;
  max-width: 280px; flex: 1; min-width: 0; cursor: pointer;
  transition: border-color 0.15s;
}
#topbar .search-trigger:hover { border-color: var(--accent); }
#topbar .search-trigger .material-symbols-rounded { font-size: 19px; color: var(--faint); }
#topbar .search-trigger .label { flex: 1; font-size: 13.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#topbar .search-trigger .kbd {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--faint);
  border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; flex-shrink: 0;
}
.eq-icon-btn {
  width: 40px; height: 40px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; color: var(--muted); position: relative;
}
.eq-icon-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.eq-icon-btn .material-symbols-rounded { font-size: 20px; }
.eq-notif-dot { position: absolute; top: 9px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--alert); }

/* Segmented toggle (SV/EN) */
.eq-segmented {
  display: flex; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 10px; padding: 3px; flex-shrink: 0;
}
.eq-segmented button {
  border: none; background: transparent; color: var(--faint);
  font-family: var(--font-ui); font-size: 12px; font-weight: 700;
  padding: 5px 11px; border-radius: 8px; cursor: pointer;
}
.eq-segmented button.active { background: var(--surface); color: var(--accent-ink); box-shadow: 0 1px 2px rgba(19, 36, 32, 0.1); }

/* The topbar hamburger only has a job on mobile (opens the off-canvas
   drawer — see the ≤900px block further down); desktop collapsing now has
   its own dedicated edge-tab control (.sidebar-collapse-toggle below). */
#topbar-hamburger { display: flex; }
@media (min-width: 901px) {
  #topbar-hamburger { display: none; }
}

/* Desktop sidebar collapse: a small edge tab, half-overlapping the sidebar's
   right border — VS Code / Notion style. Collapsing shrinks #sidebar to zero
   width (not display:none) so the tab, its flex sibling, keeps its place in
   the layout and stays clickable to re-expand. */
.sidebar-collapse-toggle { display: none; }
@media (min-width: 901px) {
  #sidebar { transition: width 0.2s ease, padding 0.2s ease; overflow: hidden; }
  body.sidebar-collapsed #sidebar { width: 0; padding-left: 0; padding-right: 0; border-right: none; }

  .sidebar-collapse-toggle {
    display: flex; align-items: center; justify-content: center;
    align-self: center; flex-shrink: 0;
    width: 18px; height: 40px; margin-left: -9px; z-index: 65;
    background: #e6f2ef; border: 1px solid var(--border);
    border-radius: 0 8px 8px 0; cursor: pointer; color: var(--muted);
    transition: background 0.15s, color 0.15s;
  }
  .sidebar-collapse-toggle:hover { background: var(--surface2); color: var(--ink); }
  .sidebar-collapse-toggle .material-symbols-rounded { font-size: 16px; transition: transform 0.2s ease; }
  body.sidebar-collapsed .sidebar-collapse-toggle .material-symbols-rounded { transform: rotate(180deg); }
}

/* Content region */
#app-content { flex: 1; min-height: 0; padding: clamp(16px, 3vw, 28px); box-sizing: border-box; }

/* View fade-in on navigation */
@keyframes eqfade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#app-content > * { animation: eqfade 0.35s ease; }

/* ── Command palette (⌘K) ── */
.eq-palette-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(10, 15, 13, 0.5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: none; align-items: flex-start; justify-content: center; padding: 11vh 16px 16px;
}
.eq-palette-overlay.open { display: flex; }
.eq-palette {
  width: 100%; max-width: 600px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: 0 24px 64px rgba(10, 15, 13, 0.4);
  overflow: hidden; animation: eqfade 0.16s ease;
}
.eq-palette-head { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.eq-palette-head .material-symbols-rounded { font-size: 22px; color: var(--faint); }
.eq-palette-head input { flex: 1; border: none; outline: none; background: transparent; font-family: var(--font-ui); font-size: 16px; color: var(--ink); }
.eq-palette-head .kbd { font-family: var(--font-mono); font-size: 11px; color: var(--faint); border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px; cursor: pointer; flex-shrink: 0; }
.eq-palette-results { max-height: 52vh; overflow-y: auto; padding: 8px; }
.eq-palette-empty { padding: 30px 16px; text-align: center; color: var(--faint); font-size: 14px; }
.eq-palette-cat { padding: 12px 10px 4px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.eq-palette-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; cursor: pointer; }
.eq-palette-item:hover, .eq-palette-item.active { background: var(--accent-soft); }
.eq-palette-item .icon { font-family: var(--msr); font-size: 20px; color: var(--accent); width: 24px; text-align: center; flex-shrink: 0; }
.eq-palette-item .txt { flex: 1; min-width: 0; line-height: 1.25; }
.eq-palette-item .txt .lbl { font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eq-palette-item .txt .sub { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eq-palette-item .go { font-family: var(--msr); font-size: 18px; color: var(--faint); flex-shrink: 0; }
.eq-palette-foot { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border); background: var(--surface2); font-size: 11.5px; color: var(--faint); }
.eq-palette-foot .kbd { font-family: var(--font-mono); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; background: var(--surface); margin-right: 6px; }

/* ── Help manual panel (topbar "?") — slide-in right-hand drawer, same
   overlay/backdrop treatment as the command palette above, docked right. ── */
.eq-help-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(10, 15, 13, 0.5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: none; justify-content: flex-end;
}
.eq-help-overlay.open { display: flex; }
@keyframes eqslidein { from { transform: translateX(100%); } to { transform: translateX(0); } }
.eq-help-panel {
  width: 420px; max-width: 92vw; height: 100vh; box-sizing: border-box;
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: -24px 0 64px rgba(10, 15, 13, 0.35);
  display: flex; flex-direction: column;
  animation: eqslidein 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.eq-help-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.eq-help-head > .material-symbols-rounded { font-size: 22px; color: var(--accent); }
.eq-help-head h3 { flex: 1; margin: 0; font-size: 16px; font-weight: 700; color: var(--ink); font-family: var(--font-ui); }
.eq-help-head .kbd { font-family: var(--font-mono); font-size: 11px; color: var(--faint); border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px; cursor: pointer; flex-shrink: 0; }
.eq-help-search { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.eq-help-search .material-symbols-rounded { font-size: 20px; color: var(--faint); }
.eq-help-search input { flex: 1; border: none; outline: none; background: transparent; font-family: var(--font-ui); font-size: 14.5px; color: var(--ink); }
.eq-help-results { flex: 1; overflow-y: auto; padding: 6px 10px 24px; }
.eq-help-empty { padding: 30px 16px; text-align: center; color: var(--faint); font-size: 14px; }
.eq-help-theme { border-bottom: 1px solid var(--border); }
.eq-help-theme > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 12px 8px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.eq-help-theme > summary::-webkit-details-marker { display: none; }
.eq-help-theme > summary > .material-symbols-rounded { font-size: 18px; transition: transform 0.2s ease; flex-shrink: 0; }
.eq-help-theme[open] > summary > .material-symbols-rounded { transform: rotate(90deg); }
.eq-help-theme > summary .count { margin-left: auto; background: var(--surface2); color: var(--faint); border-radius: 20px; padding: 1px 8px; font-size: 10.5px; }
.eq-help-article { border-radius: 10px; margin: 2px 0 8px; }
.eq-help-article > summary { list-style: none; cursor: pointer; padding: 9px 10px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.eq-help-article > summary::-webkit-details-marker { display: none; }
.eq-help-article > summary:hover { background: var(--accent-soft); }
.eq-help-article > summary .material-symbols-rounded { font-size: 16px; color: var(--faint); transition: transform 0.2s ease; margin-left: auto; flex-shrink: 0; }
.eq-help-article[open] > summary .material-symbols-rounded { transform: rotate(90deg); }
.eq-help-body { padding: 2px 10px 12px; font-size: 13.5px; line-height: 1.55; color: var(--faint); }
.eq-help-body a, .eq-help-link { color: var(--accent); font-weight: 600; text-decoration: none; }
.eq-help-body a:hover, .eq-help-link:hover { text-decoration: underline; }
.eq-help-footer { flex-shrink: 0; border-top: 1px solid var(--border); padding: 12px 18px; }
.eq-help-footer .eq-help-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; }

/* ── Mobile drawer backdrop ── */
.drawer-backdrop { display: none; position: fixed; inset: 0; background: rgba(19, 36, 32, 0.4); z-index: 40; }
.drawer-backdrop.active { display: block; }

/* SuperAdmin switcher — re-tokenised so it themes (indigo inline styles overridden) */
#superadmin-switcher { background: var(--accent-soft) !important; border: 1px solid var(--border) !important; }
#superadmin-switcher label { color: var(--accent-ink) !important; }

.card, .settings-card, .dashboard-grid > div, .benchmark-tool-grid .card { background: var(--md-surface); border-radius: 12px; border: 1px solid var(--md-border); box-shadow: none; margin-bottom: 24px; padding: 24px; }
.card-title, .card-header h2, .table-title { font: var(--md-type-title-large); color: var(--md-on-surface); margin-bottom: 16px; }
.text-secondary { font: var(--md-type-body-medium); color: var(--md-on-surface-variant); }

.md-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; height: 40px; border-radius: 11px; font: var(--md-type-label-large); cursor: pointer; transition: background-color 0.2s, box-shadow 0.2s, color 0.2s, border-color 0.2s; border: 1px solid transparent; text-transform: none; }
.md-btn-primary { background-color: var(--accent); color: #ffffff; }
.md-btn-primary:hover:not(:disabled) { background-color: var(--accent2); }
.md-btn-outline { background-color: var(--surface); color: var(--ink); border: 1px solid var(--border); }
.md-btn-outline:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-ink); }
.md-btn:disabled { background-color: var(--surface2); color: var(--faint); cursor: not-allowed; border-color: transparent; box-shadow: none; }

.table-pagination { display: flex; align-items: center; justify-content: flex-end; padding: 16px 24px; border-top: 1px solid var(--md-border); gap: 32px; background-color: var(--md-surface); border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; }
.pagination-controls, .pagination-actions { display: flex; align-items: center; gap: 8px; }
.rows-select { border: none; background: transparent; font: var(--md-type-body-medium); color: var(--md-on-surface); cursor: pointer; outline: none; padding: 4px; }
.md-icon-btn { background: transparent; border: none; border-radius: 50%; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--md-on-surface-variant); }
.md-icon-btn:hover:not(:disabled) { background-color: rgba(31, 31, 31, 0.08); color: var(--md-on-surface); }
.md-icon-btn:disabled { color: rgba(31, 31, 31, 0.38); cursor: not-allowed; }

/* --- COMPACT FILTER & STATS BARS --- */
.filter-bar {
  background: var(--md-surface);
  border-radius: 12px;
  border: 1px solid var(--md-border);
  margin-bottom: 12px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}

.stats-bar {
  padding: 16px 24px; 
  margin-bottom: 16px;
}

.filter-label {
  font: var(--md-type-label-large, 500 14px/20px 'Roboto', sans-serif);
  color: var(--md-on-surface-variant, #444746);
  margin-right: 24px;
}
.filter-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex-grow: 1;
}
.filter-options button {
  background-color: transparent;
  border: 1px solid var(--md-border, #e0e0e0);
  border-radius: 16px;
  padding: 6px 16px;
  font: var(--md-type-body-medium, 400 14px/20px 'Roboto', sans-serif);
  color: var(--md-on-surface-variant, #444746);
  cursor: pointer;
  transition: all 0.2s ease;
}
.filter-options button:hover {
  background-color: var(--md-background, #f8f9fa);
}
.filter-options button.active {
  background-color: var(--md-primary-bg, #e8f0fe);
  color: var(--md-primary, #0b57d0);
  border-color: var(--md-primary, #0b57d0);
  font-weight: 500;
}
.filter-options button.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.refresh-button {
  margin-left: auto; 
}

/* --- COLLAPSIBLE SIDEBAR LAYOUT --- */
.page-with-sidebar {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  width: 100%;
}

.filter-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--md-surface);
  border: 1px solid var(--md-border);
  border-radius: 12px;
  padding: 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: sticky;
  top: 88px; 
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.filter-sidebar.collapsed {
  width: 0;
  padding: 0;
  border: none;
  opacity: 0;
  margin-right: -24px;
  overflow: hidden;
}

.sidebar-filter-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-filter-group .filter-label {
  font: var(--md-type-label-small);
  color: var(--md-on-surface-variant);
  margin: 0;
}

.sidebar-filter-group .filter-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-filter-group .filter-options button {
  width: 100%;
  text-align: left;
  border-radius: 8px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  justify-content: flex-start;
}

.sidebar-filter-group .filter-options button:hover {
  background: var(--md-background);
}

.sidebar-filter-group .filter-options button.active {
  background: var(--md-primary-bg);
  color: var(--md-primary);
  font-weight: 500;
}

.main-content-area {
  flex-grow: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.top-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--md-surface);
  border: 1px solid var(--md-border);
  border-radius: 12px;
  padding: 12px 24px;
}

.top-action-bar .left-actions, 
.top-action-bar .right-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- ANALYSIS DASHBOARD STYLES --- */
.analysis-dashboard {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.metrics-container {
  display: flex;
  justify-content: space-between;
  background-color: var(--md-surface, #ffffff);
  border: 1px solid var(--md-border, #e0e0e0);
  border-radius: 12px;
  padding: 16px;
}

.metric-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-grow: 1;
  padding: 8px 16px;
  border-right: 1px solid var(--md-border, #e0e0e0);
}

.metric-card:last-child { border-right: none; }

.metric-title {
  font: var(--md-type-label-small, 500 11px/16px 'Roboto', sans-serif);
  color: var(--md-on-surface-variant, #444746);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.metric-value {
  font: var(--md-type-headline, 400 24px/32px 'Roboto', sans-serif);
  color: var(--md-on-surface, #1f1f1f);
}

.metric-card.highlight {
  background-color: var(--accent-soft);
  border-radius: 8px;
  border: 1px solid var(--accent);
  margin: -8px -16px -8px 0;
  padding: 16px 24px;
}

.metric-card.highlight .metric-value,
.metric-card.highlight .metric-title {
  color: var(--md-primary, #0b57d0);
}

.content-container {
  display: flex;
  gap: 24px;
}

.details-table-wrapper {
  flex-basis: 400px;
  flex-grow: 0;
  background-color: var(--md-surface, #ffffff);
  border: 1px solid var(--md-border, #e0e0e0);
  border-radius: 12px;
  padding: 24px;
}

.summary-card {
  flex: 1;
  flex-basis: auto;
}

.table-card {
  background-color: var(--md-surface, #ffffff);
  border: 1px solid var(--md-border, #e0e0e0);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.table-subtitle {
  font: var(--md-type-body-medium);
  color: var(--md-on-surface-variant);
  margin-bottom: 24px;
}

.compliance-summary-table {
  width: 100%;
  border-collapse: collapse;
}

.compliance-summary-table th {
  text-align: left;
  padding: 12px 16px;
  font: var(--md-type-label-small);
  color: var(--md-on-surface-variant);
  text-transform: uppercase;
  border-bottom: 1px solid var(--md-border);
  background: var(--md-background);
}

.compliance-summary-table td {
  padding: 16px;
  border-bottom: 1px solid #f1f3f5;
  font: var(--md-type-body-medium);
  color: var(--md-on-surface);
}

.compliance-summary-table th:not(:first-child),
.compliance-summary-table td:not(:first-child) {
  text-align: right;
}

.compliance-summary-table tfoot tr td {
  font-weight: 700;
  background: var(--md-background);
  border-top: 2px solid var(--md-border);
  border-bottom: none;
}

.female-dom-chip {
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  text-transform: uppercase;
}

.dashboard-header { margin-bottom: 24px; }

.details-title {
  font: var(--md-type-title-large, 500 22px/28px 'Roboto', sans-serif);
  color: var(--md-on-surface, #1f1f1f);
  margin: 0;
}

.details-table { display: flex; flex-direction: column; }

.details-header {
  font: var(--md-type-label-small);
  color: var(--md-on-surface-variant);
  text-transform: uppercase;
  margin-bottom: 16px;
  margin-top: 16px;
}
.details-header:first-child { margin-top: 0px; }

.details-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 12px;
  border-bottom: 1px solid #f1f3f5;
}

.details-row:last-child { border-bottom: none; }

.details-row span:first-child {
  font: var(--md-type-body-large);
  color: var(--md-on-surface-variant);
}

.details-row span:last-child {
  font: var(--md-type-body-large);
  font-weight: 500;
  color: var(--md-on-surface);
}

.details-row.highlight-row {
  background-color: var(--md-primary-bg);
  border-radius: 4px;
}

.details-row.highlight-row span:first-child {
  color: var(--md-primary);
  font-weight: 500;
}

.details-row.highlight-row span:last-child {
  color: var(--md-primary);
  font-weight: 700;
}

/* --- CLASSIFICATION TABLE --- */
.classification-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.classification-table th,
.classification-table td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
}

.classification-table th {
  background-color: #f2f2f2;
}

.justification-row {
  display: flex;
  margin-bottom: 5px;
}

.justification-row input {
  margin-right: 5px;
}

/* --- GROUP INSIGHTS --- */
.context-header-card {
  background-color: var(--md-surface);
  border: 1px solid var(--md-border);
  border-radius: 16px;
  padding: 24px;
  color: var(--md-on-surface);
  margin-bottom: 16px;
}
.context-titles {
  display: flex;
  gap: 32px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--md-border);
  padding-bottom: 16px;
}
.context-titles h2 {
  margin: 0;
  font: var(--md-type-title-large);
}
.context-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  font: var(--md-type-body-medium);
  color: var(--md-on-surface-variant);
  background: var(--md-background);
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--md-border);
}
.context-warning .material-symbols-rounded {
  font-size: 18px;
  color: var(--md-primary);
}

.audit-title-header {
  font: var(--md-type-title-medium);
  font-weight: 700;
  color: var(--md-on-surface);
  font-style: italic;
  margin-top: 32px;
  margin-bottom: 16px;
  text-transform: uppercase;
  border-left: 4px solid var(--accent);
  padding-left: 8px;
}

.audit-card {
  background-color: var(--md-surface);
  border: 1px solid var(--md-border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.audit-card-header {
  border-bottom: 1px solid var(--md-border);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.audit-card-context {
  font: var(--md-type-label-small);
  color: var(--md-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  gap: 12px;
}

.audit-card h3 {
  margin: 0 0 24px 0;
  font: var(--md-type-title-large);
  color: var(--md-on-surface);
}

.audit-card h3 .pink-text {
  color: var(--accent-ink);
  font-weight: 600;
}

.audit-stats-row {
  display: flex;
  gap: 48px;
  border-bottom: 1px solid var(--md-border);
  padding-bottom: 24px;
  margin-bottom: 24px;
}

.audit-stat-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.audit-stat-label {
  font: var(--md-type-label-small);
  color: var(--md-on-surface-variant);
  text-transform: uppercase;
}

.audit-stat-value {
  font: var(--md-type-body-large);
  font-weight: 600;
  color: var(--md-on-surface);
}

.audit-stat-value.pink { color: var(--accent-ink); }
.audit-stat-value.large { font-size: 24px; color: var(--accent-ink); }

.comparators-table {
  width: 100%;
  border-collapse: collapse;
}

.comparators-table th {
  text-align: left;
  font: var(--md-type-label-small);
  color: var(--md-on-surface-variant);
  text-transform: uppercase;
  padding-bottom: 16px;
}

.comparators-table td {
  padding: 16px 0;
  border-top: 1px solid var(--md-border);
  vertical-align: top;
}

.comp-role { 
  font: var(--md-type-label-large);
  color: var(--md-on-surface);
}
.comp-eval { 
  font: var(--md-type-label-small);
  color: var(--md-on-surface-variant);
  margin-top: 4px; 
}
.comp-salary { 
  font-weight: 500; 
  color: var(--md-on-surface-variant);
}
.comp-diff {
  font-weight: 700;
  color: var(--alert);
}

.explanation-chips {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.exp-chip {
  background: var(--accent-soft);
  border: none;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-ink);
}

.exp-summary {
  font: var(--md-type-body-medium);
  color: var(--md-on-surface-variant);
}

/* Responsiveness adjustments */
@media (max-width: 992px) {
  .page-with-sidebar { flex-direction: column; }
  .filter-sidebar { width: 100%; position: static; max-height: none; }
  /* Stacked layout: a collapsed sidebar keeps width:0, which forces its text
     content to wrap to a huge height and — now stacked ABOVE the main column —
     shoves everything down, leaving a large empty band at the top of the page.
     Remove it from flow entirely when collapsed; expanding (Växla filter) still
     shows it full-width via the .filter-sidebar rule above. */
  .filter-sidebar.collapsed { display: none; }
}

/* --- LOGIN (split brand panel + form panel) --- */
#login-overlay { position: fixed; inset: 0; background: var(--bg); z-index: 9999; display: flex; }
.login-brand {
  flex: 1; background: var(--accent); color: #fff;
  padding: clamp(32px, 5vw, 64px);
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
}
.login-brand .brand-mark { display: flex; align-items: center; gap: 12px; }
.login-brand .brand-mark .e { width: 40px; height: 40px; border-radius: 11px; background: rgba(255,255,255,0.16); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; }
.login-brand .brand-mark .brand { font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.login-brand h1 { font-size: clamp(28px, 3.6vw, 44px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.08; margin: 0 0 16px; max-width: 14ch; }
.login-brand .lead { font-size: 16px; line-height: 1.6; opacity: 0.92; max-width: 44ch; margin: 0; }
.login-brand .proof { display: flex; gap: 32px; flex-wrap: wrap; }
.login-brand .proof .stat .v { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.login-brand .proof .stat .l { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.85; margin-top: 2px; }

.login-panel { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: clamp(24px, 4vw, 56px); position: relative; }
.login-panel .login-lang { position: absolute; top: 20px; right: 20px; }
.login-card { background: transparent; border: none; box-shadow: none; padding: 0; width: 100%; max-width: 380px; text-align: left; }
.login-logo { width: 48px; height: 48px; background: var(--accent-soft); color: var(--accent-ink); font-size: 24px; font-weight: 700; display: flex; align-items: center; justify-content: center; border-radius: 12px; margin: 0 auto; }
.login-card .login-logo { display: none; }
.login-title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); margin: 0 0 8px; }
.login-subtitle { font-size: 14px; color: var(--muted); margin: 0 0 28px; line-height: 1.5; }
.login-form-group { text-align: left; margin-bottom: 18px; }
.login-form-group label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); display: block; margin-bottom: 8px; }
.login-input { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 11px; font-size: 15px; font-family: var(--font-ui); background: var(--surface); color: var(--ink); box-sizing: border-box; outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.login-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.login-input-invalid { border-color: var(--alert) !important; box-shadow: 0 0 0 3px var(--alert-soft) !important; }
.login-btn { width: 100%; padding: 12px; background: var(--accent); color: #fff; border: none; border-radius: 11px; font-size: 14px; font-weight: 600; font-family: var(--font-ui); cursor: pointer; transition: background 0.15s; }
.login-btn:hover:not(:disabled) { background: var(--accent2); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.login-error { color: var(--alert); font-size: 13px; margin-top: 12px; min-height: 20px; }
.login-link { color: var(--accent-ink); cursor: pointer; font-size: 13px; text-decoration: none; margin-top: 20px; display: inline-block; background: none; border: none; padding: 0; font-weight: 600; }
.login-link:hover { text-decoration: underline; }
/* Auth-platform Phase 3: native provider sign-in buttons + divider. */
.login-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 12px; color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.login-btn-provider { background: var(--surface); color: var(--ink); border: 1px solid var(--border); margin-top: 10px; }
.login-btn-provider:hover:not(:disabled) { background: var(--surface2); border-color: var(--accent); }

.login-label-required::after {
  content: " *";
  color: var(--alert);
  margin-left: 4px;
}

@media (max-width: 820px) { .login-brand { display: none; } }

/* Loading Animation Styles */
@keyframes pulseLogo { 0% { transform: scale(0.95); opacity: 0.8;} 50% { transform: scale(1.05); opacity: 1;} 100% { transform: scale(0.95); opacity: 0.8;} }
.pulsing-logo { animation: pulseLogo 1.5s infinite ease-in-out; }
@keyframes spin { 100% { transform: rotate(360deg); } }
.spinning { animation: spin 1s linear infinite; }
@keyframes libCardFlash { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 3px var(--accent); } }
.lib-card-flash { animation: libCardFlash 1.6s ease-out; }

/* --- EMPLOYEES PAGE STYLES --- */
.employee-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.sub-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.sub-header h2 { margin: 0; font-size: 18px; font-weight: 700; color: var(--ink); }
.sub-header p { margin: 4px 0 0; color: var(--faint); font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-box { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 8px 12px; gap: 8px; transition: border-color .15s, box-shadow .15s; }
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box .material-symbols-rounded { color: var(--faint); font-size: 20px; }
.search-box input { border: none; outline: none; background: transparent; color: var(--ink); font-family: var(--font-ui); font-size: 14px; }
.sync-button .material-symbols-rounded { margin-right: 5px; transition: transform 0.5s; }
.employee-table-wrapper { overflow-x: auto; max-height: 65vh; overflow-y: auto; }
.employee-table { width: 100%; border-collapse: collapse; }
.employee-table th, .employee-table td { padding: 14px 20px; text-align: left; border-bottom: 1px solid var(--hair); color: var(--ink); white-space: nowrap; }
.employee-table tr:hover td { background: var(--surface2); }
.employee-table tr:last-child td { border-bottom: none; }
.employee-table td.placeholder { color: var(--faint); }
.employee-table th { position: sticky; top: 0; background: var(--surface2); z-index: 1; color: var(--faint); font-family: var(--font-mono); font-weight: 500; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.employee-table th[data-sort-key] { cursor: pointer; user-select: none; }
.employee-table th[data-sort-key]::after { content: '\2195'; margin-left: 6px; opacity: 0.45; font-size: 10px; }
.employee-table th[data-sort-key].sorted-asc::after { content: '\2191'; opacity: 1; color: var(--accent-ink); }
.employee-table th[data-sort-key].sorted-desc::after { content: '\2193'; opacity: 1; color: var(--accent-ink); }
.employee-table th[data-sort-key]:hover { color: var(--ink); }
.employee-table .employee-name { font-weight: 600; }
.employee-table .employee-email { color: var(--faint); font-size: 12px; }
.employee-table th:first-child, .employee-table td:first-child { width: 32px; }
.employee-table.no-bulk-select th:first-child, .employee-table.no-bulk-select td:first-child { display: none; }
/* Part 4 — freeze the first column so it stays visible while the wide table
   scrolls horizontally (works at mobile width too — the wrapper already scrolls
   overflow-x). The checkbox column (.eq-col-check, when present) sticks at the
   left edge; the first DATA column (.eq-col-frozen) sticks just to its right via
   --frozen-left (set in employees.js to the checkbox column's rendered width, 0
   when the checkbox column is hidden for non-admins). z-index sits above regular
   cells; the sticky header (th, already z-index:1) still wins at the top-left
   corner because the frozen header cells get a higher z-index. Opaque
   backgrounds (tokens, dark-mode aware) stop scrolled cells showing through. */
.employee-table td.eq-col-check { position: sticky; left: 0; z-index: 2; background: var(--surface); }
.employee-table th.eq-col-check { position: sticky; left: 0; z-index: 4; background: var(--surface2); }
.employee-table td.eq-col-frozen { position: sticky; left: var(--frozen-left, 0); z-index: 2; background: var(--surface); }
.employee-table th.eq-col-frozen { position: sticky; left: var(--frozen-left, 0); z-index: 3; background: var(--surface2); }
.employee-table tr:hover td.eq-col-frozen, .employee-table tr:hover td.eq-col-check { background: var(--surface2); }

/* #418 — drag-and-drop column reordering (Kolumner picker) + resizable column
   widths (header drag handle). The picker's ordered rows mirror the table's
   current display order 1:1: a drag handle (or a pin icon on the frozen first
   row, which can't be reordered — see employees.js buildSelectedColumnRow),
   the existing checkbox, the label, and up/down move buttons (kept as the
   touch/keyboard-friendly path — dragging degrades poorly on touch, but these
   buttons work everywhere: mouse, touch and keyboard alike). */
.emp-col-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--border); }
.emp-col-row:last-child { border-bottom: none; }
.emp-col-row.dragging { opacity: 0.4; }
.emp-col-row-label { flex: 1; font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emp-col-drag-handle { font-size: 18px; color: var(--faint); cursor: grab; }
.emp-col-drag-handle:active { cursor: grabbing; }
.emp-col-pin { font-size: 16px; color: var(--faint); }
.emp-col-move-btn {
  width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); display: flex; align-items: center;
  justify-content: center; cursor: pointer; flex-shrink: 0; padding: 0;
}
.emp-col-move-btn .material-symbols-rounded { font-size: 14px; }
.emp-col-move-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-ink); }
.emp-col-move-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.emp-col-divider { border-top: 1px solid var(--border); margin: 4px 0; }

/* Resize handle: a thin hit-area at the right edge of every header cell.
   Desktop-only by design (Pointer Events, employees.js wireColumnResize) — the
   handle is hidden at phone widths below, since the employee table already
   scrolls horizontally there and a resize drag would fight that touch-scroll
   gesture; column REORDERING (the up/down buttons above) stays available at
   every width, unlike this drag-to-resize interaction. */
.employee-table th .emp-col-resize-handle {
  position: absolute; top: 0; right: -3px; bottom: 0; width: 6px;
  cursor: col-resize; z-index: 5; touch-action: none;
}
.employee-table th .emp-col-resize-handle:hover,
.employee-table th .emp-col-resize-handle.resizing { background: var(--accent); opacity: 0.5; }
@media (max-width: 768px) {
  .emp-col-resize-handle { display: none; }
}

.gender-chip { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 700; text-transform: capitalize; }
.gender-chip.female { background: var(--accent-soft); color: var(--accent-ink); }
.gender-chip.male { background: var(--gold-soft); color: var(--gold); }
.analysis-chip { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 700; text-transform: capitalize; }
.analysis-chip.yes { background: var(--accent-soft); color: var(--accent-ink); }
.analysis-chip.no { background: var(--alert-soft); color: var(--alert); }
.status-chip { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 700; text-transform: capitalize; }
.status-chip.active { background: var(--accent-soft); color: var(--accent-ink); }
.status-chip.onboarding { background: var(--gold-soft); color: var(--gold); }
.status-chip.inactive { background: var(--alert-soft); color: var(--alert); }
.performance-stars { color: var(--gold); }

/* --- SETTINGS PAGE STYLES --- */
.settings-container { display: flex; flex-direction: column; gap: 24px; }
.settings-tile-row { width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px 8px; background: none; border: none; border-bottom: 1px solid var(--md-border); cursor: pointer; text-align: left; font-family: var(--font-ui); }
.settings-tile-row:last-child { border-bottom: none; }
.settings-tile-row:hover { background: var(--md-background); }
.settings-tile-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--md-primary-bg); color: var(--md-primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
/* Sensitive SuperAdmin-only tile (orgManagement — tenant GDPR export/delete)
   gets a light-red icon treatment instead of the shared brand style, to flag
   it as distinct/destructive. Same token pair as other alert surfaces. */
.settings-tile-icon-danger { background: var(--alert-soft); color: var(--alert); }
.settings-tile-text { flex: 1; min-width: 0; }
.settings-tile-label { display: block; font-weight: 600; color: var(--md-on-surface); }
.settings-tile-desc { display: block; font-size: 12px; color: var(--md-on-surface-variant); }
.settings-tile-chevron { color: var(--md-on-surface-variant); }
.card-header-flex { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; gap: 16px; }
.header-icon-group { display: flex; align-items: center; gap: 12px; }
.header-icon-group .material-symbols-rounded { background-color: var(--md-primary-bg); color: var(--md-primary); padding: 8px; border-radius: 8px; }
.profiles-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--md-background); padding: 16px; border-radius: 12px; margin-bottom: 24px; }
.md-input { height: 40px; padding: 0 16px; border: 1px solid var(--md-border); border-radius: 8px; font: var(--md-type-body-medium); color: var(--md-on-surface); outline: none; transition: border-color 0.2s; }
.md-input:focus { border-color: var(--md-primary); box-shadow: 0 0 0 1px var(--md-primary); }
.md-select { height: 40px; padding: 0 12px; border: 1px solid var(--md-border); border-radius: 8px; background: var(--md-surface); color: var(--md-on-surface); font: var(--md-type-body-medium); cursor: pointer; }
.md-select:focus { outline: none; border-color: var(--md-primary); box-shadow: 0 0 0 1px var(--md-primary); }

/* Custom Material dropdown (replaces the boxy native <select> popup) */
.md-dropdown { position: relative; display: inline-block; }
.md-dropdown-toggle { display: flex; align-items: center; gap: 0.6rem; min-width: 220px; background: var(--md-surface); padding: 0.55rem 0.9rem; border: 1px solid var(--md-border); border-radius: 99px; cursor: pointer; font: var(--md-type-body-medium); color: var(--md-on-surface); box-shadow: 0 1px 2px rgba(0,0,0,0.04); transition: background 0.15s, border-color 0.15s, box-shadow 0.15s; }
.md-dropdown-toggle:hover { background: var(--md-primary-bg); border-color: var(--md-primary); }
.md-dropdown-toggle:focus-visible { outline: none; border-color: var(--md-primary); box-shadow: 0 0 0 2px var(--md-primary-bg); }
.md-dropdown-toggle .md-dropdown-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-dropdown-toggle .md-dropdown-caret { margin-left: auto; color: var(--md-on-surface-variant); transition: transform 0.18s ease; }
.md-dropdown.open .md-dropdown-caret { transform: rotate(180deg); }
.md-dropdown-menu { position: absolute; top: calc(100% + 6px); right: 0; min-width: 100%; max-height: 340px; overflow-y: auto; background: var(--md-surface); border: 1px solid var(--md-border); border-radius: 14px; box-shadow: 0 8px 28px rgba(0,0,0,0.14); padding: 6px; z-index: 1200; display: none; }
.md-dropdown.open .md-dropdown-menu { display: block; animation: md-dd-in 0.14s ease; }
@keyframes md-dd-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.md-dropdown-item { display: flex; align-items: center; gap: 0.6rem; width: 100%; text-align: left; background: none; border: none; padding: 0.55rem 0.75rem; border-radius: 10px; cursor: pointer; font: var(--md-type-body-medium); color: var(--md-on-surface); white-space: nowrap; }
.md-dropdown-item:hover { background: var(--md-primary-bg); }
.md-dropdown-item.selected { background: var(--md-primary-bg); color: var(--md-primary); font-weight: 600; }
.md-dropdown-item .md-dropdown-check { margin-left: auto; color: var(--md-primary); font-size: 1.1rem; visibility: hidden; }
.md-dropdown-item.selected .md-dropdown-check { visibility: visible; }
.md-dropdown-empty { padding: 0.75rem; color: var(--md-on-surface-variant); font: var(--md-type-body-medium); }

/* Toggle-button variant that reproduces .md-select's exact closed-state box
   (rectangular, 8px radius, plain border) for a custom JS-driven dropdown —
   combine with .md-dropdown-toggle for the flex/label/caret layout. Native
   <select> popups can't be restyled cross-browser; this lets a dropdown keep
   the existing closed-select look while using .md-dropdown-menu for the open
   popup instead of the OS-native one (see the ENKÄT report picker). */
.md-dropdown-toggle.md-select-toggle { height: 40px; min-width: 0; width: 100%; padding: 0 12px; border-radius: 8px; box-shadow: none; gap: 0.5rem; box-sizing: border-box; }
.md-dropdown-toggle.md-select-toggle:hover { background: var(--md-surface); border-color: var(--md-border); }
.md-dropdown-toggle.md-select-toggle:focus-visible { border-color: var(--md-primary); box-shadow: 0 0 0 1px var(--md-primary); }

/* Settings → per-organization feature-flag override picker: searchable org
   list rows + the 3-way (Standard/På/Av) override control per flag. */
.org-flags-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--md-border); }
.org-flags-row:last-child { border-bottom: none; }
.org-flags-row:hover { background: var(--md-primary-bg); }
.org-flags-row.selected { background: var(--md-primary-bg); }
.org-flags-tri-btn { padding: 4px 10px; font-size: 12px; }
.org-flags-tri-btn.active { background: var(--md-primary); color: #fff; border-color: var(--md-primary); }

/* Indeterminate workspace loader bar (no real progress events to report) */
.loader-indeterminate { width: 40%; border-radius: 3px; animation: loader-slide 1.15s ease-in-out infinite; }
@keyframes loader-slide {
  0%   { margin-left: -45%; }
  100% { margin-left: 100%; }
}
.params-table { width: 100%; border-collapse: collapse; }
.params-table th { text-align: left; padding: 12px 16px; font: var(--md-type-label-small); color: var(--md-on-surface-variant); text-transform: uppercase; border-bottom: 1px solid var(--md-border); }
.params-table td { padding: 20px 16px; border-bottom: 1px solid var(--md-border); vertical-align: middle; }
.params-table tr:last-child td { border-bottom: none; }
.param-name { font: var(--md-type-title-medium); color: var(--md-on-surface); display: block; }
.param-meaning { font: var(--md-type-body-medium); color: var(--md-on-surface-variant); display: block; margin-top: 4px; }
.value-input-wrapper { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.value-input-wrapper input { width: 80px; text-align: center; }
.unit-label { font: var(--md-type-label-small); color: var(--md-on-surface-variant); width: 32px; }
.toast-notification { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #323232; color: white; padding: 12px 24px; border-radius: 4px; font: var(--md-type-body-medium); z-index: 2000; box-shadow: 0 3px 5px rgba(0,0,0,0.3); transition: opacity 0.3s; }
.confirm-dialog-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: none; align-items: center; justify-content: center; z-index: 3000; transition: 0.2s; }
.confirm-dialog { background: white; padding: 24px; border-radius: 28px; width: 100%; max-width: 400px; }
.confirm-dialog h4 { font: var(--md-type-title-large); margin-bottom: 16px; }
.confirm-dialog p { font: var(--md-type-body-large); color: var(--md-on-surface-variant); margin-bottom: 24px; }

/* --- INDIVIDUAL ANALYSIS STYLES --- */
.ia-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px; margin-bottom: 16px; }
.ia-location-header { font-size: 18px; font-weight: 700; color: var(--ink); margin: 32px 0 16px 0; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.ia-location-header .material-symbols-rounded { color: var(--accent-ink); }
.ia-role-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--surface2); padding: 12px 16px; border-radius: 12px 12px 0 0; margin-top: 16px; border: 1px solid var(--border); border-bottom: none; flex-wrap: wrap; }
.ia-role-title { font-size: 16px; font-weight: 700; color: var(--accent-ink); margin: 0; }
.ia-target-salary { font-size: 13px; font-weight: 600; color: var(--muted); background: var(--surface); padding: 6px 12px; border-radius: 20px; border: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.ia-table { width: 100%; border-collapse: collapse; border: 1px solid var(--border); border-radius: 0 0 12px 12px; overflow: hidden; background: var(--surface); margin-bottom: 24px; }
.ia-table th { text-align: left; padding: 12px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; color: var(--faint); text-transform: uppercase; border-bottom: 1px solid var(--border); background: var(--surface2); }
.ia-table td { padding: 12px; border-bottom: 1px solid var(--hair); vertical-align: middle; color: var(--ink); }
.ia-select { padding: 8px; border-radius: 9px; border: 1px solid var(--border); font-family: var(--font-ui); font-size: 14px; background: var(--surface); color: var(--ink); width: 100%; }
.ia-save-btn { background: var(--accent); color: #fff; border: none; border-radius: 9px; padding: 8px 16px; cursor: pointer; font-weight: 600; }
.ia-save-btn:hover { background: var(--accent2); }
.ia-gap-alert { color: var(--alert); font-weight: 700; font-variant-numeric: tabular-nums; }

/* --- ACTION PLAN STYLES --- */
.ap-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: 24px; }
.ap-stat-card { background: var(--md-surface); padding: 24px; border-radius: 12px; border: 1px solid var(--md-border); text-align: center; }
.ap-stat-title { font: var(--md-type-label-small); color: var(--md-on-surface-variant); text-transform: uppercase; margin-bottom: 8px; }
.ap-stat-value { font: var(--md-type-headline); color: var(--md-on-surface); }
.ap-table-container { overflow-x: auto; background: var(--md-surface); border: 1px solid var(--md-border); border-radius: 12px; }
.ap-table { width: 100%; border-collapse: collapse; min-width: 950px; table-layout: fixed; }
.ap-table th, .ap-table td { padding: 16px; text-align: left; border-bottom: 1px solid var(--md-border); vertical-align: middle; }
.ap-table th { background: var(--md-background); font: var(--md-type-label-small); color: var(--md-on-surface-variant); text-transform: uppercase; white-space: nowrap; }
.col-emp { width: 25%; }
.col-adj { width: 20%; }
.col-dur { width: 15%; }
.col-split { width: 28%; }
.col-stat { width: 12%; }
.duration-select { width: 100%; padding: 8px; border-radius: 6px; border: 1px solid var(--md-border); font: var(--md-type-body-medium); background: white; outline: none; cursor: pointer; }
.duration-select:focus { border-color: var(--md-primary); }
.split-container { display: flex; gap: 12px; align-items: center; }
.split-input-wrapper { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.split-input-wrapper label { font-size: 10px; color: var(--md-on-surface-variant); font-weight: 600; text-transform: uppercase; }
.split-input { width: 50px; padding: 6px; border: 1px solid var(--md-border); border-radius: 6px; text-align: center; font-size: 14px; outline: none; transition: 0.2s; }
.split-input:focus { border-color: var(--md-primary); }
.split-input.error { border-color: #d32f2f; background-color: #ffebee; color: #d32f2f; }
.split-input:disabled { background-color: #f8f9fa; color: #adb5bd; cursor: not-allowed; border-color: #e9ecef; }
.split-total { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; min-width: 45px; }
.split-total .val { font-size: 16px; font-weight: bold; }
.split-total .lbl { font-size: 10px; color: var(--md-on-surface-variant); text-transform: uppercase; }
.split-total.error .val { color: #d32f2f; }
.split-total.success .val { color: #2e7d32; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 16px; font-size: 12px; font-weight: 600; }
.status-badge.pending { background: #fff3e0; color: #e65100; }
.status-badge.error { background: #ffebee; color: #c62828; }

/* --- BENCHMARK SIMULATOR STYLES --- */
.benchmark-tool-grid { display: grid; grid-template-columns: 350px 1fr; grid-gap: 24px; }
.benchmark-tool-grid .card { background: var(--md-surface); border: 1px solid var(--md-border); border-radius: 12px; padding: 24px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: flex; justify-content: space-between; font: var(--md-type-label-small); color: var(--md-on-surface-variant); margin-bottom: 8px; text-transform: uppercase; }

/* Mode Toggle Styling */
.mode-toggle { display: flex; background: var(--md-background); padding: 4px; border-radius: 24px; margin-bottom: 24px; border: 1px solid var(--md-border); }
.mode-toggle button { flex: 1; padding: 8px; border: none; background: transparent; cursor: pointer; border-radius: 20px; font: var(--md-type-label-large); transition: 0.2s; }
.mode-toggle button.active { background: var(--md-primary); color: white; }

/* Gender Toggle */
.gender-toggle { display: flex; background: var(--md-background); padding: 4px; border-radius: 8px; border: 1px solid var(--md-border); }
.gender-toggle button { flex: 1; padding: 8px; border: none; background: transparent; cursor: pointer; border-radius: 6px; font: var(--md-type-body-medium); transition: 0.2s; }
.gender-toggle button.active { background: var(--surface); color: var(--accent-ink); box-shadow: 0 1px 2px rgba(19,36,32,0.1); font-weight: 700;}

/* Salary Input & Slider */
.salary-input-wrapper { border: 1px solid var(--border); border-radius: 11px; overflow: hidden; display: flex; align-items: center; background: var(--surface); box-sizing: border-box; }
.salary-input-wrapper:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.salary-input-wrapper input[type="number"] { border: none; font-size: 18px; padding: 12px; flex: 1; outline: none; background: transparent; color: var(--ink); font-variant-numeric: tabular-nums; }
.salary-input-wrapper span { padding: 0 16px; font-weight: 600; color: var(--muted); background: var(--surface2); height: 100%; display: flex; align-items: center;}
.salary-slider { width: 100%; margin-top: 16px; cursor: pointer; accent-color: var(--md-primary); }

/* Comparison Table Styling */
.bm-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.bm-table th { text-align: left; font: var(--md-type-label-small); color: var(--md-on-surface-variant); padding: 12px; border-bottom: 1px solid var(--md-border); }
.bm-table td { padding: 12px; border-bottom: 1px solid var(--md-border); font-size: 14px; }

/* Results Grid */
.results-subgrid { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 24px; margin-top: 24px;}

/* Impact & Shift Cards */
.flex-container { display: flex; align-items: center; justify-content: space-between; margin-top: 16px;}
.gap-value .label { font: var(--md-type-label-small); color: var(--md-on-surface-variant); text-transform: uppercase; }
.gap-value .value { font: var(--md-type-headline); color: var(--md-on-surface); }
.arrow { color: var(--md-on-surface-variant); font-size: 24px; }
.shift-item { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--md-border); }
.shift-item:last-child { border-bottom: none; }
.shift-item span { font: var(--md-type-body-medium); color: var(--md-on-surface-variant); }
.value-shift { font-weight: 500; color: var(--md-on-surface); }

/* Averages Grid */
.avg-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 16px; }
.avg-box { background: var(--md-background); border: 1px solid var(--md-border); border-radius: 8px; padding: 16px; text-align: center; }
.avg-box .avg-label { font: var(--md-type-label-small); color: var(--md-on-surface-variant); text-transform: uppercase; margin-bottom: 8px; display: block; }
.avg-box .avg-val { font: var(--md-type-title-medium); color: var(--md-on-surface); }

/* Compliance UI UX */
.compliance-check { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.compliance-item { display: flex; align-items: center; gap: 16px; padding: 16px; background: var(--md-background); border: 1px solid var(--md-border); border-radius: 8px; transition: all 0.3s; }
.compliance-item .icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: white; border: 1px solid var(--md-border); }
.compliance-item .text-content { flex: 1; }
.compliance-item .label { font: var(--md-type-label-large); color: var(--md-on-surface); margin-bottom: 4px; }
.compliance-item .description { font: var(--md-type-body-medium); color: var(--md-on-surface-variant); }

/* Compliance Status Colors */
.compliance-item.status-ok { background: var(--accent-soft); border-color: var(--accent); }
.compliance-item.status-ok .icon { color: var(--accent-ink); border-color: var(--accent); background: var(--surface); }
.compliance-item.status-alert { background: var(--alert-soft); border-color: var(--alert); }
.compliance-item.status-alert .icon { color: var(--alert); border-color: var(--alert); background: var(--surface); }
.compliance-item.status-warn { background: var(--gold-soft); border-color: var(--gold); }
.compliance-item.status-warn .icon { color: var(--gold); border-color: var(--gold); background: var(--surface); }
.bm-search-box { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 6px 12px; box-sizing: border-box; transition: border-color 0.15s, box-shadow 0.15s; }
.bm-search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bm-search-box .material-symbols-rounded { color: var(--faint); font-size: 20px; }
.bm-search-box input { border: none; outline: none; margin-left: 8px; width: 100%; height: 30px; font-family: var(--font-ui); font-size: 14px; color: var(--ink); background: transparent; }

/* --- SALARY BAND STYLES --- */
.sb-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 992px) { .sb-grid { grid-template-columns: 1fr 2fr; } }
.sb-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px; }
.sb-title { font-size: 17px; font-weight: 700; color: var(--ink); margin-bottom: 24px; display: flex; align-items: center; gap: 8px; }
.sb-title .material-symbols-rounded { color: var(--accent-ink); }
.sb-search-box { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 6px 12px; box-sizing: border-box; transition: border-color 0.15s, box-shadow 0.15s; }
.sb-search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sb-search-box .material-symbols-rounded { color: var(--faint); font-size: 20px; }
.sb-search-box input { border: none; outline: none; margin-left: 8px; width: 100%; height: 30px; font-family: var(--font-ui); font-size: 14px; color: var(--ink); background: transparent; }
.sb-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.sb-stat-box { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 16px; text-align: center; }
.sb-stat-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; color: var(--faint); text-transform: uppercase; display: block; margin-bottom: 6px; }
.sb-stat-value { font-size: 18px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.band-graph-container { margin: 40px 0; position: relative; padding-bottom: 30px; }
.band-track { width: 100%; height: 24px; background: var(--surface2); border-radius: 12px; position: relative; overflow: visible; }
.band-fill { position: absolute; left: 0; top: 0; height: 100%; background: linear-gradient(90deg, var(--accent-soft), var(--accent)); border-radius: 12px; }
.band-marker { position: absolute; top: -8px; width: 4px; height: 40px; background: var(--ink); border-radius: 2px; transform: translateX(-50%); z-index: 10; }
.band-marker-label { position: absolute; top: -30px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--surface); font-size: 11px; padding: 2px 6px; border-radius: 4px; font-weight: 700; white-space: nowrap; }
.band-label-min { position: absolute; left: 0; bottom: -25px; font-size: 12px; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.band-label-max { position: absolute; right: 0; bottom: -25px; font-size: 12px; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.sb-table { width: 100%; border-collapse: collapse; margin-top: 16px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.sb-table th, .sb-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--hair); font-size: 14px; color: var(--ink); }
.sb-table th { background: var(--surface2); font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; color: var(--faint); text-transform: uppercase; font-weight: 500; }
.sb-table tr.highlight { background: var(--accent-soft); }
.sb-table td:first-child { font-weight: 600; color: var(--muted); }

/* --- MOBILE: sidebar becomes an off-canvas drawer (≤900px) --- */
@media (max-width: 900px) {
  #sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 280px; height: 100vh; z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 6px 0 30px rgba(19, 36, 32, 0.16);
  }
  #sidebar.open { transform: translateX(0); }

  /* Declutter the topbar: icon-only search, SV/EN moves into the drawer
     (see .mobile-lang-toggle below), hamburger is superseded by the fixed
     bottom tab bar's "Mer" button. Without this the fixed-width chrome alone
     (hamburger + search label/kbd + SV/EN pill + theme + notif) exceeds a
     phone's viewport before the title even gets room. */
  #topbar .search-trigger .label,
  #topbar .search-trigger .kbd { display: none; }
  #lang-toggle { display: none; }
  #topbar-hamburger { display: none; }

  /* Room for the fixed bottom tab bar so it never covers page content. */
  #app-content { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}

/* Mobile-only SV/EN toggle inside the drawer (hidden on desktop, where the
   topbar's own toggle applies). */
.mobile-lang-toggle { display: none; }
@media (max-width: 900px) {
  .mobile-lang-toggle { display: flex; margin: 4px 8px 0; }
}

@media (max-width: 900px) {
  .eq-help-panel { width: 100vw; max-width: 100vw; }
}

/* --- MOBILE: fixed bottom tab bar (classic app nav) --- */
.mobile-tabbar { display: none; }
@media (max-width: 900px) {
  .mobile-tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
    background: var(--topbar); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mobile-tabbar a, .mobile-tabbar button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 8px 4px 6px; border: none; background: transparent; cursor: pointer;
    font-family: var(--font-ui); font-size: 10.5px; font-weight: 600;
    color: var(--muted); text-decoration: none;
  }
  .mobile-tabbar .material-symbols-rounded { font-size: 22px; }
  .mobile-tabbar a.active { color: var(--accent-ink); }
}

/* --- MOBILE: wide data tables scroll horizontally instead of breaking layout --- */
/* Survey question editor rows + bilingual (SV/EN) input pairs. Grid on desktop;
   they stack on phones (see the max-width:768px block below). */
.qedit-row { display: grid; grid-template-columns: 1fr 1fr 0.7fr 0.9fr auto; gap: 0.5rem; align-items: center; padding: 0.5rem 0; }
.biling-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

@media (max-width: 768px) {
  .card,
  .eq-card,
  .audit-card,
  .table-card,
  .details-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* Toolbars wrap rather than overflow on narrow screens. */
  .top-action-bar,
  .sub-header,
  .actions { flex-wrap: wrap; gap: 8px; }
  /* Survey editor + bilingual pairs collapse to a single column on phones. */
  .qedit-row { grid-template-columns: 1fr 1fr; }
  .biling-grid { grid-template-columns: 1fr; }
  /* Wizard step footers keep their buttons on-screen. */
  .wizard-footer { flex-wrap: wrap; }
  .wizard-footer > div { flex-wrap: wrap; }
}

/* Shared survey picker / detail modal (survey.js _renderModal). */
.survey-modal-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; z-index: 1000; overflow-y: auto; }
.survey-modal-card { background: var(--md-surface, #fff); border-radius: 16px; width: 100%; max-width: 560px; padding: 20px 22px; box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.3); }
.survey-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.survey-modal-search { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--md-border); border-radius: 10px; margin-bottom: 12px; font-family: inherit; }
.survey-modal-list { max-height: 55vh; overflow-y: auto; }
.survey-modal-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--md-border); }

/* ==========================================================================
   REDESIGN PRIMITIVES — buttons, cards, KPI strip, charts, chips
   Shared by pages converted to the new design system (Phase 1+).
   ========================================================================== */
.eq-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 11px; font-family: var(--font-ui); font-size: 13.5px; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: background .15s, border-color .15s, color .15s; }
.eq-btn .material-symbols-rounded { font-size: 19px; }
.eq-btn-primary { background: var(--accent); color: #fff; }
.eq-btn-primary:hover:not(:disabled) { background: var(--accent2); }
.eq-btn-ghost { background: var(--surface); border-color: var(--border); color: var(--ink); }
.eq-btn-ghost:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-ink); }
.eq-btn-ghost.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.eq-btn:disabled { opacity: .6; cursor: not-allowed; }

/* Visually-hide a native <input type="file"> while pairing it with a styled
   `.eq-btn` <label for="..."> trigger (see employees.js document/training-
   record uploads). Uses the standard accessible clip technique — NOT
   display:none/visibility:hidden, either of which would pull the control out
   of the accessibility tree and break keyboard/screen-reader use — so the
   input stays focusable and its label-for click-forwarding keeps working. */
.eq-file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.eq-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: var(--pad); }
.eq-card-title { font-size: 17px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.eq-card-sub { font-size: 13px; color: var(--muted); margin-top: 2px; margin-bottom: 12px; }

/* Layout helpers — gap-based, never sibling margins */
.main-content-area { display: flex; flex-direction: column; gap: 16px; }
.eq-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }

/* KPI strip */
.eq-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.eq-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.eq-kpi .k-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.eq-kpi .k-value { font-size: 30px; font-weight: 700; letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.eq-kpi.hl { background: var(--accent); border-color: var(--accent); }
.eq-kpi.hl .k-label { color: rgba(255,255,255,.85); }
.eq-kpi.hl .k-value { color: #fff; }

.eq-table-wrap { overflow-x: auto; margin-top: 12px; }
.compliance-summary-table td:not(:first-child), .compliance-summary-table th:not(:first-child) { font-variant-numeric: tabular-nums; }

/* Workforce composition split bar */
.eq-split-track { display: flex; height: 12px; border-radius: 20px; overflow: hidden; background: var(--surface2); }
.eq-split-women { background: var(--accent); }
.eq-split-men { background: var(--gold); }
.eq-split-legend { display: flex; gap: 20px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.eq-split-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; }
.eq-split-legend .dot-women { background: var(--accent); }
.eq-split-legend .dot-men { background: var(--gold); }
.eq-split-legend b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* Average-salary comparison bars */
.eq-compare { display: flex; flex-direction: column; gap: 10px; }
.eq-compare-row { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 12px; }
.eq-compare-row .c-lbl { font-size: 13px; color: var(--muted); }
.eq-compare-row .c-bar { height: 10px; background: var(--surface2); border-radius: 20px; overflow: hidden; }
.eq-compare-row .c-fill { display: block; height: 100%; border-radius: 20px; width: 0; transition: width .4s ease; }
.eq-compare-row .c-fill.women { background: var(--accent); }
.eq-compare-row .c-fill.men { background: var(--gold); }
.eq-compare-row .c-fill.group { background: var(--faint); }
.eq-compare-row .c-val { font-size: 13px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.eq-compare-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--hair); font-size: 13px; color: var(--muted); }
.eq-compare-foot b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* Narrative summary */
.eq-narrative { font-size: 15px; line-height: 1.6; color: var(--muted); margin: 0 0 6px; }
.eq-narrative b { color: var(--ink); }
.eq-narrative-row { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-top: 1px solid var(--hair); }
.eq-narrative-row:last-child { padding-bottom: 0; }
.eq-micro { font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.eq-gap.alert { color: var(--alert); font-weight: 600; }
.eq-gap.gold { color: var(--gold); font-weight: 600; }
.eq-gap.ok { color: var(--accent-ink); font-weight: 600; }
.eq-gap.muted { color: var(--muted); }
.eq-gap b { font-weight: 700; }

/* Status chips (soft bg + matching ink) */
.eq-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 700; }
.eq-chip.ok { background: var(--accent-soft); color: var(--accent-ink); }
.eq-chip.warn { background: var(--gold-soft); color: var(--gold); }
.eq-chip.alert { background: var(--alert-soft); color: var(--alert); }

/* ==========================================================================
   SURVEY RESULTS DASHBOARD (redesign) — filter bar, KPI cards, heatmap,
   themes/quotes. See design_handoff_equipay_redesign/SURVEY_DASHBOARD.md.
   The diverging heatmap ramp uses fixed hexes (see .sd-heat-legend-bar) —
   intentionally outside the light/dark token set, per that spec's own note.
   ========================================================================== */
.sd-filterbar { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; animation: eqfade .35s ease; }
.sd-filter-field { display: flex; flex-direction: column; gap: 4px; }
.sd-filter-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.sd-compare-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; border-radius: 9px; padding: 0 13px; font-size: 12.5px; font-weight: 700; cursor: pointer; font-family: inherit; align-self: flex-end; border: 1px solid var(--border); background: var(--surface); color: var(--muted); }
.sd-compare-btn.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.sd-compare-btn .material-symbols-rounded { font-size: 17px; }
.sd-anon-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--surface2); color: var(--muted); border-radius: 20px; padding: 6px 12px; font-size: 12px; align-self: flex-end; }
.sd-anon-pill .material-symbols-rounded { font-size: 15px; color: var(--faint); }
.sd-layout-toggle { display: flex; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; align-self: flex-end; }
.sd-layout-toggle button { padding: 6px 14px; border-radius: 8px; font-size: 12.5px; font-weight: 700; cursor: pointer; border: none; font-family: inherit; background: transparent; color: var(--muted); }
.sd-layout-toggle button.active { background: var(--surface); color: var(--accent-ink); box-shadow: 0 1px 2px rgba(19, 36, 32, .14); }

/* Report export toolbar (QW2 #198): CSV download + Print/PDF, design-system buttons. */
.sd-export-toolbar { display: inline-flex; gap: 8px; align-self: flex-end; flex-wrap: wrap; }
.sd-export-btn { height: 36px; padding: 6px 14px; }
.sd-export-btn .material-symbols-rounded { font-size: 18px; margin-right: 6px; }
/* On narrow screens collapse the export buttons to icon-only so the toolbar wraps cleanly. */
@media (max-width: 560px) {
  .sd-export-btn .sd-export-label { display: none; }
  .sd-export-btn .material-symbols-rounded { margin-right: 0; }
}
/* Print-only report header — hidden on screen, shown in the PDF/print output. */
.sd-print-header { display: none; }
.sd-print-header h2 { margin: 0 0 4px; font-family:var(--font-ui); font-size: 1.4rem; }
.sd-print-header .sub { color: var(--muted); font-size: 0.9rem; }

/* OKR board-ready export toolbar (OKR-QW2 #206): CSV download + Print/PDF,
   design-system buttons — same pattern as .sd-export-toolbar above. */
.okr-export-toolbar { display: inline-flex; gap: 8px; align-self: flex-end; flex-wrap: wrap; }
.okr-export-btn { height: 36px; padding: 6px 14px; }
.okr-export-btn .material-symbols-rounded { font-size: 18px; margin-right: 6px; }
/* On narrow screens collapse the export buttons to icon-only so the toolbar wraps cleanly. */
@media (max-width: 560px) {
  .okr-export-btn .okr-export-label { display: none; }
  .okr-export-btn .material-symbols-rounded { margin-right: 0; }
}
/* Print-only OKR report header — hidden on screen, shown in the PDF/print output. */
.okr-print-header { display: none; }
.okr-print-header h2 { margin: 0 0 4px; font-family:var(--font-ui); font-size: 1.4rem; }
.okr-print-header .sub { color: var(--muted); font-size: 0.9rem; }

/* Joiners & leavers change report export toolbar (QW3 #224): CSV download +
   Print/PDF — same pattern as .okr-export-toolbar above. */
.jl-export-toolbar { display: inline-flex; gap: 8px; align-self: flex-end; flex-wrap: wrap; }
.jl-export-btn { height: 36px; padding: 6px 14px; }
.jl-export-btn .material-symbols-rounded { font-size: 18px; margin-right: 6px; }
@media (max-width: 560px) {
  .jl-export-btn .jl-export-label { display: none; }
  .jl-export-btn .material-symbols-rounded { margin-right: 0; }
}
/* Print-only report header — hidden on screen, shown in the PDF/print output. */
.jl-print-header { display: none; }
.jl-print-header h2 { margin: 0 0 4px; font-family:var(--font-ui); font-size: 1.4rem; }
.jl-print-header .sub { color: var(--muted); font-size: 0.9rem; }

/* EU Pay Transparency Directive report (F3, #261) — same print-only header
   pattern as .jl-print-header above. */
.eupt-print-header { display: none; }
.eupt-print-header h2 { margin: 0 0 4px; font-family:var(--font-ui); font-size: 1.4rem; }
.eupt-print-header .sub { color: var(--muted); font-size: 0.9rem; }

/* Annual pay-equity snapshot (F1, #261) — same print-only header pattern as
   .jl-print-header/.eupt-print-header above. */
.pes-print-header { display: none; }
.pes-print-header h2 { margin: 0 0 4px; font-family:var(--font-ui); font-size: 1.4rem; }
.pes-print-header .sub { color: var(--muted); font-size: 0.9rem; }

/* Employee self-service (My overview) quick-link tiles */
.es-quicklink { border: 1px solid var(--border); }
.es-quicklink:hover { border-color: var(--accent); background: var(--accent-soft); }

.sd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin-bottom: 16px; }
.sd-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.sd-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; margin-bottom: 16px; animation: eqfade .35s ease; }
.sd-card:last-child { margin-bottom: 0; }
.sd-eyebrow { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.sd-sublabel { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* eNPS card */
.sd-enps-score { font-weight: 800; line-height: .85; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.sd-enps-delta { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft); color: var(--accent-ink); border-radius: 20px; padding: 3px 9px; font-size: 12px; font-weight: 700; }
.sd-enps-delta .material-symbols-rounded { font-size: 15px; }
.sd-split-bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--surface2); }
.sd-enps-legend { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); margin-top: 10px; }
.sd-enps-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }

/* Participation card */
.sd-part-pct { font-weight: 800; font-variant-numeric: tabular-nums; }
.sd-part-bar { height: 8px; border-radius: 5px; background: var(--surface2); overflow: hidden; }
.sd-part-bar > div { height: 100%; background: var(--accent); }
.sd-part-caption { font-size: 12.5px; color: var(--muted); margin-top: 8px; }

/* Heatmap */
.sd-heat-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.sd-heat-legend { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--faint); }
.sd-heat-legend-bar { width: 120px; height: 8px; border-radius: 5px; background: linear-gradient(90deg, #e59a80, #f5dca6, #e7ecdd, #9cc7b6, #0f7a5c); }
.sd-heat-scroll { overflow-x: auto; }
.sd-heat-inner { min-width: 640px; }
.sd-heat-row { display: flex; gap: 6px; align-items: stretch; margin-bottom: 6px; }
.sd-heat-row:last-child { margin-bottom: 0; }
.sd-heat-label { flex: 0 0 160px; font-size: 13px; font-weight: 600; display: flex; align-items: center; }
.sd-heat-colhead { flex: 1; min-width: 66px; text-align: center; }
.sd-heat-colhead .name { font-weight: 700; font-size: 12.5px; }
.sd-heat-colhead .sub { font-size: 10.5px; color: var(--faint); font-family: var(--font-mono); }
.sd-heat-avgcol { flex: 0 0 58px; }
.sd-heat-avg-label { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; color: var(--faint); text-align: center; }
.sd-heat-cell { display: flex; align-items: center; justify-content: center; padding: 12px 8px; border-radius: 9px; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; flex: 1; min-width: 66px; }
.sd-heat-cell.avg { flex: 0 0 58px; }
.sd-heat-cell.locked { background: var(--surface2); color: var(--faint); font-weight: 400; }
.sd-heat-cell .material-symbols-rounded { font-size: 16px; }

/* Themes card */
.sd-theme-row { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--hair); }
.sd-theme-row:last-child { border-bottom: none; padding-bottom: 0; }
.sd-theme-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sd-theme-name { font-size: 13.5px; font-weight: 600; }
.sd-theme-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.sd-theme-chip .material-symbols-rounded { font-size: 14px; }
.sd-theme-bar { height: 7px; border-radius: 4px; background: var(--surface2); overflow: hidden; }
.sd-theme-bar > div { height: 100%; }

/* Focus areas card */
.sd-focus-row { display: flex; align-items: center; gap: 12px; background: var(--alert-soft); border: 1px solid color-mix(in srgb, var(--alert) 22%, transparent); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.sd-focus-row:last-child { margin-bottom: 0; }
.sd-focus-row .warn-ic { color: var(--alert); font-size: 20px; }
.sd-focus-text { flex: 1; min-width: 0; }
.sd-focus-text .label { font-weight: 600; font-size: 13.5px; }
.sd-focus-text .avg { font-size: 12px; color: var(--muted); margin-top: 2px; }
.sd-focus-action { display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: #fff; border: none; border-radius: 9px; padding: 8px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.sd-focus-action.icon-only { width: 34px; height: 34px; padding: 0; justify-content: center; }
.sd-focus-action .material-symbols-rounded { font-size: 18px; }

/* Quotes card */
.sd-quotes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.sd-quote { border-left: 3px solid var(--border); background: var(--surface2); border-radius: 0 10px 10px 0; padding: 12px 14px; }
.sd-quote-text { font-size: 13.5px; line-height: 1.5; margin-bottom: 8px; }
.sd-quote-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

/* Layout B — command grid (stacks below ~900px) */
.sd-layout-b { display: grid; grid-template-columns: minmax(280px, 330px) 1fr; gap: 16px; align-items: start; }
.sd-layout-b .sd-rail, .sd-layout-b .sd-main { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 900px) {
  .sd-layout-b { grid-template-columns: 1fr; }
}

/* ==========================================================================
   SALARY REVISION PLANNER (Lönerevisionsplaneraren) — 3-panel layout: rule
   builder (left) + analysis/comparison + group details (right, stacked).
   ========================================================================== */
.sr-grid { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
@media (min-width: 992px) { .sr-grid { grid-template-columns: minmax(300px, 360px) 1fr; } }
.sr-right-col { display: flex; flex-direction: column; gap: 24px; }

.sr-rule-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.sr-rule-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.sr-rule-card .sr-rule-title { font-size: 12.5px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.sr-rule-card .sr-rule-desc { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.sr-rule-delete { flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--alert); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.sr-rule-delete:hover { background: var(--alert-soft); border-color: var(--alert); }
.sr-rule-delete .material-symbols-rounded { font-size: 18px; }

.sr-new-rule-form { border-top: 1px solid var(--hair); padding-top: 16px; margin-top: 4px; }

.sr-recent { border-top: 1px solid var(--hair); margin-top: 20px; padding-top: 16px; }
.sr-recent-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sr-recent-list li { font-size: 12.5px; color: var(--muted); background: var(--surface2); border-radius: 8px; padding: 8px 10px; }
.sr-recent-list li b { color: var(--ink); }

.sr-tax-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; user-select: none; }
.sr-tax-toggle input { cursor: pointer; }

.sr-group-table .sr-change-badge { font-variant-numeric: tabular-nums; }

/* --- Lönerevision collaborative budget workflow (revision-workflow) --- */
.rev-form-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 720px) { .rev-form-grid { grid-template-columns: 2fr 1fr 1fr; } }
/* Budget type (.md-select, fixed 40px) and Budget (.salary-input-wrapper,
   content-driven ~46px) sit side-by-side in this grid row — match the
   select's height to the wrapper's actual rendered height so the two boxes
   line up. Scoped to this grid only; .md-select stays 40px everywhere else. */
.rev-form-grid select.md-select { height: 46px; }
.rev-emp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: 11px; padding: 10px; }
.rev-emp-item { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 6px; border-radius: 8px; cursor: pointer; }
.rev-emp-item:hover { background: var(--surface2); }
.rev-emp-item .rev-emp-sal { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Searchable multi-select employee picker (Included employees + Final-Say
   users on the create-cycle form): a search box + chips row of the current
   selection sit above the checkbox list rendered into .rev-emp-list. */
.rev-picker { display: flex; flex-direction: column; gap: 8px; }
.rev-picker-search-row { display: flex; align-items: center; gap: 10px; }
.rev-picker-search-box { flex: 1; min-width: 0; }
.rev-picker-count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.rev-picker-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rev-picker-chip { background: var(--accent-soft); color: var(--accent-ink); gap: 6px; }
.rev-picker-chip-remove { border: none; background: none; padding: 0; margin: 0; color: inherit; font-size: 14px; line-height: 1; cursor: pointer; opacity: .75; }
.rev-picker-chip-remove:hover { opacity: 1; }

.rev-node-budgets { display: flex; flex-direction: column; gap: 8px; }
.rev-node-budget-row { display: flex; align-items: center; gap: 10px; }
.rev-node-budget-row > span { min-width: 120px; font-size: 13px; }
/* Uses the .value-input-wrapper/.unit-label pattern (settings.html's params
   table) instead of the pill-style .salary-input-wrapper — that pattern gives
   the input a fixed width + a plain-text unit label with its own reserved
   width, so the "SEK" suffix can never be clipped/overlapped by the input's
   value the way it was with a flex:1 input inside a fixed-max-width pill. */
.rev-node-budget-row .value-input-wrapper { min-width: 140px; }
.rev-node-budget-row .value-input-wrapper input { width: 100px; }

.rev-budget-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 8px; }
.rev-node-summary { background: var(--surface2); border-radius: 10px; padding: 10px 12px; }
.rev-node-summary-head { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.rev-bar { height: 8px; border-radius: 99px; background: var(--hair); overflow: hidden; }
.rev-bar-fill { height: 100%; border-radius: 99px; transition: width .2s; }
.rev-node-remaining { font-size: 11.5px; margin-top: 5px; }

.rev-proposal-table .rev-proposed-input { width: 110px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--ink); font-variant-numeric: tabular-nums; }
.rev-proposal-table .rev-proposed-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.rev-proposal-table td { vertical-align: middle; }
.rev-submit-controls { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.eq-chip.rev-status-draft { background: #fef3c7; color: #92400e; }
.eq-chip.rev-status-submitted_to_manager { background: var(--accent-soft); color: var(--accent-ink); }
.eq-chip.rev-status-manager_approved { background: #dbeafe; color: #1e40af; }
.eq-chip.rev-status-final_approved { background: #dcfce7; color: #15803d; }
@media (max-width: 768px) { .rev-workflow .eq-table-wrap { overflow-x: auto; } }

/* Live budget-adequacy estimate (QW3 #290) under the create-cycle budget
   input, + the what-if scenario preview cards (F3 #290). Scenario cards are
   plain .eq-card in an auto-fill grid; the gap verdict reuses
   .eq-chip.ok/.warn/.alert and the guardrail's redacted state. */
.rev-budget-estimate { margin: 6px 0 0; min-height: 16px; font-variant-numeric: tabular-nums; }
.rev-scenario-inputs { display: flex; flex-wrap: wrap; gap: 8px; }
.rev-scenario-row { display: flex; align-items: center; gap: 6px; }
.rev-scenario-row .rev-scenario-value { width: 110px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--ink); font-variant-numeric: tabular-nums; }
.rev-scenario-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
.rev-scenario-card { padding: 14px 16px; }
.rev-scenario-card .eq-card-title { font-size: 14px; margin-bottom: 8px; }
.rev-scenario-metric { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.rev-scenario-metric span { color: var(--muted); }
.rev-scenario-gap { font-size: 10.5px; font-weight: 600; margin-top: 2px; }

/* Pay-equity guardrail (F1 #290): inline before→after gap chips under the
   proposed-salary input. Reuses .eq-chip.ok/.warn/.alert for the verdict. */
.rev-guardrail-slot { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; max-width: 260px; }
.rev-guardrail-chip { font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.eq-chip.rev-guardrail-redacted { background: var(--surface2); color: var(--muted); }

/* ==========================================================================
   Print stylesheet (QW2 #198): a print-to-PDF path for the survey results
   dashboard. On print we hide ALL app chrome (nav, top bar, help panel) and the
   report's own interactive controls (filter bar, export buttons, dropdowns), and
   reveal only the results cards + the print-only report header. Uses the
   visibility-based reveal so it works without enumerating every chrome selector.
   ========================================================================== */
@media print {
  /* Hide everything, then reveal only the survey dashboard report subtree. */
  body * { visibility: hidden !important; }
  #surveyDashboardHome, #surveyDashboardHome * { visibility: visible !important; }
  #surveyDashboardHome {
    position: absolute !important; left: 0; top: 0; width: 100% !important;
    margin: 0 !important; padding: 0 !important;
  }
  /* Interactive report controls have no place in a printed report. */
  .sd-filterbar, .sd-export-toolbar, .sd-layout-toggle, .sd-compare-btn,
  .md-dropdown, .sd-focus-action, [data-qa="sdaiinsights"], [data-qa="sdcomments"],
  [data-qa="sdcommentreply"], .sd-thread textarea { display: none !important; }
  /* Show the print-only report header. */
  .sd-print-header { display: block !important; margin-bottom: 12px; }
  /* Cards print flat and shouldn't split across pages. */
  .sd-card { break-inside: avoid; page-break-inside: avoid; box-shadow: none !important; border: 1px solid #ccc !important; }
  .sd-heat-scroll { overflow: visible !important; }

  /* OKR board-ready export (OKR-QW2 #206): reveal only the OKR view's
     container, same visibility-reveal technique as the survey report above. */
  #okr-root, #okr-root * { visibility: visible !important; }
  #okr-root {
    position: absolute !important; left: 0; top: 0; width: 100% !important;
    margin: 0 !important; padding: 0 !important;
  }
  /* Interactive OKR controls have no place in a printed report. */
  #okr-cyclebar, #okr-viewtabs, .okr-export-toolbar, .okr-checkin-btn,
  [data-edit-obj], [data-del-obj], [data-hist-obj] { display: none !important; }
  /* Show the print-only OKR header. */
  .okr-print-header { display: block !important; margin-bottom: 12px; }

  /* Joiners & leavers change report (QW3 #224): reveal only #jl-root, same
     visibility-reveal technique as the survey/OKR reports above. */
  #jl-root, #jl-root * { visibility: visible !important; }
  #jl-root {
    position: absolute !important; left: 0; top: 0; width: 100% !important;
    margin: 0 !important; padding: 0 !important;
  }
  /* Interactive report controls have no place in a printed report. */
  .jl-filterbar, .jl-export-toolbar { display: none !important; }
  /* Show the print-only report header. */
  .jl-print-header { display: block !important; margin-bottom: 12px; }

  /* EU Pay Transparency Directive report (F3, #261): reveal only #eupt-root,
     same visibility-reveal technique as the reports above. */
  #eupt-root, #eupt-root * { visibility: visible !important; }
  #eupt-root {
    position: absolute !important; left: 0; top: 0; width: 100% !important;
    margin: 0 !important; padding: 0 !important;
  }
  /* Interactive report controls have no place in a printed report. */
  .eupt-export-toolbar { display: none !important; }
  /* Show the print-only report header. */
  .eupt-print-header { display: block !important; margin-bottom: 12px; }

  /* Annual pay-equity snapshot (F1, #261): reveal only #pes-root, same
     visibility-reveal technique as the reports above. */
  #pes-root, #pes-root * { visibility: visible !important; }
  #pes-root {
    position: absolute !important; left: 0; top: 0; width: 100% !important;
    margin: 0 !important; padding: 0 !important;
  }
  /* Interactive controls (generate button, back button, export toolbar, and
     the list view itself) have no place in a printed report — only the
     currently-viewed snapshot's detail content should print. */
  .pes-generate-toolbar, .pes-list-view, .pes-toolbar { display: none !important; }
  .pes-export-toolbar { display: none !important; }
  /* Show the print-only report header. */
  .pes-print-header { display: block !important; margin-bottom: 12px; }
}

/* ==========================================================================
   Anställda (HR-hub) segmented pill bar — rendered by anstallda-tabs.js into
   the persistent #anstallda-hub slot. A light rounded strip of pills; the
   active pill is a raised surface card in the brand green, inactive pills are
   transparent + muted. All colors are design tokens (theme-aware, no hexes).
   ========================================================================== */
.eq-tabbar {
  display: flex;
  gap: 4px;
  padding: 6px;
  margin: 0 var(--pad) 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow-x: auto;            /* horizontal scroll when many categories */
  scrollbar-width: none;
}
.eq-tabbar::-webkit-scrollbar { display: none; }
.eq-tabbar[hidden] { display: none; }

.eq-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 10px 16px;
  min-height: 44px;            /* hit target */
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: 600 14px/1 var(--font-ui);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s;
}
.eq-tab .material-symbols-rounded { font-size: 20px; }
.eq-tab:hover { background: var(--hair); color: var(--ink); }
.eq-tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.eq-tab[aria-selected="true"] .material-symbols-rounded {
  font-variation-settings: 'FILL' 1;   /* filled icon when active, outline when not */
}
.eq-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Org chart: right-click context menu on a People-arrangement employee card
   (#426, follow-up to #419/#430). The floating menu container itself is
   positioned via inline style (position:fixed + cursor coordinates, computed
   in public/js/org-chart.js) — only the reusable item look/hover lives here. */
.orgchart-ctx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  padding: 8px 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  font: inherit;
  color: var(--ink);
}
.orgchart-ctx-item:hover, .orgchart-ctx-item:focus-visible {
  background: var(--surface2);
  outline: none;
}
.orgchart-ctx-item .material-symbols-rounded { font-size: 18px; color: var(--accent-ink); }



