/* ============================================================
   Kinetic Logic — Digital Command Center design system
   Corporate Modern / Minimalist, for the Skill Mapping platform.
   ============================================================ */

   /* Top-right iLensys logo */
.sl-ilensys-header {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;

    width: 80%;
    min-height: 100px;
}

.sl-feature-card {
    width: min(78%, 680px) !important;

    margin-left: auto !important;
    margin-right: auto !important;

    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;

    align-items: center !important;
    justify-items: stretch !important;
}

.sl-feature {
    width: 100%;
    min-height: 92px;

    display: flex !important;
    flex-direction: column !important;

    align-items: center !important;
    justify-content: center !important;

    text-align: center !important;

    padding-left: 12px !important;
    padding-right: 12px !important;
}

.sl-feature-icon {
    width: 100%;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    text-align: center !important;
}

.sl-feature-name,
.sl-feature-copy {
    width: 100%;

    margin-left: auto;
    margin-right: auto;

    text-align: center !important;
}

/* Increase logo size */
.sl-ilensys-header img,
.sl-ilensys-header svg {
    width: 200px !important;
    height: auto !important;

    max-width: none !important;
    max-height: none !important;
}

:root {
  /* Color tokens (from Stitch "Kinetic Logic" spec) */
  --surface: #f7f9ff;
  --surface-dim: #dbe4f7;
  --surface-bright: #ffffff;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #f3f6ff;
  --surface-container: #eaf0ff;
  --surface-container-high: #e2eaff;
  --surface-container-highest: #d8e4ff;
  --on-surface: #17233f;
  /* iLensys brand body-text gray */
  --on-surface-variant: #667085;
  --inverse-surface: #061a3d;
  /* deep tint of Core Blue, not a generic navy — keeps the brand present on every sidebar */
  --inverse-on-surface: #f7faff;
  --outline: #71809a;
  --outline-variant: #cbd6ea;

  --primary: #3E79ED;
  /* iLensys Core Blue */
  --primary-accent: #4B72FF;
  /* Core Blue's own tint-ramp step, not an unrelated blue */
  --on-primary: #ffffff;
  --primary-container: #4B86FF;
  --on-primary-container: #fefcff;

  --secondary: #53627f;
  --on-secondary: #ffffff;
  --secondary-container: #dce7ff;
  --on-secondary-container: #41506b;

  --error: #ba1a1a;
  --on-error: #ffffff;
  --error-container: #ffdad6;
  --on-error-container: #93000a;

  --background: #f7f9ff;
  --on-background: #17233f;
  --surface-main: #ffffff;
  --surface-alt: #f4f7ff;
  --border-subtle: #dde6f4;

  --success: #9CBC5B;
  /* iLensys Circuit Green */
  --warning: #FDC013;
  /* iLensys Volt Yellow */
  --danger: #ef4444;
  --info: #6366f1;

  /* Typography */
  --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Roundness */
  --radius-sm: 3px;
  --radius-default: 8px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --radius-full: 9999px;

  /* Spacing */
  --space-unit: 4px;
  --gutter: 24px;
  --margin-page: 32px;
  --container-max: 1280px;
  --card-padding: 24px;

  /* Elevation — layered soft shadows (ambient + key light) for real depth */
  --shadow-1: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-2: 0 2px 6px rgba(16, 24, 40, 0.05), 0 10px 24px rgba(16, 24, 40, 0.08);
  --shadow-3: 0 10px 24px rgba(16, 24, 40, 0.10), 0 24px 56px rgba(16, 24, 40, 0.16);

  /* Focus ring — one confident, visible ring reused everywhere */
  --ring: 0 0 0 3px rgba(75, 134, 255, 0.28);
  --ring-danger: 0 0 0 3px rgba(239, 68, 68, 0.22);

  --sidebar-width: 248px;
  --topbar-height: 64px;

  /* Motion — a standard ease for state, an expo for reveals, a gentle spring */
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.5, 1);
  --duration-fast: 0.13s;
  --duration-base: 0.2s;
  --duration-slow: 0.34s;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--surface-alt);
  color: var(--on-surface);
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.006em;
  /* Inter reads a touch tight optically — Stripe-like */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Inter OpenType: contextual alternates + disambiguated glyphs */
  font-feature-settings: "cv11", "ss01", "calt";
  -webkit-tap-highlight-color: transparent;
  /* no grey flash on mobile tap */
}

::selection {
  background: rgba(62, 121, 237, 0.22);
  color: var(--on-surface);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-standard);
}

a:hover {
  text-decoration: underline;
}

/* Skip-to-content link: invisible until keyboard-focused */
.skip-link {
  position: fixed;
  top: -48px;
  left: 12px;
  z-index: 2000;
  background: var(--on-surface);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-default);
  font-size: 13px;
  font-weight: 600;
  transition: top var(--duration-base) var(--ease-standard);
}

.skip-link:focus {
  top: 12px;
  text-decoration: none;
}

/* Consistent, on-brand focus ring for every interactive element */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.sidebar-link:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--primary-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.sidebar-link:focus-visible {
  outline-color: #fff;
  outline-offset: -2px;
}

/* Subtle entrance animation for content, staggered across cards */
@keyframes kl-fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.content>* {
  /* backwards (not both): the "to" state must NOT persist after the
     animation ends. A lingering `transform` (even translateY(0), a visual
     no-op) still creates a new containing block for any position:fixed
     descendant — e.g. the skill-request review popover, nested a few
     levels inside here, was getting trapped and clipped by its scrollable
     table ancestor instead of floating over the whole page. */
  animation: kl-fade-up var(--duration-slow) var(--ease-out-expo) backwards;
}

.content>*:nth-child(2) {
  animation-delay: 0.04s;
}

.content>*:nth-child(3) {
  animation-delay: 0.08s;
}

.content>*:nth-child(4) {
  animation-delay: 0.12s;
}

.content>*:nth-child(5) {
  animation-delay: 0.16s;
}

.content>*:nth-child(6) {
  animation-delay: 0.20s;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: 700;
  color: var(--on-surface);
}

.text-display-lg {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.text-headline-lg {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.text-headline-md {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.text-body-lg {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
}

.text-body-md {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

.text-label-caps {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
}

.text-data-tabular {
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.text-muted {
  color: var(--on-surface-variant);
}

.text-success {
  color: #3f5720;
}

.text-warning {
  color: #6b4e00;
}

.text-danger {
  color: #b91c1c;
}

.text-faint {
  color: var(--outline);
}

/* ─── Layout shell ──────────────────────────────────────────── */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background:
    radial-gradient(circle at 78% 5%, rgba(75, 134, 255, 0.18), transparent 32%),
    linear-gradient(180deg, #04132e 0%, #061a3d 54%, #061836 100%);
  color: var(--inverse-on-surface);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  /* Pin the sidebar to the viewport so it stays put while the page
     content scrolls, regardless of how tall .main-column grows. */
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 10;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 18px 18px;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  margin-bottom: 12px;
}

.sidebar-brand-logo {
  width: 40px;
  height: 48px;
  flex: 0 0 auto;
  display: block;
}

.sidebar-brand-logo svg {
  display: block;
  width: 100%;
  height: 100%;
}

.sidebar-brand-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.sidebar-brand-title {
  color: #ffffff;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.55px;
  white-space: nowrap;
}

.sidebar-brand-subtitle {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px;
  flex: 1;
  overflow-y: auto;
}

.sidebar-section {
  padding: 14px 12px 4px;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.58) !important;
  font-size: 10px !important;
}

.sidebar-section:first-child {
  margin-top: 0;
  padding-top: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  font-weight: 500;
  transition: background-color var(--duration-fast) var(--ease-standard),
    color var(--duration-fast) var(--ease-standard),
    transform var(--duration-fast) var(--ease-standard);
}

.sidebar-link svg {
  flex-shrink: 0;
  opacity: 0.85;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  text-decoration: none;
}

.sidebar-link.active {
  background: linear-gradient(180deg, #5b8dff 0%, #3e79ed 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(62, 121, 237, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.sidebar-link.active svg {
  opacity: 1;
}

.sidebar-footer {
  padding: 12px 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 12px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.sidebar-role-chip {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--inverse-on-surface);
  opacity: 0.7;
}

.sidebar-logout {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.82);
}

.sidebar-poweredby {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  padding: 12px 0 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #ffffff;
}

.sidebar-logout:hover {
  color: #fff;
}

.main-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  margin-left: var(--sidebar-width);
}

.topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 var(--margin-page);
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: box-shadow var(--duration-base) var(--ease-standard);
}

.topbar.is-scrolled {
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-title {
  font-size: 20px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Icon button (bell, etc.) with optional count badge */
.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--on-surface-variant);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}

.icon-btn:hover {
  background: var(--surface-container-low);
  color: var(--on-surface);
}

.icon-btn .badge {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  border: 2px solid #fff;
}

/* Brief confirmation that the poll just found something new — not decoration,
   it's the only visible signal the badge updated without a page reload. */
.icon-btn .badge.is-updated {
  animation: kl-badge-pulse 0.4s var(--ease-standard);
}

@keyframes kl-badge-pulse {
  0% {
    transform: scale(1);
  }

  40% {
    transform: scale(1.35);
  }

  100% {
    transform: scale(1);
  }
}

.avatar-sm {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-accent), var(--primary));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}

.avatar-sm:hover {
  box-shadow: 0 0 0 3px rgba(62, 121, 237, 0.20);
}

.avatar-sm:active {
  transform: scale(0.96);
}

/* Dropdown system (bell + avatar menus) */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 240px;
  max-width: 320px;
  max-height: 360px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-3);
  padding: 6px;
  z-index: 200;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard);
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.dropdown-title {
  padding: 10px 12px 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--on-surface-variant);
}

.dropdown-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 6px;
}

.dropdown-header .name {
  font-weight: 700;
  font-size: 14px;
}

.dropdown-header .role {
  font-size: 12px;
  color: var(--on-surface-variant);
  text-transform: capitalize;
}

.dropdown-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  color: var(--on-surface);
  font-size: 14px;
  text-align: left;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-family);
  text-decoration: none;
}

.dropdown-item:hover {
  background: var(--surface-container-low);
  text-decoration: none;
}

.dropdown-item .material-symbols-outlined {
  font-size: 20px;
  color: var(--on-surface-variant);
  flex-shrink: 0;
}

.dropdown-item.danger {
  color: var(--danger);
}

.dropdown-item.danger .material-symbols-outlined {
  color: var(--danger);
}

.notif-item {
  flex-direction: column;
  gap: 2px;
}

.notif-item .n-title {
  font-weight: 600;
}

.notif-item .n-sub {
  font-size: 12px;
  color: var(--on-surface-variant);
}

.dropdown-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--on-surface-variant);
  font-size: 13px;
}

.dropdown-empty .material-symbols-outlined {
  font-size: 28px;
  color: var(--success);
  display: block;
  margin: 0 auto 8px;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 6px 0;
}

/* Hamburger: hidden on desktop, shown only inside the mobile topbar */
.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-default);
  cursor: pointer;
  color: var(--on-surface);
  flex-shrink: 0;
}

.sidebar-toggle:hover {
  background: var(--surface-container-low);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(19, 27, 46, 0.5);
  z-index: 899;
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-standard);
}

.content {
  flex: 1;
  padding: var(--margin-page);
  max-width: var(--container-max);
  width: 100%;
  margin: 0 auto;
}

/* Wider content area for this one page (self-assessment's nav + table
   layout wants the room); every other page keeps --container-max. */
.content.content--wide {
  max-width: 1600px;
}

.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  display: inline-block;
  line-height: 1;
  -webkit-font-feature-settings: 'liga';
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
}

.material-symbols-outlined.filled {
  font-variation-settings: 'FILL' 1;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  width: 100%;
  overflow: hidden;
}

/* Left visual panel — 7/12 width, kinetic radial gradient (matches Stitch) */
.auth-panel-brand {
  flex: 0 0 58.333%;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 76% 14%, rgba(45, 104, 231, 0.20), transparent 32%), linear-gradient(132deg, #04132e 0%, #061a3d 52%, #061836 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 64px;
}

/* Two soft blurred color blobs for depth */
.auth-panel-brand::before,
.auth-panel-brand::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
}

.auth-panel-brand::before {
  top: -10%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: rgba(0, 88, 190, 0.2);
  filter: blur(120px);
}

.auth-panel-brand::after {
  bottom: -5%;
  left: -5%;
  width: 400px;
  height: 400px;
  background: rgba(75, 134, 255, 0.18);
  filter: blur(100px);
}

/* Skill-heatmap grid: rotated field of translucent squares with slow pulse */
.auth-heatmap {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.2;
  pointer-events: none;
}

.auth-heatmap-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 8px;
  transform: rotate(-12deg) scale(1.5);
}

.auth-heatmap-cell {
  width: 32px;
  height: 32px;
  border-radius: 3px;
  background: #fff;
  animation: kl-mesh-pulse 8s infinite ease-in-out;
}

@keyframes kl-mesh-pulse {

  0%,
  100% {
    opacity: 0.3;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(1.05);
  }
}

.auth-brand-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-brand-row .mark {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.auth-brand-row .brand-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
}

.auth-panel-brand .headline {
  position: relative;
  z-index: 1;
  max-width: 560px;
}

.auth-panel-brand .headline h1 {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  color: #fff;
}

.auth-panel-brand .headline p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
  line-height: 1.6;
}

.auth-stats {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 32px;
  margin-top: 48px;
}

.auth-stats .stat-value {
  font-size: 20px;
  font-weight: 600;
  color: #fff;
}

.auth-stats .stat-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 2px;
}

.auth-stats .divider {
  height: 32px;
  width: 1px;
  background: rgba(255, 255, 255, 0.2);
}

.auth-copyright {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12.5px;
  font-weight: 600;
}

.auth-copyright .sep {
  opacity: 0.5;
}

.auth-copyright .poweredby-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.75;
  margin-top: 3px;
}

.ilensys-logo {
  height: 26px;
  width: auto;
  opacity: 0.9;
  margin-top: -5px;
}

.ilensys-logo-sidebar {
  height: 23px;
  width: auto;
  opacity: 1;
  margin-top: -4px;
}

/* Right form panel — 5/12 width */
.auth-panel-form {
  flex: 1;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 64px;
}

.auth-form-inner {
  width: 100%;
  max-width: 400px;
}

.auth-form-inner.wide {
  max-width: 460px;
}

.auth-form-inner .text-headline-lg {
  margin-bottom: 8px;
}

.auth-form-inner .subtitle {
  color: var(--on-surface-variant);
  margin-bottom: 40px;
  font-size: 14px;
}

/* Mobile-only logo shown above the form when the visual panel is hidden */
.auth-mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 40px;
}

.auth-mobile-brand .mark {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-lg);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-mobile-brand .brand-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

/* Icon-prefixed inputs */
.field-icon {
  position: relative;
}

.field-icon .leading-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--outline);
  font-size: 20px;
  pointer-events: none;
  transition: color var(--duration-fast) var(--ease-standard);
}

.field-icon .field-input {
  padding-left: 40px;
}

.field-icon:focus-within .leading-icon {
  color: var(--primary-accent);
}

.field-icon .password-toggle {
  right: 6px;
}

.field-icon .field-input.has-toggle {
  padding-right: 42px;
}

/* Input with a fixed suffix, e.g. a locked email domain — user types only the
   local part and the "@company.com" is shown, not typed. */
.input-affix {
  display: flex;
  align-items: stretch;
  background: #fff;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-default);
  transition: border-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}

.input-affix:focus-within {
  border-color: var(--primary-accent);
  box-shadow: var(--ring);
}

.input-affix.has-error {
  border-color: var(--danger);
}

.input-affix.has-error:focus-within {
  box-shadow: var(--ring-danger);
}

.input-affix .affix-icon {
  display: flex;
  align-items: center;
  padding-left: 12px;
  color: var(--outline);
  font-size: 20px;
  pointer-events: none;
  transition: color var(--duration-fast) var(--ease-standard);
}

.input-affix:focus-within .affix-icon {
  color: var(--primary-accent);
}

.input-affix .affix-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-family);
  font-size: 14px;
  color: var(--on-surface);
  padding: 10px 4px 10px 10px;
}

.input-affix .affix-suffix {
  display: flex;
  align-items: center;
  white-space: nowrap;
  padding: 0 12px;
  color: var(--on-surface-variant);
  font-size: 14px;
  background: var(--surface-alt);
  border-left: 1px solid var(--outline-variant);
  border-radius: 0 var(--radius-default) var(--radius-default) 0;
}

.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.field-label-row label {
  margin-bottom: 0;
}

.field-inline-link {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-family);
}

.field-inline-link:hover {
  text-decoration: underline;
}

.btn-auth-primary {
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
}

/* "Or continue with" divider + social buttons */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 32px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border-subtle);
}

.auth-divider span {
  padding: 0 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--outline);
}

.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-default);
  background: #fff;
  color: var(--on-surface);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-family);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard);
}

.btn-social+.btn-social {
  margin-top: 16px;
}

.btn-social:hover {
  background: var(--surface-alt);
}

.btn-social:active {
  transform: scale(0.99);
}

.btn-social:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-social:disabled:hover {
  background: #fff;
}

.btn-social:disabled:active {
  transform: none;
}

.btn-social .chip {
  margin-left: auto;
}

.auth-form-footnote {
  margin-top: 40px;
  text-align: center;
}

.auth-form-footnote .prompt {
  font-size: 14px;
  color: var(--on-surface-variant);
}

.auth-form-footnote .prompt a {
  font-weight: 600;
}

.auth-legal {
  margin-top: 16px;
  padding: 0 32px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.6;
  color: rgba(114, 119, 133, 0.7);
  text-align: center;
  text-transform: uppercase;
}

@media (max-width: 1024px) {
  .auth-panel-brand {
    display: none;
  }

  .auth-mobile-brand {
    display: flex;
  }

  .auth-panel-form {
    padding: 32px 24px;
  }

  .auth-form-inner,
  .auth-form-inner.wide {
    max-width: 400px;
  }

  .auth-legal {
    padding: 0 8px;
  }
}

/* ─── Cards ─────────────────────────────────────────────────── */

.kl-card {
  background: var(--surface-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  padding: var(--card-padding);
  transition: box-shadow var(--duration-base) var(--ease-standard), border-color var(--duration-base) var(--ease-standard);
}

/* Static cards stay put — quiet is premium. Only cards that are actually
   clickable get an interactive lift. */
.kl-card-interactive {
  cursor: pointer;
}

.kl-card-interactive:hover {
  box-shadow: var(--shadow-2);
  border-color: var(--outline-variant);
  transform: translateY(-2px);
}

.kl-card-interactive {
  transition: box-shadow var(--duration-base) var(--ease-standard),
    border-color var(--duration-base) var(--ease-standard),
    transform var(--duration-base) var(--ease-out-expo);
}

.kl-card-narrow {
  max-width: 560px;
}

.kl-card-accent {
  border-left: 3px solid var(--outline-variant);
}

.kl-card-accent.accent-expert {
  border-left-color: var(--success);
}

.kl-card-accent.accent-proficient {
  border-left-color: var(--primary-accent);
}

.kl-card-accent.accent-growing {
  border-left-color: var(--warning);
}

.kl-card-accent.accent-rejected {
  border-left-color: var(--danger);
}

/* ─── Buttons ───────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  padding: 10px 18px;
  border-radius: var(--radius-default);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-fast) var(--ease-standard),
    transform var(--duration-fast) var(--ease-standard);
  line-height: 1.2;
  position: relative;
}

/* Physical press: the button dips toward the surface on activation */
.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(180deg, #5b8dff 0%, #3e79ed 100%);
  color: #fff;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #4285f4 0%, #2f74e6 100%);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn-primary:active {
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.btn-secondary {
  background: transparent;
  border-color: var(--secondary);
  color: var(--secondary);
}

.btn-secondary:hover {
  background: var(--surface-container-low);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--on-surface-variant);
}

.btn-ghost:hover {
  background: var(--surface-container-low);
  text-decoration: none;
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover {
  background: #86a84f;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(156, 188, 91, 0.25);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #dc2626;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.25);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

.btn:disabled,
.btn.is-loading {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Inline spinner shown on submit buttons mid-request */
.btn-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: kl-spin 0.6s linear infinite;
  display: none;
}

.btn.is-loading .btn-spinner {
  display: inline-block;
}

.btn.is-loading .btn-label {
  opacity: 0.85;
}

@keyframes kl-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ─── Forms ─────────────────────────────────────────────────── */

.field {
  margin-bottom: 16px;
}

/* Inline filter rows align their controls to a shared bottom edge. The field's
   stacking margin would push the submit button below the input, so drop it here
   — the label above the input already supplies the needed top offset. */
form.items-end .field {
  margin-bottom: 0;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
  margin-bottom: 6px;
}

.field-input,
select.field-input,
textarea.field-input {
  width: 100%;
  font-family: var(--font-family);
  font-size: 14px;
  color: var(--on-surface);
  background: #fff;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-default);
  padding: 10px 12px;
  transition: border-color var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-fast) var(--ease-standard);
}

.field-input::placeholder {
  color: var(--outline);
}

.field-input:focus {
  outline: none;
  border-color: var(--primary-accent);
  box-shadow: var(--ring);
}

.field-input.has-error {
  border-color: var(--danger);
}

.field-input.is-required {
  border-color: var(--danger);
}

.field-input.is-required::placeholder {
  color: var(--danger);
}

.field-input.has-error:focus {
  box-shadow: var(--ring-danger);
}

.field-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
}

.field-hint {
  color: var(--on-surface-variant);
  font-size: 12px;
  margin-top: 4px;
}

/* Live inline validation feedback (email eligibility, password match). */
.email-status,
.pw-match {
  font-size: 12px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.email-status::before,
.pw-match::before {
  font-family: "Material Symbols Outlined";
  font-size: 15px;
  line-height: 1;
}

.email-status.is-checking {
  color: var(--on-surface-variant);
}

.email-status.is-checking::before {
  content: "progress_activity";
}

.email-status.is-ok,
.pw-match.is-ok {
  color: #3f5720;
}

.email-status.is-ok::before,
.pw-match.is-ok::before {
  content: "check_circle";
}

.email-status.is-warn {
  color: #6b4e00;
}

.email-status.is-warn::before {
  content: "info";
}

.email-status.is-bad,
.pw-match.is-bad {
  color: var(--danger);
}

.email-status.is-bad::before,
.pw-match.is-bad::before {
  content: "cancel";
}

.pw-reqs {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.pw-reqs li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--on-surface-variant);
  transition: color 0.15s ease;
}

.pw-reqs li.is-met {
  color: var(--success);
}

.pw-req-mark {
  font-size: 14px;
  color: var(--on-surface-variant);
  transition: color 0.15s ease;
}

.pw-reqs li.is-met .pw-req-mark {
  color: var(--success);
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--on-surface-variant);
}

/* Required-field marker: a grey asterisk after the label text */
.req-label::after {
  content: " *";
  color: var(--on-surface-variant);
  font-weight: 700;
}

/* Disabled / locked fields read as clearly non-editable */
.field-input:disabled,
.field-input[disabled],
select.field-input:disabled {
  background: var(--surface-container-low);
  color: var(--on-surface-variant);
  cursor: not-allowed;
  opacity: 1;
}

/* ─── Segmented control (iOS-style toggle) ──────────────────── */
.segmented {
  display: inline-flex;
  background: var(--surface-container);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
  max-width: 100%;
}

.segmented .seg {
  border: none;
  background: transparent;
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 600;
  color: var(--on-surface-variant);
  padding: 7px 18px;
  border-radius: calc(var(--radius-md) - 1px);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}

.segmented .seg:hover {
  color: var(--on-surface);
}

.segmented .seg.active {
  background: var(--surface-container-lowest);
  color: var(--on-surface);
  box-shadow: var(--shadow-1);
}

.source-panel[hidden] {
  display: none;
}

/* ─── Proficiency picker (1–5 segmented radios) ─────────────── */
.prof-select {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.prof-option {
  position: relative;
  display: flex;
}

.prof-option input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.prof-option .box {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 4px;
  text-align: center;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-md);
  background: #fff;
  transition: border-color var(--duration-fast) var(--ease-standard), background var(--duration-fast) var(--ease-standard);
}

.prof-option .box:hover {
  border-color: var(--outline);
}

.prof-option .lvl {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  color: var(--on-surface-variant);
}

.prof-option .cap {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: var(--on-surface-variant);
}

.prof-option input:checked+.box {
  border-color: var(--primary-accent);
  background: rgba(62, 121, 237, 0.08);
  box-shadow: inset 0 0 0 1px var(--primary-accent);
}

.prof-option input:checked+.box .lvl,
.prof-option input:checked+.box .cap {
  color: var(--primary);
}

.prof-option input:focus-visible+.box {
  outline: 2px solid var(--primary-accent);
  outline-offset: 2px;
}

@media (max-width: 560px) {
  .prof-select {
    gap: 5px;
  }

  .prof-option .box {
    padding: 10px 2px;
  }

  .prof-option .lvl {
    font-size: 16px;
  }
}

/* ─── Self-assessment: status line + new-skill rows ─────────── */
.skill-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.skill-status-line {
  font-size: 12px;
  color: var(--on-surface-variant);
}

.newskill-remove-cell {
  text-align: right;
}

.newskill-remove {
  width: 34px;
  height: 34px;
  font-size: 20px;
  line-height: 1;
  border-radius: var(--radius-md);
}

.newskill-remove:hover {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

@media (max-width: 900px) {

  /* Stacked rows on mobile: make the remove control an explicit full-width action. */
  .newskill-remove {
    width: 100%;
    height: auto;
    padding: 8px;
    font-size: 14px;
  }

  .newskill-remove::after {
    content: " Remove";
    font-size: 13px;
    font-weight: 600;
  }
}

.password-field {
  position: relative;
}

.password-field .field-input {
  padding-right: 40px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-default);
  color: var(--on-surface-variant);
  cursor: pointer;
}

.password-toggle:hover {
  background: var(--surface-container-low);
  color: var(--on-surface);
}

.password-toggle .icon-eye-off {
  display: none;
}

.password-toggle.is-visible .icon-eye {
  display: none;
}

.password-toggle.is-visible .icon-eye-off {
  display: block;
}

/* ─── Badges & pips ─────────────────────────────────────────── */

.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.chip-pending {
  background: rgba(253, 192, 19, 0.12);
  color: #6b4e00;
}

.chip-approved {
  background: rgba(156, 188, 91, 0.12);
  color: #3f5720;
}

.chip-info {
  background: rgba(62, 121, 237, 0.10);
  color: #3E79ED;
}

.chip-rejected {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.chip-neutral {
  background: var(--surface-container);
  color: var(--on-surface-variant);
}

.pips {
  display: inline-flex;
  gap: 3px;
  vertical-align: middle;
}

.pip {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--outline-variant);
}

.pip.filled {
  background: var(--primary-accent);
}

.pip.filled.success {
  background: var(--success);
}

.pip.filled.warning {
  background: var(--warning);
}

/* ─── Tables ────────────────────────────────────────────────── */

/* ─── Feedback list toolbar ─────────────────────────────────── */

.feedback-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.feedback-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 1 320px;
}

.feedback-search .field-input {
  padding-left: 36px;
  width: 100%;
}

.feedback-search-icon {
  position: absolute;
  left: 10px;
  font-size: 18px;
  color: var(--on-surface-variant);
  pointer-events: none;
}

.feedback-from {
  display: flex;
  align-items: center;
  gap: 8px;
}

.feedback-avatar {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-accent), var(--primary));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.feedback-message {
  max-width: 420px;
  white-space: pre-wrap;
  color: var(--on-surface-variant);
}

@media (max-width: 720px) {
  .feedback-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .feedback-search {
    flex: 1 1 auto;
  }

  .feedback-message {
    max-width: none;
  }
}

.kl-table-wrap {
  background: var(--surface-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  box-shadow: var(--shadow-1);
}

table.kl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.kl-table thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
  background: var(--surface-alt);
  padding: 12px var(--card-padding);
  border-bottom: 1px solid var(--border-subtle);
}

table.kl-table tbody td {
  padding: 14px var(--card-padding);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  /* Dates, counts and proficiency read as a clean column when figures line up. */
  font-variant-numeric: tabular-nums;
}

table.kl-table tbody tr:last-child td {
  border-bottom: none;
}

/* Row highlight must actually be visible: cards are white (--surface-main),
   so the hover tint has to be a step off white, not another white. */
table.kl-table tbody tr {
  transition: background-color var(--duration-fast) var(--ease-standard);
}

table.kl-table tbody tr:hover {
  background: var(--surface-alt);
}

/* ─── Alerts / flash ────────────────────────────────────────── */

@keyframes kl-alert-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  margin-bottom: 16px;
  border: 1px solid transparent;
  animation: kl-alert-in var(--duration-base) var(--ease-standard) both;
  transition: opacity var(--duration-base) var(--ease-standard), transform var(--duration-base) var(--ease-standard), max-height var(--duration-base) var(--ease-standard);
}

.alert-success {
  background: rgba(156, 188, 91, 0.08);
  border-color: rgba(156, 188, 91, 0.25);
  color: #3f5720;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
  color: #b91c1c;
}

.alert-warning {
  background: rgba(253, 192, 19, 0.08);
  border-color: rgba(253, 192, 19, 0.25);
  color: #6b4e00;
}

.alert-info {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.25);
  color: #4338ca;
}

.alert-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: inherit;
  opacity: 0.6;
}

.alert-close:hover {
  opacity: 1;
}

/* ─── Modal ─────────────────────────────────────────────────── */

.kl-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(19, 27, 46, 0);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  transition: background-color var(--duration-base) var(--ease-standard);
}

.kl-modal-backdrop.open {
  display: flex;
  background: rgba(19, 27, 46, 0.5);
}

.kl-modal {
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-3);
  width: 100%;
  max-width: 480px;
  opacity: 0;
  transform: scale(0.96) translateY(8px);
  transition: opacity var(--duration-base) var(--ease-standard), transform var(--duration-base) var(--ease-standard);
}

.kl-modal-backdrop.open .kl-modal {
  opacity: 1;
  transform: scale(1) translateY(0);
}

@media (max-width: 640px) {
  .kl-modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .kl-modal {
    max-width: 100%;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    transform: translateY(100%);
    max-height: 85vh;
    overflow-y: auto;
  }

  .kl-modal-backdrop.open .kl-modal {
    transform: translateY(0);
  }
}

.kl-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--card-padding);
  border-bottom: 1px solid var(--border-subtle);
}

.kl-modal-body {
  padding: var(--card-padding);
}

.kl-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px var(--card-padding);
  border-top: 1px solid var(--border-subtle);
}

.kl-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--on-surface-variant);
}

/* ─── Pagination ────────────────────────────────────────────── */

.kl-pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.kl-pagination a,
.kl-pagination span,
.kl-pagination button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-default);
  border: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--on-surface);
  background: var(--surface-main);
  font-family: inherit;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard);
}

.kl-pagination a:hover,
.kl-pagination button:hover {
  background: var(--surface-container-low);
  text-decoration: none;
}

.kl-pagination button:active {
  transform: translateY(1px);
}

.kl-pagination .active {
  background: var(--primary-accent);
  color: #fff;
  border-color: var(--primary-accent);
  cursor: default;
}

.kl-pagination .disabled {
  color: var(--outline);
  border-color: var(--border-subtle);
  background: transparent;
}

/* ─── Stat cards & grid utilities ───────────────────────────── */

.stat-card .stat-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--on-surface-variant);
}

.stat-card .stat-value {
  font-size: 32px;
  font-weight: 700;
  margin-top: 6px;
}

/* KPI tiles (leadership dashboard) */
.kpi-grid {
  grid-template-columns: repeat(4, 1fr);
}

.kpi {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.kpi-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kpi-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.kpi-icon .material-symbols-outlined {
  font-size: 20px;
}

.kpi-icon-primary {
  background: rgba(62, 121, 237, 0.12);
  color: var(--primary);
}

.kpi-icon-success {
  background: rgba(156, 188, 91, 0.12);
  color: #3f5720;
}

.kpi-icon-info {
  background: rgba(99, 102, 241, 0.12);
  color: #4338ca;
}

.kpi-icon-warning {
  background: rgba(253, 192, 19, 0.14);
  color: #6b4e00;
}

.kpi-icon-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.kpi-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--on-surface-variant);
}

.kpi-value {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.kpi-unit {
  font-size: 14px;
  font-weight: 500;
  color: var(--on-surface-variant);
  letter-spacing: 0;
}

@media (max-width: 900px) {
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.grid {
  display: grid;
  gap: var(--gutter);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid-align-end {
  align-items: end;
}

.grid-align-start {
  align-items: start;
}

.flex {
  display: flex;
}

.flex-1 {
  flex: 1;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-end {
  justify-content: flex-end;
}

.text-normal-weight {
  text-transform: none;
  font-weight: 400;
}

.gap-2 {
  gap: 8px;
}

.gap-3 {
  gap: 12px;
}

.mb-0 {
  margin-bottom: 0;
}

.mb-1 {
  margin-bottom: 4px;
}

.mb-3 {
  margin-bottom: 12px;
}

.mb-4 {
  margin-bottom: 20px;
}

.mt-3 {
  margin-top: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.empty-state {
  text-align: center;
  color: var(--on-surface-variant);
  padding: 48px 20px;
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border-radius: var(--radius-full);
  background: var(--surface-container-low);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--outline);
}

.app-footer {
  text-align: center;
  padding: 20px;
  color: var(--on-surface-variant);
  font-size: 12px;
}

/* ─── Responsive card-table pattern ─────────────────────────
   Add `kl-table--stack` to any <table class="kl-table"> and
   `data-label="Column Name"` to each <td> to make it reflow into
   stacked cards on narrow screens instead of scrolling sideways. */

@media (max-width: 700px) {
  .kl-table--stack thead {
    display: none;
  }

  .kl-table--stack,
  .kl-table--stack tbody,
  .kl-table--stack tr,
  .kl-table--stack td {
    display: block;
    width: 100%;
  }

  .kl-table-wrap:has(.kl-table--stack) {
    box-shadow: none;
    border: none;
    background: transparent;
    overflow: visible;
  }

  .kl-table--stack tr {
    margin-bottom: 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--surface-main);
    box-shadow: var(--shadow-1);
    padding: 4px 16px;
  }

  .kl-table--stack tr:last-child {
    margin-bottom: 0;
  }

  .kl-table--stack td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border-subtle);
    text-align: right;
    min-height: 24px;
  }

  .kl-table--stack td:last-child {
    border-bottom: none;
  }

  .kl-table--stack td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--on-surface-variant);
    text-align: left;
    flex-shrink: 0;
  }

  .kl-table--stack td[data-label=""]::before,
  .kl-table--stack td:not([data-label])::before {
    content: none;
  }

  .kl-table--stack .flex-end {
    justify-content: flex-end;
    width: 100%;
  }
}

/* ─── Responsive: layout shell, touch targets, mobile drawer nav ─── */

@media (max-width: 900px) {

  /* Tighter card/table padding reclaims precious width on a phone. */
  :root {
    --card-padding: 18px;
  }

  .sidebar-toggle {
    display: inline-flex;
  }

  /* Honor notch / rounded-corner safe areas (viewport-fit=cover). */
  .topbar {
    gap: 12px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .content {
    padding: 16px max(16px, env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }

  .auth-shell {
    flex-direction: column;
  }

  /* No reserved gutter once the sidebar detaches into an overlay drawer. */
  .main-column {
    margin-left: 0;
  }

  /* Sidebar becomes an off-canvas drawer instead of a horizontal scroll strip */
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 900;
    width: min(280px, 82vw);
    transform: translateX(-100%);
    transition: transform var(--duration-slow) var(--ease-out-expo);
    box-shadow: var(--shadow-3);
    padding: max(20px, env(safe-area-inset-top)) 0 20px;
    padding-left: env(safe-area-inset-left);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop.open {
    display: block;
    opacity: 1;
  }

  /* Comfortable, thumb-sized touch targets everywhere. */
  .sidebar-link {
    min-height: 46px;
    font-size: 15px;
  }

  .sidebar-link:active {
    background: rgba(255, 255, 255, 0.12);
  }

  .btn {
    min-height: 46px;
    padding: 12px 18px;
  }

  .btn:active {
    transform: translateY(1px) scale(0.99);
  }

  .btn-sm {
    min-height: 38px;
  }

  .field-input {
    min-height: 46px;
    padding: 12px 13px;
    font-size: 16px;
  }

  /* 16px = no iOS zoom-on-focus */
  .affix-input {
    font-size: 16px;
  }

  .icon-btn {
    width: 44px;
    height: 44px;
  }

  .kl-pagination a,
  .kl-pagination span {
    min-width: 44px;
    height: 44px;
  }

  .dropdown-item {
    padding: 12px;
  }

  .dropdown-item:active {
    background: var(--surface-container);
  }

  .grid-2,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* On a phone, a text block and its action can't share one row without
   colliding — stack them and let the primary action span the width so it
   reads as the obvious next step. */
@media (max-width: 560px) {
  .flex-between {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .flex-between>.btn {
    width: 100%;
  }
}

/* ═══════════════════════════════════════════════════════════════
   Additional page components (Employee Profile, Skill Repository,
   Gap Analysis) — all fed by real approved-skill data.
   ═══════════════════════════════════════════════════════════════ */

/* ─── Profile header ────────────────────────────────────────── */
.profile-header {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.profile-header .avatar {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary-accent), var(--primary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.profile-identity {
  flex: 1;
  min-width: 0;
}

.profile-identity .name {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.profile-identity .role {
  color: var(--on-surface-variant);
  font-size: 14px;
  margin-top: 2px;
}

.profile-badges {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.profile-meta {
  display: flex;
  gap: 32px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.profile-meta .label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--on-surface-variant);
}

.profile-meta .value {
  font-size: 18px;
  font-weight: 700;
  margin-top: 2px;
}

.profile-meta .value.accent {
  color: var(--primary);
}

/* ─── Identity header + semantic stat strip (user detail) ─────── */
.identity-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.identity-email {
  color: var(--on-surface-variant);
  font-size: 14px;
  margin-top: 3px;
}

.identity-rule {
  height: 1px;
  background: var(--border-subtle);
  margin: 18px 0;
}

.stat-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}

.stat-strip .stat {
  padding: 0 24px;
}

.stat-strip .stat:first-child {
  padding-left: 0;
}

.stat-strip .stat+.stat {
  border-left: 1px solid var(--border-subtle);
}

.stat-strip .stat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--on-surface-variant);
}

.stat-strip .stat-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 5px;
  letter-spacing: -0.01em;
  color: var(--on-surface);
}

.stat-strip .stat-value.sm {
  font-size: 15px;
}

.stat-strip .stat-value.is-success {
  color: #3f5720;
}

.stat-strip .stat-value.is-warning {
  color: #6b4e00;
}

.stat-strip .stat-value.is-danger {
  color: #b91c1c;
}

.stat-strip .stat-value.is-primary {
  color: var(--primary);
}

.stat-strip .stat-value.is-muted {
  color: var(--outline);
}

.stat-strip .stat-value .unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--on-surface-variant);
}

/* Role identity chip tints — subtle, for at-a-glance role recognition */
.chip-role-manager {
  background: rgba(62, 121, 237, 0.10);
  color: #3E79ED;
}

.chip-role-bu_manager {
  background: rgba(63, 87, 32, 0.12);
  color: #3f5720;
}

.chip-role-bu_head {
  background: rgba(99, 102, 241, 0.14);
  color: #3f3fae;
}

.chip-role-leadership {
  background: rgba(99, 102, 241, 0.14);
  color: #3f3fae;
}

.chip-role-super_admin {
  background: rgba(0, 88, 190, 0.16);
  color: #003e86;
}

.attention-card {
  border-left: 3px solid var(--warning);
}

.attention-card.clear {
  border-left-color: var(--success);
}

.attention-card.urgent {
  border-left-color: var(--danger);
}

.attention-card .attention-body {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

/* ─── Skill matrix (grouped) ────────────────────────────────── */
.matrix-group+.matrix-group {
  margin-top: 8px;
}

.matrix-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px var(--card-padding);
  background: var(--surface-alt);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.matrix-row {
  display: grid;
  grid-template-columns: 2fr 1.4fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px var(--card-padding);
  border-bottom: 1px solid var(--border-subtle);
}

.matrix-row:hover {
  background: var(--surface-container-lowest);
}

.matrix-row .skill-name {
  font-weight: 600;
}

.matrix-row .skill-sub {
  font-size: 12px;
  color: var(--on-surface-variant);
  margin-top: 4px;
}

.matrix-row .skill-note {
  margin-top: 6px;
  font-size: 13px;
  font-style: italic;
  line-height: 1.45;
  color: #b91c1c;
  padding-left: 10px;
  border-left: 2px solid rgba(239, 68, 68, 0.35);
}

.matrix-legend {
  display: flex;
  gap: 16px;
  align-items: center;
}

.matrix-legend .dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--on-surface-variant);
}

.matrix-legend .dot::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.matrix-legend .dot.expert::before {
  background: var(--success);
}

.matrix-legend .dot.proficient::before {
  background: var(--primary-accent);
}

.matrix-legend .dot.growing::before {
  background: var(--warning);
}

.prof-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.prof-tag.expert {
  color: #3f5720;
}

.prof-tag.proficient {
  color: var(--primary);
}

.prof-tag.growing {
  color: #6b4e00;
}

/* ─── Skill Repository ──────────────────────────────────────── */
.repo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gutter);
}

.repo-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.repo-card .cat-chip {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--surface-container);
  color: var(--on-surface-variant);
}

.repo-card .skill-title {
  font-size: 16px;
  font-weight: 700;
}

.repo-score-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.repo-score {
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.repo-score .out-of {
  font-size: 13px;
  font-weight: 500;
  color: var(--on-surface-variant);
}

.repo-holders {
  font-size: 12px;
  color: var(--on-surface-variant);
}

.repo-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.repo-holders-chip {
  font-size: 11px;
  font-weight: 700;
  color: var(--on-surface-variant);
  background: var(--surface-container-low);
  padding: 3px 9px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.repo-score-row {
  align-items: center;
}

.score-bar {
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--surface-container);
  overflow: hidden;
}

.score-bar>span {
  display: block;
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--primary-accent);
  transition: width var(--duration-slow) var(--ease-out-expo);
}

.score-bar>span.tier-expert {
  background: var(--success);
}

.score-bar>span.tier-proficient {
  background: var(--primary-accent);
}

.score-bar>span.tier-growing {
  background: var(--warning);
}

.repo-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.repo-dept-chip {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--surface-container-low);
  color: var(--on-surface-variant);
}

/* Competency density heatmap (category × proficiency level) */
.density-table {
  width: 100%;
  border-collapse: collapse;
}

.density-table th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--on-surface-variant);
  padding: 8px;
  text-align: center;
}

.density-table th.row-head,
.density-table td.row-head {
  text-align: left;
  white-space: nowrap;
}

.density-cell {
  width: 56px;
  height: 40px;
  text-align: center;
  padding: 4px;
}

.density-box {
  width: 100%;
  height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.density-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--on-surface-variant);
  margin-top: 12px;
}

.density-legend .scale {
  display: flex;
  gap: 3px;
}

.density-legend .scale span {
  width: 20px;
  height: 12px;
  border-radius: 2px;
}

/* ─── Team dashboard (My Team overview + coverage in one card) ──── */
.team-dashboard-stats {
  padding: 4px var(--card-padding) 20px;
}

.team-dashboard-divider {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px var(--card-padding);
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-alt);
}

/* ─── Gap Analysis ──────────────────────────────────────────── */
.coverage-row {
  display: grid;
  grid-template-columns: 200px 1fr 72px;
  gap: 16px;
  align-items: center;
  padding: 14px var(--card-padding);
  border-bottom: 1px solid var(--border-subtle);
}

.coverage-row:last-child {
  border-bottom: none;
}

.coverage-row .cat-name {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.coverage-row .cat-sub {
  font-size: 12px;
  color: var(--on-surface-variant);
  margin-top: 2px;
}

.coverage-bar {
  height: 10px;
  border-radius: 2px;
  background: var(--surface-container);
  overflow: hidden;
}

.coverage-bar>span {
  display: block;
  height: 100%;
  border-radius: 2px;
  transition: width var(--duration-slow) var(--ease-out-expo);
}

.coverage-pct {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.risk-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px var(--card-padding);
  border-bottom: 1px solid var(--border-subtle);
}

.risk-item:last-child {
  border-bottom: none;
}

.risk-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.risk-badge.high {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.risk-badge.medium {
  background: rgba(253, 192, 19, 0.12);
  color: #6b4e00;
}

/* toolbar for repository filters + add */
.page-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* small layout utilities used by the new pages */
.grid-profile {
  grid-template-columns: 1.6fr 1fr;
}

.card-flush {
  padding: 0;
}

.card-flush-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px var(--card-padding);
}

.items-center {
  align-items: center;
}

.items-end {
  align-items: flex-end;
}

.value-sm {
  font-size: 15px !important;
}

.unit-suffix {
  font-size: 13px;
  font-weight: 500;
  color: var(--on-surface-variant);
}

.mt-0 {
  margin-top: 0;
}

.mt-1 {
  margin-top: 4px;
}

.card-sub {
  margin-top: -4px;
  margin-bottom: 16px;
  color: var(--on-surface-variant);
}

@media (max-width: 900px) {
  .grid-profile {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .repo-grid {
    grid-template-columns: 1fr;
  }

  .profile-header {
    flex-direction: column;
  }

  .matrix-row {
    grid-template-columns: 1fr auto;
  }

  .matrix-row .matrix-spark {
    display: none;
  }

  .coverage-row {
    grid-template-columns: 1fr 64px;
  }

  .coverage-row .coverage-bar {
    display: none;
  }

  .density-table-wrap {
    overflow-x: auto;
  }
}

@media (max-width: 560px) {

  /* Stats reflow into a 2-col grid; drop the vertical dividers/padding. */
  .stat-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 20px;
  }

  .stat-strip .stat,
  .stat-strip .stat:first-child {
    padding: 0;
  }

  .stat-strip .stat+.stat {
    border-left: none;
  }
}

/* ─── Manager Review workspace ──────────────────────────────── */
.review-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: var(--gutter);
  align-items: start;
}

.review-members {
  position: sticky;
  top: calc(var(--topbar-height) + 16px);
}

/* Grid tracks don't shrink below their content's min-content size by
   default, so the wide review table was stretching this column past the
   viewport instead of scrolling inside .review-table-wrap. minmax(0, 1fr)
   above lets the track shrink; min-width: 0 lets this item (and everything
   nested in it) actually respect that shrunk size. */
.review-workspace {
  min-width: 0;
}

.review-members-head {
  padding: 14px var(--card-padding) 8px;
}

.review-member {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px var(--card-padding);
  color: var(--on-surface);
  border-left: 3px solid transparent;
  transition: background-color var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard);
}

.review-member:hover {
  background: var(--surface-container-low);
  text-decoration: none;
}

.review-member:active {
  transform: scale(0.98);
}

.review-member.active {
  background: var(--surface-container-low);
  border-left-color: var(--primary-accent);
}

.review-member-avatar {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-accent), var(--primary));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.review-member-name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-member-badge {
  flex-shrink: 0;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--warning);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.review-completion {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.review-completion .coverage-bar {
  width: 120px;
}

.next-step-card {
  background: linear-gradient(120deg, var(--primary), var(--primary-accent));
  border: none;
  color: #fff;
}

.next-step-card .text-label-caps {
  color: rgba(255, 255, 255, 0.7);
}

.next-step-card .text-headline-md {
  color: #fff;
  margin: 4px 0 6px;
}

.next-step-card p {
  color: rgba(255, 255, 255, 0.85);
}

.review-table-wrap {
  overflow-x: auto;
}

/* Fixed layout + explicit widths on the checkbox/actions columns only
   (see review.html) means Skill/Self-Rating/Comment split the rest of the
   table's actual width instead of table-layout:auto ballooning the table
   past its container to fit the comment input's old 220px min-width.
   min-width keeps those flexible columns from being squeezed unreadably
   thin on a narrower container — .review-table-wrap's overflow-x then
   handles that case with a real (occasional) horizontal scroll instead. */
.review-table {
  table-layout: fixed;
  min-width: 640px;
}

.review-table td {
  vertical-align: top;
}

.review-table input[type="text"] {
  width: 100%;
}

.review-actions {
  white-space: nowrap;
}

/* The checkbox/actions columns have no multi-line content, so top-aligning
   them (the table default, for the taller Skill cell) leaves them looking
   stranded above center — middle-align just these two. */
.review-table td:first-child,
.review-table td.review-actions {
  vertical-align: middle;
}

.review-table [data-row-select],
.review-table [data-select-all] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Selected rows get a visible tint so it's obvious what a bulk action will
   apply to — otherwise the only feedback is the count in the bar below. */
.review-row.is-selected {
  background: var(--surface-alt);
}

.review-row.is-selected td {
  background: var(--surface-alt);
}

.field-input.is-invalid {
  border-color: var(--danger);
}

.field-input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Multiselect approve/reject bulk bar, shown once any row is checked.
   Animated via a grid-rows 0fr→1fr collapse (not display:none) so it
   materializes in place instead of popping — the row it lives in doesn't
   support animating "height: auto" any other way without measuring JS. */
.review-bulkbar-collapse {
  display: grid;
  grid-template-rows: minmax(0, 0fr);
  transition: grid-template-rows var(--duration-base) var(--ease-standard);
}

.review-bulkbar-collapse.is-visible {
  grid-template-rows: minmax(0, 1fr);
}

.review-bulkbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px var(--card-padding);
  background: var(--surface-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  font-size: 13px;
  font-weight: 600;
  color: var(--on-surface-variant);
  min-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard);
}

.review-bulkbar-collapse.is-visible .review-bulkbar {
  opacity: 1;
  transform: translateY(0);
}

.review-bulkbar-status {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.review-bulkbar-error {
  font-size: 12px;
  font-weight: 600;
  color: var(--danger);
}

.review-bulkbar-error[hidden] {
  display: none;
}

.icon-action {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: #fff;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard);
}

.icon-action:active {
  transform: scale(0.93);
}

.icon-action .material-symbols-outlined {
  font-size: 18px;
}

.icon-action.approve {
  color: var(--success);
}

.icon-action.approve:hover {
  background: rgba(156, 188, 91, 0.1);
  border-color: var(--success);
}

.icon-action.reject {
  color: var(--danger);
}

.icon-action.reject:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--danger);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gutter);
}

.summary-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.summary-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-container-low);
  color: var(--primary);
}

.summary-icon.ok {
  background: rgba(156, 188, 91, 0.1);
  color: #3f5720;
}

.summary-icon.warn {
  background: rgba(253, 192, 19, 0.12);
  color: #6b4e00;
}

.summary-item .s-title {
  font-weight: 600;
}

.summary-item .s-sub {
  font-size: 12px;
  color: var(--on-surface-variant);
  margin-top: 2px;
}

@media (max-width: 900px) {
  .review-layout {
    grid-template-columns: 1fr;
  }

  .review-members {
    position: static;
  }

  .review-members {
    display: flex;
    flex-direction: column;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Summary header strip (shared by org chart, etc.) ───────────
   A count badge plus a one-line intro above a data list. */
.queue-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.queue-header .queue-intro {
  color: var(--on-surface-variant);
  margin: 4px 0 0;
}

.queue-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  background: rgba(253, 192, 19, 0.12);
  color: #6b4e00;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.005em;
  white-space: nowrap;
}

.queue-count .n {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

/* `.review-row` marks the pending-skills table row (see review.html) —
   just a hook for the selected-row tint below; the table's own styling
   (table.kl-table tbody tr) already handles borders/hover/transition. */
.review-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ─── Utilities referenced across admin surfaces ────────────────── */
.text-end {
  text-align: right;
}

.mt-2 {
  margin-top: 8px;
}

/* ─── Admin: Org Chart ──────────────────────────────────────────── */
.queue-count-neutral {
  background: var(--surface-container);
  color: var(--on-surface-variant);
}

.org-toolbar-actions {
  flex-wrap: wrap;
}

.org-toolbar-actions .material-symbols-outlined {
  font-size: 18px;
}

.btn-danger-ghost {
  color: var(--danger);
}

.btn-danger-ghost:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
  text-decoration: none;
}

.btn-danger-ghost:disabled {
  color: var(--outline);
}

.org-search {
  display: flex;
  align-items: center;
  gap: 10px;
}

.org-search .field {
  flex: 1;
  min-width: 0;
}

.oc-name {
  font-weight: 600;
  color: var(--on-surface);
}

.oc-sub {
  font-size: 12.5px;
  color: var(--on-surface-variant);
  margin-top: 1px;
}

.cell-id {
  margin-left: 6px;
  font-size: 12px;
  color: var(--outline);
  font-variant-numeric: tabular-nums;
}

.kl-card-narrow-wide {
  max-width: 720px;
}

.form-divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 24px 0 20px;
}

.form-actions {
  margin-top: 24px;
}

/* ─── Skill self-assessment matrix (domain accordion) ───────────── */
/* padding:0 so the summary/table sit flush against the card edge — no
   overflow:hidden to clip their square corners to match, though: that
   turns this into a scroll container and silently breaks position:sticky
   for anything inside it (e.g. .assess-row-group-header). Round the
   summary's own corners directly instead — it's the only child that
   needs it, since .kl-table-wrap already rounds its own. */
.domain-block {
  padding: 0;
}

.domain-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px var(--card-padding);
  font-weight: 600;
  border-radius: var(--radius-lg);
  transition: background-color var(--duration-fast) var(--ease-standard);
}

.domain-summary::-webkit-details-marker {
  display: none;
}

.domain-summary:hover {
  background: var(--surface-alt);
}

.domain-name {
  font-size: 15px;
}

.domain-count {
  min-width: 26px;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--radius-full);
  background: var(--surface-container);
  color: var(--on-surface-variant);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.domain-summary::after {
  content: "expand_more";
  font-family: "Material Symbols Outlined";
  font-size: 20px;
  color: var(--on-surface-variant);
  transition: transform var(--duration-base) var(--ease-standard);
}

.domain-block[open]>.domain-summary {
  border-bottom: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.domain-block[open]>.domain-summary::after {
  transform: rotate(180deg);
}

.assess-group {
  padding: 4px var(--card-padding) 12px;
}

.assess-group-title {
  margin: 14px 0 8px;
}

.cat-tally {
  margin-left: auto;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.domain-block .matrix-row:last-child {
  border-bottom: none;
}

/* Hover-reveal proficiency picker (replaces the plain rating dropdown). */
/* nowrap: the pips + status text stay one row; if the "Your rating" column
   is narrower than that (e.g. the master-detail panel leaves less width
   than the old full-width table), the table's auto layout widens the
   column and .kl-table-wrap's overflow-x scrolls rather than wrapping. */
.rating-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.rating-pip {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  border: 1px solid var(--outline-variant);
  background: var(--surface-container-lowest);
  color: var(--on-surface-variant);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--duration-fast) var(--ease-standard),
    color var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard);
}

.rating-pip.is-hover,
.rating-pip.is-selected {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
  font-weight: 800;
}

/* "0 – No Exposure" is a neutral/negative outlier on the 1-5 positive scale,
   not just another rung — keep it visually distinct (dashed, muted) instead
   of filling with the same "achievement" primary color as a real rating. */
.rating-pip-zero {
  border-style: dashed;
}

.rating-pip-zero.is-hover,
.rating-pip-zero.is-selected {
  background: var(--surface-container-high);
  border-color: var(--outline);
  border-style: dashed;
  color: var(--on-surface-variant);
}

.rating-pip-tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--inverse-surface);
  color: var(--inverse-on-surface);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-fast) var(--ease-standard);
}

/* Tooltip shows only for the pip literally under the pointer — `.is-hover`
   fills every pip up to the hovered value (the star-rating preview), so
   keying the tooltip off that class would pop up one bubble per filled pip
   at once instead of a single tooltip for the pip actually being hovered. */
.rating-pip:hover .rating-pip-tip {
  opacity: 1;
}

.rating-picker-status {
  font-size: 12px;
  color: var(--on-surface-variant);
  margin-left: 2px;
}

/* Scale legend — reuses .matrix-legend's row layout with a numbered-badge
   marker instead of a colored dot (the scale is numeric, not color-coded).
   .legend-item mirrors .dot's inline-flex + align-items treatment: a bare
   <span> here would align the badge to the text's baseline (its bottom
   margin edge, per the inline-flex baseline rules) instead of centering it
   against the label's x-height, making the badge visibly ride high. */
.matrix-legend .legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--on-surface-variant);
}

.matrix-legend .num-badge {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--surface-container);
  color: var(--on-surface-variant);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.matrix-legend .legend-label {
  font-weight: 600;
  color: var(--on-surface);
}

/* Rating-scale legend on the assessment page: color-coded by tier (same
   green/blue/amber language as chips and prof-tags elsewhere) instead of a
   flat gray badge for every level, and given room to breathe below the
   filter bar instead of sitting flush against it. */
.rating-scale-legend {
  flex-wrap: wrap;
  gap: 10px 18px;
  padding-top: 14px;
  margin-top: 2px;
  border-top: 1px solid var(--border-subtle);
}

.rating-scale-legend .legend-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--on-surface-variant);
  flex-basis: 100%;
}

.num-badge-zero {
  background: transparent;
  border: 1px dashed var(--outline-variant);
  color: var(--on-surface-variant);
}

.num-badge-warning {
  background: rgba(253, 192, 19, 0.14);
  color: #6b4e00;
}

.num-badge-neutral {
  background: rgba(0, 88, 190, 0.12);
  color: var(--primary);
}

.num-badge-success {
  background: rgba(156, 188, 91, 0.14);
  color: #3f5720;
}

/* Master-detail layout: a domain/group tree on the left, one group's skill
   table shown at a time on the right — replaces paging through 39 stacked
   accordions to find a group. */
.assess-shell {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.assess-nav {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--topbar-height) + 16px);
  max-height: calc(100vh - var(--topbar-height) - 32px);
  overflow-y: auto;
  background: var(--surface-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  padding: 8px;
}

.nav-domain-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  padding: 10px 8px;
  border-radius: var(--radius-default);
  font-size: 13px;
  font-weight: 600;
  color: var(--on-surface);
  transition: background-color var(--duration-fast) var(--ease-standard);
}

.nav-domain-btn:hover {
  background: var(--surface-alt);
}

.nav-domain-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Full-text tooltip for a truncated .nav-domain-name/.nav-group-name.
   position:fixed and JS-positioned (self_assessment.html) rather than an
   absolutely-positioned child, because .assess-nav scrolls (overflow-y:
   auto forces overflow-x to clip too) and would cut the tooltip off exactly
   where a long, truncated name most needs it to extend past the sidebar. */
.nav-name-tip {
  position: fixed;
  z-index: 1000;
  background: var(--inverse-surface);
  color: var(--inverse-on-surface);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-2);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-standard);
}

.nav-name-tip.is-visible {
  opacity: 1;
}

.nav-domain-caret {
  font-size: 18px;
  color: var(--on-surface-variant);
  flex-shrink: 0;
  transition: transform var(--duration-base) var(--ease-standard);
}

.nav-domain.is-open>.nav-domain-btn .nav-domain-caret {
  transform: rotate(90deg);
}

.nav-groups {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 0 6px 30px;
}

.nav-groups[hidden] {
  display: none;
}

.nav-group-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  padding: 7px 8px;
  border-radius: var(--radius-default);
  font-size: 12.5px;
  color: var(--on-surface-variant);
  transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}

.nav-group-btn:hover {
  background: var(--surface-alt);
  color: var(--on-surface);
}

/* --primary (the app's actual brand navy, used by buttons and badges
   elsewhere) rather than --primary-container's brighter, unrelated blue —
   that one didn't match the rest of the UI's selected/active language. */
.nav-group-btn.is-active {
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
}

.nav-group-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-group-count,
.nav-domain-btn .domain-count {
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  font-size: 11px;
  border-radius: var(--radius-full);
  background: var(--surface-container);
  color: var(--on-surface-variant);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* A translucent white circle on --primary read as near-white-on-near-white
   (the count blended into its own badge) — a dark overlay keeps the white
   number legible regardless of the button's background color. */
.nav-group-btn.is-active .nav-group-count {
  background: rgba(0, 0, 0, 0.22);
  color: var(--on-primary);
}

/* Per-status submission counts (pending/approved/rejected — same colors as
   the chips used everywhere else in the app) vs. rated (this session's
   in-progress picks, updates live as pips are clicked) — distinct from the
   plain total count badge so each kind of "filled" reads differently. */
.nav-badge {
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.nav-badge-pending {
  background: rgba(253, 192, 19, 0.16);
  color: #6b4e00;
}

.nav-badge-approved {
  background: rgba(156, 188, 91, 0.16);
  color: #3f5720;
}

.nav-badge-rejected {
  background: rgba(239, 68, 68, 0.16);
  color: #b91c1c;
}

.nav-badge-rated {
  background: rgba(0, 88, 190, 0.14);
  color: var(--primary);
}

.nav-badge[hidden] {
  display: none;
}

/* Same problem .sidebar-link-badge already works around: these badges'
   pale-tint/dark-text pairing is tuned for a light row and loses contrast
   once the row itself goes dark (.nav-group-btn.is-active sits on
   --primary) — solid brand color + dark text keeps each one legible there. */
.nav-group-btn.is-active .nav-badge-pending {
  background: #fdc013;
  color: #4a3600;
}

.nav-group-btn.is-active .nav-badge-approved {
  background: #9cbc5b;
  color: #24350f;
}

.nav-group-btn.is-active .nav-badge-rejected {
  background: #ef4444;
  color: #fff;
}

.nav-group-btn.is-active .nav-badge-rated {
  background: rgba(255, 255, 255, 0.85);
  color: var(--primary);
}

.assess-panels {
  flex: 1;
  min-width: 0;
}

.assess-panel[hidden] {
  display: none;
}

.assess-panel-header {
  margin-bottom: 14px;
}

.assess-panel-crumb {
  font-size: 18px;
  color: var(--on-surface-variant);
}

.assess-panel-title {
  font-size: 18px;
  font-weight: 700;
  margin: 2px 0 0;
}

@media (max-width: 900px) {

  /* No room for a persistent side nav on a phone — stack it above the
     panel instead, and let it size to its content rather than the full
     viewport height. */
  .assess-shell {
    flex-direction: column;
  }

  .assess-nav {
    width: 100%;
    position: static;
    max-height: none;
  }
}

/* "Tool / skill group" as a section header spanning the table, shown once
   above the rows that share it, instead of repeating the same value down
   its own column on every row. */
.assess-row-group-header td {
  background: var(--surface-container-low);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--on-surface-variant);
  padding-top: 9px;
  padding-bottom: 9px;
}

@media (max-width: 700px) {

  /* .kl-table--stack turns every td into a label/value flex row — not
     meaningful for a single colspan heading cell, so render it as a plain
     block line instead. */
  .kl-table--stack .assess-row-group-header {
    border: none;
    box-shadow: none;
    margin-bottom: 0;
    padding: 0;
  }

  .kl-table--stack .assess-row-group-header td {
    display: block;
    text-align: left;
    border-bottom: none;
  }

  /* The stacked-card layout removes .kl-table-wrap's horizontal scroll
     (overflow: visible), so nowrap would push the picker off the edge of
     the screen here instead of scrolling — wrap it back on mobile. */
  .rating-picker {
    flex-wrap: wrap;
    white-space: normal;
    justify-content: flex-end;
  }
}

/* A locked row (already applied/pending) recedes so open rows stay the focus. */
.assess-row.is-locked {
  color: var(--on-surface-variant);
}

.assess-row.is-locked td {
  background: var(--surface-alt);
}

/* Persistent call-to-action so a 400+ row form never hides its own submit
   button behind a long scroll. This is the ONLY submit affordance in the
   form. */
.assess-actionbar {
  /* Fixed, not sticky: this is the last element in a very long (~450-row)
     form, so a sticky bar would only ever "stick" for its own height's worth
     of scroll right at the bottom — fixed keeps it floating throughout,
     always visible near wherever the user is currently rating. */
  position: fixed;
  bottom: 16px;
  z-index: 40;
  /* Center within the content area, not the full viewport: the sidebar sits in normal flow to the left on desktop, so `left: 50%` of the viewport
     would center on the whole screen and land the bar off to one side of
     the actual content the user is working in. */
  left: calc((var(--sidebar-width) + 100%) / 2);
  transform: translateX(-50%);
  width: min(420px, calc(100% - var(--sidebar-width) - 32px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  background: var(--inverse-surface);
  color: var(--inverse-on-surface);
  box-shadow: var(--shadow-3);
  font-size: 13px;
  font-weight: 600;
}

.assess-actionbar .btn {
  flex: 0 0 auto;
  width: auto;
}

.assess-actionbar[hidden] {
  display: none;
}

/* Reserve room below the form's last card so the floating pill never covers it. */
.assess-bottom-spacer {
  height: 74px;
}

@media (max-width: 900px) {

  /* Comfortable, thumb-sized touch targets for the rating picker too. */
  .rating-pip {
    width: 38px;
    height: 38px;
    font-size: 13px;
  }

  .rating-picker {
    gap: 8px;
  }

  .assess-actionbar {
    left: 16px;
    right: 16px;
    transform: none;
    width: auto;
    bottom: max(16px, env(safe-area-inset-bottom));
  }
}

.overall-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* List toolbar: result count on the left, per-page selector on the right. */
.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.list-count {
  font-size: 13px;
}

.per-page-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.per-page-form label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--on-surface-variant);
  white-space: nowrap;
}

.per-page-form select.field-input {
  width: auto;
  min-width: 76px;
  padding-top: 7px;
  padding-bottom: 7px;
}

@media (max-width: 560px) {
  .org-toolbar-actions {
    width: 100%;
  }

  .org-toolbar-actions .btn {
    flex: 1;
  }

  .org-search {
    flex-wrap: wrap;
  }

  .org-search .btn {
    flex: 1;
  }
}

/* ── Custom confirm dialog (replaces window.confirm for [data-confirm]) ── */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.4);
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-standard);
}

.confirm-overlay.open {
  opacity: 1;
}

.confirm-overlay[hidden] {
  display: none;
}

.confirm-dialog {
  width: min(360px, calc(100% - 32px));
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-3);
  padding: 24px;
  transform: translateY(-6px) scale(0.98);
  transition: transform var(--duration-fast) var(--ease-standard);
}

.confirm-overlay.open .confirm-dialog {
  transform: none;
}

.confirm-message {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--on-surface);
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Collapsible "Add a skill" card ── */
.add-skill-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--on-surface);
  list-style: none;
}

.add-skill-summary::-webkit-details-marker {
  display: none;
}

.add-skill-summary .material-symbols-outlined {
  font-size: 20px;
  color: var(--primary-accent);
  transition: transform var(--duration-fast) var(--ease-standard);
}

.add-skill-details[open] .add-skill-summary .material-symbols-outlined {
  transform: rotate(45deg);
}

.field-align-end {
  align-self: end;
}

.category-filter {
  max-width: 220px;
}

.sidebar-link-badge {
  margin-left: auto;
  /* .nav-badge-pending's pale-yellow/dark-brown pairing is tuned for
     light content areas and has no contrast on the dark sidebar. */
  background: #fdc013;
  color: #4a3600;
}

/* ── Per-row review disclosure (skill requests) ──
   The panel is position:fixed (JS sets its top/left from the summary's
   bounding rect on open) rather than absolute, because the table it lives
   in scrolls horizontally (.kl-table-wrap { overflow-x: auto }), which also
   forces overflow-y to a non-visible value — an absolutely-positioned panel
   anchored to a row got clipped by that scroll container instead of
   floating over the page. */
.request-review-details {
  display: inline-block;
  text-align: left;
}

.request-review-details summary {
  list-style: none;
  cursor: pointer;
}

.request-review-details summary::-webkit-details-marker {
  display: none;
}

.request-review-panel {
  position: fixed;
  width: 260px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  padding: 14px;
  z-index: 950;
  text-align: left;
}

.request-review-panel .field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--on-surface-variant);
  margin-bottom: 4px;
  display: block;
}

/* ── Searchable combobox (domain / level1 / skill group on skill requests):
   an existing-value dropdown that still accepts a typed new value. The
   suggestion list is position:fixed and JS-positioned (like the review
   panel above), rather than absolute inside it — the panel itself scrolls
   (overflow-y: auto), which would otherwise clip the list. ── */
.combo {
  position: relative;
}

.combo .field-input {
  padding-right: 28px;
}

.combo-clear {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--on-surface-variant);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.combo-clear:hover {
  background: var(--surface-alt);
  color: var(--on-surface);
}

/* `display: flex` above unconditionally beats the UA stylesheet's own
   `[hidden] { display: none }` (author rules win ties with UA rules
   regardless of specificity), which silently defeated the JS toggling
   `hidden` on/off — the button stayed visible even on an empty field. */
.combo-clear[hidden] {
  display: none;
}

.combo-list {
  position: fixed;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-3);
  max-height: 220px;
  overflow-y: auto;
  z-index: 960;
}

.combo-option {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
}

.combo-option:hover,
.combo-option.is-active {
  background: var(--surface-alt);
}

.combo-empty {
  padding: 6px 10px;
  font-size: 12px;
  color: var(--on-surface-variant);
}

.combo-option-not-sure {
  font-style: italic;
  color: var(--on-surface-variant);
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  margin-bottom: 2px;
}